From: LeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com> Date: Mon, 8 Feb 2021 18:54:39 +0000 (+0100) Subject: Update anchorlinks and offscreen canvas compatibility (#8395) X-Git-Tag: v3.0.0-beta.11~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c280337c21821d6950cc1c5852f96896fb5d65f2;p=thirdparty%2FChart.js.git Update anchorlinks and offscreen canvas compatibility (#8395) --- diff --git a/docs/docs/axes/_common.md b/docs/docs/axes/_common.md index 027ced318..8662e4429 100644 --- a/docs/docs/axes/_common.md +++ b/docs/docs/axes/_common.md @@ -1,4 +1,4 @@ -### Common to all axes +### Common options to all axes | Name | Type | Default | Description | ---- | ---- | ------- | ----------- diff --git a/docs/docs/axes/_common_ticks.md b/docs/docs/axes/_common_ticks.md index 658ce49bf..6362036fe 100644 --- a/docs/docs/axes/_common_ticks.md +++ b/docs/docs/axes/_common_ticks.md @@ -1,4 +1,4 @@ -### Common to all axes +### Common tick options to all axes | Name | Type | Scriptable | Default | Description | ---- | ---- | :-------------------------------: | ------- | ----------- diff --git a/docs/docs/axes/cartesian/_common_ticks.md b/docs/docs/axes/cartesian/_common_ticks.md index 1ec635fba..387d511f4 100644 --- a/docs/docs/axes/cartesian/_common_ticks.md +++ b/docs/docs/axes/cartesian/_common_ticks.md @@ -1,4 +1,4 @@ -### Common options to all cartesian axes +### Common tick options to all cartesian axes | Name | Type | Default | Description | ---- | ---- | ------- | ----------- diff --git a/docs/docs/general/performance.md b/docs/docs/general/performance.md index 6bd85a026..9b4c039a8 100644 --- a/docs/docs/general/performance.md +++ b/docs/docs/general/performance.md @@ -74,15 +74,15 @@ new Chart(ctx, { }); ``` -## Parallel rendering with web workers (Chrome only) +## Parallel rendering with web workers (Chromium only) -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. +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. 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: * 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. * 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. * 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. -* Ensure that you have a fallback if you support browsers other than the most modern Chrome browser. +* Ensure that you have a fallback if you support browsers other than the most modern Chromium browsers. * Resizing the chart must be done manually. See an example in the worker code below. Example main thread code: