@graphenedata/cli 0.0.14 → 0.0.16
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.
- package/LICENSE.md +3 -3
- package/README.md +138 -0
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/bin.js +2 -2
- package/dist/cli/bigQuery-I3F46SC6.js +75 -0
- package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
- package/dist/cli/chunk-OVWODUTJ.js +12849 -0
- package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
- package/dist/cli/chunk-QAXEOZ43.js +53 -0
- package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
- package/dist/cli/cli.js +245 -10290
- package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
- package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
- package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
- package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
- package/dist/cli/serve2-TNN5EROW.js +447 -0
- package/dist/cli/serve2-TNN5EROW.js.map +7 -0
- package/dist/cli/snowflake-MOQB5GA4.js +128 -0
- package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
- package/dist/index.d.ts +63 -0
- package/dist/lang/index.d.ts +63 -0
- package/dist/skills/graphene/SKILL.md +235 -0
- package/dist/skills/graphene/references/big-value.md +20 -0
- package/dist/skills/graphene/references/date-range.md +64 -0
- package/dist/skills/graphene/references/dropdown.md +62 -0
- package/dist/skills/graphene/references/echarts.md +162 -0
- package/dist/skills/graphene/references/gsql.md +393 -0
- package/dist/skills/graphene/references/model-gsql.md +72 -0
- package/dist/skills/graphene/references/table.md +143 -0
- package/dist/skills/graphene/references/text-input.md +29 -0
- package/dist/ui/app.css +263 -299
- package/dist/ui/component-utilities/dataShaping.ts +484 -0
- package/dist/ui/component-utilities/dataSummary.ts +57 -0
- package/dist/ui/component-utilities/enrich.ts +763 -0
- package/dist/ui/component-utilities/format.ts +177 -0
- package/dist/ui/component-utilities/inputUtils.ts +48 -9
- package/dist/ui/component-utilities/theme.ts +200 -0
- package/dist/ui/component-utilities/themeStores.ts +26 -21
- package/dist/ui/component-utilities/types.ts +70 -0
- package/dist/ui/components/AreaChart.svelte +57 -105
- package/dist/ui/components/BarChart.svelte +71 -129
- package/dist/ui/components/BigValue.svelte +24 -40
- package/dist/ui/components/Column.svelte +11 -19
- package/dist/ui/components/DateRange.svelte +71 -34
- package/dist/ui/components/Dropdown.svelte +82 -49
- package/dist/ui/components/DropdownOption.svelte +1 -2
- package/dist/ui/components/ECharts.svelte +179 -60
- package/dist/ui/components/InlineDelta.svelte +51 -32
- package/dist/ui/components/LineChart.svelte +54 -125
- package/dist/ui/components/PieChart.svelte +27 -37
- package/dist/ui/components/QueryLoad.svelte +78 -44
- package/dist/ui/components/Row.svelte +2 -1
- package/dist/ui/components/ScatterPlot.svelte +52 -0
- package/dist/ui/components/Skeleton.svelte +32 -0
- package/dist/ui/components/Table.svelte +3 -2
- package/dist/ui/components/TableGroupRow.svelte +28 -36
- package/dist/ui/components/TableHarness.svelte +32 -0
- package/dist/ui/components/TableHeader.svelte +34 -59
- package/dist/ui/components/TableRow.svelte +15 -39
- package/dist/ui/components/TableSubtotalRow.svelte +26 -21
- package/dist/ui/components/TableTotalRow.svelte +27 -37
- package/dist/ui/components/TextInput.svelte +17 -14
- package/dist/ui/components/Value.svelte +25 -0
- package/dist/ui/components/_Table.svelte +80 -76
- package/dist/ui/internal/ChartGallery.svelte +527 -0
- package/dist/ui/internal/ErrorDisplay.svelte +60 -0
- package/dist/ui/internal/LocalApp.svelte +87 -19
- package/dist/ui/internal/PageNavGroup.svelte +269 -0
- package/dist/ui/internal/Sidebar.svelte +178 -0
- package/dist/ui/internal/SidebarToggle.svelte +47 -0
- package/dist/ui/internal/StyleGallery.svelte +244 -0
- package/dist/ui/internal/clientCache.ts +15 -13
- package/dist/ui/internal/pageInputs.svelte.js +292 -0
- package/dist/ui/internal/queryEngine.ts +124 -132
- package/dist/ui/internal/runSocket.ts +59 -0
- package/dist/ui/internal/sidebar.svelte.js +18 -0
- package/dist/ui/internal/telemetry.ts +52 -17
- package/dist/ui/internal/types.d.ts +7 -0
- package/dist/ui/web.js +55 -13
- package/package.json +40 -41
- package/dist/docs/agent-instructions.md +0 -18
- package/dist/docs/base.md +0 -98
- package/dist/docs/cli.md +0 -22
- package/dist/docs/graphene.md +0 -1462
- package/dist/ui/component-utilities/autoFormatting.js +0 -301
- package/dist/ui/component-utilities/builtInFormats.js +0 -482
- package/dist/ui/component-utilities/chartContext.js +0 -12
- package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
- package/dist/ui/component-utilities/checkInputs.js +0 -95
- package/dist/ui/component-utilities/convert.js +0 -15
- package/dist/ui/component-utilities/dateParsing.js +0 -57
- package/dist/ui/component-utilities/dropdownContext.ts +0 -1
- package/dist/ui/component-utilities/echarts.js +0 -272
- package/dist/ui/component-utilities/echartsThemes.js +0 -453
- package/dist/ui/component-utilities/formatTitle.js +0 -24
- package/dist/ui/component-utilities/formatting.js +0 -250
- package/dist/ui/component-utilities/getColumnExtents.js +0 -79
- package/dist/ui/component-utilities/getColumnSummary.js +0 -67
- package/dist/ui/component-utilities/getCompletedData.js +0 -114
- package/dist/ui/component-utilities/getDistinctCount.js +0 -7
- package/dist/ui/component-utilities/getDistinctValues.js +0 -15
- package/dist/ui/component-utilities/getSeriesConfig.js +0 -237
- package/dist/ui/component-utilities/getSortedData.js +0 -7
- package/dist/ui/component-utilities/getStackPercentages.js +0 -43
- package/dist/ui/component-utilities/getStackedData.js +0 -17
- package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
- package/dist/ui/component-utilities/globalContexts.js +0 -1
- package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
- package/dist/ui/component-utilities/replaceNulls.js +0 -14
- package/dist/ui/component-utilities/tableUtils.ts +0 -120
- package/dist/ui/components/Area.svelte +0 -214
- package/dist/ui/components/Bar.svelte +0 -350
- package/dist/ui/components/Chart.svelte +0 -989
- package/dist/ui/components/ErrorChart.svelte +0 -118
- package/dist/ui/components/Line.svelte +0 -227
- package/dist/ui/internal/NavSidebar.svelte +0 -396
- package/dist/ui/internal/PageError.svelte +0 -23
- package/dist/ui/internal/checkSocket.ts +0 -48
- package/dist/ui/internal/theme.ts +0 -88
- package/dist/ui/public/inter-latin-ext.woff2 +0 -0
- package/dist/ui/public/inter-latin.woff2 +0 -0
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
type GrapheneError = {
|
|
3
|
-
type?: string
|
|
4
|
-
id?: string
|
|
5
|
-
file?: string
|
|
6
|
-
message?: string
|
|
7
|
-
stack?: string
|
|
8
|
-
from?: {line?: number, col?: number, lineText?: string}
|
|
9
|
-
loc?: {line?: number, column?: number}
|
|
10
|
-
line?: number
|
|
11
|
-
column?: number
|
|
12
|
-
codeFrame?: string
|
|
13
|
-
frame?: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface Props {
|
|
17
|
-
error: unknown
|
|
18
|
-
title?: string
|
|
19
|
-
height?: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let {error, title: _title, height = 200}: Props = $props()
|
|
23
|
-
|
|
24
|
-
function parseError (raw: unknown): GrapheneError {
|
|
25
|
-
if (raw instanceof Error) return {message: raw.message, stack: raw.stack}
|
|
26
|
-
if (typeof raw === 'string') return {message: raw}
|
|
27
|
-
if (raw && typeof raw === 'object') return raw as GrapheneError
|
|
28
|
-
return {message: String(raw)}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function lineDetails (e: GrapheneError) {
|
|
32
|
-
let line = e.from?.line ?? e.loc?.line ?? e.line
|
|
33
|
-
let column = e.from?.col ?? e.loc?.column ?? e.column
|
|
34
|
-
let lineText = e.from?.lineText
|
|
35
|
-
let pointer = Number.isFinite(column) ? `${' '.repeat(Math.max(0, (column || 1) - 1))}^` : ''
|
|
36
|
-
return {line, lineText, pointer}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function classifyError (e: GrapheneError) {
|
|
40
|
-
if (e.type === 'analysis' || e.from || e.loc || e.codeFrame || e.frame) return `GSQL error - ${e.message || 'Unknown query error'}`
|
|
41
|
-
if (e.type === 'database') return 'Database query failed'
|
|
42
|
-
if (e.type === 'server') return 'Server error while running query'
|
|
43
|
-
return 'Query failed'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
let parsed = $derived.by(() => {
|
|
47
|
-
let e = parseError(error)
|
|
48
|
-
let heading = classifyError(e)
|
|
49
|
-
let message = e.message || 'An unknown error occurred'
|
|
50
|
-
let details: string[] = []
|
|
51
|
-
let line = lineDetails(e)
|
|
52
|
-
// Query errors can be analyzed from generated wrapper gsql (`table <name> as (...)`).
|
|
53
|
-
// When that happens, line numbers are often for synthetic sql and can be misleading,
|
|
54
|
-
// but the captured source line text and caret are still accurate and useful to users.
|
|
55
|
-
// So we show file + line only when the diagnostic has a reliable line.
|
|
56
|
-
let fileLine = e.file && e.file !== 'input' ? `${e.file}${line.line ? `:${line.line}` : ''}` : undefined
|
|
57
|
-
|
|
58
|
-
if (e.id) details.push(e.id)
|
|
59
|
-
if (fileLine) details.push(fileLine)
|
|
60
|
-
else if (line.line) details.push(`Line ${line.line}`)
|
|
61
|
-
if (line.lineText) details.push(line.lineText)
|
|
62
|
-
if (line.pointer) details.push(line.pointer)
|
|
63
|
-
if (e.codeFrame) details.push(e.codeFrame)
|
|
64
|
-
if (e.frame) details.push(e.frame)
|
|
65
|
-
|
|
66
|
-
if (heading.startsWith('GSQL error - ')) message = ''
|
|
67
|
-
return {heading, message, details}
|
|
68
|
-
})
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<div class="error-chart" style={`min-height:${height}px`} role="alert">
|
|
72
|
-
<div class="error-chart__heading">{parsed.heading}</div>
|
|
73
|
-
{#if parsed.message}
|
|
74
|
-
<div class="error-chart__message">{parsed.message}</div>
|
|
75
|
-
{/if}
|
|
76
|
-
{#if parsed.details.length}
|
|
77
|
-
<pre class="error-chart__details">{parsed.details.join('\n')}</pre>
|
|
78
|
-
{/if}
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<style>
|
|
82
|
-
.error-chart {
|
|
83
|
-
width: 100%;
|
|
84
|
-
display: grid;
|
|
85
|
-
place-items: center;
|
|
86
|
-
padding: 16px;
|
|
87
|
-
margin: 12px 0;
|
|
88
|
-
border-radius: 6px;
|
|
89
|
-
border: 1px solid rgba(220, 38, 38, 0.4);
|
|
90
|
-
background: rgba(254, 226, 226, 0.7);
|
|
91
|
-
color: #991b1b;
|
|
92
|
-
box-sizing: border-box;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.error-chart__heading {
|
|
96
|
-
font-weight: 700;
|
|
97
|
-
margin-bottom: 4px;
|
|
98
|
-
text-align: center;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.error-chart__message {
|
|
102
|
-
margin: 0;
|
|
103
|
-
text-align: center;
|
|
104
|
-
max-width: 72ch;
|
|
105
|
-
line-height: 1.4;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.error-chart__details {
|
|
109
|
-
margin: 10px 0 0;
|
|
110
|
-
font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
111
|
-
font-size: 12px;
|
|
112
|
-
white-space: pre-wrap;
|
|
113
|
-
word-break: break-word;
|
|
114
|
-
max-width: 100%;
|
|
115
|
-
color: inherit;
|
|
116
|
-
background: transparent;
|
|
117
|
-
}
|
|
118
|
-
</style>
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {getContext} from 'svelte'
|
|
3
|
-
import type {Writable} from 'svelte/store'
|
|
4
|
-
import {propKey, configKey} from '../component-utilities/chartContext.js'
|
|
5
|
-
import getSeriesConfig from '../component-utilities/getSeriesConfig.js'
|
|
6
|
-
import formatTitle from '../component-utilities/formatTitle.js'
|
|
7
|
-
import getCompletedData from '../component-utilities/getCompletedData.js'
|
|
8
|
-
import getYAxisIndex from '../component-utilities/getYAxisIndex.js'
|
|
9
|
-
import {formatValue, getFormatObjectFromString} from '../component-utilities/formatting.js'
|
|
10
|
-
import {getThemeStores} from '../component-utilities/themeStores'
|
|
11
|
-
import {toBoolean} from '../component-utilities/convert'
|
|
12
|
-
import {parseCommaList} from '../component-utilities/inputUtils.ts'
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
y?: any, y2?: any, series?: any, options?: any, name?: any, lineColor?: any, lineWidth?: number
|
|
16
|
-
lineType?: string, lineOpacity?: any, markers?: boolean | string, markerShape?: string
|
|
17
|
-
markerSize?: number, labels?: boolean | string, labelSize?: number, labelPosition?: string
|
|
18
|
-
labelColor?: any, labelFmt?: any, yLabelFmt?: any, y2LabelFmt?: any, showAllLabels?: boolean | string
|
|
19
|
-
y2SeriesType?: any, handleMissing?: string, step?: boolean | string, stepPosition?: string
|
|
20
|
-
seriesOrder?: any, seriesLabelFmt?: any
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const {resolveColor} = getThemeStores()
|
|
24
|
-
const chartProps: Writable<any> = getContext(propKey)
|
|
25
|
-
const config: Writable<any> = getContext(configKey)
|
|
26
|
-
|
|
27
|
-
let {
|
|
28
|
-
y = undefined, y2 = undefined, series = undefined, options = undefined, name = undefined,
|
|
29
|
-
lineColor = undefined, lineWidth = 2, lineType = 'solid', lineOpacity = undefined, markers = false,
|
|
30
|
-
markerShape = 'circle', markerSize = 8, labels = false, labelSize = 11, labelPosition = 'top',
|
|
31
|
-
labelColor = undefined, labelFmt = undefined, yLabelFmt = undefined, y2LabelFmt = undefined,
|
|
32
|
-
showAllLabels = false, y2SeriesType = undefined, handleMissing = 'gap', step = false,
|
|
33
|
-
stepPosition = 'end', seriesOrder = undefined, seriesLabelFmt = undefined,
|
|
34
|
-
}: Props = $props()
|
|
35
|
-
|
|
36
|
-
// Use $derived for values that depend on props
|
|
37
|
-
let ySet = $derived(y ? true : false)
|
|
38
|
-
let y2Set = $derived(y2 ? true : false)
|
|
39
|
-
let seriesSet = $derived(series ? true : false)
|
|
40
|
-
|
|
41
|
-
let lineColorStore = $derived(resolveColor(lineColor))
|
|
42
|
-
let labelColorStore = $derived(resolveColor(labelColor))
|
|
43
|
-
let markersBool = $derived(toBoolean(markers))
|
|
44
|
-
let labelsBool = $derived(toBoolean(labels))
|
|
45
|
-
let showAllLabelsBool = $derived(toBoolean(showAllLabels))
|
|
46
|
-
let stepBool = $derived(toBoolean(step))
|
|
47
|
-
|
|
48
|
-
// Format objects derived from props
|
|
49
|
-
let labelFormat = $derived(labelFmt ? getFormatObjectFromString(labelFmt) : undefined)
|
|
50
|
-
let yLabelFormat = $derived(yLabelFmt ? getFormatObjectFromString(yLabelFmt) : undefined)
|
|
51
|
-
let y2LabelFormat = $derived(y2LabelFmt ? getFormatObjectFromString(y2LabelFmt) : undefined)
|
|
52
|
-
|
|
53
|
-
const labelPositions = {above: 'top', below: 'bottom', middle: 'inside'}
|
|
54
|
-
const swapXYLabelPositions = {above: 'right', below: 'left', middle: 'inside'}
|
|
55
|
-
|
|
56
|
-
// Derive values from chartProps store instead of using $effect to assign
|
|
57
|
-
let data = $derived($chartProps.data)
|
|
58
|
-
let x = $derived($chartProps.x)
|
|
59
|
-
let swapXY = $derived($chartProps.swapXY)
|
|
60
|
-
let yFormat = $derived($chartProps.yFormat)
|
|
61
|
-
let y2Format = $derived($chartProps.y2Format)
|
|
62
|
-
let yCount = $derived($chartProps.yCount)
|
|
63
|
-
let y2Count = $derived($chartProps.y2Count)
|
|
64
|
-
let xType = $derived($chartProps.xType)
|
|
65
|
-
let xMismatch = $derived($chartProps.xMismatch)
|
|
66
|
-
let columnSummary = $derived($chartProps.columnSummary)
|
|
67
|
-
let resolvedSeries = $derived(seriesSet ? series : $chartProps.series)
|
|
68
|
-
let resolvedY = $derived(ySet ? parseCommaList(y) : $chartProps.y)
|
|
69
|
-
let resolvedY2 = $derived(y2Set ? parseCommaList(y2) : $chartProps.y2)
|
|
70
|
-
let resolvedSeriesOrder = $derived(parseCommaList(seriesOrder))
|
|
71
|
-
|
|
72
|
-
// Compute all the derived state in one $derived.by block to avoid read/write conflicts
|
|
73
|
-
let computedState = $derived.by(() => {
|
|
74
|
-
let isSingleSeries = !resolvedSeries && (!Array.isArray(resolvedY) || resolvedY.length === 1)
|
|
75
|
-
let computedData = data
|
|
76
|
-
let computedName = name
|
|
77
|
-
let computedDefaultLabelPosition = swapXY ? 'right' : 'top'
|
|
78
|
-
|
|
79
|
-
if (!data || !columnSummary) {
|
|
80
|
-
return {
|
|
81
|
-
data: computedData,
|
|
82
|
-
name: computedName,
|
|
83
|
-
defaultLabelPosition: computedDefaultLabelPosition,
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (isSingleSeries) {
|
|
88
|
-
// Single Series
|
|
89
|
-
let col = Array.isArray(resolvedY) ? resolvedY[0] : resolvedY
|
|
90
|
-
if (col && columnSummary[col]) {
|
|
91
|
-
computedName = computedName ?? formatTitle(col, columnSummary[col].title)
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
// Multi Series
|
|
95
|
-
try {
|
|
96
|
-
computedData = getCompletedData(computedData, x, resolvedY, resolvedSeries)
|
|
97
|
-
} catch (error) {
|
|
98
|
-
globalThis.console?.warn('Failed to complete data', {error})
|
|
99
|
-
computedData = []
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Handle missing values
|
|
104
|
-
if (handleMissing === 'zero') {
|
|
105
|
-
try {
|
|
106
|
-
computedData = getCompletedData(computedData, x, resolvedY, resolvedSeries, true)
|
|
107
|
-
} catch (error) {
|
|
108
|
-
globalThis.console?.warn('Failed to complete data', {error})
|
|
109
|
-
computedData = []
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return {
|
|
114
|
-
data: computedData,
|
|
115
|
-
name: computedName,
|
|
116
|
-
defaultLabelPosition: computedDefaultLabelPosition,
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
// Extract computed values for use in template and other derived values
|
|
121
|
-
let processedData = $derived(computedState.data)
|
|
122
|
-
let resolvedName = $derived(computedState.name)
|
|
123
|
-
let defaultLabelPosition = $derived(computedState.defaultLabelPosition)
|
|
124
|
-
|
|
125
|
-
let resolvedLabelPosition = $derived(
|
|
126
|
-
(swapXY ? swapXYLabelPositions[labelPosition] : labelPositions[labelPosition]) ?? defaultLabelPosition,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
let chartOverrides = $derived({
|
|
130
|
-
yAxis: {boundaryGap: ['0%', '1%']},
|
|
131
|
-
xAxis: {boundaryGap: [xType === 'time' ? '2%' : '0%', '2%']},
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
$effect(() => {
|
|
135
|
-
// Don't run until we have data
|
|
136
|
-
if (!processedData || !columnSummary) return
|
|
137
|
-
|
|
138
|
-
let baseConfig = {
|
|
139
|
-
type: 'line',
|
|
140
|
-
label: {
|
|
141
|
-
show: labelsBool,
|
|
142
|
-
formatter: (params: any) =>
|
|
143
|
-
params.value[swapXY ? 0 : 1] === 0
|
|
144
|
-
? ''
|
|
145
|
-
: formatValue(
|
|
146
|
-
params.value[swapXY ? 0 : 1],
|
|
147
|
-
[yLabelFormat ?? labelFormat ?? yFormat, y2LabelFormat ?? labelFormat ?? y2Format][
|
|
148
|
-
getYAxisIndex(params.componentIndex, yCount, y2Count)
|
|
149
|
-
],
|
|
150
|
-
),
|
|
151
|
-
fontSize: labelSize,
|
|
152
|
-
color: $labelColorStore,
|
|
153
|
-
position: resolvedLabelPosition,
|
|
154
|
-
padding: 3,
|
|
155
|
-
},
|
|
156
|
-
labelLayout: {hideOverlap: showAllLabelsBool ? false : true},
|
|
157
|
-
connectNulls: handleMissing === 'connect',
|
|
158
|
-
emphasis: {
|
|
159
|
-
focus: 'series',
|
|
160
|
-
endLabel: {show: false},
|
|
161
|
-
lineStyle: {opacity: 1, width: 3},
|
|
162
|
-
},
|
|
163
|
-
lineStyle: {width: parseInt(lineWidth as string), type: lineType, opacity: lineOpacity},
|
|
164
|
-
itemStyle: {color: $lineColorStore, opacity: lineOpacity},
|
|
165
|
-
showSymbol: labelsBool || markersBool,
|
|
166
|
-
symbol: markerShape,
|
|
167
|
-
symbolSize: labelsBool && !markersBool ? 0 : markerSize,
|
|
168
|
-
step: stepBool ? stepPosition : false,
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
let seriesConfig = getSeriesConfig(
|
|
172
|
-
processedData,
|
|
173
|
-
x,
|
|
174
|
-
resolvedY,
|
|
175
|
-
resolvedSeries,
|
|
176
|
-
swapXY,
|
|
177
|
-
baseConfig,
|
|
178
|
-
resolvedName,
|
|
179
|
-
xMismatch,
|
|
180
|
-
columnSummary,
|
|
181
|
-
resolvedSeriesOrder,
|
|
182
|
-
undefined,
|
|
183
|
-
undefined,
|
|
184
|
-
resolvedY2,
|
|
185
|
-
seriesLabelFmt,
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
config.update((d: any) => {
|
|
189
|
-
// Guard against incomplete config state
|
|
190
|
-
if (!d.series) d.series = []
|
|
191
|
-
if (!d.legend) d.legend = {data: []}
|
|
192
|
-
if (!d.legend.data) d.legend.data = []
|
|
193
|
-
|
|
194
|
-
d.series.push(...seriesConfig)
|
|
195
|
-
d.legend.data.push(...seriesConfig.map((entry: any) => entry.name.toString()))
|
|
196
|
-
return d
|
|
197
|
-
})
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
// Use $effect.pre() instead of beforeUpdate for runes mode
|
|
201
|
-
$effect.pre(() => {
|
|
202
|
-
if (options) {
|
|
203
|
-
config.update((d: any) => ({...d, ...options}))
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (!chartOverrides) return
|
|
207
|
-
config.update((d: any) => {
|
|
208
|
-
if (!d.yAxis || !Array.isArray(d.yAxis)) return d
|
|
209
|
-
if (swapXY) {
|
|
210
|
-
d.yAxis = {...d.yAxis, ...chartOverrides.xAxis}
|
|
211
|
-
d.xAxis = {...d.xAxis, ...chartOverrides.yAxis}
|
|
212
|
-
if (labelsBool) d.axisPointer = {triggerEmphasis: false}
|
|
213
|
-
return d
|
|
214
|
-
}
|
|
215
|
-
if (d.yAxis[0]) d.yAxis[0] = {...d.yAxis[0], ...chartOverrides.yAxis}
|
|
216
|
-
d.xAxis = {...d.xAxis, ...chartOverrides.xAxis}
|
|
217
|
-
if (y2Count > 0 && d.yAxis[1]) {
|
|
218
|
-
let shouldSetY2Type = y2SeriesType && ['line', 'bar', 'scatter'].includes(y2SeriesType) && d.series
|
|
219
|
-
for (let i = 0; shouldSetY2Type && i < y2Count; i++) {
|
|
220
|
-
if (d.series[yCount + i]) d.series[yCount + i].type = y2SeriesType
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
if (labelsBool) d.axisPointer = {triggerEmphasis: false}
|
|
224
|
-
return d
|
|
225
|
-
})
|
|
226
|
-
})
|
|
227
|
-
</script>
|