skortchmark9 commented on issue #9232: Use OffScreenCanvas API for big data 
live charts
URL: 
https://github.com/apache/incubator-echarts/issues/9232#issuecomment-461995134
 
 
   I was able to get drawing working in a web worker using this feature:
   ```javascript
   // main.js
   const offscreen = elt.transferControlToOffscreen();
   const worker = new Worker('worker.js');
   worker.postMessage({ canvas: offscreen }, [offscreen]);
   
   ```
   
   ```javascript
   // worker.js
   onmessage = function(evt) {
        const canvas = evt.data.canvas;
   
        echarts.setCanvasCreator(function () {
                return new OffscreenCanvas(32, 32);
        });
   
        const plot = echarts.init(canvas);
           plot.setOption(...);
   }
   ```
   
   Certain features didn't work, but it's a good start.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to