Skip to content

Commit 1c52fa6

Browse files
authored
Merge pull request #1 from plotly/master
catcup 8 sept
2 parents 33e1acf + ff3c324 commit 1c52fa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2035
-290
lines changed

package-lock.json

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"karma-jasmine-spec-tags": "^1.0.1",
143143
"karma-spec-reporter": "0.0.32",
144144
"karma-verbose-reporter": "0.0.6",
145+
"karma-viewport": "^1.0.2",
145146
"madge": "^3.2.0",
146147
"minify-stream": "^1.2.0",
147148
"minimist": "^1.2.0",

src/components/errorbars/calc.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,29 @@ function calcOneAxis(calcTrace, trace, axis, coord) {
4343
var computeError = makeComputeError(opts);
4444

4545
for(var i = 0; i < calcTrace.length; i++) {
46-
var calcPt = calcTrace[i],
47-
calcCoord = calcPt[coord];
46+
var calcPt = calcTrace[i];
47+
48+
var iIn = calcPt.i;
49+
50+
// for types that don't include `i` in each calcdata point
51+
if(iIn === undefined) iIn = i;
52+
53+
// for stacked area inserted points
54+
// TODO: errorbars have been tested cursorily with stacked area,
55+
// but not thoroughly. It's not even really clear what you want to do:
56+
// Should it just be calculated based on that trace's size data?
57+
// Should you add errors from below in quadrature?
58+
// And what about normalization, where in principle the errors shrink
59+
// again when you get up to the top end?
60+
// One option would be to forbid errorbars with stacking until we
61+
// decide how to handle these questions.
62+
else if(iIn === null) continue;
63+
64+
var calcCoord = calcPt[coord];
4865

4966
if(!isNumeric(axis.c2l(calcCoord))) continue;
5067

51-
var errors = computeError(calcCoord, i);
68+
var errors = computeError(calcCoord, iIn);
5269
if(isNumeric(errors[0]) && isNumeric(errors[1])) {
5370
var shoe = calcPt[coord + 's'] = calcCoord - errors[0],
5471
hat = calcPt[coord + 'h'] = calcCoord + errors[1];

0 commit comments

Comments
 (0)