Skip to content

Commit

Permalink
[CORESDK-3299] Charts: tooltip customization for boxes in boxplots an…
Browse files Browse the repository at this point in the history
…d candles in candlestick. Fix due to double series for positive vs negative candles.
  • Loading branch information
michelezanda committed Mar 23, 2018
1 parent ef9a259 commit 8cecea6
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG_ION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# plotly.js ION changelog

## [1.33.1-ion6] -- 2018-03-23

### [CORESDK-3299] Charts: tooltip customization for boxes in boxplots and candles in candlestick. Fix due to double series for positive vs negative candles.


## [1.33.1-ion5] -- 2018-03-19

### [CORESDK-3299] Charts: tooltip customization for boxes in boxplots and candles in candlestick
Expand Down
21 changes: 13 additions & 8 deletions dist_ion/plotly-ion.js
Original file line number Diff line number Diff line change
Expand Up @@ -32816,7 +32816,7 @@ exports.svgAttrs = {
var Plotly = require('./plotly');

// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion5';
exports.version = '1.33.1-ion6';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down Expand Up @@ -65135,7 +65135,7 @@ exports.transform = function transform(dataIn, state) {
dataOut.push(traceIn);
continue;
}

dataOut.push(
makeTrace(traceIn, state, 'increasing'),
makeTrace(traceIn, state, 'decreasing')
Expand All @@ -65157,6 +65157,7 @@ function makeTrace(traceIn, state, direction) {
opacity: traceIn.opacity,
xaxis: traceIn.xaxis,
yaxis: traceIn.yaxis,
textbox: traceIn.textbox,

transforms: helpers.makeTransform(traceIn, state, direction)
};
Expand All @@ -65177,7 +65178,7 @@ function makeTrace(traceIn, state, direction) {

whiskerwidth: traceIn.whiskerwidth,
text: traceIn.text,

textbox: traceIn.textbox,
name: directionOpts.name,
showlegend: directionOpts.showlegend,
line: directionOpts.line,
Expand All @@ -65195,11 +65196,13 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
var open = trace.open,
high = trace.high,
low = trace.low,
close = trace.close;
close = trace.close,
textboxIn = trace.textbox;

var len = open.length,
x = [],
y = [];
y = [],
textbox = [];

var appendX = trace._fullInput.x ?
function(i) {
Expand All @@ -65218,11 +65221,13 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
if(filterFn(open[i], close[i]) && isNumeric(high[i]) && isNumeric(low[i])) {
appendX(i);
appendY(open[i], high[i], low[i], close[i]);
textbox.push(textboxIn[i]);
}
}

trace.x = x;
trace.y = y;
trace.textbox = textbox;
};

},{"../../lib":168,"../ohlc/helpers":312,"fast-isnumeric":17}],299:[function(require,module,exports){
Expand Down Expand Up @@ -65967,7 +65972,7 @@ module.exports = {
decreasing: directionAttrs(DECREASING_COLOR),

text: {
valType: 'string',
valType: 'info_array',

dflt: '',
arrayOk: true,
Expand All @@ -65976,7 +65981,7 @@ module.exports = {
},

textbox: {
valType: 'string',
valType: 'info_array',

dflt: '',
arrayOk: true,
Expand Down Expand Up @@ -66514,7 +66519,7 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
appendX(i);
appendY(open[i], high[i], low[i], close[i]);
appendText(i, open[i], high[i], low[i], close[i]);
}
}
}

trace.x = x;
Expand Down
2 changes: 1 addition & 1 deletion dist_ion/plotly-ion.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plotly.js",
"version": "1.33.1-ion5",
"version": "1.33.1-ion6",
"description": "The open source javascript graphing library that powers plotly",
"license": "MIT",
"main": "./lib/index.js",
Expand Down
4 changes: 2 additions & 2 deletions samples/chart_perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ var trace1 = {

low: [115.75, 115.809998, 116.470001],

open: [115.849998, 115.919998, 116.779999],
open: [115.849998, 130, 116.779999],
text: ['ciao1', 'ciao2', 'ciao3', 'ciao3', 'ciao3', 'ciao3', 'ciao3'],
textbox: [['goofy0', 'goofy1', 'goofy2', 'goofy3', 'goofy4'], ['goofy5', 'goofy6', 'goofy7']],

hoverinfo: 'text',
hoverinfo: 'y+text',

boxpoints: 'all',
type: 'candlestick',
Expand Down
2 changes: 1 addition & 1 deletion src/assets/geo_assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ var saneTopojson = require('sane-topojson');


// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion5';exports.topojson = saneTopojson;
exports.version = '1.33.1-ion6';exports.topojson = saneTopojson;
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var Plotly = require('./plotly');

// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion5';
exports.version = '1.33.1-ion6';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down
13 changes: 9 additions & 4 deletions src/traces/candlestick/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports.transform = function transform(dataIn, state) {
dataOut.push(traceIn);
continue;
}

dataOut.push(
makeTrace(traceIn, state, 'increasing'),
makeTrace(traceIn, state, 'decreasing')
Expand All @@ -59,6 +59,7 @@ function makeTrace(traceIn, state, direction) {
opacity: traceIn.opacity,
xaxis: traceIn.xaxis,
yaxis: traceIn.yaxis,
textbox: traceIn.textbox,

transforms: helpers.makeTransform(traceIn, state, direction)
};
Expand All @@ -79,7 +80,7 @@ function makeTrace(traceIn, state, direction) {

whiskerwidth: traceIn.whiskerwidth,
text: traceIn.text,

textbox: traceIn.textbox,
name: directionOpts.name,
showlegend: directionOpts.showlegend,
line: directionOpts.line,
Expand All @@ -97,11 +98,13 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
var open = trace.open,
high = trace.high,
low = trace.low,
close = trace.close;
close = trace.close,
textboxIn = trace.textbox;

var len = open.length,
x = [],
y = [];
y = [],
textbox = [];

var appendX = trace._fullInput.x ?
function(i) {
Expand All @@ -120,9 +123,11 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
if(filterFn(open[i], close[i]) && isNumeric(high[i]) && isNumeric(low[i])) {
appendX(i);
appendY(open[i], high[i], low[i], close[i]);
textbox.push(textboxIn[i]);
}
}

trace.x = x;
trace.y = y;
trace.textbox = textbox;
};
4 changes: 2 additions & 2 deletions src/traces/ohlc/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = {
decreasing: directionAttrs(DECREASING_COLOR),

text: {
valType: 'string',
valType: 'info_array',
role: 'info',
dflt: '',
arrayOk: true,
Expand All @@ -130,7 +130,7 @@ module.exports = {
},

textbox: {
valType: 'string',
valType: 'info_array',
role: 'info',
dflt: '',
arrayOk: true,
Expand Down
2 changes: 1 addition & 1 deletion src/traces/ohlc/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ exports.calcTransform = function calcTransform(gd, trace, opts) {
appendX(i);
appendY(open[i], high[i], low[i], close[i]);
appendText(i, open[i], high[i], low[i], close[i]);
}
}
}

trace.x = x;
Expand Down

0 comments on commit 8cecea6

Please sign in to comment.