Skip to content

Commit c280337

Browse files
authored
Update anchorlinks and offscreen canvas compatibility (#8395)
1 parent ffe4ab1 commit c280337

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/docs/axes/_common.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Common to all axes
1+
### Common options to all axes
22

33
| Name | Type | Default | Description
44
| ---- | ---- | ------- | -----------

docs/docs/axes/_common_ticks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Common to all axes
1+
### Common tick options to all axes
22

33
| Name | Type | Scriptable | Default | Description
44
| ---- | ---- | :-------------------------------: | ------- | -----------

docs/docs/axes/cartesian/_common_ticks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Common options to all cartesian axes
1+
### Common tick options to all cartesian axes
22

33
| Name | Type | Default | Description
44
| ---- | ---- | ------- | -----------

docs/docs/general/performance.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ new Chart(ctx, {
7474
});
7575
```
7676

77-
## Parallel rendering with web workers (Chrome only)
77+
## Parallel rendering with web workers (Chromium only)
7878

79-
Chrome (in version 69) added the ability to [transfer rendering control of a canvas](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) to a web worker. Web workers can use the [OffscreenCanvas API](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) to render from a web worker onto canvases in the DOM. Chart.js is a canvas-based library and supports rendering in a web worker - just pass an OffscreenCanvas into the Chart constructor instead of a Canvas element. Note that as of today, this API is only supported in Chrome.
79+
Chromium (Chrome: version 69, Edge: 79, Opera: 56) added the ability to [transfer rendering control of a canvas](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) to a web worker. Web workers can use the [OffscreenCanvas API](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) to render from a web worker onto canvases in the DOM. Chart.js is a canvas-based library and supports rendering in a web worker - just pass an OffscreenCanvas into the Chart constructor instead of a Canvas element. Note that as of today, this API is only supported in Chromium based browsers.
8080

8181
By moving all Chart.js calculations onto a separate thread, the main thread can be freed up for other uses. Some tips and tricks when using Chart.js in a web worker:
8282
* Transferring data between threads can be expensive, so ensure that your config and data objects are as small as possible. Try generating them on the worker side if you can (workers can make HTTP requests!) or passing them to your worker as ArrayBuffers, which can be transferred quickly from one thread to another.
8383
* You can't transfer functions between threads, so if your config object includes functions you'll have to strip them out before transferring and then add them back later.
8484
* You can't access the DOM from worker threads, so Chart.js plugins that use the DOM (including any mouse interactions) will likely not work.
85-
* Ensure that you have a fallback if you support browsers other than the most modern Chrome browser.
85+
* Ensure that you have a fallback if you support browsers other than the most modern Chromium browsers.
8686
* Resizing the chart must be done manually. See an example in the worker code below.
8787

8888
Example main thread code:

0 commit comments

Comments
 (0)