Skip to content

Commit

Permalink
Fixed bug where equi-space x button would change curve x values
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Aug 20, 2024
1 parent aaf8367 commit 1273611
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions meteor_packages/mats-common/templates/graph/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -1710,8 +1710,13 @@ Template.graph.events({
: newX[newX.length - 1];

// store previous and new x values to craft consistent tick marks
tickvals = _.union(tickvals, newX);
ticktext = _.union(ticktext, origX[didx]);
if (
reservedWords.indexOf(dataset[didx].label) === -1 &&
!dataset[didx].label.includes(matsTypes.ReservedWords.noSkill)
) {
tickvals = _.union(tickvals, newX);
ticktext = _.union(ticktext, origX[didx]);
}
}
Session.set("thresholdEquiX", true);
Session.set("origX", origX);
Expand All @@ -1736,8 +1741,13 @@ Template.graph.events({
: origX[didx][origX[didx].length - 1];

// store previous and new x values to craft consistent tick marks
tickvals = _.union(tickvals, origX[didx]);
ticktext = _.union(ticktext, origX[didx]);
if (
reservedWords.indexOf(dataset[didx].label) === -1 &&
!dataset[didx].label.includes(matsTypes.ReservedWords.noSkill)
) {
tickvals = _.union(tickvals, origX[didx]);
ticktext = _.union(ticktext, origX[didx]);
}

// remove new formatting that would have been passed to pop-out windows
delete curveOpsUpdate[didx].x;
Expand Down

0 comments on commit 1273611

Please sign in to comment.