score:1
What's probably slowing you down is the detection of mouse-object overlap, which is a very general functionality of the browser and therefore is not particularly optimized. Good news is you can optimize that easily yourself. Consider this approach:
- Render the circles into a canvas. The canvas will be static throughout the interaction. No need to redraw it contents.
- The detection if a mouse is over a circle is easy to implement on your own. You know the positions of the circle centers, you know the position of the mouse, you know the math. Therefore you can search the circle(s) under mouse cursor yourself.
- Furthermore, you can utilize e.g. quadtree structure to organize the circle centers into a hierarchical structure to hugely speed up the search process.
- Instead of changing CSS of a circle under mouse cursor you can just draw another circle on top of it. Do this in a separate
div
over thecanvas
so that the underlyingcanvas
doesn't need to be redrawn.
Source: stackoverflow.com
Related Query
- High performances to interact with 10.000 objects
- Using d3-zoom to interact with WebGL
- Conflict between d3.forceCollide() and d3.forceX/Y() with high strength() value
- How do I access values in a d3 json file with nested array objects
- Merge two javascript objects if key is equal with either lodash, vanilla js, or d3
- Modify Pie Chart code to use with array of objects
- Manipulate array of objects to new array with average number.
- How to change JSON data to Javascript array of objects with D3
- Count number of items in an array of objects with a specific property value (JavaScript)
- Visualization of streaming data coming with very high velocity
- Single stacked bar with array of objects
- Charting a D3 line chart with an array of objects
- Save High Resolution PNG with included Image in Chart Using d3.js on ObservableHQ.com
- d3 enter/exit pattern with array of objects
- How to manipulate JSON objects into an array with javascript
- AngularJS + d3js: Issues with resizing objects
- Is it possible to have layered svg elements that interact with each other in d3?
- How can I get reliable data updates with objects in D3?
- How to interact JQuery slider with d3 vertical lines for every data point
- Replace object in array with two objects
- Datamaps: How to set conditional highlight fill colors for objects with data
- How to handle heavily nested objects with D3
- Creating X-Axis with Array of Date() Objects - D3.js
- D3 objects all rendering as 0px x 0px with no attributes
- JQuery slider doesn't interact with data drawn in vertical line with d3
- How to open json file with objects in d3?
- Is it possible to use non-mouse, non-touch events to interact with a D3.js graph? If so, what is the most efficient way to go about it?
- D3: ordinal scale not working with array of objects
- "Unexpected value NaN" error when dragging D3 objects with mouse
- Can't find the center of path objects with path.centroid()
More Query from same tag
- Protecting CSV information when using data for D3 Graph
- Making pie charts using d3.js?
- D3JS: I'm not being able to iterate an array
- D3 V4 zoom.transform jump on drag
- D3.js stacked Barchart Error
- d3.js Grouped Bar Chart: text is not showing on bars
- Problem implementing Stacked Bar Chart using d3.stack() in Angular v11/12
- d3 in node and in browser - How to import?
- Angular nvd3 multibarchart stacked not showing properly
- Why labels on chart are not shown when drawn after axes
- d3 world map with country click and zoom almost working not quite
- How do I submit a json file for d3.json?
- d3 limit zoom level for time axis
- When will this design pattern break?
- D3: uncaught exception: Object
- D3.js manually creating a diverging color scale? Newbie here
- DC.js bar chart with date axis
- optimize tween() transition in d3.js
- D3 enter() and draw different component each loop
- d3 extracting a single value from a csv file
- D3.JS Click Event problem, using a svg map
- custom no data label in nvd3 scatter chart
- import {legend} from "@d3/color-legend" What is this in a html code? is there a <script src="***"> available?
- D3.js "Error: Invalid value for <path> attribute" for moving average
- Problems using D3.js locally
- Token Error in Makefile for D3js
- display non-uniform datas with a gauss curve (a bit like kernel density estimation)
- Trying to modify Voronoi Map in D3JS
- display images on mouseover for each slice
- d3.js v3 and broken zoomable treemap example