Skip to content
18 changes: 10 additions & 8 deletions src/traces/parcoords/parcoords.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,20 @@ module.exports = function(root, svg, parcoordsLineLayers, styledData, layout, ca

parcoordsLineLayer
.each(function(d) {

if(d.viewModel) {
if(d.lineLayer) d.lineLayer.update(d);
else d.lineLayer = lineLayerMaker(this, d);
if((!d.lineLayer) ||
Copy link
Contributor

@etpinard etpinard Oct 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That extra ( ) style feels somewhat new to our codebase. Maybe we could add https://eslint.org/docs/rules/no-extra-parens to our lintinting rules.

(callbacks)) { // recreate in case of having callbacks e.g. restyle. Should we test for callback to be a restyle?
d.lineLayer = lineLayerMaker(this, d);
} else d.lineLayer.update(d);

d.viewModel[d.key] = d.lineLayer;
if(d.key) {
d.viewModel[d.key] = d.lineLayer;

var setChanged = ((d.key) &&
(((d.key !== 'contextLayer') || (callbacks)) || // unless there is callback on this line layer
(!d.context))); // don't update background
var setChanged = ((!d.context) || // don't update background
((d.key !== 'contextLayer') || (callbacks))); // unless there is a callback on the context layer. Should we test the callback?

d.lineLayer.render(d.viewModel.panels, setChanged);
d.lineLayer.render(d.viewModel.panels, setChanged);
}
}
});

Expand Down