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 | b78b7c3534eb55e1294679a32dd93cfc74b45f48.json | Add explanation on how to run the samples locally (#9207)
* add explenation on how to run the samples locally
* Remove unecesarry parts from link | docs/getting-started/index.md | @@ -69,3 +69,5 @@ Finally, render the chart using our configuration:
It's that easy to get started using Chart.js! From here you can explore the many options that can help you customise your charts with scales, tooltips, labels, colors, custom actions, and much more.
All our examples are [available online](/samples... | false |
Other | chartjs | Chart.js | 9326309afd4676f16a123fa5bafe7f1f1f26b5e2.json | Fix error when swapping dataset locations (#9183) | src/core/core.controller.js | @@ -347,23 +347,6 @@ class Chart {
});
}
- /**
- * Updates the given metaset with the given dataset index. Ensures it's stored at that index
- * in the _metasets array by swapping with the metaset at that index if necessary.
- * @param {Object} meta - the dataset metadata
- * @param {number} index - the ... | true |
Other | chartjs | Chart.js | 9326309afd4676f16a123fa5bafe7f1f1f26b5e2.json | Fix error when swapping dataset locations (#9183) | test/specs/core.controller.tests.js | @@ -1778,6 +1778,33 @@ describe('Chart', function() {
expect(metasets[2].order).toEqual(4);
expect(metasets[3].order).toEqual(3);
});
+ it('should update properly when dataset locations are swapped', function() {
+ const orig = this.chart.data.datasets;
+ this.chart.data.datasets = [orig... | true |
Other | chartjs | Chart.js | 8c6335106707309d1b2441c82ac66bd9641c13cd.json | Add documentation about default scales (#9173) | docs/axes/index.md | @@ -11,6 +11,86 @@ Scales in Chart.js >v2.0 are significantly more powerful, but also different tha
* Scale titles are supported.
* New scale types can be extended without writing an entirely new chart type.
+## Default scales
+
+The default `scaleId`'s for carterian charts are `'x'` and `'y'`. For radial charts: `... | false |
Other | chartjs | Chart.js | aa6a9737bd780231b0684eeaf6df132a12b7ecec.json | Add declaration for Decimation plugin (#9172) | types/index.esm.d.ts | @@ -1953,6 +1953,8 @@ export class BasePlatform {
export class BasicPlatform extends BasePlatform {}
export class DomPlatform extends BasePlatform {}
+export const Decimation: Plugin;
+
export const enum DecimationAlgorithm {
lttb = 'lttb',
minmax = 'min-max', | true |
Other | chartjs | Chart.js | aa6a9737bd780231b0684eeaf6df132a12b7ecec.json | Add declaration for Decimation plugin (#9172) | types/tests/register.ts | @@ -0,0 +1,52 @@
+import {
+ Chart,
+ ArcElement,
+ LineElement,
+ BarElement,
+ PointElement,
+ BarController,
+ BubbleController,
+ DoughnutController,
+ LineController,
+ PieController,
+ PolarAreaController,
+ RadarController,
+ ScatterController,
+ CategoryScale,
+ LinearScale,
+ LogarithmicScale,
... | true |
Other | chartjs | Chart.js | 77cfac17859c0e086dc90b4c85ac2108581d56dc.json | Ignore items outside chart area for interaction (#9171) | src/core/core.interaction.js | @@ -166,6 +166,9 @@ function getNearestItems(chart, position, axis, intersect, useFinalPosition) {
}
const center = element.getCenterPoint(useFinalPosition);
+ if (!_isPointInArea(center, chart.chartArea, chart._minPadding)) {
+ return;
+ }
const distance = distanceMetric(position, center);
... | false |
Other | chartjs | Chart.js | 8c5d6be19748e1f0479473f75627c28268034e3a.json | Add missing props to ChartArea type (#9123) | types/geometric.d.ts | @@ -1,11 +1,13 @@
export interface ChartArea {
- top: number;
- left: number;
- right: number;
- bottom: number;
+ top: number;
+ left: number;
+ right: number;
+ bottom: number;
+ width: number;
+ height: number;
}
export interface Point {
- x: number;
- y: number;
+ x: number;
+ y: number;
} | false |
Other | chartjs | Chart.js | 749d1fc9422d7e35276da3097480707c59263e72.json | Fix animations when data is replaced (#9120) | src/core/core.datasetController.js | @@ -332,16 +332,15 @@ export default class DatasetController {
if (_data) {
// This case happens when the user replaced the data array instance.
unlistenArrayEvents(_data, me);
- // Discard old elements, parsed data and stacks
+ // Discard old parsed data and stacks
const... | true |
Other | chartjs | Chart.js | 749d1fc9422d7e35276da3097480707c59263e72.json | Fix animations when data is replaced (#9120) | test/specs/core.datasetController.tests.js | @@ -392,12 +392,14 @@ describe('Chart.DatasetController', function() {
expect(meta.data.length).toBe(6);
expect(meta._parsed.map(p => p.y)).toEqual(data0);
+ const point0 = meta.data[0];
chart.data.datasets[0].data = data1;
chart.update();
expect(meta.data.length).toBe(3);
expect(... | true |
Other | chartjs | Chart.js | d1a243efec9532db630268e0584d766b4ce2c73b.json | Delay data to elements synchronization to update (#9105) | src/core/core.datasetController.js | @@ -228,6 +228,7 @@ export default class DatasetController {
this._drawCount = undefined;
this.enableOptionSharing = false;
this.$context = undefined;
+ this._syncList = [];
this.initialize();
}
@@ -242,6 +243,9 @@ export default class DatasetController {
}
updateIndex(datasetIndex) ... | true |
Other | chartjs | Chart.js | d1a243efec9532db630268e0584d766b4ce2c73b.json | Delay data to elements synchronization to update (#9105) | test/specs/core.datasetController.tests.js | @@ -268,13 +268,15 @@ describe('Chart.DatasetController', function() {
last = meta.data[5];
data.push(6, 7, 8);
data.push(9);
+ chart.update();
expect(meta.data.length).toBe(10);
expect(meta.data[0]).toBe(first);
expect(meta.data[5]).toBe(last);
expect(parsedYValues()).toEqual(data... | true |
Other | chartjs | Chart.js | 927f24a809834100c138dc70cffd9e9b920478a5.json | Add test for issue 9085 (#9091) | types/tests/scales/chart_options.ts | @@ -0,0 +1,12 @@
+import { ChartOptions } from '../../index.esm';
+
+const chartOptions: ChartOptions<'line'> = {
+ scales: {
+ x: {
+ type: 'time',
+ time: {
+ unit: 'year'
+ }
+ },
+ }
+}; | false |
Other | chartjs | Chart.js | 1a1e677699f7b466c970529bbb988dde81f0ad9c.json | Fix: Avoid negative layout dimensions (#9027) | src/core/core.layouts.js | @@ -309,8 +309,8 @@ export default {
}
const padding = toPadding(chart.options.layout.padding);
- const availableWidth = width - padding.width;
- const availableHeight = height - padding.height;
+ const availableWidth = Math.max(width - padding.width, 0);
+ const availableHeight = Math.max(heigh... | true |
Other | chartjs | Chart.js | 1a1e677699f7b466c970529bbb988dde81f0ad9c.json | Fix: Avoid negative layout dimensions (#9027) | test/specs/scale.linear.tests.js | @@ -1220,4 +1220,31 @@ describe('Linear Scale', function() {
expect(scale.getValueForPixel(end)).toBeCloseTo(min, 4);
expect(scale.getValueForPixel(start)).toBeCloseTo(max, 4);
});
+
+ it('should not throw errors when chart size is negative', function() {
+ function createChart() {
+ return window... | true |
Other | chartjs | Chart.js | f5c51afd5186b2389250159a333a1160c09aee4b.json | fix typo on api.md (#9030) | docs/developers/api.md | @@ -103,7 +103,7 @@ To get an item that was clicked on, `getElementsAtEventForMode` can be used.
```javascript
function clickHandler(evt) {
- const points = myChart.getElementAtEventForMode(evt, 'nearest', { intersect: true }, true);
+ const points = myChart.getElementsAtEventForMode(evt, 'nearest', { interse... | false |
Other | chartjs | Chart.js | 49e7edae49467fd74a52b3cc934b33ad0219554e.json | Enable scriptable element chart options (#9012) | types/index.esm.d.ts | @@ -604,7 +604,7 @@ export interface DatasetControllerChartComponent extends ChartComponent {
};
}
-export interface Defaults extends CoreChartOptions<ChartType>, ElementChartOptions, PluginChartOptions<ChartType> {
+export interface Defaults extends CoreChartOptions<ChartType>, ElementChartOptions<ChartType>, Pl... | true |
Other | chartjs | Chart.js | 49e7edae49467fd74a52b3cc934b33ad0219554e.json | Enable scriptable element chart options (#9012) | types/tests/elements/scriptable_element_options.ts | @@ -0,0 +1,49 @@
+import { Chart } from '../../index.esm';
+
+const chart = new Chart('id', {
+ type: 'line',
+ data: {
+ labels: [],
+ datasets: []
+ },
+ options: {
+ elements: {
+ line: {
+ borderWidth: () => 2,
+ },
+ point: {
+ pointStyle: (ctx) => 'star',
+ }
+ }
... | true |
Other | chartjs | Chart.js | ea7b8cb04f528fe0c9fac526f2bdbf809397d0bd.json | Add test for DecimationAlgorithm type (#9010)
* Add test for DecimationAlgorithm type
* Allow strings to be set
* Linting | types/index.esm.d.ts | @@ -1961,12 +1961,12 @@ interface BaseDecimationOptions {
}
interface LttbDecimationOptions extends BaseDecimationOptions {
- algorithm: DecimationAlgorithm.lttb;
+ algorithm: DecimationAlgorithm.lttb | 'lttb';
samples?: number;
}
interface MinMaxDecimationOptions extends BaseDecimationOptions {
- algorit... | true |
Other | chartjs | Chart.js | ea7b8cb04f528fe0c9fac526f2bdbf809397d0bd.json | Add test for DecimationAlgorithm type (#9010)
* Add test for DecimationAlgorithm type
* Allow strings to be set
* Linting | types/tests/plugins/plugin.decimation/decimation_algorithm.ts | @@ -0,0 +1,72 @@
+import { Chart, DecimationAlgorithm } from '../../../index.esm';
+
+const chart = new Chart('id', {
+ type: 'bubble',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ plugins: {
+ decimation: {
+ algorithm: DecimationAlgorithm.lttb,
+ }
+... | true |
Other | chartjs | Chart.js | 55dd426a412c89cc0457a3ec925cb2df11ccfa28.json | Add documentation on tooltip xAlign and yAlign (#9011) | docs/configuration/tooltip.md | @@ -17,16 +17,16 @@ Namespace: `options.plugins.tooltip`, the global options for the chart tooltips
| `backgroundColor` | [`Color`](../general/colors.md) | `'rgba(0, 0, 0, 0.8)'` | Background color of the tooltip.
| `titleColor` | [`Color`](../general/colors.md) | `'#fff'` | Color of title text.
| `titleFont` | `Fon... | false |
Other | chartjs | Chart.js | 12bf256fd551b172f4a72111433eb69382640956.json | Ignore truncated pixels in bar width calculation (#8995) | src/controllers/controller.bar.js | @@ -1,7 +1,7 @@
import DatasetController from '../core/core.datasetController';
import {
clipArea, unclipArea, _arrayUnique, isArray, isNullOrUndef,
- valueOrDefault, resolveObjectKey, sign
+ valueOrDefault, resolveObjectKey, sign, defined
} from '../helpers';
function getAllScaleValues(scale) {
@@ -26,7 +26... | false |
Other | chartjs | Chart.js | 019cb9f3052a803d09da664d8aa4f33c210e8ed0.json | Add example plugins for border and quadrants (#8942) | docs/.vuepress/config.js | @@ -257,6 +257,13 @@ module.exports = {
'advanced/derived-chart-type',
]
},
+ {
+ title: 'Plugins',
+ children: [
+ 'plugins/chart-area-border',
+ 'plugins/quadrants',
+ ]
+ },
],
'/': [
'', | true |
Other | chartjs | Chart.js | 019cb9f3052a803d09da664d8aa4f33c210e8ed0.json | Add example plugins for border and quadrants (#8942) | docs/samples/plugins/chart-area-border.md | @@ -0,0 +1,63 @@
+# Chart Area Border
+
+```js chart-editor
+// <block:data:2>
+const DATA_COUNT = 7;
+const NUMBER_CFG = {count: DATA_COUNT, min: -100, max: 100};
+const labels = Utils.months({count: 7});
+const data = {
+ labels: labels,
+ datasets: [
+ {
+ label: 'Dataset 1',
+ data: Utils.numbers(NUM... | true |
Other | chartjs | Chart.js | 019cb9f3052a803d09da664d8aa4f33c210e8ed0.json | Add example plugins for border and quadrants (#8942) | docs/samples/plugins/quadrants.md | @@ -0,0 +1,79 @@
+# Quadrants
+
+```js chart-editor
+// <block:data:2>
+const DATA_COUNT = 7;
+const NUMBER_CFG = {count: DATA_COUNT, min: -100, max: 100};
+const data = {
+ datasets: [
+ {
+ label: 'Dataset 1',
+ data: Utils.points(NUMBER_CFG),
+ borderColor: Utils.CHART_COLORS.red,
+ backgroun... | true |
Other | chartjs | Chart.js | 877f4c6b2d5cdd732d79f2ed088095f5768c6bb2.json | Fix tooltip align & external types (#8782) | types/index.esm.d.ts | @@ -2208,15 +2208,16 @@ export interface TitleOptions {
text: string | string[];
}
-export type TooltipAlignment = 'start' | 'center' | 'end';
+export type TooltipXAlignment = 'left' | 'center' | 'right';
+export type TooltipYAlignment = 'top' | 'center' | 'bottom';
export interface TooltipModel<TType extends ... | false |
Other | chartjs | Chart.js | 5cb60d51109d4200ea6ac1fe65554f542075d11b.json | Remove .d.ts from helper types location (#8761) | helpers/helpers.esm.d.ts | @@ -1 +1 @@
-export * from '../types/helpers/index.d.ts';
+export * from '../types/helpers/index'; | true |
Other | chartjs | Chart.js | 5cb60d51109d4200ea6ac1fe65554f542075d11b.json | Remove .d.ts from helper types location (#8761) | helpers/helpers.esm.js | @@ -1 +1 @@
-export * from '../dist/helpers.esm';
\ No newline at end of file
+export * from '../dist/helpers.esm'; | true |
Other | chartjs | Chart.js | 5cb60d51109d4200ea6ac1fe65554f542075d11b.json | Remove .d.ts from helper types location (#8761) | helpers/helpers.js | @@ -1 +1 @@
-module.exports = require('..').helpers;
\ No newline at end of file
+module.exports = require('..').helpers; | true |
Other | chartjs | Chart.js | a6eaaf771f60575927d368bf9b6d48a87c14f902.json | Change the title of the tip block to Note (#8758) | docs/charts/area.md | @@ -2,7 +2,7 @@
Both [line](./line.mdx) and [radar](./radar.mdx) charts support a `fill` option on the dataset object which can be used to create space between two datasets or a dataset and a boundary, i.e. the scale `origin`, `start,` or `end` (see [filling modes](#filling-modes)).
-:::tip
+:::tip Note
This feat... | true |
Other | chartjs | Chart.js | a6eaaf771f60575927d368bf9b6d48a87c14f902.json | Change the title of the tip block to Note (#8758) | docs/charts/bar.md | @@ -123,7 +123,7 @@ This setting is used to avoid drawing the bar stroke at the base of the fill, or
In general, this does not need to be changed except when creating chart types
that derive from a bar chart.
-:::tip
+:::tip Note
For negative bars in a vertical chart, `top` and `bottom` are flipped. Same goes for ... | true |
Other | chartjs | Chart.js | a6eaaf771f60575927d368bf9b6d48a87c14f902.json | Change the title of the tip block to Note (#8758) | docs/configuration/animations.md | @@ -164,7 +164,7 @@ Namespace: `options.animations[animation]`
| `colors` | `properties` | `['color', 'borderColor', 'backgroundColor']`
| `colors` | `type` | `'color'`
-:::tip
+:::tip Note
These default animations are overridden by most of the dataset controllers.
:::
| true |
Other | chartjs | Chart.js | a6eaaf771f60575927d368bf9b6d48a87c14f902.json | Change the title of the tip block to Note (#8758) | docs/general/options.md | @@ -68,7 +68,7 @@ A plugin can provide `additionalOptionScopes` array of paths to additionally loo
Scriptable options also accept a function which is called for each of the underlying data values and that takes the unique argument `context` representing contextual information (see [option context](options.md#option-co... | true |
Other | chartjs | Chart.js | 4b7b3f277fcf87820bb3be0b2180927f1a59e86b.json | Build docs with node14 (#8754) | .github/workflows/deploy-docs.yml | @@ -21,6 +21,8 @@ jobs:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
+ with:
+ node-version: '14.x'
- name: Package & Deploy Docs
run: |
npm ci | true |
Other | chartjs | Chart.js | 4b7b3f277fcf87820bb3be0b2180927f1a59e86b.json | Build docs with node14 (#8754) | .github/workflows/npmpublish.yml | @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
- node-version: 12
+ node-version: '14.x'
registry-url: https://registry.npmjs.org/
- name: Setup and build
run: | | true |
Other | chartjs | Chart.js | 88c585b11e82ab9fa8d83f1878543ab293c8f0fa.json | Legend: adjust lifecycle and event handling (#8753) | src/plugins/plugin.legend.js | @@ -27,6 +27,8 @@ const getBoxSize = (labelOpts, fontSize) => {
};
};
+const itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;
+
export class Legend extends Element {
/**
@@ -154,51 +156,61 @@ export class Legend extends Element {
*/
_fitRows(... | false |
Other | chartjs | Chart.js | fe406bf717444def6e7a6cb10b8e9120d9679450.json | Legend: Ignore replayed events (#8749) | src/plugins/plugin.legend.js | @@ -538,7 +538,9 @@ export default {
afterEvent(chart, args) {
- chart.legend.handleEvent(args.event);
+ if (!args.replay) {
+ chart.legend.handleEvent(args.event);
+ }
},
defaults: { | false |
Other | chartjs | Chart.js | d6972abd48b4012d38a7b0cc7133aee25ea90112.json | Add note about inline plugins and registration (#8741) | docs/docs/developers/plugins.md | @@ -27,6 +27,8 @@ var chart3 = new Chart(ctx, {});
Plugins can also be defined directly in the chart `plugins` config (a.k.a. *inline plugins*):
+> Note: *inline* plugins are not registered. Some plugins require registering, i.e. can't be used *inline*.
+
```javascript
var chart = new Chart(ctx, {
plugins: ... | false |
Other | chartjs | Chart.js | 37080c9a8db7b4ff94bebcee3df990127d8d263a.json | Add comments for finding registry hook calls (#8734) | src/core/core.registry.js | @@ -151,9 +151,9 @@ export class Registry {
*/
_exec(method, registry, component) {
const camelMethod = _capitalize(method);
- call(component['before' + camelMethod], [], component);
+ call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister
registry[method](com... | false |
Other | chartjs | Chart.js | 54c5b7a084576d9ccf8f7b6af943b04415e0c321.json | Add a convenience alias for scale options (#8732)
* Add a convenience alias for scale options
Closes #8731
* Add an automated test
* Use parameter for a more realistic test | types/index.esm.d.ts | @@ -3248,6 +3248,9 @@ export type ScaleOptionsByType<TScale extends ScaleType = ScaleType> =
{ [key in ScaleType]: { type: key } & ScaleTypeRegistry[key]['options'] }[TScale]
;
+// Convenience alias for creating and manipulating scale options in user code
+export type ScaleOptions<TScale extends ScaleType = Scale... | true |
Other | chartjs | Chart.js | 54c5b7a084576d9ccf8f7b6af943b04415e0c321.json | Add a convenience alias for scale options (#8732)
* Add a convenience alias for scale options
Closes #8731
* Add an automated test
* Use parameter for a more realistic test | types/tests/scales/options.ts | @@ -1,4 +1,4 @@
-import { Chart } from '../../index.esm';
+import { Chart, ScaleOptions } from '../../index.esm';
const chart = new Chart('test', {
type: 'bar',
@@ -30,3 +30,29 @@ const chart = new Chart('test', {
}
}
});
+
+function makeChartScale(range: number): ScaleOptions<'linear'> {
+ return {
+ ... | true |
Other | chartjs | Chart.js | 3671c01c26cf96da4d94c01991421cf6734669db.json | Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.
This simplifies the ... | MAINTAINING.md | @@ -13,7 +13,7 @@ Chart.js relies on [Travis CI](https://travis-ci.org/) to automate the library [
Creation of this tag triggers a new build:
* `Chart.js.zip` package is generated, containing dist files and examples
-* `dist/*.js` and `Chart.js.zip` are attached to the GitHub release (downloads)
+* `dist/*.js`, `ty... | true |
Other | chartjs | Chart.js | 3671c01c26cf96da4d94c01991421cf6734669db.json | Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.
This simplifies the ... | package-lock.json | @@ -3581,40 +3581,6 @@
"rollup-pluginutils": "^2.8.2"
}
},
- "rollup-plugin-dts": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-3.0.1.tgz",
- "integrity": "sha512-sdTsd0tEIV1b5Bio1k4Ei3N4/7jbwcVRdlYotGYdJOKR59JH7DzqKTSCbfaK... | true |
Other | chartjs | Chart.js | 3671c01c26cf96da4d94c01991421cf6734669db.json | Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.
This simplifies the ... | package.json | @@ -8,7 +8,7 @@
"unpkg": "dist/chart.min.js",
"main": "dist/chart.js",
"module": "dist/chart.esm.js",
- "types": "dist/chart.esm.d.ts",
+ "types": "types/chart.esm.d.ts",
"keywords": [
"canvas",
"charts",
@@ -28,9 +28,9 @@
"auto/**/*.js",
"auto/**/*.d.ts",
"dist/*.js",
- "dist/... | true |
Other | chartjs | Chart.js | 3671c01c26cf96da4d94c01991421cf6734669db.json | Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.
This simplifies the ... | rollup.config.js | @@ -1,6 +1,5 @@
const analyze = require('rollup-plugin-analyzer');
const cleanup = require('rollup-plugin-cleanup');
-const dts = require('rollup-plugin-dts').default;
const json = require('@rollup/plugin-json');
const resolve = require('@rollup/plugin-node-resolve').default;
const terser = require('rollup-plugin-... | true |
Other | chartjs | Chart.js | 3671c01c26cf96da4d94c01991421cf6734669db.json | Distribute types as is (#8720)
I had initially seen some oddities around type augmentation for type definitions in subdirectories of `types`, and using Rollup seemed to help with that. However, now that all of Chart.js's main types are directly under `types`, there seems to be no need for this.
This simplifies the ... | types/index.esm.d.ts | @@ -1,17 +1,3 @@
-/**
- * Top-level type definitions. These are processed by Rollup and rollup-plugin-dts
- * to make a combined .d.ts file under dist; that way, all of the type definitions
- * appear directly within the "chart.js" module; that matches the layout of the
- * distributed chart.esm.js bundle and means tha... | true |
Other | chartjs | Chart.js | 7fff21b3bb2f240237a3349ad0e207ea2774507a.json | Add defaults.describe/defaults.override typings (#8716) | types/index.esm.d.ts | @@ -623,6 +623,9 @@ export interface Defaults extends CoreChartOptions<ChartType>, ElementChartOptio
set(scope: string, values: AnyObject): AnyObject;
get(scope: string): AnyObject;
+ describe(scope: string, values: AnyObject): AnyObject;
+ override(scope: string, values: AnyObject): AnyObject;
+
/**
*... | false |
Other | chartjs | Chart.js | 39140cca2e36333abb7ab4309a6b4ee2c52e4d95.json | Remove the comparrison doc page (#8709) | docs/docs/notes/comparison.md | @@ -1,33 +0,0 @@
----
-title: Comparison with Other Libraries
----
-
-Library Features
-
-| Feature | Chart.js | D3 | HighCharts | Chartist |
-| ------- | -------- | --- | ---------- | -------- |
-| Completely Free | ✓ | ✓ | | ✓ |
-| Canvas | ✓ | | | |
-| SVG | | ✓ | ✓ | ✓ |
-|... | true |
Other | chartjs | Chart.js | 39140cca2e36333abb7ab4309a6b4ee2c52e4d95.json | Remove the comparrison doc page (#8709) | docs/sidebars.js | @@ -83,7 +83,6 @@ module.exports = {
'developers/publishing'
],
'Additional Notes': [
- 'notes/comparison',
{
type: 'link',
label: 'Extensions', | true |
Other | chartjs | Chart.js | bbf298f4614c058e2ec86329566a56bfcd8bc685.json | formatters.numeric: verify ticks length (#8705)
* formatters.numeric: verify ticks length
* use tickValue as fallback delta, add tests
* cc, chore | src/core/core.ticks.js | @@ -8,45 +8,40 @@ import {log10} from '../helpers/helpers.math';
*/
const formatters = {
/**
- * Formatter for value labels
- * @method Chart.Ticks.formatters.values
- * @param value the value to display
- * @return {string|string[]} the label to display
- */
+ * Formatter for value labels
+ * @method Ch... | true |
Other | chartjs | Chart.js | bbf298f4614c058e2ec86329566a56bfcd8bc685.json | formatters.numeric: verify ticks length (#8705)
* formatters.numeric: verify ticks length
* use tickValue as fallback delta, add tests
* cc, chore | test/specs/core.ticks.tests.js | @@ -96,4 +96,13 @@ describe('Test tick generators', function() {
expect(xLabels).toEqual(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1']);
expect(yLabels).toEqual(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1']);
});
+
+ describe('formatters.numeric', function() {... | true |
Other | chartjs | Chart.js | d79b5a3d60bba39a285f4eb878839dee2b4027da.json | Add typings for throttled and debounce (#8689)
* Add typings for throttled and debounce
* Review feedback
* args for fn too
* one more | types/helpers/helpers.extras.d.ts | @@ -4,3 +4,20 @@ export function fontString(pixelSize: number, fontStyle: string, fontFamily: str
* Request animation polyfill
*/
export function requestAnimFrame(cb: () => void): void;
+
+/**
+ * Throttles calling `fn` once per animation frame
+ * Latest argments are used on the actual call
+ * @param {function} ... | false |
Other | chartjs | Chart.js | 7e8e7f01374d2c3e7633d4acf1d1e38928ba2a07.json | Generalize toTRBL and toTRBLCorners (#8686) | src/helpers/helpers.options.js | @@ -38,7 +38,22 @@ export function toLineHeight(value, size) {
}
const numberOrZero = v => +v || 0;
-const numberOrZero2 = (v1, v2) => numberOrZero(valueOrDefault(v1, v2));
+
+function readValueToProps(value, props) {
+ const ret = {};
+ const objProps = isObject(props);
+ const keys = objProps ? Object.keys(pro... | false |
Other | chartjs | Chart.js | 537064be9cc221b9c68a68cdc7f4e823eabda52e.json | Modify Scale typing (#8681) | types/index.esm.d.ts | @@ -1260,10 +1260,9 @@ export interface Scale<O extends CoreScaleOptions = CoreScaleOptions> extends El
isFullSize(): boolean;
}
-export const Scale: {
- prototype: Scale;
- new <O extends CoreScaleOptions = CoreScaleOptions>(cfg: AnyObject): Scale<O>;
-};
+export declare class Scale {
+ constructor(cfg: {id: ... | true |
Other | chartjs | Chart.js | 537064be9cc221b9c68a68cdc7f4e823eabda52e.json | Modify Scale typing (#8681) | types/tests/extensions/scale.ts | @@ -0,0 +1,48 @@
+import { AnyObject } from '../../basic';
+import { CartesianScaleOptions, Chart, Scale } from '../../index.esm';
+
+export type TestScaleOptions = CartesianScaleOptions & {
+ testOption?: boolean
+}
+
+export class TestScale<O extends TestScaleOptions = TestScaleOptions> extends Scale<O> {
+ static ... | true |
Other | chartjs | Chart.js | 185f83aca3f01020616468d98be05ad8b6a774eb.json | Update doc samples for changed file name (#7447) | docs/docusaurus.config.js | @@ -9,7 +9,7 @@ module.exports = {
organizationName: 'chartjs', // Usually your GitHub org/user name.
projectName: 'chartjs.github.io', // Usually your repo name.
plugins: [require.resolve('@docusaurus/plugin-google-analytics')],
- scripts: ['https://www.chartjs.org/dist/VERSION/Chart.min.js'],
+ scripts: ['https... | false |
Other | chartjs | Chart.js | 553ae385a8382609ca30d53a91aa3ea4b0db6745.json | Consistency: Use lower case for instances (#7436)
Consistency: Use lover case for instances | src/core/core.animations.js | @@ -1,4 +1,4 @@
-import Animator from './core.animator';
+import animator from './core.animator';
import Animation from './core.animation';
import defaults from './core.defaults';
import {noop, isObject} from '../helpers/helpers.core';
@@ -206,7 +206,7 @@ export default class Animations {
const animations = this.... | true |
Other | chartjs | Chart.js | 553ae385a8382609ca30d53a91aa3ea4b0db6745.json | Consistency: Use lower case for instances (#7436)
Consistency: Use lover case for instances | src/core/core.animator.js | @@ -20,6 +20,7 @@ function drawFPS(chart, count, date, lastDate) {
/**
* Please use the module's default export which provides a singleton instance
+ * Note: class is export for typedoc
*/
export class Animator {
constructor() { | true |
Other | chartjs | Chart.js | 553ae385a8382609ca30d53a91aa3ea4b0db6745.json | Consistency: Use lower case for instances (#7436)
Consistency: Use lover case for instances | src/core/core.controller.js | @@ -1,5 +1,5 @@
/* eslint-disable import/no-namespace, import/namespace */
-import {default as Animator} from './core.animator';
+import animator from './core.animator';
import * as controllers from '../controllers';
import defaults from './core.defaults';
import Interaction from './core.interaction';
@@ -254,8 +25... | true |
Other | chartjs | Chart.js | 553ae385a8382609ca30d53a91aa3ea4b0db6745.json | Consistency: Use lower case for instances (#7436)
Consistency: Use lover case for instances | src/core/index.js | @@ -1,14 +1,14 @@
export {default as _adapters} from './core.adapters';
export {default as Animation} from './core.animation';
export {default as Animations} from './core.animations';
-export {default as Animator} from './core.animator';
+export {default as animator} from './core.animator';
export {default as Chart... | true |
Other | chartjs | Chart.js | 553ae385a8382609ca30d53a91aa3ea4b0db6745.json | Consistency: Use lower case for instances (#7436)
Consistency: Use lover case for instances | src/index.js | @@ -8,7 +8,7 @@ import Chart from './core/core.controller';
import helpers from './helpers/index';
import _adapters from './core/core.adapters';
import Animation from './core/core.animation';
-import {default as Animator} from './core/core.animator';
+import animator from './core/core.animator';
import animationSer... | true |
Other | chartjs | Chart.js | 7752566a482f71f9905e794f9ef962bb8634127a.json | Remove missing setDataVisibility for documentation (#7437) | docs/docs/developers/api.md | @@ -159,15 +159,6 @@ chart.setDatasetVisibility(1, false); // hides dataset at index 1
chart.update(); // chart now renders with dataset hidden
```
-## setDataVisibility(datasetIndex, index, visibility)
-
-Like [setDatasetVisibility](#setdatasetvisibility) except that it hides only a single item in the dataset. **N... | false |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | babel.config.json | @@ -3,27 +3,9 @@
"@babel/preset-env"
],
"plugins": [
- "@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-object-assign"
],
"env": {
- "es6": {
- "presets": [
- [
- "@babel/preset-env",
- {
- "targets": {
- "esmodules": t... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | docs/docs/developers/axes.md | @@ -5,9 +5,9 @@ title: New Axes
Axes in Chart.js can be individually extended. Axes should always derive from `Chart.Scale` but this is not a mandatory requirement.
```javascript
-let MyScale = Chart.Scale.extend({
+class MyScale extends Chart.Scale{
/* extensions ... */
-});
+}
MyScale.id = 'myScale';
MySca... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | docs/docs/developers/charts.md | @@ -5,10 +5,11 @@ title: New Charts
Chart.js 2.0 introduces the concept of controllers for each dataset. Like scales, new controllers can be written as needed.
```javascript
-Chart.controllers.MyType = Chart.DatasetController.extend({
+class MyType extends Chart.DatasetController {
-});
+}
+Chart.controllers.My... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | package-lock.json | @@ -92,20 +92,6 @@
"semver": "^5.5.0"
}
},
- "@babel/helper-create-class-features-plugin": {
- "version": "7.9.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.6.tgz",
- "integrity": "sha512-6N9IeuyH... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | package.json | @@ -34,7 +34,6 @@
},
"devDependencies": {
"@babel/core": "^7.9.6",
- "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-transform-object-assign": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@rollup/plugin-commonjs": "^11.1.0", | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | rollup.config.js | @@ -74,7 +74,6 @@ module.exports = [
plugins: [
json(),
resolve(),
- babel({envName: 'es6'}),
cleanup({
sourcemap: true
})
@@ -92,7 +91,6 @@ module.exports = [
plugins: [
json(),
resolve(),
- babel({envName: 'es6'}),
terser({
output: {
preamble: banner | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/core/core.controller.js | @@ -172,16 +172,7 @@ function getCanvas(item) {
return item;
}
-export default class Chart {
-
- static version = version;
-
- /**
- * NOTE(SB) We actually don't use this container anymore but we need to keep it
- * for backward compatibility. Though, it can still be useful for plugins that
- * would need to wo... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/core/core.datasetController.js | @@ -1,5 +1,5 @@
import Animations from './core.animations';
-import {isObject, inherits, merge, _merger, isArray, valueOrDefault, mergeIf, arrayEquals} from '../helpers/helpers.core';
+import {isObject, merge, _merger, isArray, valueOrDefault, mergeIf, arrayEquals} from '../helpers/helpers.core';
import {resolve} fro... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/core/core.element.js | @@ -1,10 +1,7 @@
-import {inherits} from '../helpers/helpers.core';
import {isNumber} from '../helpers/helpers.math';
export default class Element {
- static extend = inherits;
-
constructor() {
this.x = undefined;
this.y = undefined; | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/elements/element.arc.js | @@ -84,9 +84,7 @@ function drawBorder(ctx, vm, arc) {
ctx.stroke();
}
-export default class Arc extends Element {
-
- static _type = 'arc';
+class Arc extends Element {
constructor(cfg) {
super();
@@ -197,3 +195,7 @@ export default class Arc extends Element {
ctx.restore();
}
}
+
+Arc._type = 'arc';
+... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/elements/element.line.js | @@ -196,9 +196,7 @@ function _getInterpolationMethod(options) {
return _pointInLine;
}
-export default class Line extends Element {
-
- static _type = 'line';
+class Line extends Element {
constructor(cfg) {
super();
@@ -357,3 +355,7 @@ export default class Line extends Element {
ctx.restore();
}
}
+
... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/elements/element.point.js | @@ -17,9 +17,7 @@ defaults.set('elements', {
}
});
-export default class Point extends Element {
-
- static _type = 'point';
+class Point extends Element {
constructor(cfg) {
super();
@@ -86,3 +84,7 @@ export default class Point extends Element {
return options.radius + options.hitRadius;
}
}
+
+Point... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/elements/element.rectangle.js | @@ -124,9 +124,7 @@ function inRange(bar, x, y, useFinalPosition) {
&& (skipY || y >= bounds.top && y <= bounds.bottom);
}
-export default class Rectangle extends Element {
-
- static _type = 'rectangle';
+class Rectangle extends Element {
constructor(cfg) {
super();
@@ -187,3 +185,7 @@ export default clas... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/helpers/helpers.core.js | @@ -293,33 +293,6 @@ export function _mergerIf(key, target, source) {
}
}
-/**
- * Basic javascript inheritance based on the model created in Backbone.js
- */
-export function inherits(extensions) {
- // eslint-disable-next-line no-invalid-this
- const me = this;
- const ChartElement = (extensions && Object.protot... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/scales/scale.category.js | @@ -3,11 +3,7 @@ import Scale from '../core/core.scale';
const defaultConfig = {
};
-export default class CategoryScale extends Scale {
-
- static id = 'category';
- // INTERNAL: static default options, registered in src/index.js
- static defaults = defaultConfig;
+class CategoryScale extends Scale {
constructo... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/scales/scale.linear.js | @@ -8,11 +8,7 @@ const defaultConfig = {
}
};
-export default class LinearScale extends LinearScaleBase {
-
- static id = 'linear';
- // INTERNAL: static default options, registered in src/index.js
- static defaults = defaultConfig;
+class LinearScale extends LinearScaleBase {
determineDataLimits() {
const ... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/scales/scale.logarithmic.js | @@ -57,11 +57,7 @@ const defaultConfig = {
}
};
-export default class LogarithmicScale extends Scale {
-
- static id = 'logarithmic';
- // INTERNAL: static default options, registered in src/index.js
- static defaults = defaultConfig;
+class LogarithmicScale extends Scale {
constructor(cfg) {
super(cfg);
@@... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/scales/scale.radialLinear.js | @@ -289,11 +289,7 @@ function numberOrZero(param) {
return isNumber(param) ? param : 0;
}
-export default class RadialLinearScale extends LinearScaleBase {
-
- static id = 'radialLinear';
- // INTERNAL: static default options, registered in src/index.js
- static defaults = defaultConfig;
+class RadialLinearScale e... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | src/scales/scale.time.js | @@ -542,11 +542,7 @@ const defaultConfig = {
}
};
-export default class TimeScale extends Scale {
-
- static id = 'time';
- // INTERNAL: static default options, registered in src/index.js
- static defaults = defaultConfig;
+class TimeScale extends Scale {
/**
* @param {object} props
@@ -812,3 +808,10 @@ exp... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | test/specs/core.scale.tests.js | @@ -454,15 +454,15 @@ describe('Core.scale', function() {
});
it('should default to one layer for custom scales', function() {
- var customScale = Chart.Scale.extend({
- draw: function() {},
- convertTicksToLabels: function() {
+ class CustomScale extends Chart.Scale {
+ draw() {}
+ convertTicks... | true |
Other | chartjs | Chart.js | f472a3f9a761c876b56771a107a7f0f36924c3cb.json | Remove proposal and obsolete features (#7425) | test/specs/helpers.core.tests.js | @@ -429,57 +429,4 @@ describe('Chart.helpers.core', function() {
expect(output.o.a).not.toBe(a1);
});
});
-
- describe('extend', function() {
- it('should merge object properties in target and return target', function() {
- var target = {a: 'abc', b: 56};
- var object = {b: 0, c: [2, 5, 6]};
- var resul... | true |
Other | chartjs | Chart.js | 94763bff351236ff5936280737b594701f0528b8.json | Fix chart resizing issue (#7297) (#7298)
Fix chart resizing issue | src/platform/platform.dom.js | @@ -236,7 +236,15 @@ function createResizeObserver(chart, type, listener) {
// @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented
const observer = new ResizeObserver(entries => {
const entry = entries[0];
- resize(entry.contentRect.width, entry.contentRect.height);
+ const width ... | true |
Other | chartjs | Chart.js | 94763bff351236ff5936280737b594701f0528b8.json | Fix chart resizing issue (#7297) (#7298)
Fix chart resizing issue | test/specs/core.controller.tests.js | @@ -365,6 +365,59 @@ describe('Chart', function() {
wrapper.style.width = '455px';
});
+ it('should restore the original size when parent became invisible', function(done) {
+ var chart = acquireChart({
+ options: {
+ responsive: true,
+ maintainAspectRatio: false
+ }
+ }, {
+ canvas: {
+... | true |
Other | chartjs | Chart.js | 5cf054ef257ce28407ae5c13bcc0b5f8c0199c80.json | Use full URL for TypeDocs (#7380)
Use full URL for TypeDocs | docs/docusaurus.config.js | @@ -1,96 +1,96 @@
+/* eslint-disable import/no-commonjs */
// VERSION replaced by deploy script
module.exports = {
- title: 'Chart.js',
- tagline: 'Open source HTML5 Charts for your website',
- url: 'https://chartjs.org',
- baseUrl: '/docs/VERSION/',
- favicon: 'img/favicon.ico',
- organizationName: 'chartjs', ... | true |
Other | chartjs | Chart.js | 5cf054ef257ce28407ae5c13bcc0b5f8c0199c80.json | Use full URL for TypeDocs (#7380)
Use full URL for TypeDocs | docs/sidebars.js | @@ -1,82 +1,85 @@
+const pkg = require('../package.json');
+const docsVersion = pkg.version.indexOf('-') > -1 ? 'next' : 'latest';
+
module.exports = {
- someSidebar: {
- Introduction: ['index'],
- 'Getting Started': [
- 'getting-started/index',
- 'getting-started/installation',
- 'getting-starte... | true |
Other | chartjs | Chart.js | 37633c221ac41b4a4cbcc5093b2049c83bee19b8.json | Remove default export from controllers/index (#7388)
Remove default export from controllers/index | src/controllers/index.js | @@ -1,25 +1,9 @@
-import bar from './controller.bar';
-import bubble from './controller.bubble';
-import doughnut from './controller.doughnut';
-import horizontalBar from './controller.horizontalBar';
-import line from './controller.line';
-import polarArea from './controller.polarArea';
-import pie from './controller.... | true |
Other | chartjs | Chart.js | 37633c221ac41b4a4cbcc5093b2049c83bee19b8.json | Remove default export from controllers/index (#7388)
Remove default export from controllers/index | src/core/core.controller.js | @@ -1,5 +1,6 @@
-import Animator from './core.animator';
-import controllers from '../controllers/index';
+/* eslint-disable import/no-namespace, import/namespace */
+import {default as Animator} from './core.animator';
+import * as controllers from '../controllers';
import defaults from './core.defaults';
import Int... | true |
Other | chartjs | Chart.js | 37633c221ac41b4a4cbcc5093b2049c83bee19b8.json | Remove default export from controllers/index (#7388)
Remove default export from controllers/index | src/index.js | @@ -8,9 +8,9 @@ import Chart from './core/core.controller';
import helpers from './helpers/index';
import _adapters from './core/core.adapters';
import Animation from './core/core.animation';
-import Animator from './core/core.animator';
+import {default as Animator} from './core/core.animator';
import animationSer... | true |
Other | chartjs | Chart.js | 5920858513710276dc33d33a172ce67bd4215d13.json | Remove default export from plugins/index (#7389) | src/index.js | @@ -42,11 +42,11 @@ Chart.scaleService = scaleService;
Chart.Ticks = Ticks;
// Register built-in scales
-import * as scales from './scales/index';
+import * as scales from './scales';
Object.keys(scales).forEach(key => Chart.scaleService.registerScale(scales[key]));
// Loading built-in plugins
-import plugins f... | true |
Other | chartjs | Chart.js | 5920858513710276dc33d33a172ce67bd4215d13.json | Remove default export from plugins/index (#7389) | src/plugins/index.js | @@ -1,11 +1,4 @@
-import filler from './plugin.filler';
-import legend from './plugin.legend';
-import title from './plugin.title';
-import tooltip from './plugin.tooltip';
-
-export default {
- filler,
- legend,
- title,
- tooltip
-};
+export {default as filler} from './plugin.filler';
+export {default as legend} from... | true |
Other | chartjs | Chart.js | 087ba88da6d76f9aea00608923eac8ba1e6679f5.json | Add index to core (#7390) | src/core/index.js | @@ -0,0 +1,14 @@
+export {default as _adapters} from './core.adapters';
+export {default as Animation} from './core.animation';
+export {default as Animations} from './core.animations';
+export {default as Animator} from './core.animator';
+export {default as Chart} from './core.controller';
+export {default as Dataset... | false |
Other | chartjs | Chart.js | 7ac61441a63efdcf1e3f1951832970c9ac1f1f60.json | Run tests in series to avoid timeouts (#7392) | gulpfile.js | @@ -31,7 +31,7 @@ gulp.task('lint-js', lintJsTask);
gulp.task('lint', gulp.parallel('lint-html', 'lint-js'));
gulp.task('tsc', typescriptTask);
gulp.task('unittest', unittestTask);
-gulp.task('test', gulp.parallel('lint', 'tsc', 'unittest'));
+gulp.task('test', gulp.series('lint', 'tsc', 'unittest'));
gulp.task('li... | false |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | docs/docs/getting-started/v3-migration.md | @@ -141,7 +141,6 @@ options: {
Animation system was completely rewritten in Chart.js v3. Each property can now be animated separately. Please see [animations](../configuration/animations.md) docs for details.
-
#### Customizability
* `custom` attribute of elements was removed. Please use scriptable options
@@ ... | true |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | src/core/core.controller.js | @@ -212,7 +212,7 @@ export default class Chart {
this.active = undefined;
this.lastActive = [];
this._lastEvent = undefined;
- /** @type {{resize?: function}} */
+ /** @type {{attach?: function, detach?: function, resize?: function}} */
this._listeners = {};
this._sortedMetasets = [];
this._updating... | true |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | src/helpers/helpers.dom.js | @@ -126,13 +126,14 @@ export function getRelativePosition(evt, chart) {
};
}
+function fallbackIfNotValid(measure, fallback) {
+ return typeof measure === 'number' ? measure : fallback;
+}
+
export function getMaximumWidth(domNode) {
const container = _getParentNode(domNode);
if (!container) {
- if (typeof d... | true |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | src/platform/platform.base.js | @@ -48,6 +48,14 @@ export default class BasePlatform {
getDevicePixelRatio() {
return 1;
}
+
+ /**
+ * @param {HTMLCanvasElement} canvas
+ * @returns {boolean} true if the canvas is attached to the platform, false if not.
+ */
+ isAttached(canvas) { // eslint-disable-line no-unused-vars
+ return true;
+ }
}... | true |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | src/platform/platform.dom.js | @@ -172,51 +172,17 @@ function throttled(fn, thisArg) {
};
}
-/**
- * Watch for resize of `element`.
- * Calling `fn` is limited to once per animation frame
- * @param {Element} element - The element to monitor
- * @param {function} fn - Callback function to call when resized
- */
-function watchForResize(element,... | true |
Other | chartjs | Chart.js | cfb5fba527cd93b596329fb05079e320b6586701.json | Delay animations until attached (#7370)
* Delay animations until attached
* Detect container detachment | test/specs/platform.dom.tests.js | @@ -1,3 +1,5 @@
+import {DomPlatform} from '../../src/platform/platforms';
+
describe('Platform.dom', function() {
describe('context acquisition', function() {
@@ -405,4 +407,24 @@ describe('Platform.dom', function() {
});
});
});
+
+ describe('isAttached', function() {
+ it('should detect detached when ... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.