- Fix: allow setting the lasso long press indicator parent element
- Fix: catch another edge case where
zoomToOrigin
was unsetting the camera fixed state
- Fix: handle camera fixing better by adding a dedicated prop called
cameraIsFixed
. Previously, the lasso end interaction would unset the camera fixing. (#94)
- Fix: ensure that the drawing order of points cannot be manipulated via
scatterplot.filter()
(#197)
- Feat: add support for linear and constant point scaling via a new property called
pointScaleMode
.
- Fix: restrict the renderer's canvas to be at most as large as the screen. Previously we had the canvas size bound to
window.innerWidth
andwindow.innerHeight
. However, in VSCode it was possible thatwindow.innerHeight
was muuuuch larger than the actual screen, which in turn caused a WebGL error (invalid renderbuffer size). This issues was first reported at flekschas/jupyter-scatter#37.
- Fix: properly set mouse mode on initialization and add tests for it
- Fix: expose x start/end and y start/end for horizontal and vertical line annotations.
- Fix: ensure KDBush worker works in prod build
- Fix: ensure single annotations render properly (#187)
- Feat: add support for annotations via
scatterplot.drawAnnotations()
- Fix: try ensure
zoomToArea
works in cases whereaspectRatio
is not equal to1
and add tests to verify this
- Fix: option types of
zoomToLocation
,zoomToOrigin
,zoomToArea
- Fix: ensure
zoomToArea
works in cases whereaspectRatio
is not equal to1
- Fix:
scatterplot.draw(newPoints, { preventFilterReset })
should preserves the filter (Jupyter-Scatter#134) - Fix:
scatterplot.hover(filteredOutPoint)
should not trigger a hover event
- Fix: point connection initial color map
- Fix: allow point connection color to be set to
inherit
(to inherit the point color)
- Fix: update
regl-line
to include a critical bug fix related to drawing connected points.
- Fix: add missing type definition for
scatterplot.get('spatialIndex')
(#179)
- Add: allow to retrieve KDBush's spatial index via
scatterplot.get('spatialIndex')
. The index refers to KDBush v4.0.2. - Add: allow to pass a spatial index to
scatterplot.draw(newPoints, { spatialIndex })
to circumvent the indexing ofnewPoints
. This can be useful when only the z or w coordinates ofnewPoints
differ to previously drawn points or when you've computed the spatial index upfront. - Add: run the computation of the spatial index in a worker when the number of points is larger or equal to one million. This behavior can be adjusted during the instantiation of the scatterplot via
createScatterplot({ spatialIndexUseWorker })
. Iftrue
, regl-scatterplot will always compute the spatial index in a worker. Iffalse
, regl-scatterplot will always compute the spatial index in the main browser thread. - Add: export
createSpatialIndex
to allow creating a spatial index upfront conveniently - Add: new
drawing
event that is always fired synchronously before the end of a draw call. This event is useful for drawing other things as part of an animation frame. The main difference to the defaultdraw
event is that thedraw
event is fired asynchronously (like all other events) after the draw call such that the draw call itself isn't blocked. - Fix: pass
{ camera, view, xScale, yScale }
as the payload of thedraw
event as specified in the docs. - Fix: allow
scatterplot.set({ showPointConnections: true })
before points were drawn #171 - Fix: pub-sub related types by updating
pub-sub-es
to version 3
- Fix: add
d3-scale
types as a dev dependency #153 - Fix: run CI workflows on Ubuntu to ensure the
sed
replacement call works properly #153
- Fix a regression with the point opacity introduced in v1.7.1
- Fix typo in draw option type (renamed
focus
tofilter
) #148
- Improve hover detection
- Fix: add ability to set
aspectRatio
in the constructor - Fix: add missing type definition for
aspectRatio
- Fix: extend
opacity
type to correctly allownumber[]
- Add
scatterplot.getScreenPosition(pointIdx)
to retrieve the screen position of a point by its index.
- Improve data type inference of the z/w values and allow to explicitely specify their data type via
draw(newPoints, { zDataType: 'categorical', wDataType: 'continuous' })
- Add
preventFilterReset
option todraw()
to allow re-drawing while keeping the current point filter. #136 - Add ability to hover, select, and filter points immediately when calling
draw(points, { hover: 0, select: [1, 2], filter: [0, 2, 3] })
. Immediately hovering, selecting, or filtering points avoids a filter that can occur when first drawing points and then hovering, selecting, or filtering points subsequently. #142 - Add missing
filteredPoints
type definition. #139 - Add missing
selectedPoints
type definition. - Fix drawing a single connecting line between points #125
- Fix drawing a single point connection #141
- Fix
draw()
's promise resolution whenshowPointConnections
istrue
. The promise is now resolved after both, the points and point connections, have been drawn. - Set minimum Node version to
16
and minimum npm version to7
. You might still be able to useregl-scatterplot
with older version but it's not advised.
- Fix
scatterplot.destroy()
to properly remove all event listeners bound during instance creation. #135
- Fix empty
select([])
handling #132
- Fix
filter()
to allow filtering out all points #122 - Add
isPointsFiltered
toget()
to allow determining if any points have been filtered out
- Fix
zoomToPoints
behavior when points are not initialized #123 - Add
isDestroyed
andisPointsDrawn
toget()
- Improve type annotations of the
select
event (#119) - Add type annotations for the
filter
andunfilter
events
- Fix typing issue related to
subscribe()
(#117)
- Fix a point hovering issue (#112)
- Fix an issue with repeated zooming to points
- Improve lasso on long press start
- Fix a build regression from updating to Rollup v3
- Update third party libraries
- Improve lasso long press indicator styling
- Fix an issue where a lasso with less than three control points
-
Add the ability to filter down points via
scatterplot.filter(pointIdxs)
. This can be useful if you need to temporarily need to hide points without having to re-instantiate the regl-scatterplot instance. E.g., when callingscatterplot.filter([0, 1, 2])
, only the first, second, and third point will remain visible. All other points (and their related point connections) will be visually and interactively hidden.To reset the filter call
scatterplot.unfilter()
orscatterplot.filter([])
.short-filter.mp4
-
Add the ability to retrieve selected and filtered point indices via
scatterplot.get('selectedPoints')
andscatterplot.get('filteredPoints')
respectively.
- Refactor lasso manager to support SSR (#101)
- Fix a glitch where the scatterplot instance is destroyed after a
scatterplot.draw()
was called but beforescatterplot.draw()
finished. (#101)
- Add the ability to lasso select point upon long press via
scatterplot.set('lassoOnLongPress', true)
. - Fix type issues (#98)
- Enforce the canvas width and height to be at least 1px to prevent view operations from breaking.
- Bump
dom-2d-camera
to publish view updates on camera tweens (#95)
- Add zooming via the following four methods. All four methods supported animated transition just like
draw()
.scatterplot.zoomToLocation(target, distance)
for zooming to a specific point locationscatterplot.zoomToArea(rectangle)
for zooming to an area specified by a rectangular bounding boxscatterplot.zoomToPoints(pointIndices)
for zooming to a set of pointsscatterplot.zoomToOrigin()
for zooming to the origin
- Add
scatterplot.isSupported
andrenderer.isSupported
as read-only properties to expose if all GL extensions are supported and enabled in the user's browser (#90) - Add
checkSupport()
as a globally exported function for users to check if their browser supports and has enabled all required GL extensions (#90)
- Add a missing
select
event name to the type definition (#87)
- Add properties
opacityInactiveScale
andopacityInactiveMax
to enable de-emphasizing unselected points and highlight selected points. The final point opacity is now set tomin(opacityInactiveMax, currentOpacity) * opacityInactiveScale
when at least one point is selected. By defaultopacityInactiveScale
andopacityInactiveMax
are set to1
. I.e., the default behavior did not change.
- Properly initialize new x/y scales upon calling
set()
- Fix a minor issue in
destroy()
that prevented disconnecting resize listeners
- Update dom-2d-camera to fix internal tests
- Outsource WebGL renderer to improve instancing: You can now use a single shared WebGL renderer (via
createRenderer()
) to power multiple scatter plot instances. See https://flekschas.github.io/regl-scatterplot/multiple-instances.html. - Add
scatterplot.redraw()
to enforce a redrawing of the scene. This can be necessary when you manually updated the camera. - Add
scatterplot.view(cameraView, { preventEvent })
as a shorthand for setting the scatter plot's camera view. ThepreventEvent
option enables synchronizing multiple scatter plot instances. See https://flekschas.github.io/regl-scatterplot/multiple-instances.html. - Allow passing typed arrays to
scatterplot.draw({ x, y, z, w })
.
Breaking changes:
scatterplot.export()
is now returning an ImageData object for better utility.
- Fix incorrect opacity handling (#74)
- Add
scatterplot.get('pointsInView')
to retrieve the indices of the points currently visible within the view (#72). Shoutout to @dulex123 for his PR! - Add
scatterplot.get('points')
to retrieve all currently drawn points. - Add an example for demonstrating how labels can be rendered. The demo using
scatterplot.get('pointsInView')
to determine when to render text labels. See https://flekschas.github.io/regl-scatterplot/text-labels.html
Woohoo 🥳 It's time to release v1! Nothing dramatic changed in this release but I felt that the library/API is now stable enough. Also, a big shoutout to @manzt and @japrescott for their PRs.
- Support drawing columnar data
scatterplot.draw({ x: [...], y: [...], ... })
(#59) - Fix the rendering issue with with Safari 14 (#45)
- Replace webpack with vite (#64)
- Fix an issue with not properly publishing the pointout event (#58)
- Simplify drawing loop by using
regl.frame
and bailing out of when nothing needs to be redrawn - Update regl-line to be compatible with regl v2
- Ensure inter buffers and viewports are properly updated on every draw call.
Breaking changes:
-
Improve the handling of the connection order by switching from a structured 5th component to a 6th component.
Previously to provide a specific order, the 5th component had to be a tuple of
[lineComponentId, orderIndex]
. With this update the 5th component will always just belineComponentId
and the 6th will beorderIndex
.
- Avoid text selection when lassoing
- Optimize density-based opacity encoding
- Fix an issue with the lasso position when the page is scrollable (#50)
- Fix an issues when programmatically trying to
select()
orhover()
non-existing points
- Harmonize
hover(pointIdx, { showReticleOnce, preventEvent })
withselect()
API by allowing it to prevent thepointover
andpointout
from being published.
- Add two events:
init
anddestroy
- Add
lassoLineWidth
to allow adjusting the lasso line width - Fix an issue with normalizing RGBA values
- Fix a camera issue when lassoing in non-
panZoom
mouse mode
- Rename
showRecticle
toshowReticle
andrecticleColor
toreticleColor
(#47) - Fix reticle glitches by updating
regl-line
(#46)
- Add density-based dynamic point opacity via
opacityBy: 'density'
. See dynamic-opacity.html for an example.
- Add
scatterplot.export
for exporting the current view as pixels. - Add default canvas width/height (
'auto'
) to fix an issue on high-dpi monitors that do not style the canvas element (#41) - Add resize handler so when width/height is set to
'auto'
the canvas element is automatically resized onresize
andorientationchange
events. - Improve framebuffer rendering and add
gamma
prop to allow controlling the opacity blending (#42)
- Add the ability to color point connections by their segment via
pointConnectionColorBy: 'segment'
- Fix an issue with normalizing RGB(A) values
- Avoid the unnecessary use of the logical-assignment-operators (#39)
- Stop calling
camera.refresh()
as that is unnecessary sincev1.2.2
- Avoid empty lasso events
- Fix incorrectly initialized
pointConnectionColorBy
,pointConnectionOpacityBy
, andpointConnectionSizeBy
- Fix an issue with the color conversion to RGBA
- Fix an issue blurring an active point connection
- Allow inheriting
pointConnectionColor
frompointColor
by settingpointConnectionColor: 'inherit'
. Same forpointConnectionColorActive
andpointConnectionColorHover
. - Fix incorrectly initialized
opacity
- Fix incorrectly initialized
colorBy
,opacityBy
, andsizeBy
- Fix not assigned
pointConnectionOpacity
- Rename
pointConnectionOpacitySelection
andpointConnectionSizeSelected
topointConnectionOpacityActive
andpointConnectionSizeActive
for consistency
-
Allow the point-associated data values to be either categorical or continuous instead of enforcing one to be categorical and the other one to be continuous. For continuous data, assign [0,1]-normalized data as the third or forth component of a point. For categorical data, assign an integer-based data. For instance, if a point looks
[1, 2, 3, 4]
we assume that the first (3
) and second (4
) data value is categorical. If you would instead have points like[1, 2, 0.33, 0.44]
where the third and forth component are within [0,1] then we would assume that those components represent continuous data. For backward compatibility,colorBy: 'category'
refers to coloring by the third component andcolorBy 'value'
refers to the forth component. Additionall, you can now reference the third components viavalue1
,valueA
,valueZ
, orz
and the forth component viavalue2
,valueB
,valueW
, orw
. -
Add the ability to connect points visually via
draw(points, { connectPoints: true })
. This assumes that your points have a 5th component that identifies the point connection. Currently the order of points as they appear inpoints
defines the order of how they would be connected. So assuming you have:// prettier-ignore scatterplot.draw([ 1, 1, 0, 0, 0, 2, 2, 0, 0, 0, 3, 3, 0, 0, 1, 4, 4, 0, 0, 1, 5, 5, 0, 0, 0, ], { connectPoints: true });
Then we would connext the points as follows:
1 -> 2 -> 5 3 -> 4
For an example see example/connected-points.js.
-
Add support for multi-selections by holding down CMD (by default) during click- or lasso-selections. The modifier key for multi-selections can be adjusted via
scatterplot.set({ keyMap: { merge: 'ctrl' } })
-
Add
performanceMode
to allow drawing up to 20 million points -
Add
opacityBy
to allow encoding one of the two data properties as the point opacity. -
Fix an issue with the point size between devices with different pixel ratios
-
Fix an issue with detecting points when using variable point sizes
-
Fix an issue that drew the background image before it was loaded
Breaking changes:
- Removed the following deplicated properties:
background
(usebackgroundColor
instead)distance
(usecameraDistance
instead)rotation
(usecameraRotation
instead)target
(usecameraTarget
instead)view
(usecameraView
instead)
- Make sure the
keyMap
is properly initiated. - Fix a memory leak by properly destroying the camera on
scatterplot.destroy()
. - Add test for rotation, key mapping, and the lasso initiator
- Add
mouseMode
for switching betweem mouse modes programmatically. Currently supported modes arepanZoom
,lasso
, androtate
. - Add
keyMap
for remapping modifier key-induced actions. Available modifier keys arealt
,shift
,ctrl
,cmd
, andmeta
. Available actions arelasso
androtate
. - Add
lassoInitiator
(boolean) for enabling a way to lasso points without having to use a modifier key. When activated, you can click into the void and a circle will appear. You can then start lassoing by mousing down + holding onto the circle and dragging. Since clicking into the void can be challenging when working with many points you can also long clicking anywhere and the circle for initiating the lasso will appear anywhere. - Improve point selection
- Add
lassoStart
,lassoExtend
, andlassoEnd
events
Breaking changes:
- Renamed event
background-image-ready
tobackgroundImageReady
for consistency - Switched to asynchronously broadcasted events to decouple regl-scatterplot's execution flow from the event handler. You can switch back to the old behavior if you like by initializing the scatterplot via
createScatterplot({ syncEvents: true })
- Add support for transitioning points via
scatterplot.draw(updatedPoints, { transition: true})
- Add support for size encoding the points' category or value via
scatterplot.set({ sizeBy })
- Add
deselectOnDblClick
anddeselectOnEscape
to allow disabling deselection on double click or escape when set tofalse
(#31) - Fix an issue updating the x and y scale domains (#30)
- Allow synchronizing D3 x and y scales with the scatterplot view. See README.md for more details. (#29)
- Make sure
backgroundImage
supports base64-encoded images - Fix missing texture destruction before recreating the texture (#22)
- Add
lassoClearEvent
property to allow customizing when the lasso is cleared. - Add
preventEvent
option toscatterplot.select()
andscatterplot.deselect()
to prevent publishing theselect
anddeselect
events - Add Promise-based return value to
scatterplot.draw()
to enable the parent application to determine when the points were drawn - Add support for
get('lassoMinDelay')
andget('lassoMinDist')
- Only listen on mouse down events within the instance's canvas element (#16)
- Renames
target
,distance
,rotation
, andview
tocameraTarget
,cameraDistance
,cameraRotation
, andcameraView
- Add getter and setter for
cameraTarget
,cameraDistance
,cameraRotation
, andcameraView
- Fix setting initial camera position (#15)
- Improve documentation on how to color points (#14)
- Add background to lasso
- Fix horizontally-flipped background image (#13)
- Rename the
background
property tobackgroundColor
for clarity - Split the
colors
property intopointColor
,pointColorActive
, andpointColorHover
for clarity - Update camera
- Increase floating point precision
- Fix #5
- Add
clear()
to clear the scatter plot - Update the camera on refresh
- Fix issue when drawing new points: do not wrap setting new points with withRaf(). Only wrap the pure draw call!
- Fix a regression from removed scroll library
- Increase floating point precision (#5)
- Fix a rare glitch in the lasso selection where the lasso would be drawn with a far away point
- Smoothify lasso by lowering the min delay and min dist
- Update 2D camera and many dev packages
- Remove the minified ESM build as it's unnecessary
- Fix glitch in the npm release of
v0.7.2
.
- Provide proper ESM instead of pointing to the source code.
- Replaced
hover
event withpointover
andpointout
to be able to know when a point is not hovered anymore.
- Allow changing the lasso smoothness via
set({ lassoMinDelay, lassoMinDist })
wherelassoMinDelay
is the minimum number of milliseconds between mousemove events before the lasso is extended andlassoMinDist
is the minimum number of pixels the mouse has to move.
- Simplify API:
style()
,attr()
,scatterplot.canvas
,scatterplot.regl
, andscatterplot.version
are merged intoget()
andset()
. The function signature is identical tostyle()
andattr()
so all you have to do is rename. - Add recticle. It's not shown by default but can be activated with
set({ showRecticle, recticleColor })
. - Fix a regression that caused interrupted panning
- Fix a bug in categorical color encoding
- Set default aspect ratio to 1. It can be changed via
attr({ aspectRatio })
- Add property to set
lassoColor
viastyle({ lassoColor })
- Expose helper (
createTextureFromUrl
) for creating a texture from an image URL - Expose regl instance via
scatterplot.regl
- Replace
mouse-position
andmouse-pressed
with internal code - Avoid click selections upon mousedown + mousemove + mouseup
- Add tests for all public API endpoints
- Fix several smaller bugs
- Use a combination of linear and log2 scaling for point size
- Add support for background images
- Add API documentation
- Switch to single quotes
- Export version
- Add endpoint for changing the background color
- Allow setting view on initialization
- Remove event listeners on
destroy()
- Rename
camera
event toview
and publish the view matrix - Fix issues with setting colors
- Fix resetting view
- Update third party libraries
- Switch to browser-based tests
- Set more strict linting
- Fix nasty floating point issue when working with large textures (> 100.000 points)
- Make point size dependent on zoom level
- Optimize rendering: up to about 500K points render fine. Usable for up to 1M points.
- Add support for one categories and one value per point for color encoding.
- Add visual outline for selected points for better highlighting.
- Add test setup and some base tests.
- Many bug fixes and under the hood improvements.
- Add fast lasso selection
- Support rotations
- Initial working version. Warning: this version is not optimized yet and only works fluidly for up to 50.000 points.