File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ function findError(graphData: FunctionPlotDatum[]) {
5656
5757let unwatchHandler: WatchHandle | null = null ;
5858const emit = defineEmits ([" require-post-update" ]);
59- onMounted ( async () => {
60- const functionPlot = ( await import ( " function-plot " )). default ;
59+ import functionPlot from " function-plot " ;
60+ onMounted (() => {
6161 const handleUpdate = throttle (() => {
6262 if (import .meta .env .DEV ) console .log (" graph update" );
6363 const graphData = profile .getOriginalData ();
@@ -67,15 +67,15 @@ onMounted(async () => {
6767 return ;
6868 }
6969 try {
70- plotRef .value &&
71- functionPlot ({
72- target: plotRef .value ,
73- data: < FunctionPlotDatum []> graphData ,
74- width: width - 20 ,
75- height: height - 20 ,
76- annotations: profile .getOriginalAnnotaion (),
77- ... profile .getOriginalOptions (),
78- });
70+ if ( ! plotRef .value ) throw new Error ( " plotRef is null " );
71+ functionPlot ({
72+ target: plotRef .value ,
73+ data: graphData ,
74+ width: width - 20 ,
75+ height: height - 20 ,
76+ annotations: profile .getOriginalAnnotaion (),
77+ ... profile .getOriginalOptions (),
78+ });
7979 if (fullUpdateState .value ) {
8080 fullUpdateState .value = false ;
8181 emit (" require-post-update" , " once after error" );
You can’t perform that action at this time.
0 commit comments