Skip to content

DM-9343:scatter and line chart zoom changed when changing between "points" and "connected points" #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/firefly/js/charts/ui/XYPlotOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function getUnit(colValStats, colname) {
}
*/

export function resultsSuccess(callback, flds, tblId) {
export function resultsSuccess(callback, flds, tblId, zoom) {
const xName = get(flds, ['x.columnOrExpr']);
const yName = get(flds, ['y.columnOrExpr']);
const xErr = get(flds, ['x.error']);
Expand Down Expand Up @@ -107,7 +107,8 @@ export function resultsSuccess(callback, flds, tblId) {
shading: flds.shading || undefined,
x : { columnOrExpr : xName, error: xErr, label : xLabel, unit : xUnit, options : xOptions},
y : { columnOrExpr : yName, error: yErr, label : yLabel, unit : yUnit, options : yOptions},
tblId
tblId,
zoom,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, do not preserve zoom if X or Y column changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. When the columns change, the zoom should not be preserved. Thanks for pointing it out. I did not realize it.

}, isUndefined);

if (xErr || yErr) {
Expand Down Expand Up @@ -469,7 +470,7 @@ export class XYPlotOptions extends React.Component {
<div style={{display: 'flex', flexDirection: 'row', padding: '5px 0 15px'}}>
<CompleteButton style={{flexGrow: 0}}
groupKey={groupKey}
onSuccess={(flds) => resultsSuccess(onOptionsSelected, flds, xyPlotParams.tblId)}
onSuccess={(flds) => resultsSuccess(onOptionsSelected, flds, xyPlotParams.tblId, xyPlotParams.zoom)}
onFail={resultsFail}
text = 'Apply'
/>
Expand Down