8000 Finance refactor by alexcjohnson · Pull Request #2561 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Finance refactor #2561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintain 8000 ers 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 25 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e979cf0
refactor candlestick into a first-class trace, also box/violin hover …
alexcjohnson Apr 5, 2018
84c36a9
refactor OHLC into a first-class trace type
alexcjohnson Apr 6, 2018
3870503
update non-finance tests for finance refactor
alexcjohnson Apr 10, 2018
4c46a73
fix finance tests - with a couple of bugfixes too
alexcjohnson Apr 13, 2018
94c4560
fix #2004
alexcjohnson Apr 13, 2018
3509b99
fix and test finance hover labels - including test for #1807
alexcjohnson Apr 13, 2018
2849ff9
test finance trace select
alexcjohnson Apr 16, 2018
be2b523
:hocho: hover test in finance_test - hover_label_test covers it better
alexcjohnson Apr 16, 2018
5b6a7d5
fix prereqs for transform_multi_test
alexcjohnson Apr 16, 2018
121d171
update finance bundle tests
alexcjohnson Apr 16, 2018
ad1d8f0
update finance mocks
alexcjohnson Apr 16, 2018
2554482
fix lf/uf vs min/max logic for box/violin/candlestick
alexcjohnson Apr 16, 2018
0d80a21
fix #2510 - or rather, revive the test that the refactor fixed this
alexcjohnson Apr 16, 2018
82677ac
tweak and test cleanData for finance traces
alexcjohnson Apr 16, 2018
71fa112
remove plotSchema change from before we decided to refactor finance t…
alexcjohnson Apr 16, 2018
0b7541e
fix for box & candlestick together on one subplot
alexcjohnson Apr 16, 2018
f84dfae
change to shorter dash in finance_style mock
alexcjohnson Apr 16, 2018
d64fab6
remove TODO that's been OK'd as is
alexcjohnson Apr 16, 2018
dc01685
undefined -> BADNUM in ohlc/calc
alexcjohnson Apr 16, 2018
c8b03ee
Merge branch 'master' into finance-refactor
alexcjohnson Apr 17, 2018
302d1e6
update new getModuleCalcData callers to new API
alexcjohnson Apr 17, 2018
f498bd0
set to null instead of delete in ohlc/calc
alexcjohnson Apr 17, 2018
c77a8a3
test that selection applies to plot, not rangeslider
alexcjohnson Apr 17, 2018
3f43253
:hocho: fit
alexcjohnson Apr 17, 2018
13204a9
mark polar drag test flaky
alexcjohnson Apr 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update non-finance tests for finance refactor
  • Loading branch information
alexcjohnson committed Apr 16, 2018
commit 38705037992b0aaefb95d1b40ca67fa4860bab67
3 changes: 2 additions & 1 deletion test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ describe('Test axes', function() {
_has: Plots._hasPlotType,
_basePlotModules: [],
_dfltTitle: {x: 'x', y: 'y'},
_subplots: {cartesian: ['xy'], xaxis: ['x'], yaxis: ['y']}
_subplots: {cartesian: ['xy'], xaxis: ['x'], yaxis: ['y']},
_requestRangeslider: {}
};
fullData = [];
});
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/box_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('Test box hover:', function() {

return Plotly.plot(gd, fig).then(function() {
mouseEvent('mousemove', pos[0], pos[1]);
assertHoverLabelContent(specs);
assertHoverLabelContent(specs, specs.desc);
});
}

Expand Down
5 changes: 1 addition & 4 deletions test/jasmine/tests/plot_api_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2963,10 +2963,7 @@ describe('Test plot api', function() {
return Plotly.react(gd, mock);
})
.then(function() {
// TODO: remove this exemption once we fix finance
if(mockSpec[0] !== 'finance_style') {
expect(fullJson()).toEqual(initialJson);
}
expect(fullJson()).toEqual(initialJson);
countCalls({});
})
.catch(failTest)
Expand Down
27 changes: 27 additions & 0 deletions test/jasmine/tests/range_slider_test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var Plotly = require('@lib/index');
var Lib = require('@src/lib');
var setConvert = require('@src/plots/cartesian/set_convert');
var name2id = require('@src/plots/cartesian/axis_ids').name2id;

var RangeSlider = require('@src/components/rangeslider');
var constants = require('@src/components/rangeslider/constants');
Expand Down Expand Up @@ -509,7 +510,11 @@ describe('Rangeslider handleDefaults function', function() {

function _supply(layoutIn, layoutOut, axName) {
setConvert(layoutOut[axName]);
layoutOut[axName]._id = name2id(axName);
if(!layoutOut._requestRangeslider) layoutOut._requestRangeslider = {};
RangeSlider.handleDefaults(layoutIn, layoutOut, axName);
// we don't care about this after it's done its job
delete layoutOut._requestRangeslider;
}

it('should not coerce anything if rangeslider isn\'t set', function() {
Expand All @@ -519,6 +524,7 @@ describe('Rangeslider handleDefaults function', function() {

_supply(layoutIn, layoutOut, 'xaxis');
expect(layoutIn).toEqual(expected);
expect(layoutOut.xaxis.rangeslider).toBeUndefined();
});

it('should not mutate layoutIn', function() {
Expand Down Expand Up @@ -547,6 +553,27 @@ describe('Rangeslider handleDefaults function', function() {
expect(layoutOut.xaxis.rangeslider).toEqual(expected);
});

it('should set defaults if rangeslider is requested', function() {
var layoutIn = { xaxis: {}},
layoutOut = { xaxis: {}, _requestRangeslider: {x: true} },
expected = {
visible: true,
autorange: true,
thickness: 0.15,
bgcolor: '#fff',
borderwidth: 0,
bordercolor: '#444',
_input: {}
};

_supply(layoutIn, layoutOut, 'xaxis');
// in fact we DO mutate layoutIn - which we should probably try not to do,
// but that's a problem for another time.
// see https://github.com/plotly/plotly.js/issues/1473
expect(layoutIn).toEqual({xaxis: {rangeslider: {}}});
expect(layoutOut.xaxis.rangeslider).toEqual(expected);
});

it('should set defaults if rangeslider.visible is true', function() {
var layoutIn = { xaxis: { rangeslider: { visible: true }} },
layoutOut = { xaxis: { rangeslider: {}} },
Expand Down
0