Skip to content

Commit 7459c01

Browse files
committed
点集面板
1 parent 2807d7c commit 7459c01

File tree

10 files changed

+94
-23
lines changed

10 files changed

+94
-23
lines changed

src/editor/data.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ watch(fnType, (newFnType) => {
147147
graphType: newGraphType,
148148
});
149149
});
150+
watch(
151+
() => self.value.graphType,
152+
(newGraphType) => {
153+
if (newGraphType === "scatter" && "closed" in self.value)
154+
self.value.closed = false;
155+
}
156+
);
150157
</script>
151158

152159
<style>

src/editor/inputs/implicit.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="input-inner">
33
<div class="field main-fn">
4-
<FilledTextfield class="styled fn" label="f(x, y)" v-model="self.fn" />
4+
<FunctionField class="styled fn" label="f(x, y)" v-model="self.fn" />
55
<span class="label styled"> =0 </span>
66
</div>
77
<AnimatedFold :folded="props.folded">
@@ -17,7 +17,11 @@
1717
</div>
1818
<div class="switches">
1919
<!-- closed -->
20-
<s-checkbox type="checkbox" v-model.lazy="self.closed">
20+
<s-checkbox
21+
type="checkbox"
22+
v-model.lazy="self.closed"
23+
:disabled="self.graphType === 'scatter'"
24+
>
2125
{{ t("data.more.closed") }}
2226
</s-checkbox>
2327
</div>
@@ -40,7 +44,7 @@ const props = defineProps<{
4044
}>();
4145
const self = toRef(props, "self");
4246
43-
import FilledTextfield from "@/editor/inputs/subblocks/function.vue";
47+
import FunctionField from "@/editor/inputs/subblocks/function.vue";
4448
import AnimatedFold from "@/ui/animated/animatedFold.vue";
4549
import ColorPicker from "./subblocks/colorPicker.vue";
4650
import HelpIcon from "./subblocks/helpIcon.vue";

src/editor/inputs/inputs.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,8 @@
6161
s-checkbox {
6262
margin-left: -10px;
6363
}
64+
s-checkbox[disabled] {
65+
color: var(--s-color-outline);
66+
}
6467
}
6568
}

src/editor/inputs/linear.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="input-inner">
33
<div class="field main-fn">
44
<span class="label styled">y=</span>
5-
<FilledTextfield class="styled fn" label="f(x)" v-model="self.fn" />
5+
<FunctionField class="styled fn" label="f(x)" v-model="self.fn" />
66
</div>
77
<AnimatedFold :folded="props.folded">
88
<s-divider>{{ t("data.more.dividerTitle") }}</s-divider>
@@ -39,7 +39,11 @@
3939
</div>
4040
<div class="switches">
4141
<!-- closed -->
42-
<s-checkbox type="checkbox" v-model.lazy="self.closed">
42+
<s-checkbox
43+
type="checkbox"
44+
v-model.lazy="self.closed"
45+
:disabled="self.graphType === 'scatter'"
46+
>
4347
{{ t("data.more.closed") }}
4448
</s-checkbox>
4549
<!-- skipTip -->
@@ -77,10 +81,10 @@ const props = defineProps<{
7781
}>();
7882
const self = toRef(props, "self");
7983
80-
import FilledTextfield from "./subblocks/function.vue";
84+
import FunctionField from "./subblocks/function.vue";
8185
import HelpIcon from "./subblocks/helpIcon.vue";
8286
import ColorPicker from "./subblocks/colorPicker.vue";
8387
import Domain from "./subblocks/domain.vue";
8488
import DerivatePane from "./subblocks/derivatePane.vue";
85-
import AnimatedFold from "@/ui/animated/animatedFold.vue"
89+
import AnimatedFold from "@/ui/animated/animatedFold.vue";
8690
</script>

src/editor/inputs/parametric.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<div class="input-inner">
33
<div class="field main-fn">
44
<span class="label styled">x=</span>
5-
<FilledTextfield class="styled fn" label="f(t)" v-model="self.x" />
5+
<FunctionField class="styled fn" label="f(t)" v-model="self.x" />
66
</div>
77
<div class="field main-fn">
88
<span class="label styled">y=</span>
9-
<FilledTextfield class="styled fn" label="g(t)" v-model="self.y" />
9+
<FunctionField class="styled fn" label="g(t)" v-model="self.y" />
1010
</div>
1111
<AnimatedFold :folded="props.folded">
1212
<s-divider>{{ t("data.more.dividerTitle") }}</s-divider>
@@ -34,7 +34,11 @@
3434
</div>
3535
<div class="switches">
3636
<!-- closed -->
37-
<s-checkbox type="checkbox" v-model.lazy="self.closed">
37+
<s-checkbox
38+
type="checkbox"
39+
v-model.lazy="self.closed"
40+
:disabled="self.graphType === 'scatter'"
41+
>
3842
{{ t("data.more.closed") }}
3943
</s-checkbox>
4044
</div>
@@ -50,7 +54,7 @@ import { useI18n } from "vue-i18n";
5054
import { I18nSchema } from "@/i18n";
5155
const { t } = useI18n<{ message: I18nSchema }>();
5256
53-
import FilledTextfield from "@/editor/inputs/subblocks/function.vue";
57+
import FunctionField from "@/editor/inputs/subblocks/function.vue";
5458
import HelpIcon from "./subblocks/helpIcon.vue";
5559
import ColorPicker from "./subblocks/colorPicker.vue";
5660
import Domain from "./subblocks/domain.vue";

