8000 Handle streamtube coordinates in string format and handle different data orders in isosurface and volume by archmoj · Pull Request #4431 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Handle streamtube coordinates in string format and handle different data orders in isosurface and volume #4431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 30, 2019
Merged
Prev Previous commit
rewrite without forEach
  • Loading branch information
archmoj committed Dec 30, 2019
commit c82da07617b8cac581eea4a4cc291a710683d320
7 changes: 4 additions & 3 deletions src/traces/isosurface/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ module.exports = function calc(gd, trace) {
trace.value.length
);

['value', 'x', 'y', 'z'].forEach(function(e) {
trace['_' + e] = filter(trace[e], trace._len);
});
trace._x = filter(trace.x, trace._len);
trace._y = filter(trace.y, trace._len);
trace._z = filter(trace.z, trace._len);
trace._value = filter(trace.value, trace._len);

var grid = processGrid(trace);
trace._gridFill = grid.fill;
Expand Down
17 changes: 10 additions & 7 deletions src/traces/streamtube/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ var colorscaleCalc = require('../../components/colorscale/calc');

function calc(gd, trace) {
trace._len = Math.min(
trace.x.length,
trace.y.length,
trace.z.length,
trace.u.length,
trace.v.length,
trace.w.length
trace.w.length,
trace.x.length,
trace.y.length,
trace.z.length
);

['u', 'v', 'w', 'x', 'y', 'z'].forEach(function(e) {
trace['_' + e] = filter(trace[e], trace._len);
});
trace._u = filter(trace.u, trace._len);
trace._v = filter(trace.v, trace._len);
trace._w = filter(trace.w, trace._len);
trace._x = filter(trace.x, trace._len);
trace._y = filter(trace.y, trace._len);
trace._z = filter(trace.z, trace._len);

var grid = processGrid(trace);
trace._gridFill = grid.fill;
Expand Down
0