Skip to content
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

Fixes bug - Camera params get overridden when changing dimension #75

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/scatter_plot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ export class ScatterPlot {
private mouseIsDown = false;
private isDragSequence = false;
private rectangleSelector: ScatterPlotRectangleSelector;
private cameraParams: any;

private readonly orbitControlParams: OrbitControlParams;

constructor(containerElement: HTMLElement, params: ScatterPlotParams) {
this.container = containerElement;
this.styles = params.styles;
this.cameraParams = params.camera
this.setParameters(params);

this.computeLayoutValues();
Expand Down Expand Up @@ -175,7 +177,7 @@ export class ScatterPlot {
);
this.addInteractionListeners();
this.setDimensions(3);
this.makeCamera(params.camera);
this.makeCamera(this.cameraParams);
this.resize();
}

Expand Down Expand Up @@ -644,7 +646,7 @@ export class ScatterPlot {

if (this.dimensions !== dimensions) {
this.dimensions = dimensions;
this.makeCamera();
this.makeCamera(this.cameraParams);
}
}

Expand Down