Skip to content

Commit 5dfe455

Browse files
committed
refactor parcoords - use general variable names in plot and base_plot
1 parent 40de5d9 commit 5dfe455

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/traces/parcoords/base_plot.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ var getModuleCalcData = require('../../plots/get_data').getModuleCalcData;
1313
var parcoordsPlot = require('./plot');
1414
var xmlnsNamespaces = require('../../constants/xmlns_namespaces');
1515

16-
var PARCOORDS = 'parcoords';
17-
18-
exports.name = PARCOORDS;
16+
exports.name = 'parcoords';
1917

2018
exports.plot = function(gd) {
21-
var calcData = getModuleCalcData(gd.calcdata, PARCOORDS)[0];
19+
var calcData = getModuleCalcData(gd.calcdata, 'parcoords')[0];
2220
if(calcData.length) parcoordsPlot(gd, calcData);
2321
};
2422

2523
exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {
26-
var hadParcoords = (oldFullLayout._has && oldFullLayout._has(PARCOORDS));
27-
var hasParcoords = (newFullLayout._has && newFullLayout._has(PARCOORDS));
24+
var hadParcoords = (oldFullLayout._has && oldFullLayout._has('parcoords'));
25+
var hasParcoords = (newFullLayout._has && newFullLayout._has('parcoords'));
2826

2927
if(hadParcoords && !hasParcoords) {
3028
oldFullLayout._paperdiv.selectAll('.parcoords').remove();

src/traces/parcoords/plot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var parcoords = require('./parcoords');
1212
var prepareRegl = require('../../lib/prepare_regl');
1313

14-
module.exports = function plot(gd, cdparcoords) {
14+
module.exports = function plot(gd, cdModule) {
1515
var fullLayout = gd._fullLayout;
1616
var svg = fullLayout._toppaper;
1717
var root = fullLayout._paperdiv;
@@ -27,7 +27,7 @@ module.exports = function plot(gd, cdparcoords) {
2727

2828
var size = fullLayout._size;
2929

30-
cdparcoords.forEach(function(d, i) {
30+
cdModule.forEach(function(d, i) {
3131
var trace = d[0].trace;
3232
fullIndices[i] = trace.index;
3333
var iIn = inputIndices[i] = trace._fullInput.index;
@@ -138,7 +138,7 @@ module.exports = function plot(gd, cdparcoords) {
138138
root,
139139
svg,
140140
container,
141-
cdparcoords,
141+
cdModule,
142142
{
143143
width: size.w,
144144
height: size.h,

0 commit comments

Comments
 (0)