reactchartjs / react-chartjs-2

React components for Chart.js, the most popular charting library
https://react-chartjs-2.js.org
MIT License
6.49k stars 2.38k forks source link

Implement alternative components to use WebWorker and OffscreenCanvas #1025

Open dangreen opened 2 years ago

dangreen commented 2 years ago

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

mdugue commented 5 months ago

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