Web worker target of d3.select #3843
Replies: 2 comments 3 replies
-
This is probably more a question for vega? (I don't think d3.select will be extended to something other than “a set of elements from the DOM”.) |
Beta Was this translation helpful? Give feedback.
-
I don't think Vega can solve the problem. Referring to the Gist:
So the setInterval call is making a selection from window and dispatching an "updateclock" message to it. I want the setInterval inside the web worker (so it can't get blocked by activity on the main thread). I am considering two kludges to accomplish this:
I suspect 1) will be the more efficient solution, and probably won't require using d3. I do, however, feel that there are use cases for timed events coming out of a web worker, so it might be worth considering at some point. |
Beta Was this translation helpful? Give feedback.
-
I am trying to animate a graph in Vega, and have found some useful guidance in https://gist.github.com/timelyportfolio/7ea26d32a7534e4064df16cbf7abaa58, however, it seems that the event stream must come from something that is d3 selectable. While this could be achieved by having a web worker posting an event back to the main thread and then posting the event to a listener on the window, I'm wondering if there is a way to do this in one fell swoop:
timerworker.js
Main.js
Is there a way that the Vega spec could simply be:
This would require d3.select('timeworker') to return a reference to the web worker, which is not in the DOM.
Beta Was this translation helpful? Give feedback.
All reactions