Skip to content

Replace _has<PlotType> variables with '_has()' fullLayout method #491

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 27 commits into from
May 11, 2016
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
88f552a
mv gd._modules -> fullLayout._modules
etpinard Apr 27, 2016
525e3c7
lint
etpinard Apr 27, 2016
876ce4b
attach has (plot type) method to fullLayout,
etpinard Apr 27, 2016
f45ffec
add tempory block _has() -> _hasCartesian etc.
etpinard Apr 27, 2016
4e0c6da
rm _has??? attributes
etpinard Apr 27, 2016
93493a6
make 'pie' a layout category,
etpinard Apr 27, 2016
e63ba4a
check for hasCartesian && !hasPie for 'hovermode',
etpinard Apr 28, 2016
b655cb0
Revert "check for hasCartesian && !hasPie for 'hovermode',"
etpinard May 3, 2016
f476e05
split pie trace base plot module from cartesian:
etpinard May 3, 2016
1c41c2e
rm (now useless) trace module layoutCategories
etpinard May 3, 2016
313150e
add fill unique lib function,
etpinard May 6, 2016
392619c
fill fullLayout._basePlotModules list in default trace loop,
etpinard May 6, 2016
3787d47
loop over basePlotModules instead of subplotRegistry in:
etpinard May 6, 2016
68b12c4
make sure to add cartesian base plot module to orphan axis graphs:
etpinard May 6, 2016
a41427c
move 3d axes init step from makePlotFrameork -> Gl3d.plot
etpinard May 6, 2016
a48d071
check for non-cartesian/pie/ternary base plot module in restyle,
etpinard May 6, 2016
a78521c
handle a few polar-only cases:
etpinard May 6, 2016
aa2ec8b
sub has??? -> has('???')
etpinard May 6, 2016
77fb7e2
loop over (trace) modules in trace supplyLayoutDefaults:
etpinard May 6, 2016
a141d78
robustify pie clean step:
etpinard May 6, 2016
dc297ca
put ref of hasPlotType method on Plots:
etpinard May 6, 2016
e3f72f0
move block of _has?? = _has('') after all defaults are filled:
etpinard May 6, 2016
c59a960
update tests
etpinard May 6, 2016
9f94494
add info about data/layout and fullData/fullLayout
etpinard May 6, 2016
9837d8b
Merge branch 'master' into has-plot-type
etpinard May 6, 2016
0c7b2f8
rename Lib.fillUnique -> Lib.pushUnique
etpinard May 9, 2016
5e6759b
rm unnecessary boolean type coercion
etpinard May 9, 2016
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
move block of _has?? = _has('') after all defaults are filled:
- so that orphan axes are considered hasCartesian still
- IMPORTANT: we must keep ref to _has??? for backward compatibility
  • Loading branch information
etpinard committed May 6, 2016
commit e3f72f092f16e67345cbabb72da742ced607f4a7
16 changes: 9 additions & 7 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,6 @@ plots.supplyDefaults = function(gd) {

// attach helper method to check whether a plot type is present on graph
newFullLayout._has = plots._hasPlotType.bind(newFullLayout);
// temporary block (before replace all _has??? with _hasPlotType() ?
newFullLayout._hasCartesian = newFullLayout._has('cartesian');
newFullLayout._hasGeo = newFullLayout._has('geo');
newFullLayout._hasGL3D = newFullLayout._has('gl3d');
newFullLayout._hasGL2D = newFullLayout._has('gl2d');
newFullLayout._hasTernary = newFullLayout._has('ternary');
newFullLayout._hasPie = newFullLayout._has('pie');

// special cases that introduce interactions between traces
for(i = 0; i < modules.length; i++) {
Expand All @@ -511,6 +504,15 @@ plots.supplyDefaults = function(gd) {
// finally, fill in the pieces of layout that may need to look at data
plots.supplyLayoutModuleDefaults(newLayout, newFullLayout, newFullData);

// TODO remove in v2.0.0
// add has-plot-type refs to fullLayout for backward compatibility
newFullLayout._hasCartesian = newFullLayout._has('cartesian');
newFullLayout._hasGeo = newFullLayout._has('geo');
newFullLayout._hasGL3D = newFullLayout._has('gl3d');
newFullLayout._hasGL2D = newFullLayout._has('gl2d');
newFullLayout._hasTernary = newFullLayout._has('ternary');
newFullLayout._hasPie = newFullLayout._has('pie');

// clean subplots and other artifacts from previous plot calls
plots.cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);

Expand Down