Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7e41625
Removed reference to Plotly
mdtusz Jan 8, 2016
b716568
Removed more references to Plotly
mdtusz Jan 11, 2016
d639a93
Change `module` to `_module`
mdtusz Jan 11, 2016
356d0af
Change `Plotly.Lib` to `Lib`
mdtusz Jan 11, 2016
7a22cff
Modify trace modules to all follow the same format, exporing `plot`
mdtusz Jan 12, 2016
2ac3605
Modify trace modules to work with registry
mdtusz Jan 13, 2016
6e53762
Update tests to require trace modules directly
mdtusz Jan 13, 2016
46b83d8
Modify index and plotly to have register func and traces registered
mdtusz Jan 13, 2016
23519f0
Require pie trace module directly
mdtusz Jan 13, 2016
71db785
Plot register function warns instead of throwing error
mdtusz Jan 13, 2016
06640b4
Update plotting calls to work agnostically using registered modules
mdtusz Jan 13, 2016
4507ec5
Fix eslint warnings for multiple var declarations
mdtusz Jan 13, 2016
6bd4c5b
Removed reference to Plotly
mdtusz Jan 8, 2016
b4793c1
Removed more references to Plotly
mdtusz Jan 11, 2016
48b3803
Change `module` to `_module`
mdtusz Jan 11, 2016
5a2da5c
Change `Plotly.Lib` to `Lib`
mdtusz Jan 11, 2016
4fe8440
Modify trace modules to all follow the same format, exporing `plot`
mdtusz Jan 12, 2016
e46373e
Modify trace modules to work with registry
mdtusz Jan 13, 2016
a7fda91
Update tests to require trace modules directly
mdtusz Jan 13, 2016
43156a3
Modify index and plotly to have register func and traces registered
mdtusz Jan 13, 2016
03232e0
Require pie trace module directly
mdtusz Jan 13, 2016
28def12
Plot register function warns instead of throwing error
mdtusz Jan 13, 2016
f831b66
Update plotting calls to work agnostically using registered modules
mdtusz Jan 13, 2016
4994256
Fix eslint warnings for multiple var declarations
mdtusz Jan 13, 2016
6dd9a41
Fix undefined reference
mdtusz Jan 13, 2016
823ae72
Merge branch 'agnostic-geo-trace' of github.com:plotly/plotly.js into…
mdtusz Jan 13, 2016
75dc282
Change fields used by module registry
mdtusz Jan 14, 2016
b8864eb
Require styleOne directly
mdtusz Jan 14, 2016
5f26169
Use Object.keys instead of for-in
mdtusz Jan 14, 2016
a693bb2
Change register function and add test
mdtusz Jan 14, 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
Change module to _module
  • Loading branch information
mdtusz committed Jan 13, 2016
commit 48b3803c3fa2d97bd2e053b767db67d9be8e9498
14 changes: 7 additions & 7 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Plotly.plot = function(gd, data, layout, config) {
modules = gd._modules;

var i, j, cd, trace, uid, subplot, subplotInfo,
cdSubplot, cdError, cdModule, module;
cdSubplot, cdError, cdModule, _module;

function getCdSubplot(calcdata, subplot) {
var cdSubplot = [];
Expand All @@ -266,13 +266,13 @@ Plotly.plot = function(gd, data, layout, config) {
return cdSubplot;
}

function getCdModule(cdSubplot, module) {
function getCdModule(cdSubplot, _module) {
var cdModule = [];
var i, cd, trace;
for (i = 0; i < cdSubplot.length; i++) {
cd = cdSubplot[i];
trace = cd[0].trace;
if (trace._module===module && trace.visible===true) cdModule.push(cd);
if (trace._module === _module && trace.visible === true) cdModule.push(cd);
}
return cdModule;
}
Expand Down Expand Up @@ -311,12 +311,12 @@ Plotly.plot = function(gd, data, layout, config) {
if(subplotInfo.plot) subplotInfo.plot.selectAll('g.trace').remove();

for(j = 0; j < modules.length; j++) {
module = modules[j];
if(!module.plot) continue;
_module = modules[j];
if(!_module.plot) continue;

// plot all traces of this type on this subplot at once
cdModule = getCdModule(cdSubplot, module);
module.plot(gd, subplotInfo, cdModule);
cdModule = getCdModule(cdSubplot, _module);
_module.plot(gd, subplotInfo, cdModule);
Lib.markTime('done ' + (cdModule[0] && cdModule[0][0].trace.type));

// collect the traces that may have error bars
Expand Down
18 changes: 9 additions & 9 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ plots.supplyDefaults = function(gd) {
newData = gd.data || [],
modules = gd._modules = [];

var i, trace, fullTrace, module, axList, ax;
var i, trace, fullTrace, _module, axList, ax;


// first fill in what we can of layout without looking at data
Expand All @@ -441,14 +441,14 @@ plots.supplyDefaults = function(gd) {
else if(plots.traceIs(fullTrace, 'gl2d')) newFullLayout._hasGL2D = true;
else if('r' in fullTrace) newFullLayout._hasPolar = true;

module = fullTrace._module;
if (module && modules.indexOf(module)===-1) modules.push(module);
_module = fullTrace._module;
if (_module && modules.indexOf(_module)===-1) modules.push(_module);
}

// special cases that introduce interactions between traces
for (i = 0; i < modules.length; i++) {
module = modules[i];
if (module.cleanData) module.cleanData(newFullData);
_module = modules[i];
if (_module.cleanData) _module.cleanData(newFullData);
}

if (oldFullData.length === newData.length) {
Expand Down Expand Up @@ -563,7 +563,7 @@ plots.supplyDataDefaults = function(traceIn, i, layout) {
traceOut.index = i;
var visible = coerce('visible'),
scene,
module;
_module;

coerce('type');
coerce('uid');
Expand All @@ -577,14 +577,14 @@ plots.supplyDataDefaults = function(traceIn, i, layout) {
// module-specific attributes --- note: we need to send a trace into
// the 3D modules to have it removed from the webgl context.
if(visible || scene) {
module = plots.getModule(traceOut);
traceOut._module = module;
_module = plots.getModule(traceOut);
traceOut._module = _module;
}

// gets overwritten in pie and geo
if(visible) coerce('hoverinfo', (layout._dataLength === 1) ? 'x+y+z+text' : undefined);

if(module && visible) module.supplyDefaults(traceIn, traceOut, defaultColor, layout);
if(_module && visible) _module.supplyDefaults(traceIn, traceOut, defaultColor, layout);

if(visible) {
coerce('name', 'trace ' + i);
Expand Down