huww98 / TimeChart

An chart library specialized for large-scale time-series data, built on WebGL.
https://huww98.github.io/TimeChart
MIT License
365 stars 31 forks source link

OffscreenCanvas Support #20

Closed ierturk closed 11 months ago

ierturk commented 3 years ago

Hi, Thanks for works. There is no documentation or demo on OffscreenCanvas option. Does the library support OffscreenCanvas?

Regards, Ibrahim

huww98 commented 3 years ago

Hi, I have not used OffscreenCanvas. What is your intended use case?

This library only uses canvas to draw the performance-critical part. The axis, legend and some other elements are rendered with SVG. So it may be hard to render everything offscreen with OffscreenCanvas.

ierturk commented 3 years ago

Hi @huww98, Thanks for prompt reply.

In our case, we are trying to plot a data @ ~38.4k. We are using webworkers threads to retrieve data from the server. I think it is good to render graphs within webworker without blocking main thread. However as you said, when the SVG is used to render some part of the graph, it is not possible to use OffscreenCanvas. So we have to render graphs in main thread and employ some other optimizations.

So far I tried the demos and it works within our projects. I'll let you know about the performance of the library within main thread after we try to plot our real time data.

Thanks and regards, Ibrahim