-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
React finance precursor #2525
React finance precursor #2525
Changes from 7 commits
28d073f
c802d79
16a22f3
035c98d
95911da
6b201a1
5546ec7
0221510
b0af416
c2b11dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,7 +380,7 @@ plots.supplyDefaults = function(gd) { | |
if(_module.cleanData) _module.cleanData(newFullData); | ||
} | ||
|
||
if(oldFullData.length === newData.length) { | ||
if(oldFullData.length === newFullData.length) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How hard would it be to 🔒 this fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
sounds good 👌 |
||
for(i = 0; i < newFullData.length; i++) { | ||
relinkPrivateKeys(newFullData[i], oldFullData[i]); | ||
} | ||
|
@@ -2364,14 +2364,15 @@ plots.doCalcdata = function(gd, traces) { | |
// clear stuff that should recomputed in 'regular' loop | ||
if(hasCalcTransform) clearAxesCalc(axList); | ||
|
||
// 'regular' loop | ||
for(i = 0; i < fullData.length; i++) { | ||
var cd = []; | ||
|
||
function calci(i, isContainer) { | ||
trace = fullData[i]; | ||
_module = trace._module; | ||
|
||
if(!!_module.isContainer !== isContainer) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha. Nice fix. I wonder if other carpet-dependent blocks (e.g. here) could be simplified (or at least generatlized) using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably some such blocks could... though I don't see much to do with that |
||
|
||
var cd = []; | ||
|
||
if(trace.visible === true) { | ||
_module = trace._module; | ||
|
||
// keep ref of index-to-points map object of the *last* enabled transform, | ||
// this index-to-points map object is required to determine the calcdata indices | ||
|
@@ -2406,6 +2407,11 @@ plots.doCalcdata = function(gd, traces) { | |
calcdata[i] = cd; | ||
} | ||
|
||
// 'regular' loop - make sure container traces (eg carpet) calc before | ||
// contained traces (eg contourcarpet) | ||
for(i = 0; i < fullData.length; i++) calci(i, true); | ||
for(i = 0; i < fullData.length; i++) calci(i, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I moved |
||
|
||
Registry.getComponentMethod('fx', 'calc')(gd); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,25 +17,37 @@ var calcLabels = require('./calc_labels'); | |
var calcClipPath = require('./calc_clippath'); | ||
var clean2dArray = require('../heatmap/clean_2d_array'); | ||
var smoothFill2dArray = require('./smooth_fill_2d_array'); | ||
var hasColumns = require('./has_columns'); | ||
var convertColumnData = require('../heatmap/convert_column_xyz'); | ||
var setConvert = require('./set_convert'); | ||
|
||
module.exports = function calc(gd, trace) { | ||
var xa = Axes.getFromId(gd, trace.xaxis || 'x'); | ||
var ya = Axes.getFromId(gd, trace.yaxis || 'y'); | ||
var xa = Axes.getFromId(gd, trace.xaxis); | ||
var ya = Axes.getFromId(gd, trace.yaxis); | ||
var aax = trace.aaxis; | ||
var bax = trace.baxis; | ||
var a = trace._a = trace.a; | ||
var b = trace._b = trace.b; | ||
|
||
var t = {}; | ||
var x; | ||
var x = trace.x; | ||
var y = trace.y; | ||
var cols = []; | ||
if(x && !hasColumns(x)) cols.push('x'); | ||
if(y && !hasColumns(y)) cols.push('y'); | ||
|
||
if(cols.length) { | ||
convertColumnData(trace, aax, bax, 'a', 'b', cols); | ||
} | ||
|
||
var a = trace._a = trace._a || trace.a; | ||
var b = trace._b = trace._b || trace.b; | ||
x = trace._x || trace.x; | ||
y = trace._y || trace.y; | ||
|
||
var t = {}; | ||
|
||
if(trace._cheater) { | ||
var avals = aax.cheatertype === 'index' ? a.length : a; | ||
var bvals = bax.cheatertype === 'index' ? b.length : b; | ||
x = cheaterBasis(avals, bvals, trace.cheaterslope); | ||
} else { | ||
x = trace.x; | ||
} | ||
|
||
trace._x = x = clean2dArray(x); | ||
|
@@ -48,12 +60,14 @@ module.exports = function calc(gd, trace) { | |
smoothFill2dArray(x, a, b); | ||
smoothFill2dArray(y, a, b); | ||
|
||
setConvert(trace); | ||
|
||
// create conversion functions that depend on the data | ||
trace.setScale(); | ||
|
||
// Convert cartesian-space x/y coordinates to screen space pixel coordinates: | ||
t.xp = trace.xp = map2dArray(trace.xp, x, xa.c2p); | ||
t.yp = trace.yp = map2dArray(trace.yp, y, ya.c2p); | ||
t.xp = trace._xp = map2dArray(trace._xp, x, xa.c2p); | ||
t.yp = trace._yp = map2dArray(trace._yp, y, ya.c2p); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these xp and yp values used anywhere? Here they appear to be reset during the plot step. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha good call. Nothing fails if you 🔪 these lines, which is good because the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wow, then |
||
|
||
// This is a rather expensive scan. Nothing guarantees monotonicity, | ||
// so we need to scan through all data to get proper ranges: | ||
|
@@ -88,7 +102,7 @@ module.exports = function calc(gd, trace) { | |
|
||
// Tabulate points for the four segments that bound the axes so that we can | ||
// map to pixel coordinates in the plot function and create a clip rect: | ||
t.clipsegments = calcClipPath(trace.xctrl, trace.yctrl, aax, bax); | ||
t.clipsegments = calcClipPath(trace._xctrl, trace._yctrl, aax, bax); | ||
|
||
t.x = x; | ||
t.y = y; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly here, can we 🔒 this thing?