react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

Implement alternative components to use WebWorker and OffscreenCanvas

Open dangreen opened this issue 2 years ago • 1 comments

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 avatar Feb 28 '22 10:02 dangreen

@dangreen any news on this? OffscreenCanvas seem to have become more widely adopted https://caniuse.com/?search=OffscreenCanvas

mdugue avatar Feb 01 '24 09:02 mdugue