@graphenedata/cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE.md +100 -0
  2. package/THIRD_PARTY_NOTICES.md +12 -0
  3. package/cli.ts +157 -0
  4. package/dist/cli/cli.js +43 -0
  5. package/dist/docs/data_apps/components/charts/annotations.md +673 -0
  6. package/dist/docs/data_apps/components/charts/area-chart.md +202 -0
  7. package/dist/docs/data_apps/components/charts/bar-chart.md +317 -0
  8. package/dist/docs/data_apps/components/charts/box-plot.md +190 -0
  9. package/dist/docs/data_apps/components/charts/bubble-chart.md +151 -0
  10. package/dist/docs/data_apps/components/charts/calendar-heatmap.md +112 -0
  11. package/dist/docs/data_apps/components/charts/custom-echarts.md +308 -0
  12. package/dist/docs/data_apps/components/charts/echarts-options.md +217 -0
  13. package/dist/docs/data_apps/components/charts/funnel-chart.md +106 -0
  14. package/dist/docs/data_apps/components/charts/heatmap.md +180 -0
  15. package/dist/docs/data_apps/components/charts/histogram.md +107 -0
  16. package/dist/docs/data_apps/components/charts/line-chart.md +265 -0
  17. package/dist/docs/data_apps/components/charts/mixed-type-charts.md +240 -0
  18. package/dist/docs/data_apps/components/charts/sankey-diagram.md +301 -0
  19. package/dist/docs/data_apps/components/charts/scatter-plot.md +134 -0
  20. package/dist/docs/data_apps/components/charts/sparkline.md +68 -0
  21. package/dist/docs/data_apps/components/data/big-value.md +153 -0
  22. package/dist/docs/data_apps/components/data/delta.md +89 -0
  23. package/dist/docs/data_apps/components/data/table.md +470 -0
  24. package/dist/docs/data_apps/components/data/value.md +97 -0
  25. package/dist/docs/data_apps/components/inputs/button-group.md +154 -0
  26. package/dist/docs/data_apps/components/inputs/checkbox.md +52 -0
  27. package/dist/docs/data_apps/components/inputs/date-input.md +131 -0
  28. package/dist/docs/data_apps/components/inputs/date-range.md +124 -0
  29. package/dist/docs/data_apps/components/inputs/dimension-grid.md +67 -0
  30. package/dist/docs/data_apps/components/inputs/dropdown.md +199 -0
  31. package/dist/docs/data_apps/components/inputs/index.md +3 -0
  32. package/dist/docs/data_apps/components/inputs/slider.md +126 -0
  33. package/dist/docs/data_apps/components/inputs/text-input.md +86 -0
  34. package/dist/docs/data_apps/components/maps/area-map.md +397 -0
  35. package/dist/docs/data_apps/components/maps/base-map.md +269 -0
  36. package/dist/docs/data_apps/components/maps/bubble-map.md +361 -0
  37. package/dist/docs/data_apps/components/maps/point-map.md +326 -0
  38. package/dist/docs/data_apps/components/maps/us-map.md +167 -0
  39. package/dist/docs/data_apps/components/ui/accordion.md +116 -0
  40. package/dist/docs/data_apps/components/ui/alert.md +37 -0
  41. package/dist/docs/data_apps/components/ui/big-link.md +19 -0
  42. package/dist/docs/data_apps/components/ui/details.md +58 -0
  43. package/dist/docs/data_apps/components/ui/download-data.md +41 -0
  44. package/dist/docs/data_apps/components/ui/embed.md +47 -0
  45. package/dist/docs/data_apps/components/ui/grid.md +45 -0
  46. package/dist/docs/data_apps/components/ui/image.md +61 -0
  47. package/dist/docs/data_apps/components/ui/info.md +47 -0
  48. package/dist/docs/data_apps/components/ui/last-refreshed.md +28 -0
  49. package/dist/docs/data_apps/components/ui/link-button.md +20 -0
  50. package/dist/docs/data_apps/components/ui/link.md +40 -0
  51. package/dist/docs/data_apps/components/ui/modal.md +57 -0
  52. package/dist/docs/data_apps/components/ui/note.md +32 -0
  53. package/dist/docs/data_apps/components/ui/print-format-components.md +85 -0
  54. package/dist/docs/data_apps/components/ui/tabs.md +122 -0
  55. package/dist/docs/graphene.md +129 -0
  56. package/dist/ui/app.css +332 -0
  57. package/dist/ui/assets/favicon.ico +0 -0
  58. package/dist/ui/component-utilities/autoFormatting.js +301 -0
  59. package/dist/ui/component-utilities/builtInFormats.js +482 -0
  60. package/dist/ui/component-utilities/chartContext.js +12 -0
  61. package/dist/ui/component-utilities/chartWindowDebug.js +21 -0
  62. package/dist/ui/component-utilities/checkInputs.js +95 -0
  63. package/dist/ui/component-utilities/convert.js +15 -0
  64. package/dist/ui/component-utilities/dateParsing.js +57 -0
  65. package/dist/ui/component-utilities/dropdownContext.ts +1 -0
  66. package/dist/ui/component-utilities/echarts.js +262 -0
  67. package/dist/ui/component-utilities/echartsThemes.js +453 -0
  68. package/dist/ui/component-utilities/formatTitle.js +24 -0
  69. package/dist/ui/component-utilities/formatting.js +258 -0
  70. package/dist/ui/component-utilities/getColumnExtents.js +79 -0
  71. package/dist/ui/component-utilities/getColumnSummary.js +67 -0
  72. package/dist/ui/component-utilities/getCompletedData.js +114 -0
  73. package/dist/ui/component-utilities/getDistinctCount.js +7 -0
  74. package/dist/ui/component-utilities/getDistinctValues.js +15 -0
  75. package/dist/ui/component-utilities/getSeriesConfig.js +236 -0
  76. package/dist/ui/component-utilities/getSortedData.js +7 -0
  77. package/dist/ui/component-utilities/getStackPercentages.js +43 -0
  78. package/dist/ui/component-utilities/getStackedData.js +17 -0
  79. package/dist/ui/component-utilities/getYAxisIndex.js +15 -0
  80. package/dist/ui/component-utilities/globalContexts.js +1 -0
  81. package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +119 -0
  82. package/dist/ui/component-utilities/inputUtils.ts +25 -0
  83. package/dist/ui/component-utilities/replaceNulls.js +14 -0
  84. package/dist/ui/component-utilities/tableUtils.ts +120 -0
  85. package/dist/ui/component-utilities/themeStores.ts +116 -0
  86. package/dist/ui/components/Area.svelte +174 -0
  87. package/dist/ui/components/AreaChart.svelte +150 -0
  88. package/dist/ui/components/Bar.svelte +326 -0
  89. package/dist/ui/components/BarChart.svelte +194 -0
  90. package/dist/ui/components/BigValue.svelte +69 -0
  91. package/dist/ui/components/Chart.svelte +1070 -0
  92. package/dist/ui/components/Column.svelte +172 -0
  93. package/dist/ui/components/DateRange.svelte +324 -0
  94. package/dist/ui/components/Dropdown.svelte +738 -0
  95. package/dist/ui/components/DropdownOption.svelte +21 -0
  96. package/dist/ui/components/ECharts.svelte +77 -0
  97. package/dist/ui/components/ErrorChart.svelte +54 -0
  98. package/dist/ui/components/GrapheneQuery.svelte +12 -0
  99. package/dist/ui/components/InlineDelta.svelte +150 -0
  100. package/dist/ui/components/Line.svelte +210 -0
  101. package/dist/ui/components/LineChart.svelte +178 -0
  102. package/dist/ui/components/PieChart.svelte +36 -0
  103. package/dist/ui/components/QueryLoad.svelte +82 -0
  104. package/dist/ui/components/Row.svelte +14 -0
  105. package/dist/ui/components/SortIcon.svelte +32 -0
  106. package/dist/ui/components/Table.svelte +19 -0
  107. package/dist/ui/components/TableCell.svelte +75 -0
  108. package/dist/ui/components/TableGroupRow.svelte +136 -0
  109. package/dist/ui/components/TableGroupToggle.svelte +42 -0
  110. package/dist/ui/components/TableHeader.svelte +242 -0
  111. package/dist/ui/components/TableRow.svelte +283 -0
  112. package/dist/ui/components/TableSubtotalRow.svelte +62 -0
  113. package/dist/ui/components/TableTotalRow.svelte +88 -0
  114. package/dist/ui/components/TextInput.svelte +92 -0
  115. package/dist/ui/components/_Table.svelte +516 -0
  116. package/dist/ui/internal/clientCache.ts +43 -0
  117. package/dist/ui/internal/queryEngine.ts +169 -0
  118. package/dist/ui/internal/telemetry.ts +28 -0
  119. package/dist/ui/internal/theme.ts +88 -0
  120. package/dist/ui/layout.svelte +3 -0
  121. package/dist/ui/playwright.config.ts +30 -0
  122. package/dist/ui/web.js +106 -0
  123. package/package.json +71 -0
