-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathtreeChartPropertyView.tsx
80 lines (72 loc) · 3.01 KB
/
treeChartPropertyView.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { CompAction } from "lowcoder-core";
import { ChartCompChildrenType } from "./treeChartConstants";
import {
hiddenPropertyView,
Section,
sectionNames,
} from "lowcoder-sdk";
import { trans } from "i18n/comps";
import { examplesUrl,optionUrl } from "../chartComp/chartConfigs/chartUrls";
export function treeChartPropertyView(
children: ChartCompChildrenType,
dispatch: (action: CompAction) => void
) {
const jsonModePropertyView = (
<>
<Section name={trans("chart.config")}>
{children.echartsData.propertyView({ label: trans("chart.data") })}
{children.echartsTitleConfig.getPropertyView()}
{children.echartsTitleVerticalConfig.getPropertyView()}
{children.echartsTitle.propertyView({ label: trans("treeChart.title") })}
{children.left.propertyView({ label: trans("treeChart.left"), tooltip: trans("echarts.leftTooltip") })}
{children.right.propertyView({ label: trans("treeChart.right"), tooltip: trans("echarts.rightTooltip") })}
{children.top.propertyView({ label: trans("treeChart.top"), tooltip: trans("echarts.topTooltip") })}
{children.bottom.propertyView({ label: trans("treeChart.bottom"), tooltip: trans("echarts.bottomTooltip") })}
{children.pointSize.propertyView({ label: trans("treeChart.pointSize"), tooltip: trans("treeChart.pointSizeTooltip") })}
{children.lineWidth.propertyView({ label: trans("treeChart.lineWidth"), tooltip: trans("treeChart.lineWidthTooltip") })}
{children.tooltip.propertyView({label: trans("treeChart.tooltip")})}
{children.labelVisibility.propertyView({
label: trans("treeChart.labelVisibility"),
tooltip: trans("echarts.labelVisibilityTooltip")
})}
</Section>
<Section name={sectionNames.interaction}>
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.chartStyle}>
{children.chartStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.titleStyle}>
{children.titleStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.detailStyle}>
{children.detailStyle?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
<Section name={sectionNames.advanced}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
tooltip: (
<div>
<a href={optionUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionTooltip")}
</a>
<br />
<a href={examplesUrl} target="_blank" rel="noopener noreferrer">
{trans("chart.echartsOptionExamples")}
</a>
</div>
),
})}
</Section>
</>
);
const getChatConfigByMode = (mode: string) => {
switch(mode) {
case "json":
return jsonModePropertyView;
}
}
return getChatConfigByMode(children.mode.getView())
}