streamtube coloring and positions depend on data order
See original GitHub issuevar 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
The figure data structure in Python - Plotly
Detailed examples of The Figure Data Structure including changing color, size, log axes, and more in Python.
Read more >Streamlines and Streamtubes
A streamline is a line that is tangential to the instantaneous velocity direction (velocity is a vector, and it has a magnitude and...
Read more >Laplace's Eqn & Flow Nets Streamline - New Mexico Tech
Depending on the number of flow lines selected, the number of equipotential lines will automatically be fixed by geometry and grid layout. After...
Read more >Python Plotly tutorial - GeeksforGeeks
A bubble plot is a scatter plot with bubbles (color-filled circles). Bubbles have various sizes dependent on another variable in the data.
Read more >ParaView
Scientific visualization: specifically concerned with data that has a well-defined representation in 2D or 3D space (e.g., from simulation mesh or scanner).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice find @archmoj !
It appears that
gl-streamtube3d
module makes false assumption about the order of data! https://github.com/gl-vis/gl-streamtube3d/blob/533bf21665b8849542756402ffc0800b932cffec/streamtube.js#L242-L249