Closed
Description
var gd = document.getElementById('graphDiv');
var type = 'streamtube';
var allX = [];
var allY = [];
var allZ = [];
var allU = [];
var allV = [];
var allW = [];
var res = 10;
var ni = res;
var nj = res;
var nk = res;
var i, j, k;
for(var k = 0; k < nk; k++) {
for(var j = 0; j < nj; j++) {
for(var i = 0; i < ni; i++) {
var x = i;
var y = j;
var z = k;
allX.push(x);
allY.push(y);
allZ.push(z);
var u = 0;
var v = 0;
var w = z;
allU.push(u);
allV.push(v);
allW.push(w);
}
}
}
var allX2 = [];
var allY2 = [];
var allZ2 = [];
var allU2 = [];
var allV2 = [];
var allW2 = [];
for(var k = 0; k < nk; k++) {
for(var j = 0; j < nj; j++) {
for(var i = 0; i < ni; i++) {
var x = k;
var y = j;
var z = i;
allX2.push(x);
allY2.push(y);
allZ2.push(z);
var u = 0;
var v = 0;
var w = z;
allU2.push(u);
allV2.push(v);
allW2.push(w);
}
}
}
Plotly.newPlot(gd, {
data: [{
type: type,
x: allX,
y: allY,
z: allZ,
u: allU,
v: allV,
w: allW,
scene: 'scene1'
},
{
type: type,
x: allX2,
y: allY2,
z: allZ2,
u: allU2,
v: allV2,
w: allW2,
scene: 'scene2'
},
],
layout: {
width: 1200,
height: 600,
scene1: {
domain: {
x: [0, 0.45]
}
},
scene2: {
domain: {
x: [0.5, 0.95]
}
},
}
}
);
A codepen is available on https://codepen.io/emmanuelle-plotly/pen/PoYxZQv?editors=0010
I would not expect the viz to depend on whether x or z is the fastest varying variable.
Metadata
Metadata
Assignees
Labels
bugsomething brokensomething broken

Activity
archmoj commentedon Sep 19, 2019
In addition to
colorit looks there is a bug in the positions!In your codepen if I change the trace type from
streamtubetocone, it displays the full correct data.Demo
archmoj commentedon Oct 7, 2019
Not sure about the
coneplot sizes even: codepenetpinard commentedon Oct 7, 2019
See #3613 for that.
archmoj commentedon Oct 9, 2019
It appears that
gl-streamtube3dmodule makes false assumption about the order of data!https://github.com/gl-vis/gl-streamtube3d/blob/533bf21665b8849542756402ffc0800b932cffec/streamtube.js#L242-L249
etpinard commentedon Oct 9, 2019
Nice find @archmoj !
[-]streamtube coloring depends on data order[/-][+]streamtube coloring and positions depends on data order[/+]archmoj commentedon Oct 10, 2019
@emmanuelle what do you think of this fix?
codepen
Do the normals make sense e.g. when compared with
cone.archmoj commentedon Oct 10, 2019
Here is another example to help test changes.
codepen
[-]streamtube coloring and positions depends on data order[/-][+]streamtube coloring and positions depend on data order[/+]add tests streamtube fails before fixing bug issue #4206
emmanuelle commentedon Oct 11, 2019
Thank you @archmoj it looks good now :-)