Skip to content

Commit 62b90b5

Browse files
committed
hook in 'maxLength' as 'maxdisplayed'
- I found gl-streamtube3d's maxLength similar enough to scatter traces' 'marker.maxdisplayed' to use same same attribute name.
1 parent 8182cab commit 62b90b5

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

src/traces/streamtube/attributes.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ var attrs = {
7777
].join(' ')
7878
},
7979

80+
maxdisplayed: {
81+
valType: 'integer',
82+
min: 0,
83+
dflt: 1000,
84+
role: 'info',
85+
editType: 'calc',
86+
description: [
87+
'The maximum number of displayed segments in a streamtube.'
88+
].join(' ')
89+
},
90+
8091
// TODO
8192
//
8293
// Should add 'absolute' (like cone traces have), but currently gl-streamtube3d's
@@ -95,7 +106,6 @@ var attrs = {
95106
// 'Sets the mode by which the streamtubes are sized.'
96107
// ].join(' ')
97108
// },
98-
// maxLength
99109

100110
sizeref: {
101111
valType: 'number',

src/traces/streamtube/convert.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,8 @@ function convert(scene, trace) {
145145
}
146146

147147
tubeOpts.colormap = parseColorScale(trace.colorscale);
148-
149-
// TODO
150-
// tubeOpts.maxLength
151-
152148
tubeOpts.tubeSize = trace.sizeref;
149+
tubeOpts.maxLength = trace.maxdisplayed;
153150

154151
// add some padding around the bounds
155152
// to e.g. allow tubes starting from a slice of the x/y/z mesh

src/traces/streamtube/defaults.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3838
coerce('starty');
3939
coerce('startz');
4040

41-
// TODO adapt these
42-
// coerce('maxLength');
43-
41+
coerce('maxdisplayed');
4442
coerce('sizeref');
4543

4644
coerce('lighting.ambient');
16.7 KB
Loading

test/image/mocks/gl3d_streamtube-wind.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129218,15 +129218,16 @@
129218129218
15,
129219129219
15
129220129220
],
129221-
"sizeref": 0.6,
129221+
"sizeref": 0.3,
129222129222
"colorscale": "Portland",
129223-
"showscale": false
129223+
"showscale": false,
129224+
"maxdisplayed": 3000
129224129225
}
129225129226
],
129226129227
"layout": {
129227129228
"scene": {
129228129229
"aspectratio": {
129229-
"x": 1,
129230+
"x": 2,
129230129231
"y": 1,
129231129232
"z": 0.3
129232129233
}

0 commit comments

Comments
 (0)