Skip to content

Commit d6e5506

Browse files
authored
feat: update mode prop (#65)
1 parent ec905cc commit d6e5506

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.size-limit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"path": "dist/index.cjs",
4-
"limit": "2.7 KB",
4+
"limit": "2.75 KB",
55
"webpack": false,
66
"running": false
77
},

src/Chart.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
};
2828
export let options: $$Props['options'] = {};
2929
export let plugins: $$Props['plugins'] = [];
30+
export let updateMode: $$Props['updateMode'] = undefined;
3031
export let chart: $$Props['chart'] = null;
3132
let canvasRef: HTMLCanvasElement;
3233
let props = clean($$props);
@@ -45,7 +46,7 @@
4546
4647
chart.data = data;
4748
chart.options = options;
48-
chart.update();
49+
chart.update(updateMode);
4950
});
5051
5152
onDestroy(() => {

src/types/chart.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
ChartOptions,
55
DefaultDataPoint,
66
Plugin,
7-
// UpdateMode,
7+
UpdateMode,
88
} from 'chart.js';
99
import type { HTMLAttributes } from './html';
1010

@@ -38,5 +38,5 @@ export interface ChartBaseProps<
3838
* A mode string to indicate transition configuration should be used.
3939
* @see https://www.chartjs.org/docs/latest/developers/api.html#update-mode
4040
*/
41-
// updateMode?: UpdateMode;
41+
updateMode?: UpdateMode;
4242
}

0 commit comments

Comments
 (0)