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 | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-right-center-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "right",
- "align": "center"
+ "plugins": {
+ "legend": {
+ "position": "right",
+ "align": "center"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-right-center-single.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "right",
- "align": "center"
+ "plugins": {
+ "legend": {
+ "position": "right",
+ "align": "center"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-right-default-center.json | @@ -10,8 +10,10 @@
}]
},
"options": {
- "legend": {
- "position": "right"
+ "plugins": {
+ "legend": {
+ "position": "right"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-right-end-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "right",
- "align": "end"
+ "plugins": {
+ "legend": {
+ "position": "right",
+ "align": "end"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-right-start-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "right",
- "align": "start"
+ "plugins": {
+ "legend": {
+ "position": "right",
+ "align": "start"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-top-center-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "top",
- "align": "center"
+ "plugins": {
+ "legend": {
+ "position": "top",
+ "align": "center"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-top-center-single.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "top",
- "align": "center"
+ "plugins": {
+ "legend": {
+ "position": "top",
+ "align": "center"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-top-end-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "top",
- "align": "end"
+ "plugins": {
+ "legend": {
+ "position": "top",
+ "align": "end"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/fixtures/plugin.legend/legend-doughnut-top-start-mulitiline.json | @@ -10,9 +10,11 @@
}]
},
"options": {
- "legend": {
- "position": "top",
- "align": "start"
+ "plugins": {
+ "legend": {
+ "position": "top",
+ "align": "start"
+ }
}
}
}, | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.bar.tests.js | @@ -590,8 +590,10 @@ describe('Chart.controllers.bar', function() {
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false
+ },
elements: {
bar: {
backgroundColor: 'red',
@@ -664,8 +6... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.bubble.tests.js | @@ -115,8 +115,10 @@ describe('Chart.controllers.bubble', function() {
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false
+ },
scales: {
x: {
type: 'category', | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.doughnut.tests.js | @@ -61,8 +61,10 @@ describe('Chart.controllers.doughnut', function() {
labels: ['label0', 'label1', 'label2', 'label3']
},
options: {
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false,
+ },
animation: {
duration: 0,
animateRotate: true,
@@ -1... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.line.tests.js | @@ -110,8 +110,10 @@ describe('Chart.controllers.line', function() {
},
options: {
showLine: true,
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false
+ },
elements: {
point: {
backgroundColor: 'red',
@@ -167,8 +169,10 @@ describe('Chart.contr... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.polarArea.tests.js | @@ -87,8 +87,10 @@ describe('Chart.controllers.polarArea', function() {
},
options: {
showLine: true,
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false
+ },
elements: {
arc: {
backgroundColor: 'rgb(255, 0, 0)',
@@ -154,8 +156,10 @@ describe(... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/controller.radar.tests.js | @@ -85,8 +85,10 @@ describe('Chart.controllers.radar', function() {
},
options: {
showLine: true,
- legend: false,
- title: false,
+ plugins: {
+ legend: false,
+ title: false,
+ },
elements: {
line: {
backgroundColor: 'rgb(255, 0, 0)', | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/core.controller.tests.js | @@ -153,8 +153,10 @@ describe('Chart', function() {
hover: {
mode: 'dataset',
},
- title: {
- position: 'bottom'
+ plugins: {
+ title: {
+ position: 'bottom'
+ }
}
}
});
@@ -163,7 +165,7 @@ describe('Chart', function() {
expect(options.showLine).toBe(de... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/core.layouts.tests.js | @@ -262,11 +262,9 @@ describe('Chart.layouts', function() {
display: false
}
},
- legend: {
- display: false
- },
- title: {
- display: false
+ plugins: {
+ legend: false,
+ title: false
},
layout: {
padding: 10
@@ -307,11 +305,9 @@ describe('C... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/core.scale.tests.js | @@ -143,8 +143,8 @@ describe('Core.scale', function() {
display: false
}
},
- legend: {
- display: false
+ plugins: {
+ legend: false
}
}
});
@@ -188,8 +188,8 @@ describe('Core.scale', function() {
offset: test.offset
}
},
- legend: {
- ... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/core.ticks.tests.js | @@ -20,8 +20,8 @@ describe('Test tick generators', function() {
}],
},
options: {
- legend: {
- display: false,
+ plugins: {
+ legend: false
},
scales: {
x: {
@@ -61,8 +61,8 @@ describe('Test tick generators', function() {
}],
},
options: {
- legend: {
- di... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/global.defaults.tests.js | @@ -147,12 +147,12 @@ describe('Default Configs', function() {
spyOn(chart, 'update').and.callThrough();
var legendItem = chart.legend.legendItems[0];
- config.legend.onClick(null, legendItem, chart.legend);
+ config.plugins.legend.onClick(null, legendItem, chart.legend);
expect(chart.getDataVisibil... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/plugin.legend.tests.js | @@ -196,8 +196,10 @@ describe('Legend block tests', function() {
labels: []
},
options: {
- legend: {
- reverse: true
+ plugins: {
+ legend: {
+ reverse: true
+ }
}
}
});
@@ -271,11 +273,13 @@ describe('Legend block tests', function() {
labels: []
},
options:... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/plugin.title.tests.js | @@ -252,14 +252,16 @@ describe('Title block tests', function() {
}]
},
options: {
- title: {
- display: true
+ plugins: {
+ title: {
+ display: true
+ }
}
}
});
expect(chart.titleBlock.options.display).toBe(true);
- chart.options.title.display = false;... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/plugin.tooltip.tests.js | @@ -51,9 +51,11 @@ describe('Plugin.Tooltip', function() {
labels: ['Point 1', 'Point 2', 'Point 3']
},
options: {
- tooltips: {
- mode: 'index',
- intersect: false,
+ plugins: {
+ tooltip: {
+ mode: 'index',
+ intersect: false,
+ }
},
hover: {
... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | test/specs/scale.time.tests.js | @@ -1107,7 +1107,9 @@ describe('Time scale tests', function() {
}
}
},
- legend: false
+ plugins: {
+ legend: false
+ }
});
const scale = chart.scales.x;
expect(scale.getPixelForDecimal(0)).toBeCloseToPixel(29); | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | types/core/index.d.ts | @@ -25,7 +25,7 @@ import {
ScaleType
} from '../interfaces';
import { ElementChartOptions } from '../elements';
-import { PluginOptions, PluginChartOptions } from '../plugins';
+import { PluginOptions } from '../plugins';
export interface DateAdapterBase {
/**
@@ -338,7 +338,6 @@ export interface Defaults exte... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | types/interfaces.d.ts | @@ -22,7 +22,7 @@ import {
} from './controllers';
import { CoreChartOptions } from './core/interfaces';
import { ElementChartOptions } from './elements';
-import { FillerControllerDatasetOptions, PluginChartOptions } from './plugins';
+import { FillerControllerDatasetOptions } from './plugins';
import { Plugin } f... | true |
Other | chartjs | Chart.js | 913a01a3a629c5249850c66857ca5f7c76b9f322.json | Move title, tooltip and legend to options.plugins (#8089)
* Move title, tooltip and legend to options.plugins
* Update tooltip.md
* Update legend.md and title.md
* Add migration notes
* typo
* Types
* Restore plurals
* One more s, restore tabs
* All plugins disabled
* lint
* cc | types/plugins/index.d.ts | @@ -201,10 +201,6 @@ export interface LegendOptions {
};
}
-export interface LegendChartOptions {
- legend: LegendOptions;
-}
-
export const Title: Plugin;
export interface TitleOptions {
@@ -235,10 +231,6 @@ export interface TitleOptions {
text: string | string[];
}
-export interface TitleChartOptions... | true |
Other | chartjs | Chart.js | 2efffb8ae4b86045100252186cadaf41a1b1d93e.json | Improve test coverage (#8087)
* Remove usage of currentStyle (IE only)
* Nothing is registered in root scope anymore
* Add some more tests for animations
* Add some more tests to defaults | src/core/core.typedRegistry.js | @@ -70,8 +70,6 @@ export default class TypedRegistry {
if (scope && id in defaults[scope]) {
delete defaults[scope][id];
- } else if (id in defaults) {
- delete defaults[id];
}
}
} | true |
Other | chartjs | Chart.js | 2efffb8ae4b86045100252186cadaf41a1b1d93e.json | Improve test coverage (#8087)
* Remove usage of currentStyle (IE only)
* Nothing is registered in root scope anymore
* Add some more tests for animations
* Add some more tests to defaults | src/helpers/helpers.dom.js | @@ -34,9 +34,7 @@ function parseMaxStyle(styleValue, node, parentProperty) {
const getComputedStyle = (element) => window.getComputedStyle(element, null);
export function getStyle(el, property) {
- return el.currentStyle ?
- el.currentStyle[property] :
- getComputedStyle(el).getPropertyValue(property);
+ return g... | true |
Other | chartjs | Chart.js | 2efffb8ae4b86045100252186cadaf41a1b1d93e.json | Improve test coverage (#8087)
* Remove usage of currentStyle (IE only)
* Nothing is registered in root scope anymore
* Add some more tests for animations
* Add some more tests to defaults | test/specs/core.animations.tests.js | @@ -44,6 +44,23 @@ describe('Chart.animations', function() {
})).toBeUndefined();
});
+ it('should assing options directly, if target does not have previous options', function() {
+ const chart = {};
+ const anims = new Chart.Animations(chart, {option: {duration: 200}});
+ const target = {};
+ expect(anims.u... | true |
Other | chartjs | Chart.js | 2efffb8ae4b86045100252186cadaf41a1b1d93e.json | Improve test coverage (#8087)
* Remove usage of currentStyle (IE only)
* Nothing is registered in root scope anymore
* Add some more tests for animations
* Add some more tests to defaults | test/specs/core.defaults.tests.js | @@ -0,0 +1,38 @@
+describe('Chart.defaults', function() {
+ describe('.set', function() {
+ it('Should set defaults directly to root when scope is not provided', function() {
+ expect(Chart.defaults.test).toBeUndefined();
+ Chart.defaults.set({test: true});
+ expect(Chart.defaults.test).toEqual(true);
+ delete... | true |
Other | chartjs | Chart.js | f96fa2b96dc3e5a0b55a95351fe7bf80876873d4.json | Allow single parameter to Defaults.set (#8050)
* Allow single parameter to Defaults.set
* Review update
* Record | src/core/core.defaults.js | @@ -59,14 +59,21 @@ export class Defaults {
this.scales = {};
this.controllers = {};
}
+
/**
- * @param {string} scope
- * @param {*} values
+ * @param {string|object} scope
+ * @param {object} [values]
*/
set(scope, values) {
- return merge(getScope(this, scope), values);
+ if (typeof scope === 's... | true |
Other | chartjs | Chart.js | f96fa2b96dc3e5a0b55a95351fe7bf80876873d4.json | Allow single parameter to Defaults.set (#8050)
* Allow single parameter to Defaults.set
* Review update
* Record | types/core/index.d.ts | @@ -333,6 +333,7 @@ export interface DatasetControllerChartComponent extends ChartComponent {
};
}
+export type AnyObject = Record<string, unknown>;
export interface Defaults extends CoreChartOptions, ElementChartOptions {
controllers: {
[key in ChartType]: DeepPartial<
@@ -352,8 +353,9 @@ export interface D... | true |
Other | chartjs | Chart.js | 065fc117afd342e1cf0f896d208c540caca76922.json | Fix url bug (#8072) | docs/docs/charts/polar.mdx | @@ -116,7 +116,7 @@ These are the customisation options specific to Polar Area charts. These options
| `animation.animateRotate` | `boolean` | `true` | If true, the chart will animate in with a rotation animation. This property is in the `options.animation` object.
| `animation.animateScale` | `boolean` | `true` | If... | false |
Other | chartjs | Chart.js | 200c04db99ceec68272eeec57609739be47c940b.json | fix broken url in docs (#8070) | docs/docs/axes/cartesian/timeseries.md | @@ -22,4 +22,4 @@ var chart = new Chart(ctx, {
## More details
-Please see [the time scale documentation](./time.md) for all other details.
+Please see [the time scale documentation](./time.mdx) for all other details. | true |
Other | chartjs | Chart.js | 200c04db99ceec68272eeec57609739be47c940b.json | fix broken url in docs (#8070) | docs/docs/axes/radial/index.md | @@ -4,4 +4,4 @@ title: Radial Axes
Radial axes are used specifically for the radar and polar area chart types. These axes overlay the chart area, rather than being positioned on one of the edges. One radial axis is included by default in Chart.js.
-* [radialLinear](./linear.md#linear-radial-axis)
+* [radialLinear]... | true |
Other | chartjs | Chart.js | 7610def1c4709467b2a9136e62a8e54d1a529aef.json | Remove set-env from actions (#8063)
* Remove set-env from CI
* Eanble macOs
* Another try on macOs, update npmpublish
* No xvfb-run on macOs
* Remove macos | .github/workflows/ci.yml | @@ -23,27 +23,18 @@ jobs:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- - name: Setup xvfb
- run: |
- Xvfb :99 -screen 0 1024x768x24 &
- echo "::set-env name=DISPLAY:::99.0"
- if: runner.os == 'Linux'
- - name: Install chrome
- run: |
-... | true |
Other | chartjs | Chart.js | 7610def1c4709467b2a9136e62a8e54d1a529aef.json | Remove set-env from actions (#8063)
* Remove set-env from CI
* Eanble macOs
* Another try on macOs, update npmpublish
* No xvfb-run on macOs
* Remove macos | .github/workflows/npmpublish.yml | @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.trim.outputs.version }}
- steps:
+ steps:
- id: trim
run: echo "::set-output name=version::${TAG:1}"
- env:
+ env:
TAG: ${{ github.event.release.tag_name }}
test:
@@ -24,14... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/_common.md | @@ -0,0 +1,14 @@
+### Common to all axes
+
+| Name | Type | Default | Description
+| ---- | ---- | ------- | -----------
+| `type` | `string` | | Type of scale being employed. Custom scales can be created and registered with a string key. This allows changing the type of an axis for a chart.
+| `display` | `boolean`\|`... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/_common_ticks.md | @@ -0,0 +1,10 @@
+### Common to all axes
+
+| Name | Type | Scriptable | Default | Description
+| ---- | ---- | :-------------------------------: | ------- | -----------
+| `callback` | `function` | | | Returns the string representation of the tick value as it should be displayed on the chart. See [callback](../axes/la... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/_common.md | @@ -0,0 +1,9 @@
+### Common options to all cartesian axes
+
+| Name | Type | Default | Description
+| ---- | ---- | ------- | -----------
+| `bounds` | `string` | `'ticks'` | Determines the scale bounds. [more...](./index.mdx#scale-bounds)
+| `position` | `string` | | Position of the axis. [more...](./index.mdx#axis-po... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/_common_ticks.md | @@ -0,0 +1,14 @@
+### Common options to all cartesian axes
+
+| Name | Type | Default | Description
+| ---- | ---- | ------- | -----------
+| `align` | `string` | `'center'` | The tick alignment along the axis. Can be `'start'`, `'center'`, or `'end'`.
+| `crossAlign` | `string` | `'near'` | The tick alignment perpendi... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/category.mdx | @@ -2,6 +2,11 @@
title: Category Axis
---
+import CommonAll from '../_common.md'
+import CommonCartesian from './_common.md'
+import CommonTicks from './_common_ticks.md'
+import CommonTicksAll from '../_common_ticks.md'
+
If the global configuration is used, labels are drawn from one of the label arrays included ... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/index.mdx | @@ -2,30 +2,26 @@
title: Cartesian Axes
---
+import CommonAll from '../_common.md'
+import CommonCartesian from './_common.md'
+import CommonTicks from './_common_ticks.md'
+import CommonTicksAll from '../_common_ticks.md'
+
import { useEffect } from 'react';
Axes that follow a cartesian grid are known as 'Cart... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/linear.md | @@ -1,86 +0,0 @@
----
-title: Linear Axis
----
-
-The linear scale is used to chart numerical data. It can be placed on either the x or y-axis. The scatter chart type automatically configures a line chart to use one of these scales for the x-axis. As the name suggests, linear interpolation is used to determine where a ... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/linear.mdx | @@ -0,0 +1,59 @@
+---
+title: Linear Axis
+---
+
+import CommonAll from '../_common.md'
+import CommonCartesian from './_common.md'
+import CommonTicks from './_common_ticks.md'
+import CommonTicksAll from '../_common_ticks.md'
+
+The linear scale is used to chart numerical data. It can be placed on either the x or y-a... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/logarithmic.md | @@ -1,26 +0,0 @@
----
-title: Logarithmic Axis
----
-
-The logarithmic scale is used to chart numerical data. It can be placed on either the x or y-axis. As the name suggests, logarithmic interpolation is used to determine where a value lies on the axis.
-
-## Configuration Options
-
-These options extend the [common c... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/logarithmic.mdx | @@ -0,0 +1,30 @@
+---
+title: Logarithmic Axis
+---
+
+import CommonAll from '../_common.md'
+import CommonCartesian from './_common.md'
+import CommonTicks from './_common_ticks.md'
+import CommonTicksAll from '../_common_ticks.md'
+
+The logarithmic scale is used to chart numerical data. It can be placed on either th... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/cartesian/time.mdx | @@ -2,6 +2,10 @@
title: Time Cartesian Axis
---
+import CommonAll from '../_common.md'
+import CommonCartesian from './_common.md'
+import CommonTicks from './_common_ticks.md'
+
The time scale is used to display times and dates. Data are spread according to the amount of time between data points. When building it... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/index.mdx | @@ -2,9 +2,12 @@
title: Axes
---
-Axes are an integral part of a chart. They are used to determine how data maps to a pixel value on the chart. In a cartesian chart, there is 1 or more X-axis and 1 or more Y-axis to map points onto the 2-dimensional canvas. These axes are known as ['cartesian axes'](./cartesian/ind... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/radial/linear.mdx | @@ -2,29 +2,28 @@
title: Linear Radial Axis
---
+import CommonAll from '../_common.md'
+import CommonTicksAll from '../_common_ticks.md'
+
The linear radial scale is used to chart numerical data. As the name suggests, linear interpolation is used to determine where a value lies in relation to the center of the axi... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/axes/styling.mdx | @@ -38,16 +38,7 @@ The scriptable context has the following form:
## Tick Configuration
-The tick configuration is nested under the scale configuration in the `ticks` key. It defines options for the tick marks that are generated by the axis.
-
-| Name | Type | Scriptable | Default | Description
-| ---- | ---- | :-... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/docs/general/fonts.md | @@ -32,8 +32,8 @@ let chart = new Chart(ctx, {
| `style` | `string` | `'normal'` | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
| `weight` | `string` | `undefined` | Default font weight (b... | true |
Other | chartjs | Chart.js | ed846f62f7ef61cdc9bf3855506b2bcaeb5fc91b.json | Update axis documentation (#8061) | docs/sidebars.js | @@ -49,7 +49,8 @@ module.exports = {
'axes/cartesian/category',
'axes/cartesian/linear',
'axes/cartesian/logarithmic',
- 'axes/cartesian/time'
+ 'axes/cartesian/time',
+ 'axes/cartesian/timeseries'
]},
{Radial: [
'axes/radial/index', | true |
Other | chartjs | Chart.js | 988c86559924d412139aab71a60a616c6f718955.json | Add plugins to CoreChartOptions (#8048) | types/core/interfaces.d.ts | @@ -1,6 +1,7 @@
import { Chart, Element, InteractionMode } from '.';
import { ChartDataset } from '../interfaces';
import { ParsingOptions } from '../controllers';
+import { PluginOptions } from '../plugins';
export type Color = string | CanvasGradient | CanvasPattern;
@@ -155,6 +156,8 @@ export interface CoreC... | false |
Other | chartjs | Chart.js | fde84f272acf441fbfb8d51931c2484e1d34c805.json | Chart.register: preserve existing defaults (#8052) | src/core/core.typedRegistry.js | @@ -42,10 +42,6 @@ export default class TypedRegistry {
return scope;
}
- if (Object.keys(defaults.get(scope)).length) {
- throw new Error('Can not register "' + id + '", because "defaults.' + scope + '" would collide with existing defaults');
- }
-
items[id] = item;
registerDefaults(item, scope, par... | true |
Other | chartjs | Chart.js | fde84f272acf441fbfb8d51931c2484e1d34c805.json | Chart.register: preserve existing defaults (#8052) | test/specs/core.registry.tests.js | @@ -284,14 +284,18 @@ describe('Chart.registry', function() {
expect(afterUnregisterCount).withContext('afterUnregister').toBe(4);
});
- it('should not register anything that would collide with existing defaults', function() {
- Chart.defaults.controllers.test = {test: true};
+ it('should preserve existing defa... | true |
Other | chartjs | Chart.js | 7718d5fd56e14ac26af14f8c74aaeb5cbfcd32ee.json | Fix broken link (#8041) | samples/samples.js | @@ -195,7 +195,7 @@
path: 'tooltips/positioning.html'
}, {
title: 'Custom Positioning',
- path: 'tooltips/position-custom.html'
+ path: 'tooltips/positioning-custom.html'
}, {
title: 'Interactions',
path: 'tooltips/interactions.html' | false |
Other | chartjs | Chart.js | d063f654cfd1b2f4e17f9bcd810680fcb5efbded.json | Fix import names in integration example (#8039) | docs/docs/getting-started/integration.md | @@ -25,9 +25,9 @@ var myChart = new Chart(ctx, {...});
Chart.js 3 is tree-shakeable, so it is necessary to import and register the controllers, elements, scales and plugins you are going to use.
```javascript
-import { Chart, LineController, Line, Point, LinearScale, CategoryScale, Title, Tooltip, Filler, Legend } ... | false |
Other | chartjs | Chart.js | e00dc1e9147057db0e1b034f060440fa983b478e.json | Improve helpers.color test coverage (#8034) | test/specs/helpers.color.tests.js | @@ -11,6 +11,14 @@ describe('Color helper', function() {
});
describe('Background hover color helper', function() {
+ it('should return a modified version of color when called with a color', function() {
+ var originalColorRGB = 'rgb(70, 191, 189)';
+
+ expect(getHoverColor('#46BFBD')).not.toEqual(originalColorRG... | false |
Other | chartjs | Chart.js | 183637b87f928c3d62991de764d15228f1a19338.json | Add tests and clean up resolveObjectKey helper (#8028)
* Add tests and clean up resolveObjectKey helper
* Change the optimized path to comply with thests | src/helpers/helpers.core.js | @@ -274,17 +274,21 @@ export function _deprecated(scope, value, previous, current) {
}
export function resolveObjectKey(obj, key) {
- if (key.length < 3) {
- return obj[key];
+ // Special cases for `x` and `y` keys. It's quite a lot faster to aceess this way.
+ // Those are the default keys Chart.js is resolving, ... | true |
Other | chartjs | Chart.js | 183637b87f928c3d62991de764d15228f1a19338.json | Add tests and clean up resolveObjectKey helper (#8028)
* Add tests and clean up resolveObjectKey helper
* Change the optimized path to comply with thests | test/specs/helpers.core.tests.js | @@ -374,4 +374,87 @@ describe('Chart.helpers.core', function() {
expect(output.o.a).not.toBe(a1);
});
});
+
+ describe('resolveObjectKey', function() {
+ it('should resolve empty key to root object', function() {
+ const obj = {test: true};
+ expect(helpers.resolveObjectKey(obj, '')).toEqual(obj);
+ });
... | true |
Other | chartjs | Chart.js | 3f413c7bcf40e1dcda2982105917fd5fd271f711.json | Fix inconsistency in types for LABEL (#8027)
Co-authored-by: Sergey Khomushin <sergey@placer.io> | types/core/index.d.ts | @@ -172,7 +172,7 @@ export interface ActiveElement extends ActiveDataPoint {
export declare class Chart<
TYPE extends ChartType = ChartType,
DATA extends unknown[] = DefaultDataPoint<TYPE>,
- LABEL = string
+ LABEL = unknown
> {
readonly platform: BasePlatform;
readonly id: string; | true |
Other | chartjs | Chart.js | 3f413c7bcf40e1dcda2982105917fd5fd271f711.json | Fix inconsistency in types for LABEL (#8027)
Co-authored-by: Sergey Khomushin <sergey@placer.io> | types/interfaces.d.ts | @@ -175,7 +175,7 @@ export interface ChartData<
export interface ChartConfiguration<
TYPE extends ChartType = ChartType,
DATA extends unknown[] = DefaultDataPoint<TYPE>,
- LABEL = string
+ LABEL = unknown
> {
type: TYPE;
data: ChartData<TYPE, DATA, LABEL>; | true |
Other | chartjs | Chart.js | 91fec4a3970a91baa534c585f4301aebfb18ee37.json | Bubble: Use point.size() in getMaxOverflow (#8018) | src/controllers/controller.bubble.js | @@ -34,10 +34,10 @@ export default class BubbleController extends DatasetController {
getMaxOverflow() {
const me = this;
const meta = me._cachedMeta;
- let i = (meta.data || []).length - 1;
+ const data = meta.data;
let max = 0;
- for (; i >= 0; --i) {
- max = Math.max(max, me.getStyle(i, true).radius)... | false |
Other | chartjs | Chart.js | d74a5d7552c8cecd895de1edb92ed7e54a8250a0.json | Add type to context objects (#8007) | docs/docs/general/options.md | @@ -54,6 +54,7 @@ The context object contains the following properties:
### chart
- `chart`: the associated chart
+- `type`: `'chart'`
### dataset
@@ -63,6 +64,7 @@ In addition to [chart](#chart)
- `dataset`: dataset at index `datasetIndex`
- `datasetIndex`: index of the current dataset
- `index`: getter fo... | true |
Other | chartjs | Chart.js | d74a5d7552c8cecd895de1edb92ed7e54a8250a0.json | Add type to context objects (#8007) | src/core/core.controller.js | @@ -735,6 +735,9 @@ class Chart {
return this.$context || (this.$context = Object.create(null, {
chart: {
value: this
+ },
+ type: {
+ value: 'chart'
}
}));
} | true |
Other | chartjs | Chart.js | d74a5d7552c8cecd895de1edb92ed7e54a8250a0.json | Add type to context objects (#8007) | src/core/core.datasetController.js | @@ -164,6 +164,9 @@ function createDatasetContext(parent, index, dataset) {
get() {
return this.datasetIndex;
}
+ },
+ type: {
+ value: 'dataset'
}
});
}
@@ -187,6 +190,9 @@ function createDataContext(parent, index, point, element) {
get() {
return this.dataIndex;
}
+ },
+ type: {
... | true |
Other | chartjs | Chart.js | d74a5d7552c8cecd895de1edb92ed7e54a8250a0.json | Add type to context objects (#8007) | src/core/core.scale.js | @@ -274,6 +274,9 @@ function createScaleContext(parent, scale) {
scale: {
value: scale
},
+ type: {
+ value: 'scale'
+ }
});
}
@@ -284,6 +287,9 @@ function createTickContext(parent, index, tick) {
},
index: {
value: index
+ },
+ type: {
+ value: 'tick'
}
});
} | true |
Other | chartjs | Chart.js | aae53c835e51be732b6600d7cd982de5a5f28312.json | Use same merging logic for init and update (#8006)
* Use same merging logic for init and update
* Add test | src/core/core.config.js | @@ -101,25 +101,12 @@ function mergeConfig(...args/* config objects ... */) {
});
}
-function includeDefaults(options, type) {
- return mergeConfig(
+function includeDefaults(config, options) {
+ const scaleConfig = mergeScaleConfig(config, options);
+ options = mergeConfig(
defaults,
- defaults.controllers[ty... | true |
Other | chartjs | Chart.js | aae53c835e51be732b6600d7cd982de5a5f28312.json | Use same merging logic for init and update (#8006)
* Use same merging logic for init and update
* Add test | test/specs/core.controller.tests.js | @@ -355,6 +355,28 @@ describe('Chart', function() {
});
});
+ describe('Updating options', function() {
+ it('update should result to same set of options as construct', function() {
+ var chart = acquireChart({
+ type: 'line',
+ data: [],
+ options: {
+ animation: false,
+ locale: 'en-US',
+ ... | true |
Other | chartjs | Chart.js | aae53c835e51be732b6600d7cd982de5a5f28312.json | Use same merging logic for init and update (#8006)
* Use same merging logic for init and update
* Add test | test/utils.js | @@ -58,7 +58,6 @@ function acquireChart(config, options) {
config.options = config.options || {};
config.options.animation = config.options.animation === undefined ? false : config.options.animation;
config.options.responsive = config.options.responsive === undefined ? false : config.options.responsive;
- config.... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | .editorconfig | @@ -16,3 +16,7 @@ indent_size = 2
[*.json]
indent_style = space
indent_size = 2
+
+[*.mdx]
+indent_style = space
+indent_size = 2 | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/axes/cartesian/index.mdx | @@ -111,7 +111,8 @@ function exampleAlignment() {
}
}
};
- new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-1').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="chartjs-... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/bar.mdx | @@ -53,7 +53,8 @@ export const ExampleChart0 = () => {
}
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="cha... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/bubble.mdx | @@ -26,7 +26,8 @@ export const ExampleChart = () => {
}]
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="cha... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/doughnut.mdx | @@ -47,7 +47,8 @@ function example() {
}]
}
};
- new Chart(canvas.current.getContext('2d'), cfg);
+ const chart = new Chart(canvas.current.getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="chartjs-wrapper"><canvas ref={canvas} className="chartjs"></ca... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/line.mdx | @@ -31,7 +31,8 @@ export const ExampleChart = () => {
options: {
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div classNam... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/mixed.mdx | @@ -60,7 +60,8 @@ export const ExampleChart = () => {
}
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="char... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/polar.mdx | @@ -33,7 +33,8 @@ export const ExampleChart = () => {
}]
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="cha... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/radar.mdx | @@ -55,7 +55,8 @@ export const ExampleChart = () => {
}
}
};
- new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ const chart = new Chart(document.getElementById('chartjs-0').getContext('2d'), cfg);
+ return () => chart.destroy();
});
return <div className="char... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/scatter.md | @@ -1,56 +0,0 @@
----
-title: Scatter Chart
----
-
-Scatter charts are based on basic line charts with the x axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties. The example below creates a scatter chart with 3 points.
-
-```javascript
-var scatterChart = ... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/charts/scatter.mdx | @@ -0,0 +1,66 @@
+---
+title: Scatter Chart
+---
+
+Scatter charts are based on basic line charts with the x axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties. The example below creates a scatter chart with 3 points.
+
+import { useEffect, useRef } from ... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/configuration/animations.mdx | @@ -50,7 +50,8 @@ function example() {
}
}
};
- new Chart(ctx, cfg);
+ const chart = new Chart(ctx, cfg);
+ return () => chart.destroy();
});
return <div className="chartjs-wrapper"><canvas id="chartjs-a0" className="chartjs"></canvas></div>;
}
@@ -96,7 +97,8 @@ function example()... | true |
Other | chartjs | Chart.js | e277aa4c1fb0dffb7e59c31a4913d78687549a7e.json | Destroy example charts on unmount (#8004)
* Destroy example charts on unmount
* Make scatter live
* Use spaces | docs/docs/getting-started/index.mdx | @@ -25,25 +25,26 @@ import { useEffect } from 'react';
```jsx live
function example() {
useEffect(() => {
- var ctx = document.getElementById('myChart').getContext('2d');
- var chart = new Chart(ctx, {
- // The type of chart we want to create
- type: 'line',
-
- // The data for our dataset
- data: {
- labels... | true |
Other | chartjs | Chart.js | b54679889710aedc0240631de105ae6de6d6040a.json | Change version to 3.0.0-mater and update deps (#7997) | package-lock.json | @@ -1,6 +1,6 @@
{
"name": "chart.js",
- "version": "3.0.0-beta.3",
+ "version": "3.0.0-master",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1937,9 +1937,9 @@
}
},
"@eslint/eslintrc": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/@eslint/esl... | true |
Other | chartjs | Chart.js | b54679889710aedc0240631de105ae6de6d6040a.json | Change version to 3.0.0-mater and update deps (#7997) | 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.3",
+ "version": "3.0.0-master",
"license": "MIT",
"jsdelivr": "dist/chart.min.js",
"unpkg": "dist/chart.min.js",
@@ -48,44 +48,44 @@
... | true |
Other | chartjs | Chart.js | 4daf37e864872d7fe244f17f1820798523d9d043.json | Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc
Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com> | docs/docs/getting-started/v3-migration.md | @@ -366,6 +366,8 @@ The following public APIs were removed.
The following private APIs were removed.
+* `Chart._bufferedRender`
+* `Chart._updating`
* `Chart.data.datasets[datasetIndex]._meta`
* `DatasetController._getIndexScaleId`
* `DatasetController._getIndexScale`
@@ -457,6 +459,7 @@ The APIs listed in this... | true |
Other | chartjs | Chart.js | 4daf37e864872d7fe244f17f1820798523d9d043.json | Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc
Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com> | src/core/core.controller.js | @@ -97,7 +97,6 @@ class Chart {
this.height = height;
this.aspectRatio = height ? width / height : null;
this.options = config.options;
- this._bufferedRender = false;
this._layers = [];
this._metasets = [];
this.boxes = [];
@@ -108,7 +107,6 @@ class Chart {
/** @type {{attach?: function, detach?:... | true |
Other | chartjs | Chart.js | 4daf37e864872d7fe244f17f1820798523d9d043.json | Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc
Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com> | test/specs/core.controller.tests.js | @@ -1289,6 +1289,7 @@ describe('Chart', function() {
var hooks = {
init: [
'beforeInit',
+ 'resize',
'afterInit'
],
update: [ | true |
Other | chartjs | Chart.js | 4daf37e864872d7fe244f17f1820798523d9d043.json | Delay resize to just before draw when animating (#7989)
* Remove unused properties
* Delay resize to just before draw when animating
* Remove silent resize, update migration guide
* Fix typo in migrations doc
Co-authored-by: Evert Timberg <evert.timberg+github@gmail.com> | types/core/index.d.ts | @@ -277,7 +277,7 @@ export declare class Chart<
clear(): this;
stop(): this;
- resize(silent: boolean, width: number, height: number): void;
+ resize(width: number, height: number): void;
ensureScalesHaveIDs(): void;
buildOrUpdateScales(): void;
buildOrUpdateControllers(): void; | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | docs/docs/general/options.md | @@ -37,14 +37,52 @@ color: [
## Option Context
The option context is used to give contextual information when resolving options and currently only applies to [scriptable options](#scriptable-options).
+The object is preserved, so it can be used to store and pass information between calls.
+
+There are multiple leve... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | samples/animations/delay.html | @@ -63,7 +63,6 @@
};
window.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
- var started = {};
window.myBar = new Chart(ctx, {
type: 'bar',
data: barChartData,
@@ -77,9 +76,9 @@
var delay = 0;
var dsIndex = context.datasetIndex;
var ind... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | src/core/core.controller.js | @@ -116,6 +116,7 @@ class Chart {
this._hiddenIndices = {};
this.attached = false;
this._animationsDisabled = undefined;
+ this.$context = undefined;
// Add the chart instance to the global namespace
Chart.instances[me.id] = me;
@@ -712,6 +713,14 @@ class Chart {
return meta;
}
+ getContext() {... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | src/core/core.datasetController.js | @@ -148,6 +148,49 @@ function getFirstScaleId(chart, axis) {
return Object.keys(scales).filter(key => scales[key].axis === axis).shift();
}
+function createDatasetContext(parent, index, dataset) {
+ return Object.create(parent, {
+ active: {
+ writable: true,
+ value: false
+ },
+ dataset: {
+ value: data... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | src/core/core.scale.js | @@ -8,7 +8,7 @@ import Ticks from './core.ticks';
/**
* @typedef { import("./core.controller").default } Chart
- * @typedef {{value:any, label?:string, major?:boolean}} Tick
+ * @typedef {{value:any, label?:string, major?:boolean, $context?:any}} Tick
*/
defaults.set('scale', {
@@ -269,6 +269,25 @@ function s... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | test/fixtures/controller.line/backgroundColor/scriptable.js | @@ -8,7 +8,7 @@ module.exports = {
// option in dataset
data: [4, 5, 10, null, -10, -5],
backgroundColor: function(ctx) {
- var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+ var index = ctx.index;
return index === 0 ? '#ff0000'
: index === 1 ? '#0... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | test/fixtures/controller.line/borderColor/scriptable.js | @@ -8,7 +8,7 @@ module.exports = {
// option in dataset
data: [4, 5, 10, null, -10, -5],
borderColor: function(ctx) {
- var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+ var index = ctx.index;
return index === 0 ? '#ff0000'
: index === 1 ? '#00ff0... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | test/fixtures/controller.line/borderWidth/scriptable.js | @@ -9,7 +9,7 @@ module.exports = {
data: [4, 5, 10, null, -10, -5],
borderColor: '#0000ff',
borderWidth: function(ctx) {
- var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+ var index = ctx.index;
return index % 2 ? 10 : 20;
},
pointBorderColor... | true |
Other | chartjs | Chart.js | 23bf7c0c89bd3e5ed4cbc2709a08eac63ad1c67d.json | Preserve scriptable context (#7981)
* Preserve scriptable context
* CC, utilize `index` in tests
* Update example to utilize context | test/fixtures/controller.radar/backgroundColor/scriptable.js | @@ -8,7 +8,7 @@ module.exports = {
// option in dataset
data: [0, 5, 10, null, -10, -5],
backgroundColor: function(ctx) {
- var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+ var index = ctx.index;
return index === 0 ? '#ff0000'
: index === 1 ? '#0... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.