Skip to content

Commit 8ea0c25

Browse files
committed
add 'sizeref'
... using @kig's work from gl-vis/gl-streamtube3d#3
1 parent 1367c07 commit 8ea0c25

File tree

8 files changed

+4036
-11
lines changed

8 files changed

+4036
-11
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"gl-select-box": "^1.0.2",
8484
"gl-spikes2d": "^1.0.1",
8585
"gl-surface3d": "^1.3.4",
86-
"gl-streamtube3d": "[email protected]:gl-vis/gl-streamtube3d#a56d653657f0c7cef4fd338318ba69d908a8ce1f",
86+
"gl-streamtube3d": "[email protected]:gl-vis/gl-streamtube3d#97c89d7d0e4e4ed1074d47fbfc715bb2d149841c",
8787
"glslify": "^6.1.1",
8888
"has-hover": "^1.0.1",
8989
"has-passive-events": "^1.0.0",

src/traces/streamtube/attributes.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ var attrs = {
7979

8080
// TODO
8181
// maxLength
82-
// widthScale
82+
83+
sizeref: {
84+
valType: 'number',
85+
role: 'info',
86+
editType: 'calc',
87+
min: 0,
88+
dflt: 1,
89+
description: ''
90+
},
8391

8492
text: {
8593
valType: 'string',

src/traces/streamtube/convert.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ function convert(scene, trace) {
8484

8585
// TODO
8686
// tubeOpts.maxLength
87-
// tubeOpts.widthScale
8887

89-
// TODO the widhScale default looks BRUTAL
90-
tubeOpts.widthScale = 100;
88+
tubeOpts.tubeSize = trace.sizeref;
9189

9290
var xbnds = toDataCoords(trace._xbnds, 'xaxis');
9391
var ybnds = toDataCoords(trace._ybnds, 'yaxis');
@@ -99,12 +97,9 @@ function convert(scene, trace) {
9997

10098
var meshData = tube2mesh(tubeOpts, bounds);
10199

102-
// TODO cmin/cmax correspond to the min/max vector norm
100+
// N.B. cmin/cmax correspond to the min/max vector norm
103101
// in the u/v/w arrays, which in general is NOT equal to max
104102
// intensity that colors the tubes.
105-
//
106-
// Maybe we should use meshData.vertexIntensities instead to
107-
// determine the auto values for "cmin" and "cmax"?
108103
meshData.vertexIntensityBounds = [trace.cmin, trace.cmax];
109104

110105
// pass gl-mesh3d lighting attributes

src/traces/streamtube/defaults.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
4242

4343
// TODO adapt these
4444
// coerce('maxLength');
45-
// coerce('widthScale');
45+
// coerce('sizemode');
46+
47+
coerce('sizeref');
4648

4749
coerce('lighting.ambient');
4850
coerce('lighting.diffuse');
-150 Bytes
Loading
62.7 KB
Loading

0 commit comments

Comments
 (0)