From 8777a1c10efe54ce055f85db3e6bbdff8ef46bb4 Mon Sep 17 00:00:00 2001 From: Linho Date: Fri, 9 May 2025 00:31:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=BA=BF?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/data.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/data.vue b/src/editor/data.vue index d59cb71..38f0493 100644 --- a/src/editor/data.vue +++ b/src/editor/data.vue @@ -147,8 +147,9 @@ watch(fnType, (newFnType) => { graphType: newGraphType, }); }); + watch( - () => self.value.graphType, + () => props.self.graphType, (newGraphType) => { if (newGraphType === "scatter" && "closed" in self.value) self.value.closed = false; From ad8c5deeed032861a1cbe4dd4d0ae194abac1de4 Mon Sep 17 00:00:00 2001 From: Linho Date: Fri, 9 May 2025 00:34:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E5=99=A8=E4=B8=BA=20polyline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/states.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/states.ts b/src/states.ts index 11fef0e..1d6a629 100644 --- a/src/states.ts +++ b/src/states.ts @@ -33,7 +33,7 @@ export const useProfile = defineStore("profile", () => { const importedDatum = importedProfile?.data; const processedDatum = importedDatum ? importedDatum.map(toPrivateData) - : [toPrivateData({ fn: "x^2" })]; + : [toPrivateData({ fn: "x^2", graphType: "polyline" })]; const datum = ref(processedDatum); @@ -42,7 +42,8 @@ export const useProfile = defineStore("profile", () => { .filter(({ hidden }) => !(hidden && forExport)) .map((data) => (data.hidden ? getInvisible() : toPublicData(data))); - const addData = () => datum.value.push(toPrivateData({})); + const addData = () => + datum.value.push(toPrivateData({ graphType: "polyline" })); const importedAnnotations = importedProfile?.annotations; const processedAnnotations = importedAnnotations