@@ -0,0 +1,262 @@
1
+ import {registerTheme, init, connect} from 'echarts/dist/echarts.esm.js'
2
+ import {evidenceThemeDark, evidenceThemeLight} from './echartsThemes'
3
+ import debounce from 'debounce'
4
+ import * as chartWindowDebug from './chartWindowDebug'
5
+
6
+ /**
7
+ * @typedef {import("echarts").EChartsOption & {
8
+ * dispatch?: ReturnType<typeof import("svelte").createEventDispatcher>;
9
+ * showAllXAxisLabels?: boolean;
10
+ * theme: 'light' | 'dark';
11
+ * }
12
+ * } EChartsActionOptions
13
+ */
14
+
15
+ const ANIMATION_DURATION = 500
16
+ const pendingChartsKey = Symbol.for('graphene.pendingCharts')
17
+
18
+ /** @returns {Set<number> | null} */
19
+ const getPendingCharts = () => {
20
+ if (typeof window === 'undefined') return null
21
+ window[pendingChartsKey] ??= new Set()
22
+ return window[pendingChartsKey]
23
+ }
24
+
25
+ /** @param {number} chartId */
26
+ const markChartPending = (chartId) => {
27
+ let pending = getPendingCharts()
28
+ if (!pending) return
29
+ pending.add(chartId)
30
+ }
31
+
32
+ /** @param {number} chartId */
33
+ const markChartFinished = (chartId) => {
34
+ let pending = getPendingCharts()
35
+ if (!pending) return
36
+ pending.delete(chartId)
37
+ }
38
+
39
+ /** @param {HTMLElement} node */
40
+ /** @param {EChartsActionOptions} options */
41
+ const echartsAction = (node, options) => {
42
+ // https://github.com/evidence-dev/evidence/issues/1323
43
+ let useSvg =
44
+ ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(
45
+ navigator.platform,
46
+ // ios breaks w/ canvas if the canvas is too large
47
+ ) && node.clientWidth * 3 * node.clientHeight * 3 > 16777215
48
+
49
+ registerTheme('light', evidenceThemeLight)
50
+ registerTheme('dark', evidenceThemeDark)
51
+
52
+ let chart
53
+
54
+ let initChart = () => {
55
+ chart = init(node, options.theme, {
56
+ renderer: useSvg ? 'svg' : (options.renderer ?? 'canvas'),
57
+ })
58
+ markChartPending(chart.id)
59
+ chart.on('finished', () => markChartFinished(chart.id))
60
+ }
61
+
62
+ initChart()
63
+
64
+ chartWindowDebug.set(chart.id, chart)
65
+
66
+ // If connectGroup supplied, connect chart to other charts matching that connectGroup
67
+ if (options.connectGroup) {
68
+ chart.group = options.connectGroup
69
+ connect(options.connectGroup)
70
+ }
71
+
72
+ // This function applies overrides to the echarts config generated by our chart components.
73
+ // In cases where these affect the spacing of the chart, some jumping/reanimation will be visible when
74
+ // the chart is animated. This is because we need to pass the initial options without the overrides to echarts
75
+ // first in order to use setOption()'s built-in merge capability. I believe the only way around this is
76
+ // to handle the option merge ourselves, then pass the final config object to setOption().
77
+
78
+ // Series Color override
79
+ let applySeriesColors = () => {
80
+ if (options.seriesColors) {
81
+ /** @type {import("echarts").EChartsOption} */
82
+ let prevOption = chart.getOption()
83
+ if (!prevOption) return
84
+ let newOption = {...prevOption}
85
+ for (let seriesName of Object.keys(options.seriesColors)) {
86
+ let matchingSeriesIndex = prevOption.series.findIndex((s) => s.name === seriesName)
87
+ if (matchingSeriesIndex !== -1) {
88
+ newOption.series[matchingSeriesIndex] = {
89
+ ...newOption.series[matchingSeriesIndex],
90
+ itemStyle: {
91
+ ...newOption.series[matchingSeriesIndex].itemStyle,
92
+ color: options.seriesColors[seriesName],
93
+ },
94
+ }
95
+ }
96
+ }
97
+ chart.setOption(newOption)
98
+ }
99
+ }
100
+
101
+ // Check if echartsOptions are provided and apply them
102
+ let applyEchartsOptions = () => {
103
+ if (options.echartsOptions) {
104
+ chart.setOption({
105
+ ...options.echartsOptions,
106
+ })
107
+ }
108
+ }
109
+
110
+ // seriesOptions - loop through series and apply same changes to each
111
+ let applySeriesOptions = () => {
112
+ let tempSeries = []
113
+ if (options.seriesOptions) {
114
+ let reference_index = options.config.series.reduce(
115
+ (acc, {evidenceSeriesType}, reference_index) => {
116
+ if (
117
+ evidenceSeriesType === 'reference_line' ||
118
+ evidenceSeriesType === 'reference_area' ||
119
+ evidenceSeriesType === 'reference_point'
120
+ ) {
121
+ acc.push(reference_index)
122
+ }
123
+ return acc
124
+ },
125
+ [],
126
+ )
127
+
128
+ for (let i = 0; i < options.config.series.length; i++) {
129
+ if (reference_index.includes(i)) {
130
+ tempSeries.push({})
131
+ } else {
132
+ tempSeries.push({...options.seriesOptions})
133
+ }
134
+ }
135
+ chart.setOption({series: tempSeries})
136
+ }
137
+ }
138
+
139
+ // Initial options set:
140
+ chart.setOption({
141
+ ...options.config,
142
+ animationDuration: ANIMATION_DURATION,
143
+ animationDurationUpdate: ANIMATION_DURATION,
144
+ })
145
+
146
+ applySeriesColors()
147
+ applyEchartsOptions()
148
+ applySeriesOptions()
149
+
150
+ // Click event handler:
151
+ let dispatch = options.dispatch
152
+ chart.on('click', function (params) {
153
+ dispatch('click', params)
154
+ })
155
+
156
+ // watching parent element is necessary for charts within `Fullscreen` components
157
+ let parentElement = node.parentElement
158
+ let onWindowResize = debounce(() => {
159
+ chart.resize({
160
+ animation: {
161
+ duration: ANIMATION_DURATION,
162
+ },
163
+ })
164
+ updateLabelWidths()
165
+ }, 100)
166
+
167
+ let resizeObserver
168
+ if (window.ResizeObserver && parentElement) {
169
+ resizeObserver = new ResizeObserver(onWindowResize)
170
+ resizeObserver.observe(parentElement)
171
+ } else {
172
+ window.addEventListener('resize', onWindowResize)
173
+ }
174
+
175
+ // Label width setting:
176
+ let updateLabelWidths = () => {
177
+ if (options.showAllXAxisLabels) {
178
+ // Make sure we operate on an up-to-date options object
179
+ /** @type {import("echarts").EChartsOption} */
180
+ let prevOption = chart.getOption()
181
+ if (!prevOption) return
182
+ // If the options object includes showing all x axis labels
183
+ // Note: this isn't a standard option, but right now this is the easiest way to pass something to the action.
184
+ // We don't want to have multiple resize observers if we can avoid it, and this is all due for a cleanup anyways
185
+ // Get all the possible x values
186
+ let distinctXValues = new Set(prevOption.series.flatMap((s) => s.data?.map((d) => d[0])))
187
+ let modConst = 4 / 5
188
+ let clientWidth = node?.clientWidth ?? 0
189
+
190
+ // We disable this behavior because it doesn't make sense on horizontal bar charts
191
+ // Category labels will grow to be visible
192
+ // Value labels are interpolatable anyway
193
+ if (!options.swapXY) {
194
+ /** @type {import("echarts").EChartsOption} */
195
+ let newOption = {
196
+ xAxis: {
197
+ axisLabel: {
198
+ interval: 0,
199
+ overflow: options.xAxisLabelOverflow,
200
+ width: (clientWidth * modConst) / distinctXValues.size,
201
+ },
202
+ },
203
+ }
204
+ chart.setOption(newOption)
205
+ }
206
+ }
207
+ }
208
+
209
+ /** @param {EChartsActionOptions} newOptions */
210
+ let updateChart = (newOptions) => {
211
+ if (newOptions.theme !== options.theme) {
212
+ chart.dispose()
213
+ options = newOptions
214
+ initChart()
215
+ }
216
+
217
+ options = newOptions
218
+ markChartPending(chart.id)
219
+ chart.setOption(
220
+ {
221
+ ...options.config,
222
+ animationDuration: ANIMATION_DURATION,
223
+ animationDurationUpdate: ANIMATION_DURATION,
224
+ },
225
+ true,
226
+ )
227
+ applySeriesColors()
228
+ applyEchartsOptions()
229
+ applySeriesOptions()
230
+ markChartPending(chart.id)
231
+ chart.resize({
232
+ animation: {
233
+ duration: ANIMATION_DURATION,
234
+ },
235
+ })
236
+ updateLabelWidths()
237
+ }
238
+
239
+ onWindowResize()
240
+
241
+ window[Symbol.for('chart renders')] ??= 0
242
+ window[Symbol.for('chart renders')]++
243
+ return {
244
+ update (options) {
245
+ window[Symbol.for('chart renders')]++
246
+ updateChart(options)
247
+ },
248
+ destroy () {
249
+ if (resizeObserver) {
250
+ resizeObserver.unobserve(parentElement)
251
+ } else {
252
+ window.removeEventListener('resize', onWindowResize)
253
+ }
254
+ markChartFinished(chart.id)
255
+ chart.dispose()
256
+
257
+ chartWindowDebug.unset(chart.id)
258
+ },
259
+ }
260
+ }
261
+
262
+ export default echartsAction
@@ -0,0 +1,453 @@
1
+ import {themes} from '../internal/theme'
2
+
3
+ /** @param {'light' | 'dark'} mode */
4
+ const createTheme = (mode) => {
5
+ let axisBaselineColor = themes[mode].colors['base-content-muted']
6
+ let axisTickColor = themes[mode].colors['base-content-muted']
7
+ let axisLabelColor = themes[mode].colors['base-content-muted']
8
+ let gridlineColor = themes[mode].colors['base-300']
9
+ let axisTitleBackgroundColor = themes[mode].colors['base-100']
10
+ let legendTextColor = themes[mode].colors['base-content-muted']
11
+ let legendPageIconColor = themes[mode].colors['base-content-muted']
12
+ let legendPageTextColor = themes[mode].colors['base-content-muted']
13
+ let tooltipBorderColor = themes[mode].colors['base-300']
14
+ let tooltipBackgroundColor = themes[mode].colors['base-100']
15
+ let tooltipTextColor = themes[mode].colors['base-content']
16
+ let titleColor = themes[mode].colors['base-heading']
17
+ let subtitleColor = themes[mode].colors['base-content-muted']
18
+
19
+ return {
20
+ darkMode: mode === 'dark', // if true, echarts will automatically update the font colour to work better on dark background
21
+ backgroundColor: themes[mode].colors['base-100'],
22
+ textStyle: {
23
+ fontFamily: ['Inter', 'sans-serif'],
24
+ },
25
+ grid: {
26
+ left: '1%',
27
+ right: '4%',
28
+ bottom: '0%',
29
+ top: '15%',
30
+ containLabel: true,
31
+ },
32
+ color: themes[mode].colorPalettes.default,
33
+ title: {
34
+ padding: 0,
35
+ itemGap: 7,
36
+ textStyle: {
37
+ fontSize: 14,
38
+ fontWeight: 600,
39
+ color: titleColor,
40
+ },
41
+ subtextStyle: {
42
+ fontSize: 13,
43
+ color: subtitleColor,
44
+ overflow: 'break',
45
+ },
46
+ top: '1px',
47
+ },
48
+ line: {
49
+ itemStyle: {
50
+ borderWidth: 0,
51
+ },
52
+ lineStyle: {
53
+ width: 2,
54
+ join: 'round',
55
+ },
56
+ symbolSize: 0,
57
+ symbol: 'circle',
58
+ smooth: false,
59
+ },
60
+ radar: {
61
+ itemStyle: {
62
+ borderWidth: 0,
63
+ },
64
+ lineStyle: {
65
+ width: 2,
66
+ },
67
+ symbolSize: 0,
68
+ symbol: 'circle',
69
+ smooth: false,
70
+ },
71
+ pie: {
72
+ itemStyle: {
73
+ borderWidth: 0,
74
+ borderColor: '#cccccc',
75
+ },
76
+ },
77
+ scatter: {
78
+ itemStyle: {
79
+ borderWidth: 0,
80
+ borderColor: '#cccccc',
81
+ },
82
+ },
83
+ boxplot: {
84
+ itemStyle: {
85
+ borderWidth: 1.5,
86
+ // borderColor: '#cccccc'
87
+ },
88
+ },
89
+ parallel: {
90
+ itemStyle: {
91
+ borderWidth: 0,
92
+ borderColor: '#cccccc',
93
+ },
94
+ },
95
+ sankey: {
96
+ itemStyle: {
97
+ borderWidth: 0,
98
+ borderColor: '#cccccc',
99
+ },
100
+ },
101
+ funnel: {
102
+ itemStyle: {
103
+ borderWidth: 0,
104
+ borderColor: '#cccccc',
105
+ },
106
+ },
107
+ gauge: {
108
+ itemStyle: {
109
+ borderWidth: 0,
110
+ borderColor: '#cccccc',
111
+ },
112
+ },
113
+ candlestick: {
114
+ itemStyle: {
115
+ color: '#eb5454',
116
+ color0: '#47b262',
117
+ borderColor: '#eb5454',
118
+ borderColor0: '#47b262',
119
+ borderWidth: 1,
120
+ },
121
+ },
122
+ graph: {
123
+ itemStyle: {
124
+ borderWidth: 0,
125
+ borderColor: '#cccccc',
126
+ },
127
+ lineStyle: {
128
+ width: 1,
129
+ color: '#aaaaaa',
130
+ },
131
+ symbolSize: 0,
132
+ symbol: 'circle',
133
+ smooth: false,
134
+ color: [
135
+ '#923d59',
136
+ '#488f96',
137
+ '#518eca',
138
+ '#b3a9a0',
139
+ '#ffc857',
140
+ '#495867',
141
+ '#bfdbf7',
142
+ '#bc4749',
143
+ '#eeebd0',
144
+ ],
145
+ label: {
146
+ color: '#f2f2f2',
147
+ },
148
+ },
149
+ map: {
150
+ itemStyle: {
151
+ areaColor: '#eee',
152
+ borderColor: '#444',
153
+ borderWidth: 0.5,
154
+ },
155
+ label: {
156
+ color: '#000',
157
+ },
158
+ emphasis: {
159
+ itemStyle: {
160
+ areaColor: 'rgba(255,215,0,0.8)',
161
+ borderColor: '#444',
162
+ borderWidth: 1,
163
+ },
164
+ label: {
165
+ color: 'rgb(100,0,0)',
166
+ },
167
+ },
168
+ },
169
+ geo: {
170
+ itemStyle: {
171
+ areaColor: '#eee',
172
+ borderColor: '#444',
173
+ borderWidth: 0.5,
174
+ },
175
+ label: {
176
+ color: '#000',
177
+ },
178
+ emphasis: {
179
+ itemStyle: {
180
+ areaColor: 'rgba(255,215,0,0.8)',
181
+ borderColor: '#444',
182
+ borderWidth: 1,
183
+ },
184
+ label: {
185
+ color: 'rgb(100,0,0)',
186
+ },
187
+ },
188
+ },
189
+ categoryAxis: {
190
+ axisLine: {
191
+ show: true,
192
+ lineStyle: {
193
+ color: axisBaselineColor,
194
+ },
195
+ },
196
+ axisTick: {
197
+ show: false,
198
+ lineStyle: {
199
+ color: axisTickColor,
200
+ },
201
+ length: 3,
202
+ alignWithLabel: true,
203
+ },
204
+ axisLabel: {
205
+ show: true,
206
+ color: axisLabelColor,
207
+ },
208
+ splitLine: {
209
+ show: false,
210
+ lineStyle: {
211
+ color: [gridlineColor],
212
+ },
213
+ },
214
+ splitArea: {
215
+ show: false,
216
+ areaStyle: {
217
+ color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
218
+ },
219
+ },
220
+ },
221
+ valueAxis: {
222
+ axisLine: {
223
+ show: false,
224
+ lineStyle: {
225
+ color: axisBaselineColor,
226
+ },
227
+ },
228
+ axisTick: {
229
+ show: false,
230
+ lineStyle: {
231
+ color: axisTickColor,
232
+ },
233
+ length: 2,
234
+ },
235
+ axisLabel: {
236
+ show: true,
237
+ color: axisLabelColor,
238
+ },
239
+ splitLine: {
240
+ show: true,
241
+ lineStyle: {
242
+ color: [gridlineColor],
243
+ width: 1,
244
+ },
245
+ },
246
+ splitArea: {
247
+ show: false,
248
+ areaStyle: {
249
+ color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
250
+ },
251
+ },
252
+ nameTextStyle: {
253
+ backgroundColor: axisTitleBackgroundColor,
254
+ },
255
+ },
256
+ logAxis: {
257
+ axisLine: {
258
+ show: false,
259
+ lineStyle: {
260
+ color: axisBaselineColor,
261
+ },
262
+ },
263
+ axisTick: {
264
+ show: false,
265
+ lineStyle: {
266
+ color: axisTickColor,
267
+ },
268
+ length: 2,
269
+ },
270
+ axisLabel: {
271
+ show: true,
272
+ color: axisLabelColor,
273
+ },
274
+ splitLine: {
275
+ show: true,
276
+ lineStyle: {
277
+ color: [gridlineColor],
278
+ },
279
+ },
280
+ splitArea: {
281
+ show: false,
282
+ areaStyle: {
283
+ color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
284
+ },
285
+ },
286
+ nameTextStyle: {
287
+ backgroundColor: axisTitleBackgroundColor,
288
+ },
289
+ },
290
+ timeAxis: {
291
+ axisLine: {
292
+ show: true,
293
+ lineStyle: {
294
+ color: axisBaselineColor,
295
+ },
296
+ },
297
+ axisTick: {
298
+ show: true,
299
+ lineStyle: {
300
+ color: axisTickColor,
301
+ },
302
+ length: 3,
303
+ },
304
+ axisLabel: {
305
+ show: true,
306
+ color: axisLabelColor,
307
+ },
308
+ splitLine: {
309
+ show: false,
310
+ lineStyle: {
311
+ color: [gridlineColor],
312
+ },
313
+ },
314
+ splitArea: {
315
+ show: false,
316
+ areaStyle: {
317
+ color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
318
+ },
319
+ },
320
+ },
321
+ toolbox: {
322
+ iconStyle: {
323
+ borderColor: '#999999',
324
+ },
325
+ emphasis: {
326
+ iconStyle: {
327
+ borderColor: '#459cde',
328
+ },
329
+ },
330
+ },
331
+ legend: {
332
+ textStyle: {
333
+ padding: [0, 0, 0, -7],
334
+ color: legendTextColor,
335
+ },
336
+ // "padding": [15,0,0,0],
337
+ icon: 'circle',
338
+ pageIcons: {
339
+ horizontal: [
340
+ 'M 17 3 h 2 c 0.386 0 0.738 0.223 0.904 0.572 s 0.115 0.762 -0.13 1.062 L 11.292 15 l 8.482 10.367 c 0.245 0.299 0.295 0.712 0.13 1.062 S 19.386 27 19 27 h -2 c -0.3 0 -0.584 -0.135 -0.774 -0.367 l -9 -11 c -0.301 -0.369 -0.301 -0.898 0 -1.267 l 9 -11 C 16.416 3.135 16.7 3 17 3 Z',
341
+ 'M 12 27 h -2 c -0.386 0 -0.738 -0.223 -0.904 -0.572 s -0.115 -0.762 0.13 -1.062 L 17.708 15 L 9.226 4.633 c -0.245 -0.299 -0.295 -0.712 -0.13 -1.062 S 9.614 3 10 3 h 2 c 0.3 0 0.584 0.135 0.774 0.367 l 9 11 c 0.301 0.369 0.301 0.898 0 1.267 l -9 11 C 12.584 26.865 12.3 27 12 27 Z',
342
+ ],
343
+ },
344
+ pageIconColor: legendPageIconColor,
345
+ pageIconSize: 12,
346
+ pageTextStyle: {
347
+ color: legendPageTextColor,
348
+ },
349
+ pageButtonItemGap: -2,
350
+ animationDurationUpdate: 300,
351
+ },
352
+ tooltip: {
353
+ axisPointer: {
354
+ lineStyle: {
355
+ color: '#cccccc',
356
+ width: 1,
357
+ },
358
+ crossStyle: {
359
+ color: '#cccccc',
360
+ width: 1,
361
+ },
362
+ },
363
+ borderRadius: 4,
364
+ borderWidth: 1,
365
+ borderColor: tooltipBorderColor,
366
+ backgroundColor: tooltipBackgroundColor,
367
+ textStyle: {
368
+ color: tooltipTextColor,
369
+ fontSize: 12,
370
+ fontWeight: 400,
371
+ },
372
+ padding: 6,
373
+ },
374
+ timeline: {
375
+ lineStyle: {
376
+ color: '#e3e3e3',
377
+ width: 2,
378
+ },
379
+ itemStyle: {
380
+ color: '#d6d6d6',
381
+ borderWidth: 1,
382
+ },
383
+ controlStyle: {
384
+ color: '#bfbfbf',
385
+ borderColor: '#bfbfbf',
386
+ borderWidth: 1,
387
+ },
388
+ checkpointStyle: {
389
+ color: '#8f8f8f',
390
+ borderColor: '#ffffff',
391
+ },
392
+ label: {
393
+ color: '#c9c9c9',
394
+ },
395
+ emphasis: {
396
+ itemStyle: {
397
+ color: '#9c9c9c',
398
+ },
399
+ controlStyle: {
400
+ color: '#bfbfbf',
401
+ borderColor: '#bfbfbf',
402
+ borderWidth: 1,
403
+ },
404
+ label: {
405
+ color: '#c9c9c9',
406
+ },
407
+ },
408
+ },
409
+ visualMap: {
410
+ color: ['#c41621', '#e39588', '#f5ed98'],
411
+ },
412
+ dataZoom: {
413
+ type: 'slider',
414
+ bottom: 10,
415
+ height: 30,
416
+ showDetail: false,
417
+ handleSize: '80%',
418
+ borderColor: gridlineColor,
419
+ handleStyle: {
420
+ borderColor: gridlineColor,
421
+ color: gridlineColor,
422
+ },
423
+ moveHandleStyle: {
424
+ borderColor: gridlineColor,
425
+ color: gridlineColor,
426
+ },
427
+ textStyle: {},
428
+ emphasis: {
429
+ handleStyle: {
430
+ borderColor: gridlineColor,
431
+ color: gridlineColor,
432
+ },
433
+ moveHandleStyle: {
434
+ borderColor: gridlineColor,
435
+ color: gridlineColor,
436
+ },
437
+ },
438
+ },
439
+ markPoint: {
440
+ label: {
441
+ color: '#f2f2f2',
442
+ },
443
+ emphasis: {
444
+ label: {
445
+ color: '#f2f2f2',
446
+ },
447
+ },
448
+ },
449
+ }
450
+ }
451
+
452
+ export const evidenceThemeLight = createTheme('light')
453
+ export const evidenceThemeDark = createTheme('dark')