@@ -40,8 +40,8 @@ const fullUpdateState = defineModel<boolean>({ required: true });
4040const plotRef = ref <HTMLDivElement >();
4141const errorMsg = ref <string | undefined >(undefined );
4242
43- function findError(graphData : FunctionPlotDatum []) {
44- for (const [index, dataItem] of graphData .entries ()) {
43+ function findError(datum : FunctionPlotDatum []) {
44+ for (const [index, dataItem] of datum .entries ()) {
4545 const fnType = getFnType (dataItem .fnType );
4646 for (const input of fnType .inputs ) if (! dataItem [input .value ]) return index ;
4747 for (const coord of fnType .coord ?? [])
@@ -56,11 +56,12 @@ const { width, height } = useElementSize(plotRef);
5656let unwatchHandler: WatchHandle | null = null ;
5757const emit = defineEmits ([" require-post-update" ]);
5858import functionPlot from " function-plot" ;
59+
5960onMounted (() => {
6061 const handleUpdate = throttle (() => {
6162 if (import .meta .env .DEV ) console .log (" graph update" );
62- const graphData = profile .getOriginalData ();
63- const flag = findError (graphData );
63+ const datum = profile .getPublicDatum ();
64+ const flag = findError (datum );
6465 if (flag ) {
6566 errorMsg .value = ` Invalid input in function ${flag + 1 } ` ;
6667 return ;
@@ -69,11 +70,11 @@ onMounted(() => {
6970 if (! plotRef .value ) throw new Error (" plotRef is null" );
7071 functionPlot ({
7172 target: plotRef .value ,
72- data: graphData ,
73+ data: datum ,
7374 width: width .value ,
7475 height: height .value ,
75- annotations: profile .getOriginalAnnotaion (),
76- ... profile .getOriginalOptions (),
76+ annotations: profile .getPublicAnnotations (),
77+ ... profile .getPublicOptions (),
7778 });
7879 if (fullUpdateState .value ) {
7980 fullUpdateState .value = false ;
0 commit comments