"lint-js": "eslint samples/**/*.html samples/**/*.js src/**/*.js test/**/*.js",
"lint-md": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules\"",
"lint-tsc": "tsc",
- "lint-types": "eslint types/**/*.d.ts",
+ "lint-types": "eslint types/**/*.d.ts && tsc -p types/tests/",
"lint": "concurrently \"npm:lint-*\"",
"test": "npm run lint && cross-env NODE_ENV=test karma start --auto-watch --single-run --coverage --grep",
"typedoc": "npx typedoc"
}
export type AnimationsSpec = {
- [name: string]: AnimationSpec & {
+ [name: string]: false | AnimationSpec & {
properties: string[];
/**
*
*/
to: Scriptable<Color | number | boolean, ScriptableContext>;
- } | false
+ }
}
export type TransitionSpec = {
}
export type AnimationOptions = {
- animation: AnimationSpec & {
+ animation: false | AnimationSpec & {
/**
* Callback called on each step of an animation.
*/
--- /dev/null
+import { Chart } from '../index.esm';
+
+const chart = new Chart('id', {
+ type: 'bar',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ animation: false,
+ animations: {
+ colors: false,
+ numbers: {
+ properties: ['a', 'b'],
+ type: 'number',
+ from: 0,
+ to: 10,
+ delay: (ctx) => ctx.dataIndex * 100,
+ duration: (ctx) => ctx.datasetIndex * 1000,
+ loop: true,
+ easing: 'linear'
+ }
+ },
+ transitions: {
+ show: {
+ animation: {
+ duration: 10
+ },
+ animations: {
+ numbers: false
+ }
+ },
+ custom: {
+ animation: {
+ duration: 10
+ }
+ }
+ }
+ },
+});
--- /dev/null
+{
+ "compilerOptions": {
+ "target": "ES6",
+ "moduleResolution": "Node",
+ "alwaysStrict": true,
+ "noEmit": true
+ },
+ "include": [
+ "*.ts",
+ "../index.esm.d.ts"
+ ]
+}