@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.
Files changed (121) hide show
  1. package/LICENSE.md +3 -3
  2. package/README.md +138 -0
  3. package/THIRD_PARTY_NOTICES.md +1 -0
  4. package/bin.js +2 -2
  5. package/dist/cli/bigQuery-I3F46SC6.js +75 -0
  6. package/dist/cli/bigQuery-I3F46SC6.js.map +7 -0
  7. package/dist/cli/chunk-OVWODUTJ.js +12849 -0
  8. package/dist/cli/chunk-OVWODUTJ.js.map +7 -0
  9. package/dist/cli/chunk-QAXEOZ43.js +53 -0
  10. package/dist/cli/chunk-QAXEOZ43.js.map +7 -0
  11. package/dist/cli/cli.js +245 -10290
  12. package/dist/cli/clickhouse-ZN5AN2UL.js +64 -0
  13. package/dist/cli/clickhouse-ZN5AN2UL.js.map +7 -0
  14. package/dist/cli/duckdb-IYBIO5KJ.js +87 -0
  15. package/dist/cli/duckdb-IYBIO5KJ.js.map +7 -0
  16. package/dist/cli/serve2-TNN5EROW.js +447 -0
  17. package/dist/cli/serve2-TNN5EROW.js.map +7 -0
  18. package/dist/cli/snowflake-MOQB5GA4.js +128 -0
  19. package/dist/cli/snowflake-MOQB5GA4.js.map +7 -0
  20. package/dist/index.d.ts +63 -0
  21. package/dist/lang/index.d.ts +63 -0
  22. package/dist/skills/graphene/SKILL.md +235 -0
  23. package/dist/skills/graphene/references/big-value.md +20 -0
  24. package/dist/skills/graphene/references/date-range.md +64 -0
  25. package/dist/skills/graphene/references/dropdown.md +62 -0
  26. package/dist/skills/graphene/references/echarts.md +162 -0
  27. package/dist/skills/graphene/references/gsql.md +393 -0
  28. package/dist/skills/graphene/references/model-gsql.md +72 -0
  29. package/dist/skills/graphene/references/table.md +143 -0
  30. package/dist/skills/graphene/references/text-input.md +29 -0
  31. package/dist/ui/app.css +263 -299
  32. package/dist/ui/component-utilities/dataShaping.ts +484 -0
  33. package/dist/ui/component-utilities/dataSummary.ts +57 -0
  34. package/dist/ui/component-utilities/enrich.ts +763 -0
  35. package/dist/ui/component-utilities/format.ts +177 -0
  36. package/dist/ui/component-utilities/inputUtils.ts +48 -9
  37. package/dist/ui/component-utilities/theme.ts +200 -0
  38. package/dist/ui/component-utilities/themeStores.ts +26 -21
  39. package/dist/ui/component-utilities/types.ts +70 -0
  40. package/dist/ui/components/AreaChart.svelte +57 -105
  41. package/dist/ui/components/BarChart.svelte +71 -129
  42. package/dist/ui/components/BigValue.svelte +24 -40
  43. package/dist/ui/components/Column.svelte +11 -19
  44. package/dist/ui/components/DateRange.svelte +71 -34
  45. package/dist/ui/components/Dropdown.svelte +82 -49
  46. package/dist/ui/components/DropdownOption.svelte +1 -2
  47. package/dist/ui/components/ECharts.svelte +179 -60
  48. package/dist/ui/components/InlineDelta.svelte +51 -32
  49. package/dist/ui/components/LineChart.svelte +54 -125
  50. package/dist/ui/components/PieChart.svelte +27 -37
  51. package/dist/ui/components/QueryLoad.svelte +78 -44
  52. package/dist/ui/components/Row.svelte +2 -1
  53. package/dist/ui/components/ScatterPlot.svelte +52 -0
  54. package/dist/ui/components/Skeleton.svelte +32 -0
  55. package/dist/ui/components/Table.svelte +3 -2
  56. package/dist/ui/components/TableGroupRow.svelte +28 -36
  57. package/dist/ui/components/TableHarness.svelte +32 -0
  58. package/dist/ui/components/TableHeader.svelte +34 -59
  59. package/dist/ui/components/TableRow.svelte +15 -39
  60. package/dist/ui/components/TableSubtotalRow.svelte +26 -21
  61. package/dist/ui/components/TableTotalRow.svelte +27 -37
  62. package/dist/ui/components/TextInput.svelte +17 -14
  63. package/dist/ui/components/Value.svelte +25 -0
  64. package/dist/ui/components/_Table.svelte +80 -76
  65. package/dist/ui/internal/ChartGallery.svelte +527 -0
  66. package/dist/ui/internal/ErrorDisplay.svelte +60 -0
  67. package/dist/ui/internal/LocalApp.svelte +87 -19
  68. package/dist/ui/internal/PageNavGroup.svelte +269 -0
  69. package/dist/ui/internal/Sidebar.svelte +178 -0
  70. package/dist/ui/internal/SidebarToggle.svelte +47 -0
  71. package/dist/ui/internal/StyleGallery.svelte +244 -0
  72. package/dist/ui/internal/clientCache.ts +15 -13
  73. package/dist/ui/internal/pageInputs.svelte.js +292 -0
  74. package/dist/ui/internal/queryEngine.ts +124 -132
  75. package/dist/ui/internal/runSocket.ts +59 -0
  76. package/dist/ui/internal/sidebar.svelte.js +18 -0
  77. package/dist/ui/internal/telemetry.ts +52 -17
  78. package/dist/ui/internal/types.d.ts +7 -0
  79. package/dist/ui/web.js +55 -13
  80. package/package.json +40 -41
  81. package/dist/docs/agent-instructions.md +0 -18
  82. package/dist/docs/base.md +0 -98
  83. package/dist/docs/cli.md +0 -22
  84. package/dist/docs/graphene.md +0 -1462
  85. package/dist/ui/component-utilities/autoFormatting.js +0 -301
  86. package/dist/ui/component-utilities/builtInFormats.js +0 -482
  87. package/dist/ui/component-utilities/chartContext.js +0 -12
  88. package/dist/ui/component-utilities/chartWindowDebug.js +0 -21
  89. package/dist/ui/component-utilities/checkInputs.js +0 -95
  90. package/dist/ui/component-utilities/convert.js +0 -15
  91. package/dist/ui/component-utilities/dateParsing.js +0 -57
  92. package/dist/ui/component-utilities/dropdownContext.ts +0 -1
  93. package/dist/ui/component-utilities/echarts.js +0 -272
  94. package/dist/ui/component-utilities/echartsThemes.js +0 -453
  95. package/dist/ui/component-utilities/formatTitle.js +0 -24
  96. package/dist/ui/component-utilities/formatting.js +0 -250
  97. package/dist/ui/component-utilities/getColumnExtents.js +0 -79
  98. package/dist/ui/component-utilities/getColumnSummary.js +0 -67
  99. package/dist/ui/component-utilities/getCompletedData.js +0 -114
  100. package/dist/ui/component-utilities/getDistinctCount.js +0 -7
  101. package/dist/ui/component-utilities/getDistinctValues.js +0 -15
  102. package/dist/ui/component-utilities/getSeriesConfig.js +0 -237
  103. package/dist/ui/component-utilities/getSortedData.js +0 -7
  104. package/dist/ui/component-utilities/getStackPercentages.js +0 -43
  105. package/dist/ui/component-utilities/getStackedData.js +0 -17
  106. package/dist/ui/component-utilities/getYAxisIndex.js +0 -15
  107. package/dist/ui/component-utilities/globalContexts.js +0 -1
  108. package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +0 -119
  109. package/dist/ui/component-utilities/replaceNulls.js +0 -14
  110. package/dist/ui/component-utilities/tableUtils.ts +0 -120
  111. package/dist/ui/components/Area.svelte +0 -214
  112. package/dist/ui/components/Bar.svelte +0 -350
  113. package/dist/ui/components/Chart.svelte +0 -989
  114. package/dist/ui/components/ErrorChart.svelte +0 -118
  115. package/dist/ui/components/Line.svelte +0 -227
  116. package/dist/ui/internal/NavSidebar.svelte +0 -396
  117. package/dist/ui/internal/PageError.svelte +0 -23
  118. package/dist/ui/internal/checkSocket.ts +0 -48
  119. package/dist/ui/internal/theme.ts +0 -88
  120. package/dist/ui/public/inter-latin-ext.woff2 +0 -0
  121. package/dist/ui/public/inter-latin.woff2 +0 -0
