From: paul cheung Date: Sun, 18 Oct 2020 13:52:56 +0000 (+0800) Subject: fix some typos (#7914) X-Git-Tag: v3.0.0-beta.5~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ce9710f336c2ad2359466dc9357979c4d562446;p=thirdparty%2FChart.js.git fix some typos (#7914) --- diff --git a/docs/docs/configuration/legend.md b/docs/docs/configuration/legend.md index 02e2d1a23..c9532a5bf 100644 --- a/docs/docs/configuration/legend.md +++ b/docs/docs/configuration/legend.md @@ -57,7 +57,7 @@ The legend label configuration is nested below the legend configuration using th | `generateLabels` | `function` | | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See [Legend Item](#legend-item-interface) for details. | `filter` | `function` | `null` | Filters legend items out of the legend. Receives 2 parameters, a [Legend Item](#legend-item-interface) and the chart data. | `sort` | `function` | `null` | Sorts legend items. Receives 3 parameters, two [Legend Items](#legend-item-interface) and the chart data. -| `usePointStyle` | `boolean` | `false` | Label style will match corresponding point style (size is based on the mimimum value between boxWidth and font.size). +| `usePointStyle` | `boolean` | `false` | Label style will match corresponding point style (size is based on the minimum value between boxWidth and font.size). ## Legend Title Configuration diff --git a/docs/docs/general/performance.md b/docs/docs/general/performance.md index 499b29110..d244534a5 100644 --- a/docs/docs/general/performance.md +++ b/docs/docs/general/performance.md @@ -75,7 +75,7 @@ new Chart(ctx, { ## Parallel rendering with web workers (Chrome only) -Chome (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. +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. 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. @@ -222,7 +222,7 @@ new Chart(ctx, { }); ``` -## When transpiling with Babel, cosider using `loose` mode +## When transpiling with Babel, consider using `loose` mode Babel 7.9 changed the way classes are constructed. It is slow, unless used with `loose` mode. [More information](https://github.com/babel/babel/issues/11356) diff --git a/docs/docs/general/responsive.md b/docs/docs/general/responsive.md index 8c91263b8..eab8bf963 100644 --- a/docs/docs/general/responsive.md +++ b/docs/docs/general/responsive.md @@ -39,7 +39,7 @@ chart.canvas.parentNode.style.width = '128px'; Note that in order for the above code to correctly resize the chart height, the [`maintainAspectRatio`](#configuration-options) option must also be set to `false`. -## Printing Resizeable Charts +## Printing Resizable Charts CSS media queries allow changing styles when printing a page. The CSS applied from these media queries may cause charts to need to resize. However, the resize won't happen automatically. To support resizing charts when printing, one needs to hook the [onbeforeprint](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeprint) event and manually trigger resizing of each chart. diff --git a/src/core/core.animations.js b/src/core/core.animations.js index 1a4e9b0ca..b51463373 100644 --- a/src/core/core.animations.js +++ b/src/core/core.animations.js @@ -127,7 +127,7 @@ export default class Animations { const animations = this._createAnimations(options, newOptions); if (newOptions.$shared && !options.$shared) { // Going from distinct options to shared options: - // After all animations are done, assing the shared options object to the element + // After all animations are done, assign the shared options object to the element // So any new updates to the shared options are observed awaitAll(target.options.$animations, newOptions).then(() => { target.options = newOptions; diff --git a/src/core/core.plugins.js b/src/core/core.plugins.js index d24b4d56a..359738342 100644 --- a/src/core/core.plugins.js +++ b/src/core/core.plugins.js @@ -214,7 +214,7 @@ function createDescriptors(plugins, options) { /** * @method IPlugin#beforeDraw * @desc Called before drawing `chart` at every animation frame. If any plugin returns `false`, - * the frame drawing is cancelled untilanother `render` is triggered. + * the frame drawing is cancelled until another `render` is triggered. * @param {Chart} chart - The chart instance. * @param {object} options - The plugin options. * @returns {boolean} `false` to cancel the chart drawing. diff --git a/src/scales/scale.category.js b/src/scales/scale.category.js index e3347bd7c..1c8c93328 100644 --- a/src/scales/scale.category.js +++ b/src/scales/scale.category.js @@ -83,7 +83,7 @@ export default class CategoryScale extends Scale { return me.getPixelForDecimal((value - me._startValue) / me._valueRange); } - // Must override base implementation becuase it calls getPixelForValue + // Must override base implementation because it calls getPixelForValue // and category scale can have duplicate values getPixelForTick(index) { const me = this;