react-chartjs-2
react-chartjs-2 copied to clipboard
Implement alternative components to use WebWorker and OffscreenCanvas
What problem are you trying to solve?
In the chart.js performance documentation it mentions the possibility of using web workers to perform chart rendering in parallel with the main thread.
Describe the solution you'd like
Implement alternative components. Final result usage example should look like this:
worker.js
import 'react-chartjs-2/offscreen/worker'
app.js
import { Chart } from 'react-chartjs-2/offscreen'
const worker = new Worker('worker.js')
<Chart worker={worker} type='bar' data={...} />
Source: https://github.com/reactchartjs/react-chartjs-2/issues/986
@dangreen any news on this? OffscreenCanvas seem to have become more widely adopted https://caniuse.com/?search=OffscreenCanvas