Skip to content

Commit d786467

Browse files
authored
Merge pull request #445 from Caltech-IPAC/IRSA-688-gridResetYmin
IRSA-688:IRSAViewer xyplot settings grid resets ymin
2 parents a050a1b + f88eaa0 commit d786467

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/firefly/js/charts/ui/XYPlotPlotly.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,18 @@ export class XYPlotPlotly extends PureComponent {
580580
layoutUpdate['xaxis.range'] = getRange(xAxisMin, xAxisMax, newXOptions.xLog, newXOptions.xReversed); // no change for reverse here
581581
layoutUpdate['yaxis.range'] = getRange(yAxisMin, yAxisMax, newYOptions.yLog, newYOptions.yReversed); // no change for reverse here
582582
}
583+
// when no boundaries are changed, the block below to ensure the boundaries are kept if the boundaries IRSA-688
584+
else if( !isUndefined(params.boundaries) && shallowequal(params.boundaries, newParams.boundaries) ){
585+
layoutUpdate['xaxis.autorange'] = false;
586+
const xAxisMin = params.boundaries.xMin;
587+
const xAxisMax = params.boundaries.xMax;
588+
const yAxisMin = params.boundaries.yMin;
589+
const yAxisMax = params.boundaries.yMax;
590+
layoutUpdate['xaxis.range'] = getRange(xAxisMin, xAxisMax, newXOptions.xLog, newXOptions.xReversed); // no change for reverse here
591+
layoutUpdate['yaxis.range'] = getRange(yAxisMin, yAxisMax, newYOptions.yLog, newYOptions.yReversed); // no change for reverse here
592+
593+
}
594+
583595

584596
if (!shallowequal(params.selection, newParams.selection)) {
585597
if (newParams.selection) {

0 commit comments

Comments
 (0)