Skip to content

Commit

Permalink
fix: aspect ratio and opacity types (#147)
Browse files Browse the repository at this point in the history
* Fix aspect ration and opacity type

* Add ability to set `aspectRatio` in the constructor
  • Loading branch information
flekschas authored Aug 9, 2023
1 parent cc23a7c commit 805694b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.8.1

- Add ability to set `aspectRatio` in the constructor
- Add type for `aspectRatio`
- Fix type of `opacity`

## 1.8.0

- Add `scatterplot.getScreenPosition(pointIdx)` to retrieve the screen position of a point by its index.
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ const createScatterplot = (
let lassoPointsCurr = [];
let searchIndex;
let viewAspectRatio;
let dataAspectRatio = DEFAULT_DATA_ASPECT_RATIO;
let dataAspectRatio =
initialProperties.aspectRatio || DEFAULT_DATA_ASPECT_RATIO;
let projectionLocal;
let projection;
let model;
Expand Down
3 changes: 2 additions & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ interface BaseOptions {
showPointConnections: boolean;
showReticle: boolean;
reticleColor: Color;
opacity: number;
opacity: number | Array<number>;
opacityByDensityFill: number;
opacityInactiveMax: number;
opacityInactiveScale: number;
height: 'auto' | number;
width: 'auto' | number;
gamma: number;
aspectRatio: number;
// Nullifiable
backgroundImage: null | import('regl').Texture2D | string;
colorBy: null | DataEncoding;
Expand Down

0 comments on commit 805694b

Please sign in to comment.