-
Notifications
You must be signed in to change notification settings - Fork 308
Expand file tree
/
Copy pathfunnelChartPropertyView.tsx
More file actions
108 lines (105 loc) · 4.78 KB
/
Copy pathfunnelChartPropertyView.tsx
File metadata and controls
108 lines (105 loc) · 4.78 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { CompAction } from "lowcoder-core";
import { ChartCompChildrenType } from "./funnelChartConstants";
import {
hiddenPropertyView,
Section,
sectionNames,
} from "lowcoder-sdk";
import { trans } from "i18n/comps";
import { examplesUrl,optionUrl } from "../chartComp/chartConfigs/chartUrls";
export function funnelChartPropertyView(
children: ChartCompChildrenType,
dispatch: (action: CompAction) => void
) {
const jsonModePropertyView = (
<>
<Section name={trans("chart.config")}>
{children.echartsData.propertyView({
label: trans("chart.data"),
enableAIHelp: true,
aiHelp: {
targetKind: "json",
label: "Funnel chart data",
fieldName: "echartsData",
fieldDescription:
"JSON array of funnel stages. Each item should have name and value (and optional color).",
},
})}
{children.echartsTitleConfig.getPropertyView()}
{children.echartsTitleVerticalConfig.getPropertyView()}
{children.legendVisibility.getView() && children.echartsLegendAlignConfig.getPropertyView()}
{children.legendVisibility.getView() && children.echartsLegendConfig.getPropertyView()}
{children.legendVisibility.getView() && children.echartsLegendOrientConfig.getPropertyView()}
{children.echartsSortingConfig.getPropertyView()}
{children.label.getView()&& children.echartsLabelConfig.getPropertyView()}
{children.echartsFunnelAlignConfig.getPropertyView()}
{children.echartsTitle.propertyView({ label: trans("funnelChart.title"), tooltip: trans("echarts.titleTooltip") })}
{children.left.propertyView({ label: trans("funnelChart.left"), tooltip: trans("echarts.positionChart_x_Tooltip") })}
{children.top.propertyView({ label: trans("funnelChart.top"), tooltip: trans("echarts.topTooltip") })}
{children.bottom.propertyView({ label: trans("funnelChart.bottom"), tooltip: trans("echarts.bottomTooltip") })}
{children.width.propertyView({ label: trans("funnelChart.width"), tooltip: trans("echarts.widthTooltip") })}
{children.min.propertyView({ label: trans("funnelChart.min"), tooltip: trans("echarts.minTooltip") })}
{children.max.propertyView({ label: trans("funnelChart.max"), tooltip: trans("echarts.maxTooltip") })}
{children.gap.propertyView({ label: trans("funnelChart.gap"), tooltip: trans("echarts.gapTooltip") })}
{children.opacity.propertyView({ label: trans("funnelChart.opacity"), tooltip: trans("echarts.opacityTooltip") })}
{children.tooltip.propertyView({label: trans("funnelChart.tooltip"), tooltip: trans("echarts.tooltipVisibilityTooltip")})}
{children.label.propertyView({label: trans("funnelChart.label"), tooltip: trans("echarts.labelVisibilityTooltip")})}
{children.legendVisibility.propertyView({label: trans("funnelChart.legendVisibility"), tooltip: trans("echarts.legendVisibilityTooltip")})}
</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>
{
children.label.getView() ?
<Section name={sectionNames.labelStyle}>
{children.labelStyle?.getPropertyView()}
</Section> : <></>
}
{
children.legendVisibility.getView() ?
<Section name={sectionNames.legendStyle}>
{children.legendStyle?.getPropertyView()}
</Section> : <></>
}
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
<Section name={sectionNames.advanced}>
{children.echartsOption.propertyView({
label: trans("chart.echartsOptionLabel"),
styleName: "higher",
language: "json",
enableAIHelp: true,
aiHelp: {
targetKind: "echarts-option",
label: "Funnel option",
fieldName: "echartsOption",
fieldDescription: "Apache ECharts option JSON for this chart component.",
},
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())
}