- Feat: add programmatic lasso selection API via new
lassoSelect()method that accept a polygon in either data or GL space. This enables automated point selection without manual interaction. Supportsmergeandremoveoptions. Note, vertices in data space requiresxScaleandyScaleto be defined.
- Fix: ensure view aspect ratio is updated before the scales are updated on resize
- Feat: expose a flag indicating a view change for events
draw,drawing, andview - Fix: clean up worker URL after creation
- 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. - Fix: Smooth the brush normal to avoid jitter
- Fix: an issue where new colors wouldn't be set properly (#214)
- Feat: add support for two new lasso types:
'rectangle'and'brush'. The lasso type can be changed vialassoType. Additionally, for the brush lasso, you can adjust the brush size vialassoBrushSize. The default lasso type is'freeform'. (#186) - Feat: replace
keyMapwithactionKeyMapto allow triggering multiple actions with the same modifier key. - Feat: add
'remove'key action to allow removing selecting points. By default, to rgitemove selected points hold downALTand then lasso around selected points. (#105) - Feat: expose
renderPointsAsSquaresanddisableAlphaBlendingto allow finer control over performance increasing settings (#206)
- Fix: prevent drawing points if all are filtered out (#201)
- Fix: destroy the encoding texture before recreating it
- Fix: reject
set()calls if the instance was destroyed - Fix: ensures unnecessary color and encoding texture updates are avoided
- Fix: color and encoding textures are destroyed upon calling
scatterplot.destroy() - Fix: prevent a minor memory leak in the newly added advanced exporter
- Feat: add support for adjusting the anti-aliasing via
scatterplot.set({ antiAliasing: 1 }). (#175) - Feat: add support for aligning points with the pixel grid via
scatterplot.set({ pixelAligned: true }). (#175) - Feat: enhance
scatterplot.export()by allowing to adjust the scale, anti-aliasing, and pixel alignment. Note that when customizing the render setting for export, the function returns a promise that resolves intoImageData. - Feat: expose
resize()method of therenderer.
- Fix: allow setting the lasso long press indicator parent element
- Fix: catch another edge case where
zoomToOriginwas 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.innerWidthandwindow.innerHeight. However, in VSCode it was possible thatwindow.innerHeightwas 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
zoomToAreaworks in cases whereaspectRatiois not equal to1and add tests to verify this
- Fix: option types of
zoomToLocation,zoomToOrigin,zoomToArea - Fix: ensure
zoomToAreaworks in cases whereaspectRatiois 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-lineto 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 ofnewPointsdiffer 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
createSpatialIndexto allow creating a spatial index upfront conveniently - Add: new
drawingevent 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 defaultdrawevent is that thedrawevent 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 thedrawevent 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-esto version 3
- Fix: add
d3-scaletypes as a dev dependency #153 - Fix: run CI workflows on Ubuntu to ensure the
sedreplacement call works properly #153
- Fix a regression with the point opacity introduced in v1.7.1
- Fix typo in draw option type (renamed
focustofilter) #148
- Improve hover detection
- Fix: add ability to set
aspectRatioin the constructor - Fix: add missing type definition for
aspectRatio - Fix: extend
opacitytype 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
preventFilterResetoption 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
filteredPointstype definition. #139 - Add missing
selectedPointstype definition. - Fix drawing a single connecting line between points #125
- Fix drawing a single point connection #141
- Fix
draw()'s promise resolution whenshowPointConnectionsistrue. The promise is now resolved after both, the points and point connections, have been drawn. - Set minimum Node version to
16and minimum npm version to7. You might still be able to useregl-scatterplotwith 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
isPointsFilteredtoget()to allow determining if any points have been filtered out
- Fix
zoomToPointsbehavior when points are not initialized #123 - Add
isDestroyedandisPointsDrawntoget()
- Improve type annotations of the
selectevent (#119) - Add type annotations for the
filterandunfilterevents
- 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-camerato 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.isSupportedandrenderer.isSupportedas 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
selectevent name to the type definition (#87)
- Add properties
opacityInactiveScaleandopacityInactiveMaxto enable de-emphasizing unselected points and highlight selected points. The final point opacity is now set tomin(opacityInactiveMax, currentOpacity) * opacityInactiveScalewhen at least one point is selected. By defaultopacityInactiveScaleandopacityInactiveMaxare 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. ThepreventEventoption 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.frameand 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 belineComponentIdand 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 thepointoverandpointoutfrom being published.
- Add two events:
initanddestroy - Add
lassoLineWidthto allow adjusting the lasso line width - Fix an issue with normalizing RGBA values
- Fix a camera issue when lassoing in non-
panZoommouse mode
- Rename
showRecticletoshowReticleandrecticleColortoreticleColor(#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.exportfor 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 onresizeandorientationchangeevents. - Improve framebuffer rendering and add
gammaprop 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
pointConnectionColorfrompointColorby settingpointConnectionColor: 'inherit'. Same forpointConnectionColorActiveandpointConnectionColorHover. - Fix incorrectly initialized
opacity - Fix incorrectly initialized
colorBy,opacityBy, andsizeBy - Fix not assigned
pointConnectionOpacity - Rename
pointConnectionOpacitySelectionandpointConnectionSizeSelectedtopointConnectionOpacityActiveandpointConnectionSizeActivefor 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, orzand 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 inpointsdefines 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 -> 4For 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
performanceModeto allow drawing up to 20 million points -
Add
opacityByto 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(usebackgroundColorinstead)distance(usecameraDistanceinstead)rotation(usecameraRotationinstead)target(usecameraTargetinstead)view(usecameraViewinstead)
- Make sure the
keyMapis 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
mouseModefor switching betweem mouse modes programmatically. Currently supported modes arepanZoom,lasso, androtate. - Add
keyMapfor remapping modifier key-induced actions. Available modifier keys arealt,shift,ctrl,cmd, andmeta. Available actions arelassoandrotate. - 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, andlassoEndevents
Breaking changes:
- Renamed event
background-image-readytobackgroundImageReadyfor 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
deselectOnDblClickanddeselectOnEscapeto 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
backgroundImagesupports base64-encoded images - Fix missing texture destruction before recreating the texture (#22)
- Add
lassoClearEventproperty to allow customizing when the lasso is cleared. - Add
preventEventoption toscatterplot.select()andscatterplot.deselect()to prevent publishing theselectanddeselectevents - 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, andviewtocameraTarget,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
backgroundproperty tobackgroundColorfor clarity - Split the
colorsproperty intopointColor,pointColorActive, andpointColorHoverfor 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
hoverevent withpointoverandpointoutto be able to know when a point is not hovered anymore.
- Allow changing the lasso smoothness via
set({ lassoMinDelay, lassoMinDist })wherelassoMinDelayis the minimum number of milliseconds between mousemove events before the lasso is extended andlassoMinDistis the minimum number of pixels the mouse has to move.
- Simplify API:
style(),attr(),scatterplot.canvas,scatterplot.regl, andscatterplot.versionare 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
lassoColorviastyle({ lassoColor }) - Expose helper (
createTextureFromUrl) for creating a texture from an image URL - Expose regl instance via
scatterplot.regl - Replace
mouse-positionandmouse-pressedwith 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
cameraevent toviewand 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.