Skip to content

Commit 2e35b94

Browse files
committed
2 parents 09ddf15 + 4411031 commit 2e35b94

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ See a complete example at [example/index.js](example/index.js).
6969

7070
- `regl` a Regl instance to be used for rendering.
7171
- `background` background color of the scatterplot.
72-
- `backgroundImage` background image for the scatterplot. This must be a [regl texture object](https://github.com/regl-project/regl/blob/gh-pages/API.md#textures).
72+
- `backgroundImage` background image for the scatterplot. This must be a [regl texture object](https://github.com/regl-project/regl/blob/gh-pages/API.md#textures) and can be created with [`createTextureFromUrl`](#const-texture--createTextureFromUrlregl-url-isCrossOrigin).
7373
- `canvas` canvas element.
7474
- `colors` colormap.
7575
- `pointSize` size of the points.
@@ -92,7 +92,7 @@ See a complete example at [example/index.js](example/index.js).
9292

9393
**Returns:** a new [Regl texture](https://github.com/regl-project/regl/blob/gh-pages/API.md#textures) from a remote image.
9494

95-
**regl:** the Regl instance associated to your scatterplot instance. Either use [`createRegl()`](#const-regl--createreglcanvas) or `scatterplot.regl`;
95+
**regl:** the Regl instance **associated to your scatterplot instance**. Either use [`createRegl()`](#const-regl--createreglcanvas) or `scatterplot.regl`. Important, if you use `createRegl()` make sure to pass the created regl instance into the scatterplot constructor as well!
9696

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

@@ -188,7 +188,7 @@ The version number of the scatterplot.
188188
the background with CSS! `background` is used when drawing the
189189
outline of selected points to simulate the padded border only.
190190

191-
- The background image must be a Regl texture function. To easily set a remote
191+
- The background image must be a Regl texture. To easily set a remote
192192
image as the background please use [`createTextureFromUrl`](#const-texture--createTextureFromUrlregl-url-isCrossOrigin).
193193

194194
- The scatterplot stores 4 colors per color representing 4 states, representing:
@@ -236,7 +236,7 @@ scatterplot.set({ backgroundImage: { src: 'https://server.com/my-image.png', cro
236236
// Set background image to some regl texture
237237
const image = new Image();
238238
image.src = 'my-image.png';
239-
image.onload = () => { scatterplot.set({ backgroundImage: regl.texture(image) });
239+
image.onload = () => { scatterplot.set({ backgroundImage: scatterplot.regl.texture(image) });
240240

241241
// Color by
242242
scatterplot.set({ colorBy: 'category' });

0 commit comments

Comments
 (0)