language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
chartjs
Chart.js
b6c22d269a16097bc8c55d7cc01d37b7369391d4.json
Remove circular dependencies from helpers (#7898)
src/helpers/helpers.easing.js
@@ -1,4 +1,4 @@ -import {PI, TAU, HALF_PI} from './index'; +import {PI, TAU, HALF_PI} from './helpers.math'; /** * Easing functions adapted from Robert Penner's easing equations.
true
Other
chartjs
Chart.js
64b45294861ca19c0713dec9f6854e71747571b0.json
Fix double env (#7892)
.github/workflows/npmpublish.yml
@@ -59,17 +59,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_AUTH_TOKEN }} GH_AUTH_EMAIL: ${{ secrets.GH_AUTH_EMAIL }} - env: VERSION: ${{ github.event.release.tag_name }} - name: Upload NPM package file id: upload-npm-package-file uses: actions/u...
false
Other
chartjs
Chart.js
efa0ade501b774a71938437e78b429eb2b0a4d2a.json
Update workflow to use GitHub releaes (#7891)
.github/workflows/npmpublish.yml
@@ -32,44 +32,44 @@ jobs: with: node-version: 12 registry-url: https://registry.npmjs.org/ - # Since we created the release in the UI, we need to find it. - # This step gets the release from the GITHUB_REF env var - - name: Get release - id: get_release - uses...
true
Other
chartjs
Chart.js
efa0ade501b774a71938437e78b429eb2b0a4d2a.json
Update workflow to use GitHub releaes (#7891)
scripts/publish.sh
@@ -4,7 +4,7 @@ set -e NPM_TAG="next" -if [[ "$GITHUB_REF" =~ ^[^-]+$ ]]; then +if [[ "$VERSION" =~ ^[^-]+$ ]]; then echo "Release tag indicates a full release. Releasing as \"latest\"." NPM_TAG="latest" fi
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
docs/docs/axes/cartesian/index.mdx
@@ -49,8 +49,8 @@ The following options are common to all cartesian axes but do not apply to other | Name | Type | Default | Description | ---- | ---- | ------- | ----------- -| `alignment` | `string` | | `'center'` | The tick alignment along the axis. Can be `'start'`, `'center'`, or `'end'`. -| `crossAlignment` |...
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
samples/scales/label-text-alignment.html
@@ -87,13 +87,13 @@ x: { display: true, ticks: { - alignment: xAlign, + align: xAlign, } }, y: { display: true, ticks: { - alignment: yAlign + align: yAlign } } },
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
src/core/core.scale.js
@@ -62,8 +62,8 @@ defaults.set('scale', { callback: Ticks.formatters.values, minor: {}, major: {}, - alignment: 'center', - crossAlignment: 'near', + align: 'center', + crossAlign: 'near', } }); @@ -763,10 +763,10 @@ export default class Scale extends Element { paddingRight = labelsBelowTicks ? ...
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-bottom-center.js
@@ -13,7 +13,7 @@ module.exports = { scales: { x: { ticks: { - crossAlignment: 'center', + crossAlign: 'center', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-bottom-far.js
@@ -13,7 +13,7 @@ module.exports = { scales: { x: { ticks: { - crossAlignment: 'far', + crossAlign: 'far', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-bottom-near.js
@@ -13,7 +13,7 @@ module.exports = { scales: { x: { ticks: { - crossAlignment: 'near', + crossAlign: 'near', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-left-center.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'left', ticks: { - crossAlignment: 'center', + crossAlign: 'center', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-left-far.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'left', ticks: { - crossAlignment: 'far', + crossAlign: 'far', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-left-near.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'left', ticks: { - crossAlignment: 'near', + crossAlign: 'near', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-right-center.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'right', ticks: { - crossAlignment: 'center', + crossAlign: 'center', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-right-far.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'right', ticks: { - crossAlignment: 'far', + crossAlign: 'far', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-right-near.js
@@ -15,7 +15,7 @@ module.exports = { y: { position: 'right', ticks: { - crossAlignment: 'near', + crossAlign: 'near', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-top-center.js
@@ -14,7 +14,7 @@ module.exports = { x: { position: 'top', ticks: { - crossAlignment: 'center', + crossAlign: 'center', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-top-far.js
@@ -14,7 +14,7 @@ module.exports = { x: { position: 'top', ticks: { - crossAlignment: 'far', + crossAlign: 'far', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/crossAlignment/cross-align-top-near.js
@@ -14,7 +14,7 @@ module.exports = { x: { position: 'top', ticks: { - crossAlignment: 'near', + crossAlign: 'near', }, }, }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/label-align-center.js
@@ -13,12 +13,12 @@ module.exports = { scales: { x: { ticks: { - alignment: 'center', + align: 'center', }, }, y: { ticks: { - alignment: 'center', + align: 'center', } } }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/label-align-end.js
@@ -13,12 +13,12 @@ module.exports = { scales: { x: { ticks: { - alignment: 'end', + align: 'end', }, }, y: { ticks: { - alignment: 'end', + align: 'end', } } }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
test/fixtures/core.scale/label-align-start.js
@@ -13,12 +13,12 @@ module.exports = { scales: { x: { ticks: { - alignment: 'start', + align: 'start', }, }, y: { ticks: { - alignment: 'start', + align: 'start', } } }
true
Other
chartjs
Chart.js
1ca60808b4ccf630ea91cfe7077ae821879eab5d.json
Shorten alignment settings for axes (#7886) * Rename crossAlignment to crossAlign * Update alignment to align for cartesian axes
types/scales/index.d.ts
@@ -132,7 +132,7 @@ export interface ICartesianScaleOptions extends ICoreScaleOptions { * The label alignment * @default 'center' */ - alignment: 'start' | 'center' | 'end'; + align: 'start' | 'center' | 'end'; /** * If true, automatically calculates how many labels can be shown and ...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
.github/workflows/ci.yml
@@ -41,7 +41,7 @@ jobs: shell: bash - name: Build and Test run: | - npm install + npm ci npm run build npm test - name: Package
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
.github/workflows/deploy-docs.yml
@@ -0,0 +1,28 @@ +# This workflow publishes new documentation to https://chartjs.org/docs/master after every commit +name: CI + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-n...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
.github/workflows/npmpublish.yml
@@ -0,0 +1,75 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [published] + ...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
.travis.yml
@@ -1,59 +0,0 @@ -language: node_js -node_js: - - lts/* - -before_install: - - "export CHROME_BIN=/usr/bin/google-chrome" - -services: - - xvfb - -script: - - npm run build - - npm test - - ./scripts/docs-config.sh - - npm run docs - - npm run typedoc - - npm pack - - cat ./coverage/lcov.info | ./node_modules...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
README.md
@@ -5,7 +5,7 @@ <p align="center"> <a href="https://www.chartjs.org/docs/latest/getting-started/installation.html"><img src="https://img.shields.io/github/release/chartjs/Chart.js.svg?style=flat-square&maxAge=600" alt="Downloads"></a> - <a href="https://travis-ci.org/chartjs/Chart.js"><img src="https://img.s...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
scripts/deploy-docs.sh
@@ -4,20 +4,9 @@ set -e TARGET_DIR='gh-pages' TARGET_BRANCH='master' -TARGET_REPO_URL="https://$GITHUB_AUTH_TOKEN@github.com/chartjs/chartjs.github.io.git" +TARGET_REPO_URL="https://$GITHUB_TOKEN@github.com/chartjs/chartjs.github.io.git" -# Note: this code also exists in docs-config.sh -# Make sure that this scri...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
scripts/docs-config.sh
@@ -2,18 +2,7 @@ set -e -# Note: this code also exists in deploy.sh -# Make sure that this script is executed only for the release and master branches -VERSION_REGEX='[[:digit:]]+.[[:digit:]]+.[[:digit:]]+(-.*)?' -if [[ "$TRAVIS_BRANCH" =~ ^release.*$ ]]; then - # Travis executes this script from the repository...
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
scripts/publish.sh
@@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +NPM_TAG="next" + +if [[ "$GITHUB_REF" =~ ^[^-]+$ ]]; then + echo "Release tag indicates a full release. Releasing as \"latest\"." + NPM_TAG="latest" +fi + +npm publish --tag "$NPM_TAG"
true
Other
chartjs
Chart.js
ff354cc5b8245049887f24cf855d19d928d6d8de.json
Remove release branch workflow (#7827) * GitHub actions uses locked install for CI * Add initial GitHub action to publish to NPM * Detect the NPM tag (latest vs next) depending on the git tag * Deploy docs from releases & master commits * Remove Travis CI * Update repo badge to use actions status * Remove Travis...
scripts/release.sh
@@ -1,29 +0,0 @@ -#!/bin/bash - -set -e - -if [[ ! "$TRAVIS_BRANCH" =~ ^release.*$ ]]; then - echo "Skipping release because this is not the 'release' branch" - exit 0 -fi - -# Travis executes this script from the repository root, so at the same level than package.json -VERSION=$(node -p -e "require('./package.js...
true
Other
chartjs
Chart.js
0d95c7974c2bc44a891c3a8d159f4127ad2e7e92.json
Fix typo in const name (#7872)
src/helpers/helpers.dom.js
@@ -104,9 +104,9 @@ function getContainerSize(canvas, width, height) { const rect = container.getBoundingClientRect(); // this is the border box of the container const containerStyle = getComputedStyle(container); const containerBorder = getPositionedStyle(containerStyle, 'border', 'width'); - const conta...
false
Other
chartjs
Chart.js
168965fa3899a19fc6acbb8863d8ac100b817b8e.json
Enable custom sorting of the legend items (#7851)
docs/docs/configuration/legend.md
@@ -54,6 +54,7 @@ The legend label configuration is nested below the legend configuration using th | `padding` | `number` | `10` | Padding between rows of colored boxes. | `generateLabels` | `function` | | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the c...
true
Other
chartjs
Chart.js
168965fa3899a19fc6acbb8863d8ac100b817b8e.json
Enable custom sorting of the legend items (#7851)
src/plugins/plugin.legend.js
@@ -160,6 +160,10 @@ export class Legend extends Element { legendItems = legendItems.filter((item) => labelOpts.filter(item, me.chart.data)); } + if (labelOpts.sort) { + legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, me.chart.data)); + } + if (me.options.reverse) { legendItems.reverse...
true
Other
chartjs
Chart.js
168965fa3899a19fc6acbb8863d8ac100b817b8e.json
Enable custom sorting of the legend items (#7851)
test/specs/plugin.legend.tests.js
@@ -311,6 +311,85 @@ describe('Legend block tests', function() { }]); }); + it('should sort items', function() { + var chart = window.acquireChart({ + type: 'line', + data: { + datasets: [{ + label: 'dataset1', + backgroundColor: '#f31', + borderCapStyle: 'round', + borderDash: [2, 2], + ...
true
Other
chartjs
Chart.js
168965fa3899a19fc6acbb8863d8ac100b817b8e.json
Enable custom sorting of the legend items (#7851)
types/plugins/index.d.ts
@@ -165,6 +165,11 @@ export interface ILegendOptions { */ filter(item: ILegendItem, data: IChartData): boolean; + /** + * Sorts the legend items + */ + sort(a: ILegendItem, b: ILegendItem, data: IChartData): number; + /** * Label style will match corresponding point style (size is ...
true
Other
chartjs
Chart.js
8d36927b290bfe28b2ecb7393ccf5c0a473fd08a.json
Normalize context creation for option resolution (#7847) * Normalize context creation for option resolution * Pass mode to _computeAngle
src/controllers/controller.bubble.js
@@ -109,18 +109,11 @@ export default class BubbleController extends DatasetController { resolveDataElementOptions(index, mode) { const me = this; const chart = me.chart; - const dataset = me.getDataset(); const parsed = me.getParsed(index); let values = super.resolveDataElementOptions(index, mode); ...
true
Other
chartjs
Chart.js
8d36927b290bfe28b2ecb7393ccf5c0a473fd08a.json
Normalize context creation for option resolution (#7847) * Normalize context creation for option resolution * Pass mode to _computeAngle
src/controllers/controller.polarArea.js
@@ -59,12 +59,12 @@ export default class PolarAreaController extends DatasetController { me._cachedMeta.count = me.countVisibleElements(); for (i = 0; i < start; ++i) { - angle += me._computeAngle(i); + angle += me._computeAngle(i, mode); } for (i = start; i < start + count; i++) { const arc = arc...
true
Other
chartjs
Chart.js
8d36927b290bfe28b2ecb7393ccf5c0a473fd08a.json
Normalize context creation for option resolution (#7847) * Normalize context creation for option resolution * Pass mode to _computeAngle
src/core/core.datasetController.js
@@ -693,9 +693,9 @@ export default class DatasetController { } /** - * @private + * @protected */ - _getContext(index, active) { + getContext(index, active) { return { chart: this.chart, dataPoint: this.getParsed(index), @@ -764,7 +764,7 @@ export default class DatasetController { const dataset...
true
Other
chartjs
Chart.js
8d36927b290bfe28b2ecb7393ccf5c0a473fd08a.json
Normalize context creation for option resolution (#7847) * Normalize context creation for option resolution * Pass mode to _computeAngle
src/core/core.scale.js
@@ -1013,6 +1013,19 @@ export default class Scale extends Element { 0; } + /** + * @protected + */ + getContext(index) { + const ticks = this.ticks || []; + return { + chart: this.chart, + scale: this, + tick: ticks[index], + index + }; + } + /** * Returns a subset of ticks to be plotted to av...
true
Other
chartjs
Chart.js
8d36927b290bfe28b2ecb7393ccf5c0a473fd08a.json
Normalize context creation for option resolution (#7847) * Normalize context creation for option resolution * Pass mode to _computeAngle
src/scales/scale.radialLinear.js
@@ -96,12 +96,7 @@ function fitWithPointLabels(scale) { for (i = 0; i < valueCount; i++) { pointPosition = scale.getPointPosition(i, scale.drawingArea + 5); - const context = { - chart: scale.chart, - scale, - index: i, - label: scale.pointLabels[i] - }; + const context = scale.getContext(i); const...
true
Other
chartjs
Chart.js
1a9b452cda942a74692780cf6a25cfbe231b745c.json
Limit pixel values further to 16bit integer range (#7848)
src/core/core.scale.js
@@ -2,7 +2,7 @@ import defaults from './core.defaults'; import Element from './core.element'; import {_alignPixel, _measureText} from '../helpers/helpers.canvas'; import {callback as call, each, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core'; -import {_factorize, toDegrees...
true
Other
chartjs
Chart.js
1a9b452cda942a74692780cf6a25cfbe231b745c.json
Limit pixel values further to 16bit integer range (#7848)
src/helpers/helpers.math.js
@@ -173,6 +173,6 @@ export function _limitValue(value, min, max) { return Math.max(min, Math.min(max, value)); } -export function _int32Range(value) { - return _limitValue(value, -2147483648, 2147483647); +export function _int16Range(value) { + return _limitValue(value, -32768, 32767); }
true
Other
chartjs
Chart.js
8438da9e8426f8b707b1b0dbb87d43ae32ffc7d1.json
Provide method to lookup a chart from a canvas (#7843) * Provide method to lookup a chart from a canvas * Throw an error during construction if a canvas is in use * Migration docs for new constructor behaviour
docs/docs/developers/api.md
@@ -204,3 +204,11 @@ Sets the visibility for the given dataset to true. Updates the chart and animate ```javascript chart.show(1); // shows dataset at index 1 and does 'show' animation. ``` + +## Static: getChart(key) + +Finds the chart instance from the given key. If the key is a `string`, it is interpreted as the ...
true
Other
chartjs
Chart.js
8438da9e8426f8b707b1b0dbb87d43ae32ffc7d1.json
Provide method to lookup a chart from a canvas (#7843) * Provide method to lookup a chart from a canvas * Throw an error during construction if a canvas is in use * Migration docs for new constructor behaviour
docs/docs/getting-started/v3-migration.md
@@ -21,6 +21,7 @@ Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released * Distributed files are now in lower case. For example: `dist/chart.js`. * Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`. Please see the [installation](installation.md) and [integration]...
true
Other
chartjs
Chart.js
8438da9e8426f8b707b1b0dbb87d43ae32ffc7d1.json
Provide method to lookup a chart from a canvas (#7843) * Provide method to lookup a chart from a canvas * Throw an error during construction if a canvas is in use * Migration docs for new constructor behaviour
src/core/core.controller.js
@@ -222,6 +222,14 @@ class Chart { config = initConfig(config); const initialCanvas = getCanvas(item); + const existingChart = Chart.getChart(initialCanvas); + if (existingChart) { + throw new Error( + 'Canvas is already in use. Chart with ID \'' + existingChart.id + '\'' + + ' must be destroyed befor...
true
Other
chartjs
Chart.js
8438da9e8426f8b707b1b0dbb87d43ae32ffc7d1.json
Provide method to lookup a chart from a canvas (#7843) * Provide method to lookup a chart from a canvas * Throw an error during construction if a canvas is in use * Migration docs for new constructor behaviour
test/specs/core.controller.tests.js
@@ -10,6 +10,33 @@ describe('Chart', function() { expect(chart instanceof Chart).toBeTruthy(); }); + it('should throw an error if the canvas is already in use', function() { + var config = { + type: 'line', + data: { + datasets: [{ + data: [1, 2, 3, 4] + }], + labels: ['A', 'B', 'C', 'D'] + }...
true
Other
chartjs
Chart.js
8438da9e8426f8b707b1b0dbb87d43ae32ffc7d1.json
Provide method to lookup a chart from a canvas (#7843) * Provide method to lookup a chart from a canvas * Throw an error during construction if a canvas is in use * Migration docs for new constructor behaviour
types/core/index.d.ts
@@ -302,6 +302,7 @@ export declare class Chart< static readonly version: string; static readonly instances: { [key: string]: Chart }; static readonly registry: Registry; + static getChart(key: string | CanvasRenderingContext2D | HTMLCanvasElement) : Chart | undefined; static register(...items: IChartCompon...
true
Other
chartjs
Chart.js
d332ebc63d46e4cc7657662cc47835ec94f5b52d.json
Remove enum types (#7841) * Remove type enum * Add declare keyword to UpdateModeEnum
docs/docs/developers/charts.md
@@ -155,21 +155,14 @@ new Chart(ctx, { If you want your new chart type to be statically typed, you must provide a `.d.ts` TypeScript declaration file. Chart.js provides a way to augment built-in types with user-defined ones, by using the concept of "declaration merging". -There are three main declarations that can...
true
Other
chartjs
Chart.js
d332ebc63d46e4cc7657662cc47835ec94f5b52d.json
Remove enum types (#7841) * Remove type enum * Add declare keyword to UpdateModeEnum
types/core/index.d.ts
@@ -315,7 +315,7 @@ export declare type ChartItem = | { canvas: HTMLCanvasElement | OffscreenCanvas } | ArrayLike<CanvasRenderingContext2D | HTMLCanvasElement | OffscreenCanvas>; -export enum UpdateModeEnum { +export declare enum UpdateModeEnum { resize = 'resize', reset = 'reset', none = 'none',
true
Other
chartjs
Chart.js
d332ebc63d46e4cc7657662cc47835ec94f5b52d.json
Remove enum types (#7841) * Remove type enum * Add declare keyword to UpdateModeEnum
types/interfaces.d.ts
@@ -45,17 +45,6 @@ export type DeepPartial<T> = T extends {} export type DistributiveArray<T> = T extends unknown ? T[] : never -export enum ScaleTypeEnum { - linear = 'linear', - logarithmic = 'logarithmic', - category = 'category', - radialLinear = 'radialLinear', - time = 'time', - timeseries = 'timeserie...
true
Other
chartjs
Chart.js
2ac0436bd497e7b660f5d2ff7104d1f6a4331358.json
Use full height for fullWidth box when left/right (#7836) Use full height for fullWidth box when left/right
src/core/core.layouts.js
@@ -47,12 +47,14 @@ function setLayoutDims(layouts, params) { let i, ilen, layout; for (i = 0, ilen = layouts.length; i < ilen; ++i) { layout = layouts[i]; - // store width used instead of chartArea.w in fitBoxes - layout.width = layout.horizontal - ? layout.box.fullWidth && params.availableWidth - : param...
false
Other
chartjs
Chart.js
5c0d13981c34753163088d2bafb96f837ff2bc67.json
Include dist/chunks in the NPM package (#7830) * Include all files in the dist folder * Bump version for beta3 * Update lockfile
package-lock.json
@@ -1,6 +1,6 @@ { "name": "chart.js", - "version": "3.0.0-beta.2", + "version": "3.0.0-beta.3", "lockfileVersion": 1, "requires": true, "dependencies": {
true
Other
chartjs
Chart.js
5c0d13981c34753163088d2bafb96f837ff2bc67.json
Include dist/chunks in the NPM package (#7830) * Include all files in the dist folder * Bump version for beta3 * Update lockfile
package.json
@@ -2,7 +2,7 @@ "name": "chart.js", "homepage": "https://www.chartjs.org", "description": "Simple HTML5 charts using the canvas element.", - "version": "3.0.0-beta.2", + "version": "3.0.0-beta.3", "license": "MIT", "jsdelivr": "dist/chart.min.js", "unpkg": "dist/chart.min.js", @@ -25,8 +25,8 @@ ...
true
Other
chartjs
Chart.js
b36d55d0936bf591d5ab58ae3d6a076f8f2d62e1.json
Add onLeave to legend config docs (#6088)
docs/configuration/legend.md
@@ -12,6 +12,7 @@ The legend configuration is passed into the `options.legend` namespace. The glob | `fullWidth` | `boolean` | `true` | Marks that this box should take the full width of the canvas (pushing down other boxes). This is unlikely to need to be changed in day-to-day use. | `onClick` | `function` | | A call...
false
Other
chartjs
Chart.js
f3b18373e67c8e0aab6b29379787725a88dd7391.json
Add onLeave callback to legend (#6059)
samples/legend/callbacks.html
@@ -0,0 +1,124 @@ +<!doctype html> +<html> +<head> + <title>Legend Callbacks</title> + <script src="../../dist/Chart.min.js"></script> + <script src="../utils.js"></script> + <style> + body, html { + height: 100%; + font-family: sans-serif; + } + canvas{ + -moz-user-select: none; + -webkit-user-select: none;...
true
Other
chartjs
Chart.js
f3b18373e67c8e0aab6b29379787725a88dd7391.json
Add onLeave callback to legend (#6059)
samples/samples.js
@@ -148,6 +148,9 @@ }, { title: 'Point style', path: 'legend/point-style.html' + }, { + title: 'Callbacks', + path: 'legend/callbacks.html' }] }, { title: 'Tooltip',
true
Other
chartjs
Chart.js
f3b18373e67c8e0aab6b29379787725a88dd7391.json
Add onLeave callback to legend (#6059)
src/plugins/plugin.legend.js
@@ -30,6 +30,7 @@ defaults._set('global', { }, onHover: null, + onLeave: null, labels: { boxWidth: 40, @@ -106,6 +107,11 @@ var Legend = Element.extend({ // Contains hit boxes for each dataset (in dataset order) this.legendHitBoxes = []; + /** + * @private + */ + this._hoveredItem = nu...
true
Other
chartjs
Chart.js
f3b18373e67c8e0aab6b29379787725a88dd7391.json
Add onLeave callback to legend (#6059)
test/specs/plugin.legend.tests.js
@@ -11,6 +11,7 @@ describe('Legend block tests', function() { // a callback that will handle onClick: jasmine.any(Function), onHover: null, + onLeave: null, labels: { boxWidth: 40, @@ -653,4 +654,53 @@ describe('Legend block tests', function() { expect(chart.legend.options).toEqual(jasmine....
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
docs/axes/cartesian/time.md
@@ -28,6 +28,7 @@ The following options are provided by the time scale. You may also set options p | Name | Type | Default | Description | ---- | ---- | ------- | ----------- +| `adapters.date` | `object` | `{}` | Options for adapter for external date library if that adapter needs or supports options | `distributi...
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
docs/getting-started/integration.md
@@ -25,7 +25,7 @@ import Chart from 'chart.js'; var myChart = new Chart(ctx, {...}); ``` -**Note:** Moment.js is installed along Chart.js as dependency. If you don't want to use Momemt.js (either because you use a different date adapter or simply because don't need time functionalities), you will have to configure ...
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
src/adapters/adapter.moment.js
@@ -3,8 +3,7 @@ 'use strict'; var moment = require('moment'); -var adapter = require('../core/core.adapters')._date; -var helpers = require('../helpers/helpers.core'); +var adapters = require('../core/core.adapters'); var FORMATS = { datetime: 'MMM D, YYYY, h:mm:ss a', @@ -19,7 +18,7 @@ var FORMATS = { year:...
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
src/core/core.adapters.js
@@ -6,6 +6,8 @@ 'use strict'; +var helpers = require('../helpers/index'); + function abstract() { throw new Error( 'This method is not implemented: either no adapter can ' + @@ -27,8 +29,14 @@ function abstract() { * @name Unit */ -/** @lends Chart._adapters._date */ -module.exports._date = { +/** + * ...
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
src/scales/scale.time.js
@@ -1,6 +1,6 @@ 'use strict'; -var adapter = require('../core/core.adapters')._date; +var adapters = require('../core/core.adapters'); var defaults = require('../core/core.defaults'); var helpers = require('../helpers/index'); var Scale = require('../core/core.scale'); @@ -177,7 +177,9 @@ function interpolate(tab...
true
Other
chartjs
Chart.js
f2b099b835bf5d6dfe3a7d3097997ec11983c3ed.json
Initialize date adapter with chart options (#6016)
test/specs/scale.time.tests.js
@@ -76,6 +76,7 @@ describe('Time scale tests', function() { scaleLabel: Chart.defaults.scale.scaleLabel, bounds: 'data', distribution: 'linear', + adapters: {}, ticks: { beginAtZero: false, minRotation: 0,
true
Other
chartjs
Chart.js
1c01272c9af8261a114524e6781e5e67105735fb.json
Improve autoSkip documentation (#6079)
docs/axes/cartesian/README.md
@@ -26,8 +26,8 @@ The following options are common to all cartesian axes but do not apply to other | Name | Type | Default | Description | ---- | ---- | ------- | ----------- -| `autoSkip` | `boolean` | `true` | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn i...
false
Other
chartjs
Chart.js
32aeeac82cdc371b6eb15e0b3442d307e2f36df7.json
Add crosshair plugin to extensions page (#6070)
docs/notes/extensions.md
@@ -15,6 +15,7 @@ In addition, many charts can be found on the [npm registry](https://www.npmjs.co - <a href="https://github.com/chartjs/chartjs-plugin-annotation" target="_blank">chartjs-plugin-annotation</a> - Draws lines and boxes on chart area. - <a href="https://github.com/nagix/chartjs-plugin-colorschemes" ...
false
Other
chartjs
Chart.js
58d7891ba23f154d3d799445c7ccb6dda2926468.json
Add examples of scriptable charts (#6042) * Add example of scriptable pie chart * Add example of scriptable line chart * Add example of scriptable polar area chart * Add example of scriptable radar chart
samples/samples.js
@@ -181,6 +181,18 @@ }, { title: 'Bubble Chart', path: 'scriptable/bubble.html' + }, { + title: 'Pie Chart', + path: 'scriptable/pie.html' + }, { + title: 'Line Chart', + path: 'scriptable/line.html' + }, { + title: 'Polar Area Chart', + path: 'scriptable/polar.html' + }, { + title: 'Radar ...
true
Other
chartjs
Chart.js
58d7891ba23f154d3d799445c7ccb6dda2926468.json
Add examples of scriptable charts (#6042) * Add example of scriptable pie chart * Add example of scriptable line chart * Add example of scriptable polar area chart * Add example of scriptable radar chart
samples/scriptable/line.html
@@ -0,0 +1,115 @@ +<!DOCTYPE html> +<html lang="en-US"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=Edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Scriptable > Line | Chart.js sample</title> + <link rel="stylesheet" type="text/css" href="../s...
true
Other
chartjs
Chart.js
58d7891ba23f154d3d799445c7ccb6dda2926468.json
Add examples of scriptable charts (#6042) * Add example of scriptable pie chart * Add example of scriptable line chart * Add example of scriptable polar area chart * Add example of scriptable radar chart
samples/scriptable/pie.html
@@ -0,0 +1,110 @@ +<!DOCTYPE html> +<html lang="en-US"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=Edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Scriptable > Pie | Chart.js sample</title> + <link rel="stylesheet" type="text/css" href="../st...
true
Other
chartjs
Chart.js
58d7891ba23f154d3d799445c7ccb6dda2926468.json
Add examples of scriptable charts (#6042) * Add example of scriptable pie chart * Add example of scriptable line chart * Add example of scriptable polar area chart * Add example of scriptable radar chart
samples/scriptable/polar.html
@@ -0,0 +1,98 @@ +<!DOCTYPE html> +<html lang="en-US"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=Edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Scriptable > Polar Area | Chart.js sample</title> + <link rel="stylesheet" type="text/css" href=...
true
Other
chartjs
Chart.js
58d7891ba23f154d3d799445c7ccb6dda2926468.json
Add examples of scriptable charts (#6042) * Add example of scriptable pie chart * Add example of scriptable line chart * Add example of scriptable polar area chart * Add example of scriptable radar chart
samples/scriptable/radar.html
@@ -0,0 +1,112 @@ +<!DOCTYPE html> +<html lang="en-US"> +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=Edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Scriptable > Radar | Chart.js sample</title> + <link rel="stylesheet" type="text/css" href="../...
true
Other
chartjs
Chart.js
5fc934eae1237e78f6db3ab065c71ee9412b9047.json
Fix responsive resize on rtl page (#6063)
src/platforms/platform.dom.css
@@ -19,6 +19,7 @@ .chartjs-size-monitor-expand, .chartjs-size-monitor-shrink { position: absolute; + direction: ltr; left: 0; top: 0; right: 0;
true
Other
chartjs
Chart.js
5fc934eae1237e78f6db3ab065c71ee9412b9047.json
Fix responsive resize on rtl page (#6063)
test/specs/core.controller.tests.js
@@ -379,6 +379,46 @@ describe('Chart', function() { }); }); + it('should resize the canvas when parent is RTL and width changes', function(done) { + var chart = acquireChart({ + options: { + responsive: true, + maintainAspectRatio: false + } + }, { + canvas: { + style: '' + }, + ...
true
Other
chartjs
Chart.js
ef507e11bd6936a0a60cbd66822aa6aef23df828.json
Handle inextensible `dataset.data` array (#6060)
src/core/core.datasetController.js
@@ -225,7 +225,9 @@ helpers.extend(DatasetController.prototype, { unlistenArrayEvents(me._data, me); } - listenArrayEvents(data, me); + if (data && Object.isExtensible(data)) { + listenArrayEvents(data, me); + } me._data = data; }
true
Other
chartjs
Chart.js
ef507e11bd6936a0a60cbd66822aa6aef23df828.json
Handle inextensible `dataset.data` array (#6060)
test/specs/core.datasetController.tests.js
@@ -38,6 +38,86 @@ describe('Chart.DatasetController', function() { }); }); + describe('inextensible data', function() { + it('should handle a frozen data object', function() { + function createChart() { + var data = Object.freeze([0, 1, 2, 3, 4, 5]); + expect(Object.isExtensible(data)).toBeFalsy(); + +...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
.gitignore
@@ -9,6 +9,8 @@ /package-lock.json .DS_Store .idea +.project +.settings .vscode bower.json *.log
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/controllers/controller.bar.js
@@ -190,8 +190,8 @@ module.exports = DatasetController.extend({ /** * Returns the stacks based on groups and bar visibility. - * @param {Number} [last] - The dataset index - * @returns {Array} The stack list + * @param {number} [last] - The dataset index + * @returns {string[]} The list of stack IDs * @pr...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/controllers/controller.horizontalBar.js
@@ -1,4 +1,3 @@ - 'use strict'; var BarController = require('./controller.bar');
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.animations.js
@@ -20,8 +20,8 @@ module.exports = { /** * @param {Chart} chart - The chart to animate. * @param {Chart.Animation} animation - The animation that we will animate. - * @param {Number} duration - The animation duration in ms. - * @param {Boolean} lazy - if true, the chart is not marked as animating to enable mo...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.controller.js
@@ -736,8 +736,10 @@ helpers.extend(Chart.prototype, /** @lends Chart */ { plugins.notify(me, 'afterTooltipDraw', [args]); }, - // Get the single element that was clicked on - // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw ...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.helpers.js
@@ -123,8 +123,8 @@ module.exports = function() { /** * Returns the number of decimal places * i.e. the number of digits after the decimal point, of the value of this Number. - * @param {Number} x - A number. - * @returns {Number} The number of decimal places. + * @param {number} x - A number. + * @returns ...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.interaction.js
@@ -6,7 +6,7 @@ var helpers = require('../helpers/index'); * Helper function to get relative position for an event * @param {Event|IEvent} event - The event to get the position for * @param {Chart} chart - The chart - * @returns {Point} the event position + * @returns {object} the event position */ function ge...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.layouts.js
@@ -67,19 +67,19 @@ defaults._set('global', { /** * @interface ILayoutItem - * @prop {String} position - The position of the item in the chart layout. Possible values are + * @prop {string} position - The position of the item in the chart layout. Possible values are * 'left', 'top', 'right', 'bottom', and 'chart...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.plugins.js
@@ -29,7 +29,7 @@ module.exports = { /** * Registers the given plugin(s) if not already registered. - * @param {Array|Object} plugins plugin instance(s). + * @param {IPlugin[]|IPlugin} plugins plugin instance(s). */ register: function(plugins) { var p = this._plugins; @@ -44,7 +44,7 @@ module.exports =...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.scale.js
@@ -717,8 +717,10 @@ module.exports = Element.extend({ return false; }, - // Actually draw the scale on the canvas - // @param {rectangle} chartArea : the area of the chart to draw full grid lines on + /** + * Actually draw the scale on the canvas + * @param {object} chartArea - the area of the chart to draw f...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.ticks.js
@@ -16,7 +16,7 @@ module.exports = { * Formatter for value labels * @method Chart.Ticks.formatters.values * @param value the value to display - * @return {String|Array} the label to display + * @return {string|string[]} the label to display */ values: function(value) { return helpers.isArray(...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/core/core.tooltip.js
@@ -107,7 +107,7 @@ var positioners = { * Average mode places the tooltip at the average position of the elements shown * @function Chart.Tooltip.positioners.average * @param elements {ChartElement[]} the elements being displayed in the tooltip - * @returns {Point} tooltip position + * @returns {object} tool...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/helpers/helpers.canvas.js
@@ -25,11 +25,11 @@ var exports = { * Creates a "path" for a rectangle with rounded corners at position (x, y) with a * given size (width, height) and the same `radius` for all corners. * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context. - * @param {Number} x - The x axis of the coordinate for th...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/helpers/helpers.core.js
@@ -11,7 +11,7 @@ var helpers = { /** * Returns a unique id, sequentially generated from a global variable. - * @returns {Number} + * @returns {number} * @function */ uid: (function() { @@ -24,7 +24,7 @@ var helpers = { /** * Returns true if `value` is neither null nor undefined, else returns fals...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/helpers/helpers.options.js
@@ -7,8 +7,8 @@ var valueOrDefault = helpers.valueOrDefault; /** * Converts the given font object into a CSS font string. - * @param {Object} font - A font object. - * @return {String} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font + * @param {object} font - A font object. + * @retu...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/platforms/platform.dom.js
@@ -38,7 +38,7 @@ var EVENT_TYPES = { * `element` has a size relative to its parent and this last one is not yet displayed, * for example because of `display: none` on a parent node. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value - * @returns {Number} Size in pixels or undefined if unknown. + ...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/platforms/platform.js
@@ -22,7 +22,7 @@ module.exports = helpers.extend({ * Called at chart construction time, returns a context2d instance implementing * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}. * @param {*} item - The native item from which to acquire context (platform specific) - * @para...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/plugins/plugin.legend.js
@@ -85,9 +85,9 @@ defaults._set('global', { /** * Helper function to get the box width based on the usePointStyle option - * @param labelopts {Object} the label options on the legend - * @param fontSize {Number} the label font size - * @return {Number} width of the color box area + * @param {object} labelopts - th...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/scales/scale.linearbase.js
@@ -10,7 +10,7 @@ var isNullOrUndef = helpers.isNullOrUndef; * Generate a set of linear ticks * @param generationOptions the options used to generate the ticks * @param dataRange the range of the data - * @returns {Array<Number>} array of tick values + * @returns {number[]} array of tick values */ function gen...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/scales/scale.logarithmic.js
@@ -11,7 +11,7 @@ var valueOrDefault = helpers.valueOrDefault; * Generate a set of logarithmic ticks * @param generationOptions the options used to generate the ticks * @param dataRange the range of the data - * @returns {Array<Number>} array of tick values + * @returns {number[]} array of tick values */ funct...
true
Other
chartjs
Chart.js
2f874fde622ebd2c3b45c668861659f17e1254e9.json
Use lowercase for primitives in jsdocs (#6033)
src/scales/scale.time.js
@@ -88,8 +88,8 @@ function arrayUnique(items) { * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need * to create the lookup table. The table ALWAYS contains at least two items: min and max. * - * @param {Number[]} timestamps - timestamps sorted from lowest to highest. - * @...
true
Other
chartjs
Chart.js
0ed652b39f7fc96cfcbfd916081d5d930850a231.json
Fix typo in radial linear scale docs (#6054)
docs/axes/radial/linear.md
@@ -1,6 +1,6 @@ # Linear Radial Axis -The linear scale is use to chart numerical data. As the name suggests, linear interpolation is used to determine where a value lies in relation the center of the axis. +The linear scale is used to chart numerical data. As the name suggests, linear interpolation is used to determ...
false
Other
chartjs
Chart.js
55128f74c1518ac82189c0acba2a6b40f77bf698.json
Move CSS in a separate file to be CSP-compliant (#6048) In order to be compatible with any CSP, we need to prevent the automatic creation of the DOM 'style' element and offer our CSS as a separate file that can be manually loaded (`Chart.js` or `Chart.min.js`). Users can now opt-out the style injection using `Chart.pl...
docs/getting-started/integration.md
@@ -84,3 +84,18 @@ require(['moment'], function() { }); }); ``` + +## Content Security Policy + +By default, Chart.js injects CSS directly into the DOM. For webpages secured using [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), this requires to allow `style-src 'unsafe-inl...
true