src/editor/inputs/points.vue

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
<template>
2-
<PointsInput v-model="self.points" />
3-
<s-divider>{{ t("title.moreOptions") }}</s-divider>
2+
<div class="input-inner">
3+
<PointsInput v-model="self.points" />
4+
<AnimatedFold :folded="props.folded">
5+
<s-divider>{{ t("data.more.dividerTitle") }}</s-divider>
6+
<div class="input-inner-optional">
7+
<div class="fields">
8+
<!-- color -->
9+
<span class="label">
10+
{{ t("data.more.color") }}
11+
<HelpIcon> {{ t("data.more.colorHelp") }} </HelpIcon>
12+
</span>
13+
<ColorPicker v-model="self.color" />
14+
</div>
15+
<div class="switches">
16+
<!-- closed -->
17+
<s-checkbox
18+
type="checkbox"
19+
v-model.lazy="self.closed"
20+
:disabled="self.graphType === 'scatter'"
21+
>
22+
{{ t("data.more.closed") }}
23+
</s-checkbox>
24+
</div>
25+
</div>
26+
</AnimatedFold>
27+
</div>
428
</template>
529

630
<script setup lang="ts">
@@ -17,4 +41,8 @@ const props = defineProps<{
1741
index: number;
1842
}>();
1943
const self = toRef(props, "self");
44+
45+
import HelpIcon from "./subblocks/helpIcon.vue";
46+
import ColorPicker from "./subblocks/colorPicker.vue";
47+
import AnimatedFold from "@/ui/animated/animatedFold.vue";
2048
</script>

src/editor/inputs/polar.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="input-inner">
33
<div class="field main-fn">
44
<span class="label styled">ρ=</span>
5-
<FilledTextfield
5+
<FunctionField
66
class="styled fn"
77
ref="inputBox"
88
label="f(θ)"
@@ -35,7 +35,11 @@
3535
</div>
3636
<div class="switches">
3737
<!-- closed -->
38-
<s-checkbox type="checkbox" v-model.lazy="self.closed">
38+
<s-checkbox
39+
type="checkbox"
40+
v-model.lazy="self.closed"
41+
:disabled="self.graphType === 'scatter'"
42+
>
3943
{{ t("data.more.closed") }}
4044
</s-checkbox>
4145
</div>
@@ -46,7 +50,7 @@
4650

4751
<script setup lang="ts">
4852
import { PrivateDataTypes } from "@/types/data";
49-
import FilledTextfield from "@/editor/inputs/subblocks/function.vue";
53+
import FunctionField from "@/editor/inputs/subblocks/function.vue";
5054
import { toRef } from "vue";
5155
import { useI18n } from "vue-i18n";
5256
import { I18nSchema } from "@/i18n";

src/editor/inputs/subblocks/pointsInput.vue

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@
2828
>
2929
</s-text-field>
3030
<span class="coord-label">)</span>
31-
<s-icon-button @click="privateData.splice(index, 1)">
32-
<SIconDelete />
33-
</s-icon-button>
31+
<s-tooltip>
32+
<s-icon-button slot="trigger" @click="privateData.splice(index, 1)">
33+
<SIconDelete />
34+
</s-icon-button>
35+
{{ t("data.points.delete") }}
36+
</s-tooltip>
3437
</div>
3538
</AnimatedListItem>
3639
</AnimatedList>
@@ -45,7 +48,7 @@
4548
})
4649
"
4750
>
48-
<s-icon slot="start" name="add"></s-icon> {{ t("buttons.addPoint") }}
51+
<s-icon slot="start" name="add"></s-icon> {{ t("data.points.add") }}
4952
</s-button>
5053
</template>
5154

@@ -86,11 +89,16 @@ watch(
8689
);
8790
</script>
8891

89-
<style>
92+
<style lang="scss">
9093
.coordarr {
9194
position: relative;
9295
align-items: center;
9396
display: flex;
97+
gap: 0.3em;
98+
font-size: 16px;
99+
.coord-label {
100+
font-size: 20px;
101+
}
94102
}
95103
96104
.coordarr-wrapper {
@@ -113,6 +121,7 @@ watch(
113121
background: var(--s-color-outline-variant);
114122
z-index: 999;
115123
}
124+
116125
.add-coord {
117126
margin-left: 25px;
118127
width: fit-content;

src/i18n/en-US.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,18 @@
8080
"point": "Position",
8181
"followMouse": "Dynamic",
8282
"manual": "Specify Point",
83-
"sepcify":"Point Abscissa",
83+
"sepcify": "Point Abscissa",
8484
"xcoord": "Abscissa"
8585
},
8686
"secant": {
8787
"title": "Secant Settings",
8888
"enable": "Enable Secant Display",
8989
"followMouse": "Dynamic",
9090
"add": "Add Secant"
91+
},
92+
"points": {
93+
"add": "Add Point",
94+
"delete": "Delete Point"
9195
}
9296
},
9397
"annotation": {

src/i18n/zh-CN.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,18 @@
8080
"point": "切点位置",
8181
"followMouse": "跟随鼠标",
8282
"manual": "指定切点",
83-
"sepcify":"切点横坐标",
83+
"sepcify": "切点横坐标",
8484
"xcoord": "横坐标"
8585
},
8686
"secant": {
8787
"title": "割线设置",
8888
"enable": "启用割线显示",
8989
"followMouse": "跟随鼠标",
9090
"add": "添加割线"
91+
},
92+
"points": {
93+
"add": "添加点",
94+
"delete": "删除点"
9195
}
9296
},
9397
"annotation": {

0 commit comments

Comments
 (0)