Skip to content

Commit 9848882

Browse files
authored
Add a note specifically to Vue.js
1 parent 064e7e4 commit 9848882

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ events.
330330

331331
## Trouble Shooting
332332

333-
#### Resizing and conditionally hiding/showing the scatterplot
333+
#### Resizing the scatterplot
334334

335335
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:
336336

@@ -339,4 +339,6 @@ const { width, height } = canvas.getBoundingClientRect();
339339
scatterplot.set({ width, height });
340340
```
341341

342-
Importantly, this is also true when you changed the visible of the canvas element from `canvas.hidden = true` to `canvas.hidden = false`!
342+
#### Using regl-scatterplot with Vue
343+
344+
Related to the resizing, when conditionally displaying regl-scatterplot in Vue you might have to update the `width` and `height` when the visibility is changed. See [issue #20](https://github.com/flekschas/regl-scatterplot/issues/20#issuecomment-639377810) for an example.

0 commit comments

Comments
 (0)