Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.14.0

- Feat: expose a flag indicating a view change for events `draw`, `drawing`, and `view`
- Fix: clean up worker URL after creation

## 1.13.2

- Fix: replace the even-odd rule based with the non-zero winding rule for `isPointInPolygon()` to correctly handle overlapping/looping selections. Previosuly points that would fall within the overlapping area would falsely be excluded from the selection instead of being included.
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1051,26 +1051,26 @@ Render Regl draw instructions into a target canvas using the renderer.

### Events

| Name | Trigger | Payload |
| -------------------- | ------------------------------------------ | ---------------------------------- |
| init | when the scatter plot is initialized | `undefined` |
| destroy | when the scatter plot is destroyed | `undefined` |
| backgroundImageReady | when the background image was loaded | `undefined` |
| pointOver | when the mouse cursor is over a point | pointIndex |
| pointOut | when the mouse cursor moves out of a point | pointIndex |
| select | when points are selected | `{ points }` |
| deselect | when points are deselected | `undefined` |
| filter | when points are filtered | `{ points }` |
| unfilter | when the point filter is reset | `undefined` |
| view | when the view has changes | `{ camera, view, xScale, yScale }` |
| draw | when the plot was drawn | `{ camera, view, xScale, yScale }` |
| drawing | when the plot is being drawn | `{ camera, view, xScale, yScale }` |
| lassoStart | when the lasso selection has started | `undefined` |
| lassoExtend | when the lasso selection has extended | `{ coordinates }` |
| lassoEnd | when the lasso selection has ended | `{ coordinates }` |
| transitionStart | when points started to transition | `undefined` |
| transitionEnd | when points ended to transition | `createRegl(canvas)` |
| pointConnectionsDraw | when point connections were drawn | `undefined` |
| Name | Trigger | Payload |
| -------------------- | ------------------------------------------ | ------------------------------------------------- |
| init | when the scatter plot is initialized | `undefined` |
| destroy | when the scatter plot is destroyed | `undefined` |
| backgroundImageReady | when the background image was loaded | `undefined` |
| pointOver | when the mouse cursor is over a point | pointIndex |
| pointOut | when the mouse cursor moves out of a point | pointIndex |
| select | when points are selected | `{ points }` |
| deselect | when points are deselected | `undefined` |
| filter | when points are filtered | `{ points }` |
| unfilter | when the point filter is reset | `undefined` |
| view | when the view has changes | `{ camera, view, isViewChanged, xScale, yScale }` |
| draw | when the plot was drawn | `{ camera, view, isViewChanged, xScale, yScale }` |
| drawing | when the plot is being drawn | `{ camera, view, isViewChanged, xScale, yScale }` |
| lassoStart | when the lasso selection has started | `undefined` |
| lassoExtend | when the lasso selection has extended | `{ coordinates }` |
| lassoEnd | when the lasso selection has ended | `{ coordinates }` |
| transitionStart | when points started to transition | `undefined` |
| transitionEnd | when points ended to transition | `createRegl(canvas)` |
| pointConnectionsDraw | when point connections were drawn | `undefined` |

## Trouble Shooting

Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,7 @@ const createScatterplot = (

const renderView = {
view: camera.view,
isViewChanged,
camera,
xScale,
yScale,
Expand Down
15 changes: 8 additions & 7 deletions src/kdbush.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ const createWorker = (fn) => {
`const createWorker = ${fnStr};` +
'createWorker();';

return new Worker(
window.URL.createObjectURL(
new Blob([workerStr], {
type: 'text/javascript',
}),
),
);
const blob = new Blob([workerStr], { type: 'text/javascript' });
const workerUrl = URL.createObjectURL(blob);
const worker = new Worker(workerUrl, { name: 'KDBush' });

// Clean up URL
URL.revokeObjectURL(workerUrl);

return worker;
};

/**
Expand Down