Skip to content

Commit 181bab4

Browse files
author
Lijun Zhang
committed
DM-9343:
Fixed bug after zoom
1 parent 456f33e commit 181bab4

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/firefly/js/charts/ChartsCntlr.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ export function makeChartDataFetch (getChartDataType) {
215215
};
216216
}
217217

218+
function areAllValuesEaual(obj1, obj2){
219+
for(var key in obj1) {
220+
if (obj1.hasOwnProperty(key)) {
221+
if (obj1[key]!=obj2[key]){
222+
return false;
223+
}
224+
}
225+
}
226+
return true;
227+
}
218228
/**
219229
*
220230
* @param dispatch
@@ -229,6 +239,15 @@ function doChartDataFetch(dispatch, payload, getChartDataType) {
229239
const {chartId, chartDataElement, invokedBy} = payload;
230240
const oldOptions = chartDataElement.options;
231241
let {newOptions=oldOptions} = payload;
242+
/*
243+
LZ 2/24/17
244+
DM-9343
245+
If the zoom is in the oldOption, copy it to the newOption unless the new zoom exists in the newOption
246+
*/
247+
248+
if (!newOptions.zoom && oldOptions.zoom && !areAllValuesEaual(oldOptions.zoom,oldOptions.boundaries)){
249+
newOptions.zoom = oldOptions.zoom;
250+
}
232251

233252
const dataTypeId = chartDataElement.type;
234253
const cdt = dataTypeId ? getChartDataType(dataTypeId) : {};

src/firefly/js/charts/dataTypes/XYColsCDT.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ export function setZoom(chartId, chartDataElementId, selection=undefined) {
194194
if (decimatedUnzoomed || isUndefined(decimatedUnzoomed)) {
195195
noFetch = false;
196196
}
197-
dispatchChartOptionsUpdate({chartId, chartDataElementId, updates: {zoom: xyPlotParams.selection, selection: undefined}, noFetch});
197+
dispatchChartOptionsUpdate({chartId, chartDataElementId, updates: {zoom: xyPlotParams.boundaries, selection: undefined}, noFetch});
198+
199+
//dispatchChartOptionsUpdate({chartId, chartDataElementId, updates: {zoom: xyPlotParams.selection, selection: undefined}, noFetch});
198200
}
199201
}
200202
}

0 commit comments

Comments
 (0)