@@ -0,0 +1,527 @@
1
+ <script lang="ts">
2
+ import ECharts from '../components/ECharts.svelte'
3
+
4
+ let monthRows = [
5
+ {month: '2024-01-01', value: 0.082},
6
+ {month: '2024-02-01', value: 0.0932},
7
+ {month: '2024-03-01', value: 0.0901},
8
+ {month: '2024-04-01', value: 0.129},
9
+ {month: '2024-05-01', value: 0.133},
10
+ {month: '2024-06-01', value: 0.152},
11
+ ]
12
+
13
+ let weekdaySeriesRows = [
14
+ {day_of_week: 1, metric: 'Downloads', value: 150},
15
+ {day_of_week: 2, metric: 'Downloads', value: 230},
16
+ {day_of_week: 3, metric: 'Downloads', value: 224},
17
+ {day_of_week: 4, metric: 'Downloads', value: 218},
18
+ {day_of_week: 5, metric: 'Downloads', value: 335},
19
+ {day_of_week: 6, metric: 'Downloads', value: 410},
20
+ {day_of_week: 7, metric: 'Downloads', value: 360},
21
+ {day_of_week: 1, metric: 'Installs', value: 80},
22
+ {day_of_week: 2, metric: 'Installs', value: 120},
23
+ {day_of_week: 3, metric: 'Installs', value: 150},
24
+ {day_of_week: 4, metric: 'Installs', value: 130},
25
+ {day_of_week: 5, metric: 'Installs', value: 210},
26
+ {day_of_week: 6, metric: 'Installs', value: 280},
27
+ {day_of_week: 7, metric: 'Installs', value: 220},
28
+ ]
29
+
30
+ let quarterMetricRows = [
31
+ {quarter_of_year: 1, metric: 'Revenue', value: 42},
32
+ {quarter_of_year: 2, metric: 'Revenue', value: 51},
33
+ {quarter_of_year: 3, metric: 'Revenue', value: 48},
34
+ {quarter_of_year: 4, metric: 'Revenue', value: 67},
35
+ {quarter_of_year: 1, metric: 'Cost', value: 28},
36
+ {quarter_of_year: 2, metric: 'Cost', value: 32},
37
+ {quarter_of_year: 3, metric: 'Cost', value: 30},
38
+ {quarter_of_year: 4, metric: 'Cost', value: 38},
39
+ ]
40
+
41
+ let hourOrdinalRows = [
42
+ {hour_of_day: 22, volume: 120},
43
+ {hour_of_day: 7, volume: 95},
44
+ {hour_of_day: 14, volume: 143},
45
+ {hour_of_day: 3, volume: 60},
46
+ {hour_of_day: 19, volume: 158},
47
+ {hour_of_day: 10, volume: 112},
48
+ ]
49
+
50
+
51
+ let scatterRows = [
52
+ {group: 'Group A', x: 10, y: 8},
53
+ {group: 'Group A', x: 20, y: 35},
54
+ {group: 'Group A', x: 30, y: 22},
55
+ {group: 'Group A', x: 40, y: 60},
56
+ {group: 'Group A', x: 50, y: 55},
57
+ {group: 'Group A', x: 60, y: 80},
58
+ {group: 'Group A', x: 70, y: 75},
59
+ {group: 'Group B', x: 15, y: 5},
60
+ {group: 'Group B', x: 25, y: 18},
61
+ {group: 'Group B', x: 35, y: 30},
62
+ {group: 'Group B', x: 45, y: 40},
63
+ {group: 'Group B', x: 55, y: 35},
64
+ {group: 'Group B', x: 65, y: 50},
65
+ {group: 'Group B', x: 75, y: 60},
66
+ ]
67
+
68
+
69
+ let pieRows = [
70
+ {channel: 'Organic', value: 335},
71
+ {channel: 'Paid', value: 310},
72
+ {channel: 'Referral', value: 234},
73
+ {channel: 'Social', value: 135},
74
+ ]
75
+
76
+ let heatmapRows = [
77
+ {day: 'Mon', period: 'Morning', value: 28},
78
+ {day: 'Tue', period: 'Morning', value: 33},
79
+ {day: 'Wed', period: 'Morning', value: 47},
80
+ {day: 'Thu', period: 'Morning', value: 40},
81
+ {day: 'Fri', period: 'Morning', value: 38},
82
+ {day: 'Sat', period: 'Morning', value: 25},
83
+ {day: 'Sun', period: 'Morning', value: 18},
84
+ {day: 'Mon', period: 'Evening', value: 66},
85
+ {day: 'Tue', period: 'Evening', value: 72},
86
+ {day: 'Wed', period: 'Evening', value: 81},
87
+ {day: 'Thu', period: 'Evening', value: 75},
88
+ {day: 'Fri', period: 'Evening', value: 69},
89
+ {day: 'Sat', period: 'Evening', value: 55},
90
+ {day: 'Sun', period: 'Evening', value: 44},
91
+ ]
92
+
93
+ let candleRows = [
94
+ {month: 'Jan', open: 20, close: 34, low: 10, high: 38},
95
+ {month: 'Feb', open: 40, close: 35, low: 30, high: 50},
96
+ {month: 'Mar', open: 31, close: 38, low: 33, high: 44},
97
+ {month: 'Apr', open: 38, close: 15, low: 5, high: 42},
98
+ {month: 'May', open: 12, close: 36, low: 10, high: 40},
99
+ {month: 'Jun', open: 27, close: 45, low: 25, high: 48},
100
+ {month: 'Jul', open: 38, close: 52, low: 35, high: 56},
101
+ {month: 'Aug', open: 49, close: 60, low: 45, high: 65},
102
+ ]
103
+
104
+ let funnelRows = [
105
+ {stage: 'Visited', value: 100},
106
+ {stage: 'Inquiry', value: 80},
107
+ {stage: 'Order', value: 60},
108
+ {stage: 'Payment', value: 40},
109
+ {stage: 'Complete', value: 20},
110
+ ]
111
+
112
+ let treemapRows = [
113
+ {name: 'Storage', value: 40},
114
+ {name: 'Compute', value: 30},
115
+ {name: 'Network', value: 20},
116
+ {name: 'Database', value: 15},
117
+ {name: 'Security', value: 10},
118
+ {name: 'CDN', value: 8},
119
+ ]
120
+
121
+ let themeRiverRows = [
122
+ {month: '2024-01-01', topic: 'JS', value: 10},
123
+ {month: '2024-02-01', topic: 'JS', value: 15},
124
+ {month: '2024-03-01', topic: 'JS', value: 20},
125
+ {month: '2024-04-01', topic: 'JS', value: 18},
126
+ {month: '2024-05-01', topic: 'JS', value: 25},
127
+ {month: '2024-06-01', topic: 'JS', value: 30},
128
+ {month: '2024-01-01', topic: 'Python', value: 8},
129
+ {month: '2024-02-01', topic: 'Python', value: 12},
130
+ {month: '2024-03-01', topic: 'Python', value: 18},
131
+ {month: '2024-04-01', topic: 'Python', value: 22},
132
+ {month: '2024-05-01', topic: 'Python', value: 20},
133
+ {month: '2024-06-01', topic: 'Python', value: 25},
134
+ ]
135
+
136
+ let groupedStackedRows = [
137
+ {quarter: 'Q1', region: 'North', channel: 'Online', value: 160},
138
+ {quarter: 'Q1', region: 'North', channel: 'Retail', value: 110},
139
+ {quarter: 'Q1', region: 'South', channel: 'Online', value: 130},
140
+ {quarter: 'Q1', region: 'South', channel: 'Retail', value: 95},
141
+ {quarter: 'Q2', region: 'North', channel: 'Online', value: 175},
142
+ {quarter: 'Q2', region: 'North', channel: 'Retail', value: 120},
143
+ {quarter: 'Q2', region: 'South', channel: 'Online', value: 145},
144
+ {quarter: 'Q2', region: 'South', channel: 'Retail', value: 105},
145
+ {quarter: 'Q3', region: 'North', channel: 'Online', value: 190},
146
+ {quarter: 'Q3', region: 'North', channel: 'Retail', value: 125},
147
+ {quarter: 'Q3', region: 'South', channel: 'Online', value: 155},
148
+ {quarter: 'Q3', region: 'South', channel: 'Retail', value: 115},
149
+ ]
150
+ let groupedStackedSlots = Array.from(new Set(groupedStackedRows.map(row => `${row.quarter}|${row.region}`)))
151
+ let groupedStackedRegionLabels = groupedStackedSlots.map(slot => slot.split('|')[1])
152
+ let groupedStackedQuarterLabels = groupedStackedSlots.map((slot, index, slots) => {
153
+ let quarter = slot.split('|')[0]
154
+ let previousQuarter = slots[index - 1]?.split('|')[0]
155
+ return quarter === previousQuarter ? '' : quarter
156
+ })
157
+ let groupedStackedSlotRows = groupedStackedRows.map(row => ({
158
+ ...row,
159
+ slot: groupedStackedSlots.indexOf(`${row.quarter}|${row.region}`),
160
+ }))
161
+
162
+ let dualAxisRows = [
163
+ {month: '2024-01-01', revenue: 120, conversion_rate: 3.2},
164
+ {month: '2024-02-01', revenue: 138, conversion_rate: 3.5},
165
+ {month: '2024-03-01', revenue: 150, conversion_rate: 3.9},
166
+ {month: '2024-04-01', revenue: 166, conversion_rate: 4.1},
167
+ {month: '2024-05-01', revenue: 184, conversion_rate: 4.4},
168
+ {month: '2024-06-01', revenue: 205, conversion_rate: 4.8},
169
+ ]
170
+
171
+ let bubbleRows = [
172
+ {segment: 'SMB', efficiency: 42, growth: 28, pipeline: 120, quality: 55},
173
+ {segment: 'Mid Market', efficiency: 58, growth: 35, pipeline: 180, quality: 62},
174
+ {segment: 'Enterprise', efficiency: 66, growth: 48, pipeline: 260, quality: 70},
175
+ {segment: 'Public Sector', efficiency: 51, growth: 31, pipeline: 150, quality: 58},
176
+ {segment: 'Healthcare', efficiency: 63, growth: 44, pipeline: 220, quality: 68},
177
+ {segment: 'Retail', efficiency: 47, growth: 30, pipeline: 140, quality: 53},
178
+ ]
179
+
180
+ let sankeyRows = [
181
+ {source: 'Leads', target: 'Qualified', value: 420},
182
+ {source: 'Leads', target: 'Disqualified', value: 180},
183
+ {source: 'Qualified', target: 'Demo', value: 260},
184
+ {source: 'Qualified', target: 'No Decision', value: 160},
185
+ {source: 'Demo', target: 'Proposal', value: 190},
186
+ {source: 'Proposal', target: 'Won', value: 130},
187
+ {source: 'Proposal', target: 'Lost', value: 60},
188
+ ]
189
+
190
+ let chordRows = [
191
+ {source: 'Design', target: 'Engineering', value: 30},
192
+ {source: 'Design', target: 'Marketing', value: 12},
193
+ {source: 'Engineering', target: 'Support', value: 18},
194
+ {source: 'Engineering', target: 'Marketing', value: 8},
195
+ {source: 'Marketing', target: 'Sales', value: 24},
196
+ {source: 'Sales', target: 'Support', value: 16},
197
+ {source: 'Support', target: 'Design', value: 6},
198
+ ]
199
+
200
+ let beeswarmRows: {group: string; value: number}[] = []
201
+ for (let group of ['SMB', 'Mid Market', 'Enterprise', 'Public Sector']) {
202
+ for (let i = 0; i < 30; i++) beeswarmRows.push({group, value: Math.round(50 + (Math.random() - 0.5) * 40)})
203
+ }
204
+
205
+ let dayPeriods = ['Morning', 'Evening']
206
+ let weekDays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
207
+ </script>
208
+
209
+ <div class="chart-grid">
210
+ <ECharts
211
+ data={{
212
+ rows: monthRows,
213
+ fields: [
214
+ {name: 'month', type: 'date', metadata: {timeGrain: 'month'}},
215
+ {name: 'value', type: 'number', metadata: {ratio: true}},
216
+ ],
217
+ }}
218
+ config={{
219
+ title: {text: 'Line (Percentage Metadata)'},
220
+ series: [{type: 'line', encode: {x: 'month', y: 'value'}}],
221
+ }}
222
+ />
223
+
224
+ <ECharts
225
+ data={{
226
+ rows: weekdaySeriesRows,
227
+ fields: [
228
+ {name: 'day_of_week', type: 'number', metadata: {timeOrdinal: 'dow_1m'}},
229
+ {name: 'metric', type: 'string'},
230
+ {name: 'value', type: 'number'},
231
+ ],
232
+ }}
233
+ config={{
234
+ title: {text: 'Stacked Area'},
235
+ series: [{type: 'line', stack: 'total', areaStyle: {}, encode: {x: 'day_of_week', y: 'value', splitBy: 'metric'}}],
236
+ }}
237
+ />
238
+
239
+ <ECharts
240
+ data={{
241
+ rows: quarterMetricRows,
242
+ fields: [
243
+ {name: 'quarter_of_year', type: 'number', metadata: {timeOrdinal: 'quarter_of_year'}},
244
+ {name: 'metric', type: 'string'},
245
+ {name: 'value', type: 'number'},
246
+ ],
247
+ }}
248
+ config={{
249
+ title: {text: 'Bar (Quarter Ordinal)'},
250
+ series: [{type: 'bar', encode: {x: 'quarter_of_year', y: 'value', splitBy: 'metric'}}],
251
+ }}
252
+ />
253
+
254
+ <ECharts
255
+ data={{
256
+ rows: hourOrdinalRows,
257
+ fields: [
258
+ {name: 'hour_of_day', type: 'number', metadata: {timeOrdinal: 'hour_of_day'}},
259
+ {name: 'volume', type: 'number'},
260
+ ],
261
+ }}
262
+ config={{
263
+ title: {text: 'Line (Hour Ordinal)'},
264
+ series: [{type: 'line', encode: {x: 'hour_of_day', y: 'volume'}}],
265
+ }}
266
+ />
267
+
268
+
269
+ <ECharts
270
+ data={{
271
+ rows: scatterRows,
272
+ fields: [
273
+ {name: 'group', type: 'string'},
274
+ {name: 'x', type: 'number'},
275
+ {name: 'y', type: 'number'},
276
+ ],
277
+ }}
278
+ config={{
279
+ title: {text: 'Scatter'},
280
+ series: [{type: 'scatter', encode: {x: 'x', y: 'y', splitBy: 'group'}}],
281
+ }}
282
+ />
283
+
284
+ <ECharts
285
+ data={{
286
+ rows: groupedStackedSlotRows,
287
+ fields: [
288
+ {name: 'quarter', type: 'string'},
289
+ {name: 'region', type: 'string'},
290
+ {name: 'channel', type: 'string'},
291
+ {name: 'value', type: 'number'},
292
+ {name: 'slot', type: 'number'},
293
+ ],
294
+ }}
295
+ config={{
296
+ title: {text: 'Grouped + Stacked Bar (Two X-Axes)'},
297
+ tooltip: {trigger: 'axis'},
298
+ legend: {show: true},
299
+ grid: {bottom: 56},
300
+ xAxis: [
301
+ {type: 'category', data: groupedStackedRegionLabels, axisTick: {alignWithLabel: true}},
302
+ {type: 'category', data: groupedStackedQuarterLabels, position: 'bottom', offset: 24, axisTick: {show: false}},
303
+ ],
304
+ yAxis: {type: 'value'},
305
+ series: [{type: 'bar', stack: 'channels', encode: {x: 'slot', y: 'value', splitBy: 'channel'}}],
306
+ }}
307
+ />
308
+
309
+ <ECharts
310
+ data={{
311
+ rows: pieRows,
312
+ fields: [
313
+ {name: 'channel', type: 'string'},
314
+ {name: 'value', type: 'number'},
315
+ ],
316
+ }}
317
+ config={{
318
+ title: {text: 'Pie'},
319
+ tooltip: {trigger: 'item'},
320
+ series: [{type: 'pie', encode: {itemName: 'channel', value: 'value'}}],
321
+ }}
322
+ />
323
+
324
+ <ECharts
325
+ data={{
326
+ rows: heatmapRows,
327
+ fields: [
328
+ {name: 'day', type: 'string'},
329
+ {name: 'period', type: 'string'},
330
+ {name: 'value', type: 'number'},
331
+ ],
332
+ }}
333
+ config={{
334
+ title: {text: 'Heatmap'},
335
+ tooltip: {trigger: 'item'},
336
+ xAxis: {type: 'category', data: weekDays},
337
+ yAxis: {type: 'category', data: dayPeriods},
338
+ visualMap: {min: 0, max: 100, show: false},
339
+ series: [{type: 'heatmap', encode: {x: 'day', y: 'period', value: 'value'}}],
340
+ }}
341
+ />
342
+
343
+ <ECharts
344
+ data={{
345
+ rows: candleRows,
346
+ fields: [
347
+ {name: 'month', type: 'string'},
348
+ {name: 'open', type: 'number'},
349
+ {name: 'close', type: 'number'},
350
+ {name: 'low', type: 'number'},
351
+ {name: 'high', type: 'number'},
352
+ ],
353
+ }}
354
+ config={{
355
+ title: {text: 'Candlestick'},
356
+ tooltip: {trigger: 'axis'},
357
+ xAxis: {type: 'category'},
358
+ yAxis: {type: 'value', scale: true},
359
+ series: [{type: 'candlestick', encode: {x: 'month', y: ['open', 'close', 'low', 'high']}}],
360
+ }}
361
+ />
362
+
363
+ <ECharts
364
+ data={{
365
+ rows: funnelRows,
366
+ fields: [
367
+ {name: 'stage', type: 'string'},
368
+ {name: 'value', type: 'number'},
369
+ ],
370
+ }}
371
+ config={{
372
+ title: {text: 'Funnel'},
373
+ tooltip: {trigger: 'item'},
374
+ series: [{type: 'funnel', encode: {itemName: 'stage', value: 'value'}}],
375
+ }}
376
+ />
377
+
378
+ <ECharts
379
+ data={{
380
+ rows: treemapRows,
381
+ fields: [
382
+ {name: 'name', type: 'string'},
383
+ {name: 'value', type: 'number'},
384
+ ],
385
+ }}
386
+ config={{
387
+ title: {text: 'Treemap'},
388
+ tooltip: {trigger: 'item'},
389
+ series: [{type: 'treemap', encode: {itemName: 'name', value: 'value'}}],
390
+ }}
391
+ />
392
+
393
+ <ECharts
394
+ data={{
395
+ rows: themeRiverRows,
396
+ fields: [
397
+ {name: 'month', type: 'date'},
398
+ {name: 'topic', type: 'string'},
399
+ {name: 'value', type: 'number'},
400
+ ],
401
+ }}
402
+ config={{
403
+ title: {text: 'Theme River'},
404
+ tooltip: {trigger: 'axis'},
405
+ singleAxis: {type: 'time'},
406
+ series: [{type: 'themeRiver', encode: {single: 'month', value: 'value', seriesName: 'topic', splitBy: 'topic'}}],
407
+ }}
408
+ />
409
+
410
+ <ECharts
411
+ data={{
412
+ rows: dualAxisRows,
413
+ fields: [
414
+ {name: 'month', type: 'date'},
415
+ {name: 'revenue', type: 'number'},
416
+ {name: 'conversion_rate', type: 'number'},
417
+ ],
418
+ }}
419
+ config={{
420
+ title: {text: 'Bar + Line (Dual Axis)'},
421
+ tooltip: {trigger: 'axis'},
422
+ legend: {},
423
+ xAxis: {type: 'time'},
424
+ yAxis: [
425
+ {type: 'value', name: 'Revenue'},
426
+ {type: 'value', name: 'Conversion %'},
427
+ ],
428
+ series: [
429
+ {name: 'Revenue', type: 'bar', encode: {x: 'month', y: 'revenue'}},
430
+ {name: 'Conversion %', type: 'line', yAxisIndex: 1, smooth: true, encode: {x: 'month', y: 'conversion_rate'}},
431
+ ],
432
+ }}
433
+ />
434
+
435
+ <ECharts
436
+ data={{
437
+ rows: bubbleRows,
438
+ fields: [
439
+ {name: 'segment', type: 'string'},
440
+ {name: 'efficiency', type: 'number'},
441
+ {name: 'growth', type: 'number'},
442
+ {name: 'pipeline', type: 'number'},
443
+ {name: 'quality', type: 'number'},
444
+ ],
445
+ }}
446
+ config={{
447
+ title: {text: 'Bubble (x/y/size/color)'},
448
+ tooltip: {trigger: 'item'},
449
+ xAxis: {type: 'value', name: 'Efficiency'},
450
+ yAxis: {type: 'value', name: 'Growth'},
451
+ visualMap: [
452
+ {dimension: 'quality', min: 50, max: 72, inRange: {color: ['#60a5fa', '#2563eb', '#1e3a8a']}, show: false},
453
+ {dimension: 'pipeline', min: 100, max: 280, inRange: {symbolSize: [10, 28]}, show: false},
454
+ ],
455
+ series: [{type: 'scatter', encode: {x: 'efficiency', y: 'growth', tooltip: ['segment', 'pipeline', 'quality']}}],
456
+ }}
457
+ />
458
+
459
+ <ECharts
460
+ data={{
461
+ rows: beeswarmRows,
462
+ fields: [
463
+ {name: 'group', type: 'string'},
464
+ {name: 'value', type: 'number'},
465
+ ],
466
+ }}
467
+ config={{
468
+ title: {text: 'Beeswarm'},
469
+ tooltip: {trigger: 'item'},
470
+ xAxis: {type: 'category', jitter: 40, jitterOverlap: false},
471
+ yAxis: {type: 'value'},
472
+ series: [{type: 'scatter', symbolSize: 8, encode: {x: 'group', y: 'value'}}],
473
+ }}
474
+ />
475
+
476
+ <ECharts
477
+ data={{
478
+ rows: chordRows,
479
+ fields: [
480
+ {name: 'source', type: 'string'},
481
+ {name: 'target', type: 'string'},
482
+ {name: 'value', type: 'number'},
483
+ ],
484
+ }}
485
+ config={{
486
+ title: {text: 'Chord'},
487
+ tooltip: {trigger: 'item'},
488
+ series: [{type: 'chord', encode: {source: 'source', target: 'target', value: 'value'}}],
489
+ }}
490
+ />
491
+
492
+ <ECharts
493
+ data={{
494
+ rows: sankeyRows,
495
+ fields: [
496
+ {name: 'source', type: 'string'},
497
+ {name: 'target', type: 'string'},
498
+ {name: 'value', type: 'number'},
499
+ ],
500
+ }}
501
+ config={{
502
+ title: {text: 'Sankey'},
503
+ tooltip: {trigger: 'item'},
504
+ series: [{
505
+ type: 'sankey',
506
+ layout: 'none',
507
+ emphasis: {focus: 'adjacency'},
508
+ encode: {source: 'source', target: 'target', value: 'value'},
509
+ lineStyle: {curveness: 0.5},
510
+ }],
511
+ }}
512
+ />
513
+ </div>
514
+
515
+ <style>
516
+ .chart-grid {
517
+ display: grid;
518
+ grid-template-columns: repeat(auto-fill, 420px);
519
+ justify-content: center;
520
+ gap: 8px;
521
+ padding: 16px;
522
+ }
523
+
524
+ :global(.chart-grid .echarts-container) {
525
+ margin: 0;
526
+ }
527
+ </style>
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import type {GrapheneError} from '../../lang/index.d.ts'
3
+
4
+ interface Props {
5
+ error: GrapheneError | string
6
+ }
7
+
8
+ let {error: raw}: Props = $props()
9
+
10
+ let parsed = $derived.by(() => {
11
+ let error = typeof raw === 'string' ? {message: raw} : raw
12
+ let details: string[] = []
13
+ let file = error.file
14
+
15
+ // Vite compile errors can include machine-specific absolute paths.
16
+ // In browser tests, pin this one known message to a stable fake path for screenshots.
17
+ if (import.meta.env.VITE_TEST && error.message?.match(/Unexpected block closing tag/) && typeof file === 'string') {
18
+ file = '/myproject/index.md'
19
+ }
20
+
21
+ if (error.componentId) details.push(error.componentId)
22
+ if (file && file != 'input') {
23
+ let line = error.from?.line != null ? error.from.line + 1 : undefined
24
+ details.push(line ? `${file}:${line}` : file)
25
+ }
26
+ if (error.frame) details.push(error.frame)
27
+
28
+ return {message: error.message || 'Unknown error', details}
29
+ })
30
+ </script>
31
+
32
+ <div class="g-error" role="alert">
33
+ <p class="g-error__message">{parsed.message}</p>
34
+ {#if parsed.details.length}
35
+ <div class="g-error__details">{parsed.details.join('\n')}</div>
36
+ {/if}
37
+ </div>
38
+
39
+ <style>
40
+ .g-error {
41
+ padding: 16px 20px;
42
+ border-radius: 6px;
43
+ border-left: 3px solid var(--graphene-error-border, #ef4444);
44
+ background: var(--graphene-error-background, #fef2f2);
45
+ color: var(--graphene-error-content, #991b1b);
46
+ }
47
+ .g-error__message {
48
+ margin: 0;
49
+ line-height: 1.5;
50
+ }
51
+ .g-error__details {
52
+ margin: 12px 0 0;
53
+ font-family: var(--font-mono);
54
+ font-size: 0.875rem;
55
+ line-height: 1.6;
56
+ white-space: pre-wrap;
57
+ word-break: break-word;
58
+ color: var(--graphene-error-content-strong, #b91c1c);
59
+ }
60
+ </style>