Skip to content

Commit

Permalink
Address #20
Browse files Browse the repository at this point in the history
  • Loading branch information
flekschas authored Jun 4, 2020
1 parent 418652c commit f3d1d26
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,16 @@ events.
**Returns:** a Promise that resolves to a [Regl texture](https://github.com/regl-project/regl/blob/gh-pages/API.md#textures) that can be used, for example, as the [background image](#).

**url:** the URL to an image.

## Trouble Shooting

#### Resizing and conditionally hiding/showing the scatterplot

The chances are high that you use the regl-scatterplot in a dynamically-resizable or interactive web-app. Please note that **regl-scatterplot doesn't not automatically resize** when the dimensions of its parent container change. It's your job to keep the size of regl-scatterplot and its parent element in sync. Hence, every time the size of the parent or `canvas` element changed, you have to call:

```javascript
const { width, height } = canvas.getBoundingClientRect();
scatterplot.set({ width, height });
```

Importantly, this is also true when you changed the visible of the canvas element from `canvas.hidden = true` to `canvas.hidden = false`!

0 comments on commit f3d1d26

Please sign in to comment.