@graphenedata/cli 0.0.15 → 0.0.17

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 (117) hide show
  1. package/README.md +174 -0
  2. package/dist/cli/bigQuery-OQUNH3VT.js +75 -0
  3. package/dist/cli/bigQuery-OQUNH3VT.js.map +7 -0
  4. package/dist/cli/chunk-56K2FF57.js +53 -0
  5. package/dist/cli/chunk-56K2FF57.js.map +7 -0
  6. package/dist/cli/chunk-TZTTALAV.js +12868 -0
  7. package/dist/cli/chunk-TZTTALAV.js.map +7 -0
  8. package/dist/cli/cli.js +260 -11196
  9. package/dist/cli/clickhouse-S3BJSKND.js +65 -0
  10. package/dist/cli/clickhouse-S3BJSKND.js.map +7 -0
  11. package/dist/cli/duckdb-TKVMONRK.js +87 -0
  12. package/dist/cli/duckdb-TKVMONRK.js.map +7 -0
  13. package/dist/cli/serve2-S2LL4D4D.js +448 -0
  14. package/dist/cli/serve2-S2LL4D4D.js.map +7 -0
  15. package/dist/cli/snowflake-3VPDEYYP.js +128 -0
  16. package/dist/cli/snowflake-3VPDEYYP.js.map +7 -0
  17. package/dist/index.d.ts +63 -0
  18. package/dist/lang/index.d.ts +63 -0
  19. package/dist/skills/graphene/SKILL.md +156 -95
  20. package/dist/skills/graphene/references/big-value.md +6 -41
  21. package/dist/skills/graphene/references/date-range.md +64 -0
  22. package/dist/skills/graphene/references/dropdown.md +3 -4
  23. package/dist/skills/graphene/references/echarts.md +162 -0
  24. package/dist/skills/graphene/references/gsql.md +55 -25
  25. package/dist/skills/graphene/references/model-gsql.md +70 -0
  26. package/dist/skills/graphene/references/table.md +13 -14
  27. package/dist/skills/graphene/references/text-input.md +2 -1
  28. package/dist/ui/app.css +239 -340
  29. package/dist/ui/component-utilities/dataShaping.ts +484 -0
  30. package/dist/ui/component-utilities/dataSummary.ts +57 -0
  31. package/dist/ui/component-utilities/enrich.ts +793 -0
  32. package/dist/ui/component-utilities/format.ts +177 -0
  33. package/dist/ui/component-utilities/inputUtils.ts +44 -8
  34. package/dist/ui/component-utilities/theme.ts +200 -0
  35. package/dist/ui/component-utilities/themeStores.ts +21 -8
  36. package/dist/ui/component-utilities/types.ts +70 -0
  37. package/dist/ui/components/AreaChart.svelte +57 -105
  38. package/dist/ui/components/BarChart.svelte +71 -129
  39. package/dist/ui/components/BigValue.svelte +24 -40
  40. package/dist/ui/components/Column.svelte +10 -18
  41. package/dist/ui/components/DateRange.svelte +54 -21
  42. package/dist/ui/components/Dropdown.svelte +47 -26
  43. package/dist/ui/components/DropdownOption.svelte +1 -2
  44. package/dist/ui/components/ECharts.svelte +181 -67
  45. package/dist/ui/components/InlineDelta.svelte +50 -31
  46. package/dist/ui/components/LineChart.svelte +54 -125
  47. package/dist/ui/components/PieChart.svelte +27 -37
  48. package/dist/ui/components/QueryLoad.svelte +77 -45
  49. package/dist/ui/components/Row.svelte +2 -1
  50. package/dist/ui/components/ScatterPlot.svelte +52 -0
  51. package/dist/ui/components/Skeleton.svelte +32 -0
  52. package/dist/ui/components/Table.svelte +3 -2
  53. package/dist/ui/components/TableGroupRow.svelte +28 -36
  54. package/dist/ui/components/TableHarness.svelte +32 -0
  55. package/dist/ui/components/TableHeader.svelte +34 -59
  56. package/dist/ui/components/TableRow.svelte +14 -38
  57. package/dist/ui/components/TableSubtotalRow.svelte +18 -21
  58. package/dist/ui/components/TableTotalRow.svelte +27 -37
  59. package/dist/ui/components/TextInput.svelte +13 -12
  60. package/dist/ui/components/Value.svelte +25 -0
  61. package/dist/ui/components/_Table.svelte +72 -70
  62. package/dist/ui/internal/ChartGallery.svelte +527 -0
  63. package/dist/ui/internal/ErrorDisplay.svelte +22 -97
  64. package/dist/ui/internal/LocalApp.svelte +84 -19
  65. package/dist/ui/internal/PageNavGroup.svelte +269 -0
  66. package/dist/ui/internal/Sidebar.svelte +178 -0
  67. package/dist/ui/internal/SidebarToggle.svelte +47 -0
  68. package/dist/ui/internal/StyleGallery.svelte +244 -0
  69. package/dist/ui/internal/clientCache.ts +2 -2
  70. package/dist/ui/internal/pageInputs.svelte.js +292 -0
  71. package/dist/ui/internal/queryEngine.ts +112 -129
  72. package/dist/ui/internal/runSocket.ts +31 -14
  73. package/dist/ui/internal/sidebar.svelte.js +18 -0
  74. package/dist/ui/internal/telemetry.ts +51 -16
  75. package/dist/ui/internal/types.d.ts +7 -0
  76. package/dist/ui/web.js +30 -11
  77. package/package.json +40 -38
  78. package/dist/skills/graphene/references/area-chart.md +0 -95
  79. package/dist/skills/graphene/references/bar-chart.md +0 -112
  80. package/dist/skills/graphene/references/line-chart.md +0 -108
  81. package/dist/skills/graphene/references/pie-chart.md +0 -29
  82. package/dist/skills/graphene/references/value-formats.md +0 -104
  83. package/dist/ui/component-utilities/autoFormatting.js +0 -280
  84. package/dist/ui/component-utilities/builtInFormats.js +0 -481
  85. package/dist/ui/component-utilities/chartContext.js +0 -12
  86. package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
  87. package/dist/ui/component-utilities/checkInputs.js +0 -84
  88. package/dist/ui/component-utilities/convert.js +0 -15
  89. package/dist/ui/component-utilities/dateParsing.js +0 -56
  90. package/dist/ui/component-utilities/dropdownContext.ts +0 -1
  91. package/dist/ui/component-utilities/echarts.js +0 -252
  92. package/dist/ui/component-utilities/echartsThemes.js +0 -443
  93. package/dist/ui/component-utilities/formatTitle.js +0 -24
  94. package/dist/ui/component-utilities/formatting.js +0 -241
  95. package/dist/ui/component-utilities/getColumnExtents.js +0 -79
  96. package/dist/ui/component-utilities/getColumnSummary.js +0 -62
  97. package/dist/ui/component-utilities/getCompletedData.js +0 -122
  98. package/dist/ui/component-utilities/getDistinctCount.js +0 -7
  99. package/dist/ui/component-utilities/getDistinctValues.js +0 -15
  100. package/dist/ui/component-utilities/getSeriesConfig.js +0 -231
  101. package/dist/ui/component-utilities/getSortedData.js +0 -9
  102. package/dist/ui/component-utilities/getStackPercentages.js +0 -45
  103. package/dist/ui/component-utilities/getStackedData.js +0 -19
  104. package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
  105. package/dist/ui/component-utilities/globalContexts.js +0 -1
  106. package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
  107. package/dist/ui/component-utilities/replaceNulls.js +0 -16
  108. package/dist/ui/component-utilities/tableUtils.ts +0 -107
  109. package/dist/ui/component-utilities/tidyWithTypes.js +0 -9
  110. package/dist/ui/components/Area.svelte +0 -214
  111. package/dist/ui/components/Bar.svelte +0 -347
  112. package/dist/ui/components/Chart.svelte +0 -995
  113. package/dist/ui/components/Line.svelte +0 -227
  114. package/dist/ui/internal/NavSidebar.svelte +0 -396
  115. package/dist/ui/internal/theme.ts +0 -60
  116. package/dist/ui/public/inter-latin-ext.woff2 +0 -0
  117. package/dist/ui/public/inter-latin.woff2 +0 -0
