d3-cloud icon indicating copy to clipboard operation
d3-cloud copied to clipboard

Run from web worker

Open davidebaldini opened this issue 10 years ago • 3 comments

The d3 dependent library has achieved to run without DOM from within a web worker. However, d3-cloud still requires to run in the main browser thread, blocking UI responsiveness for large cloud elaborations.

At least this is what it appears to me. I get a "ReferenceError: Canvas is not defined" running from a web worker.

Is it possible to solve this, or are there workarounds?

davidebaldini avatar Feb 08 '15 04:02 davidebaldini

Interesting idea. The part that draws and retrieves text won’t work inside a Web Worker. The current algorithm requires each word to be placed serially, but perhaps an alternative parallel algorithm could be used instead.

jasondavies avatar Jun 22 '15 20:06 jasondavies

OffScreen canvas support is available in chrome, and coming to other browsers https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas

OffScreen canvas = webworker

Bnaya avatar Nov 08 '18 09:11 Bnaya

@Bnaya Thanks for your suggestion

erivan avatar Nov 11 '18 14:11 erivan