Skip to content

Commit

Permalink
Refactor declaration of useModifySVGInStages
Browse files Browse the repository at this point in the history
`useModifySVGInStages` is false unless `newLayout` is set to true. Thus,
set `useModifySVGInStages = newLayout`.
  • Loading branch information
kairstenfay committed May 31, 2019
1 parent f98bb55 commit 76546d5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/tree/phyloTree/change.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const change = function change({
const elemsToUpdate = new Set(); /* what needs updating? E.g. ".branch", ".tip" etc */
const nodePropsToModify = {}; /* which properties (keys) on the nodes should be updated (before the SVG) */
const svgPropsToUpdate = new Set(); /* which SVG properties shall be changed. E.g. "fill", "stroke" */
let useModifySVGInStages = false; /* use modifySVGInStages rather than modifySVG. Not used often. */
const useModifySVGInStages = newLayout; /* use modifySVGInStages rather than modifySVG. Not used often. */

/* calculate dt */
const idealTransitionTime = 500;
Expand Down Expand Up @@ -306,9 +306,6 @@ export const change = function change({
elemsToUpdate.add(".grid").add(".regression");
svgPropsToUpdate.add("cx").add("cy").add("d").add("opacity").add("visibility");
}
if (newLayout) {
useModifySVGInStages = true;
}

/* change the requested properties on the nodes */
updateNodesWithNewData(this.nodes, nodePropsToModify);
Expand Down

0 comments on commit 76546d5

Please sign in to comment.