@@ -1,252 +0,0 @@
1
- import {registerTheme, init, connect} from 'echarts/dist/echarts.esm.js'
2
-
3
- import * as chartWindowDebug from './chartWindowDebug'
4
- import {evidenceThemeDark, evidenceThemeLight} from './echartsThemes'
5
-
6
- /**
7
- * @typedef {import("echarts").EChartsOption & {
8
- * onclick?: (params: any) => void;
9
- * showAllXAxisLabels?: boolean;
10
- * theme: 'light' | 'dark';
11
- * }
12
- * } EChartsActionOptions
13
- */
14
-
15
- const ANIMATION_DURATION = 0
16
-
17
- /** @param {number} chartId */
18
- const markChartPending = chartId => window.$GRAPHENE?.renderStart?.(`chart:${chartId}`)
19
-
20
- /** @param {number} chartId */
21
- const markChartFinished = chartId => window.$GRAPHENE?.renderComplete?.(`chart:${chartId}`)
22
-
23
- /** @param {HTMLElement} node */
24
- /** @param {EChartsActionOptions} options */
25
- const echartsAction = (node, options) => {
26
- // https://github.com/evidence-dev/evidence/issues/1323
27
- let useSvg =
28
- ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(
29
- navigator.platform,
30
- // ios breaks w/ canvas if the canvas is too large
31
- ) && node.clientWidth * 3 * node.clientHeight * 3 > 16777215
32
-
33
- registerTheme('light', evidenceThemeLight)
34
- registerTheme('dark', evidenceThemeDark)
35
-
36
- let chart
37
- let destroyed = false
38
-
39
- let initChart = () => {
40
- chart = init(node, options.theme, {
41
- renderer: useSvg ? 'svg' : (options.renderer ?? 'canvas'),
42
- })
43
- chart.on('finished', () => markChartFinished(chart.id))
44
- chart.on('click', params => options.onclick?.(params))
45
- chartWindowDebug.set(chart.id, chart)
46
-
47
- // If connectGroup supplied, connect chart to other charts matching that connectGroup
48
- if (options.connectGroup) {
49
- chart.group = options.connectGroup
50
- connect(options.connectGroup)
51
- }
52
- }
53
-
54
- // This function applies overrides to the echarts config generated by our chart components.
55
- // In cases where these affect the spacing of the chart, some jumping/reanimation will be visible when
56
- // the chart is animated. This is because we need to pass the initial options without the overrides to echarts
57
- // first in order to use setOption()'s built-in merge capability. I believe the only way around this is
58
- // to handle the option merge ourselves, then pass the final config object to setOption().
59
-
60
- // Series Color override
61
- let applySeriesColors = () => {
62
- if (options.seriesColors) {
63
- /** @type {import("echarts").EChartsOption} */
64
- let prevOption = chart.getOption()
65
- if (!prevOption) return
66
- let newOption = {...prevOption}
67
- for (let seriesName of Object.keys(options.seriesColors)) {
68
- let matchingSeriesIndex = prevOption.series.findIndex(s => s.name === seriesName)
69
- if (matchingSeriesIndex !== -1) {
70
- newOption.series[matchingSeriesIndex] = {
71
- ...newOption.series[matchingSeriesIndex],
72
- itemStyle: {
73
- ...newOption.series[matchingSeriesIndex].itemStyle,
74
- color: options.seriesColors[seriesName],
75
- },
76
- }
77
- }
78
- }
79
- chart.setOption(newOption)
80
- }
81
- }
82
-
83
- // Check if echartsOptions are provided and apply them
84
- let applyEchartsOptions = () => {
85
- if (options.echartsOptions) {
86
- chart.setOption({
87
- ...options.echartsOptions,
88
- })
89
- }
90
- }
91
-
92
- // seriesOptions - loop through series and apply same changes to each
93
- let applySeriesOptions = () => {
94
- let tempSeries = []
95
- if (options.seriesOptions) {
96
- let reference_index = options.config.series.reduce((acc, {evidenceSeriesType}, reference_index) => {
97
- if (evidenceSeriesType === 'reference_line' || evidenceSeriesType === 'reference_area' || evidenceSeriesType === 'reference_point') {
98
- acc.push(reference_index)
99
- }
100
- return acc
101
- }, [])
102
-
103
- for (let i = 0; i < options.config.series.length; i++) {
104
- if (reference_index.includes(i)) {
105
- tempSeries.push({})
106
- } else {
107
- tempSeries.push({...options.seriesOptions})
108
- }
109
- }
110
- chart.setOption({series: tempSeries})
111
- }
112
- }
113
-
114
- let applyChartOptions = () => {
115
- if (!chart) return
116
- markChartPending(chart.id)
117
- chart.setOption(
118
- {
119
- ...options.config,
120
- animation: false,
121
- animationDuration: ANIMATION_DURATION,
122
- animationDurationUpdate: ANIMATION_DURATION,
123
- },
124
- true,
125
- )
126
- applySeriesColors()
127
- applyEchartsOptions()
128
- applySeriesOptions()
129
- }
130
-
131
- // watching parent element is necessary for charts within `Fullscreen` components
132
- let parentElement = node.parentElement
133
- let onWindowResize = debounce(() => {
134
- if (!chart) return
135
- chart.resize({
136
- animation: {
137
- duration: ANIMATION_DURATION,
138
- },
139
- })
140
- updateLabelWidths()
141
- }, 100)
142
-
143
- let resizeObserver
144
- if (window.ResizeObserver && parentElement) {
145
- resizeObserver = new ResizeObserver(onWindowResize)
146
- resizeObserver.observe(parentElement)
147
- } else {
148
- window.addEventListener('resize', onWindowResize)
149
- }
150
-
151
- // Label width setting:
152
- let updateLabelWidths = () => {
153
- if (!chart) return
154
- if (options.showAllXAxisLabels) {
155
- // Make sure we operate on an up-to-date options object
156
- /** @type {import("echarts").EChartsOption} */
157
- let prevOption = chart.getOption()
158
- if (!prevOption) return
159
- // If the options object includes showing all x axis labels
160
- // Note: this isn't a standard option, but right now this is the easiest way to pass something to the action.
161
- // We don't want to have multiple resize observers if we can avoid it, and this is all due for a cleanup anyways
162
- // Get all the possible x values
163
- let distinctXValues = new Set(prevOption.series.flatMap(s => s.data?.map(d => d[0])))
164
- let modConst = 4 / 5
165
- let clientWidth = node?.clientWidth ?? 0
166
-
167
- // We disable this behavior because it doesn't make sense on horizontal bar charts
168
- // Category labels will grow to be visible
169
- // Value labels are interpolatable anyway
170
- if (!options.swapXY) {
171
- /** @type {import("echarts").EChartsOption} */
172
- let newOption = {
173
- xAxis: {
174
- axisLabel: {
175
- interval: 0,
176
- overflow: options.xAxisLabelOverflow,
177
- width: (clientWidth * modConst) / distinctXValues.size,
178
- },
179
- },
180
- }
181
- markChartPending(chart.id)
182
- chart.setOption(newOption)
183
- }
184
- }
185
- }
186
-
187
- /** @param {EChartsActionOptions} newOptions */
188
- let updateChart = newOptions => {
189
- let themeChanged = newOptions.theme !== options.theme
190
- options = newOptions
191
- if (!chart) return
192
- if (themeChanged) {
193
- chart.dispose()
194
- initChart()
195
- }
196
- applyChartOptions()
197
- chart.resize({
198
- animation: {
199
- duration: ANIMATION_DURATION,
200
- },
201
- })
202
- updateLabelWidths()
203
- }
204
-
205
- void (async () => {
206
- if (document?.fonts?.ready) await document.fonts.ready
207
- if (destroyed || chart) return
208
- initChart()
209
- applyChartOptions()
210
- chart.resize({
211
- animation: {
212
- duration: ANIMATION_DURATION,
213
- },
214
- })
215
- updateLabelWidths()
216
- })()
217
-
218
- window[Symbol.for('chart renders')] ??= 0
219
- window[Symbol.for('chart renders')]++
220
- return {
221
- update(options) {
222
- window[Symbol.for('chart renders')]++
223
- updateChart(options)
224
- },
225
- destroy() {
226
- destroyed = true
227
- if (!chart) return
228
- if (resizeObserver) {
229
- resizeObserver.unobserve(parentElement)
230
- } else {
231
- window.removeEventListener('resize', onWindowResize)
232
- }
233
- markChartFinished(chart.id)
234
- chart.dispose()
235
-
236
- chartWindowDebug.unset(chart.id)
237
- chart = undefined
238
- },
239
- }
240
- }
241
-
242
- const debounce = (callback, wait) => {
243
- let timeoutId = null
244
- return (...args) => {
245
- window.clearTimeout(timeoutId)
246
- timeoutId = window.setTimeout(() => {
247
- callback(...args)
248
- }, wait)
249
- }
250
- }
251
-
252
- export default echartsAction
@@ -1,443 +0,0 @@
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: ['#923d59', '#488f96', '#518eca', '#b3a9a0', '#ffc857', '#495867', '#bfdbf7', '#bc4749', '#eeebd0'],
135
- label: {
136
- color: '#f2f2f2',
137
- },
138
- },
139
- map: {
140
- itemStyle: {
141
- areaColor: '#eee',
142
- borderColor: '#444',
143
- borderWidth: 0.5,
144
- },
145
- label: {
146
- color: '#000',
147
- },
148
- emphasis: {
149
- itemStyle: {
150
- areaColor: 'rgba(255,215,0,0.8)',
151
- borderColor: '#444',
152
- borderWidth: 1,
153
- },
154
- label: {
155
- color: 'rgb(100,0,0)',
156
- },
157
- },
158
- },
159
- geo: {
160
- itemStyle: {
161
- areaColor: '#eee',
162
- borderColor: '#444',
163
- borderWidth: 0.5,
164
- },
165
- label: {
166
- color: '#000',
167
- },
168
- emphasis: {
169
- itemStyle: {
170
- areaColor: 'rgba(255,215,0,0.8)',
171
- borderColor: '#444',
172
- borderWidth: 1,
173
- },
174
- label: {
175
- color: 'rgb(100,0,0)',
176
- },
177
- },
178
- },
179
- categoryAxis: {
180
- axisLine: {
181
- show: true,
182
- lineStyle: {
183
- color: axisBaselineColor,
184
- },
185
- },
186
- axisTick: {
187
- show: false,
188
- lineStyle: {
189
- color: axisTickColor,
190
- },
191
- length: 3,
192
- alignWithLabel: true,
193
- },
194
- axisLabel: {
195
- show: true,
196
- color: axisLabelColor,
197
- },
198
- splitLine: {
199
- show: false,
200
- lineStyle: {
201
- color: [gridlineColor],
202
- },
203
- },
204
- splitArea: {
205
- show: false,
206
- areaStyle: {
207
- color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
208
- },
209
- },
210
- },
211
- valueAxis: {
212
- axisLine: {
213
- show: false,
214
- lineStyle: {
215
- color: axisBaselineColor,
216
- },
217
- },
218
- axisTick: {
219
- show: false,
220
- lineStyle: {
221
- color: axisTickColor,
222
- },
223
- length: 2,
224
- },
225
- axisLabel: {
226
- show: true,
227
- color: axisLabelColor,
228
- },
229
- splitLine: {
230
- show: true,
231
- lineStyle: {
232
- color: [gridlineColor],
233
- width: 1,
234
- },
235
- },
236
- splitArea: {
237
- show: false,
238
- areaStyle: {
239
- color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
240
- },
241
- },
242
- nameTextStyle: {
243
- backgroundColor: axisTitleBackgroundColor,
244
- },
245
- },
246
- logAxis: {
247
- axisLine: {
248
- show: false,
249
- lineStyle: {
250
- color: axisBaselineColor,
251
- },
252
- },
253
- axisTick: {
254
- show: false,
255
- lineStyle: {
256
- color: axisTickColor,
257
- },
258
- length: 2,
259
- },
260
- axisLabel: {
261
- show: true,
262
- color: axisLabelColor,
263
- },
264
- splitLine: {
265
- show: true,
266
- lineStyle: {
267
- color: [gridlineColor],
268
- },
269
- },
270
- splitArea: {
271
- show: false,
272
- areaStyle: {
273
- color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
274
- },
275
- },
276
- nameTextStyle: {
277
- backgroundColor: axisTitleBackgroundColor,
278
- },
279
- },
280
- timeAxis: {
281
- axisLine: {
282
- show: true,
283
- lineStyle: {
284
- color: axisBaselineColor,
285
- },
286
- },
287
- axisTick: {
288
- show: true,
289
- lineStyle: {
290
- color: axisTickColor,
291
- },
292
- length: 3,
293
- },
294
- axisLabel: {
295
- show: true,
296
- color: axisLabelColor,
297
- },
298
- splitLine: {
299
- show: false,
300
- lineStyle: {
301
- color: [gridlineColor],
302
- },
303
- },
304
- splitArea: {
305
- show: false,
306
- areaStyle: {
307
- color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)'],
308
- },
309
- },
310
- },
311
- toolbox: {
312
- iconStyle: {
313
- borderColor: '#999999',
314
- },
315
- emphasis: {
316
- iconStyle: {
317
- borderColor: '#459cde',
318
- },
319
- },
320
- },
321
- legend: {
322
- textStyle: {
323
- padding: [0, 0, 0, -7],
324
- color: legendTextColor,
325
- },
326
- // "padding": [15,0,0,0],
327
- icon: 'circle',
328
- pageIcons: {
329
- horizontal: [
330
- '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',
331
- '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',
332
- ],
333
- },
334
- pageIconColor: legendPageIconColor,
335
- pageIconSize: 12,
336
- pageTextStyle: {
337
- color: legendPageTextColor,
338
- },
339
- pageButtonItemGap: -2,
340
- animationDurationUpdate: 300,
341
- },
342
- tooltip: {
343
- axisPointer: {
344
- lineStyle: {
345
- color: '#cccccc',
346
- width: 1,
347
- },
348
- crossStyle: {
349
- color: '#cccccc',
350
- width: 1,
351
- },
352
- },
353
- borderRadius: 4,
354
- borderWidth: 1,
355
- borderColor: tooltipBorderColor,
356
- backgroundColor: tooltipBackgroundColor,
357
- textStyle: {
358
- color: tooltipTextColor,
359
- fontSize: 12,
360
- fontWeight: 400,
361
- },
362
- padding: 6,
363
- },
364
- timeline: {
365
- lineStyle: {
366
- color: '#e3e3e3',
367
- width: 2,
368
- },
369
- itemStyle: {
370
- color: '#d6d6d6',
371
- borderWidth: 1,
372
- },
373
- controlStyle: {
374
- color: '#bfbfbf',
375
- borderColor: '#bfbfbf',
376
- borderWidth: 1,
377
- },
378
- checkpointStyle: {
379
- color: '#8f8f8f',
380
- borderColor: '#ffffff',
381
- },
382
- label: {
383
- color: '#c9c9c9',
384
- },
385
- emphasis: {
386
- itemStyle: {
387
- color: '#9c9c9c',
388
- },
389
- controlStyle: {
390
- color: '#bfbfbf',
391
- borderColor: '#bfbfbf',
392
- borderWidth: 1,
393
- },
394
- label: {
395
- color: '#c9c9c9',
396
- },
397
- },
398
- },
399
- visualMap: {
400
- color: ['#c41621', '#e39588', '#f5ed98'],
401
- },
402
- dataZoom: {
403
- type: 'slider',
404
- bottom: 10,
405
- height: 30,
406
- showDetail: false,
407
- handleSize: '80%',
408
- borderColor: gridlineColor,
409
- handleStyle: {
410
- borderColor: gridlineColor,
411
- color: gridlineColor,
412
- },
413
- moveHandleStyle: {
414
- borderColor: gridlineColor,
415
- color: gridlineColor,
416
- },
417
- textStyle: {},
418
- emphasis: {
419
- handleStyle: {
420
- borderColor: gridlineColor,
421
- color: gridlineColor,
422
- },
423
- moveHandleStyle: {
424
- borderColor: gridlineColor,
425
- color: gridlineColor,
426
- },
427
- },
428
- },
429
- markPoint: {
430
- label: {
431
- color: '#f2f2f2',
432
- },
433
- emphasis: {
434
- label: {
435
- color: '#f2f2f2',
436
- },
437
- },
438
- },
439
- }
440
- }
441
-
442
- export const evidenceThemeLight = createTheme('light')
443
- export const evidenceThemeDark = createTheme('dark')
@@ -1,24 +0,0 @@
1
- import {applyTitleTagReplacement} from './formatting'
2
-
3
- export default function formatTitle(column, columnFormat) {
4
- let result = applyTitleTagReplacement(column, columnFormat)
5
- // Allow some acronyms to remain fully capitalized in titles:
6
- let acronyms = ['id', 'gdp']
7
- // Allow some joining words to remain fully lowercased in title:
8
- let lowercase = ['of', 'the', 'and', 'in', 'on']
9
- // Set name to proper casing:
10
- function toTitleCase(str) {
11
- return str.replace(/\S*/g, function (txt) {
12
- if (!acronyms.includes(txt) && !lowercase.includes(txt)) {
13
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
14
- } else if (acronyms.includes(txt)) {
15
- return txt.toUpperCase()
16
- } else {
17
- return txt.toLowerCase()
18
- }
19
- })
20
- }
21
- // Remove all underscores & double quotes before passing to title case function:
22
- result = toTitleCase(column.replace(/"/g, '').replace(/_/g, ' '))
23
- return result
24
- }