Skip to content

Commit

Permalink
feat: update mode prop (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Aug 17, 2022
1 parent ec905cc commit d6e5506
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"path": "dist/index.cjs",
"limit": "2.7 KB",
"limit": "2.75 KB",
"webpack": false,
"running": false
},
Expand Down
3 changes: 2 additions & 1 deletion src/Chart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
};
export let options: $$Props['options'] = {};
export let plugins: $$Props['plugins'] = [];
export let updateMode: $$Props['updateMode'] = undefined;
export let chart: $$Props['chart'] = null;
let canvasRef: HTMLCanvasElement;
let props = clean($$props);
Expand All @@ -45,7 +46,7 @@
chart.data = data;
chart.options = options;
chart.update();
chart.update(updateMode);
});
onDestroy(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/types/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
ChartOptions,
DefaultDataPoint,
Plugin,
// UpdateMode,
UpdateMode,
} from 'chart.js';
import type { HTMLAttributes } from './html';

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

0 comments on commit d6e5506

Please sign in to comment.