Skip to content

Commit 643ba30

Browse files
committed
reduce number of passing argumnets to parcoords
1 parent 8b88690 commit 643ba30

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/traces/parcoords/parcoords.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,12 @@ function extremeText(d, isTop) {
395395
return linearFormat(v, d.tickFormat);
396396
}
397397

398-
module.exports = function(gd, svg, parcoordsLineLayers, cdModule, layout, callbacks) {
398+
module.exports = function parcoords(gd, cdModule, layout, callbacks) {
399399
var state = parcoordsInteractionState();
400400

401401
var fullLayout = gd._fullLayout;
402+
var svg = fullLayout._toppaper;
403+
var glContainer = fullLayout._glcontainer;
402404

403405
// mock one linear axes for tick formatting
404406
linearAxis = { type: 'linear', showexponent: 'all', exponentformat: 'B' };
@@ -409,11 +411,11 @@ module.exports = function(gd, svg, parcoordsLineLayers, cdModule, layout, callba
409411
.map(model.bind(0, layout))
410412
.map(viewModel.bind(0, state, callbacks));
411413

412-
parcoordsLineLayers.each(function(d, i) {
414+
glContainer.each(function(d, i) {
413415
return Lib.extendFlat(d, vm[i]);
414416
});
415417

416-
var parcoordsLineLayer = parcoordsLineLayers.selectAll('.gl-canvas')
418+
var parcoordsLineLayer = glContainer.selectAll('.gl-canvas')
417419
.each(function(d) {
418420
// FIXME: figure out how to handle multiple instances
419421
d.viewModel = vm[0];

src/traces/parcoords/plot.js

-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ function sorter(visibleIndices, orig) {
3333

3434
module.exports = function plot(gd, cdModule) {
3535
var fullLayout = gd._fullLayout;
36-
var svg = fullLayout._toppaper;
37-
var container = fullLayout._glcontainer;
3836

3937
var success = prepareRegl(gd);
4038
if(!success) return;
@@ -134,8 +132,6 @@ module.exports = function plot(gd, cdModule) {
134132

135133
parcoords(
136134
gd,
137-
svg,
138-
container,
139135
cdModule,
140136
{ // layout
141137
width: size.w,

0 commit comments

Comments
 (0)