@squadbase/vantage-template 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.
- package/README.md +112 -0
- package/base-template/.squadbase/skills/vantage-add-feature/SKILL.md +162 -0
- package/base-template/.squadbase/skills/vantage-app/SKILL.md +120 -0
- package/base-template/.squadbase/skills/vantage-pitfalls/SKILL.md +137 -0
- package/base-template/AGENTS.md +339 -0
- package/base-template/_404.tsx +18 -0
- package/base-template/_error.tsx +14 -0
- package/base-template/_gitignore +5 -0
- package/base-template/_layout.tsx +60 -0
- package/base-template/components/user-card.tsx +132 -0
- package/base-template/index.tsx +59 -0
- package/base-template/package.json +27 -0
- package/base-template/server/api/health.ts +12 -0
- package/base-template/squadbase.yml +5 -0
- package/base-template/styles.css +18 -0
- package/base-template/tsconfig.json +28 -0
- package/chart-presets/berry.css +16 -0
- package/chart-presets/blue.css +16 -0
- package/chart-presets/forest.css +16 -0
- package/chart-presets/mono.css +16 -0
- package/chart-presets/ocean.css +16 -0
- package/chart-presets/sunset.css +16 -0
- package/dist/index.js +1157 -0
- package/package.json +55 -0
- package/ui-templates/CLAUDE.md +200 -0
- package/ui-templates/blank/manifest.json +8 -0
- package/ui-templates/blank/pages/index.tsx +33 -0
- package/ui-templates/blank-ja/manifest.json +8 -0
- package/ui-templates/blank-ja/pages/index.tsx +33 -0
- package/ui-templates/chart-grid/lib/mock-data.ts +139 -0
- package/ui-templates/chart-grid/lib/types.ts +31 -0
- package/ui-templates/chart-grid/manifest.json +10 -0
- package/ui-templates/chart-grid/pages/index.tsx +331 -0
- package/ui-templates/chart-grid/preview-square.png +0 -0
- package/ui-templates/chart-grid/preview-wide.png +0 -0
- package/ui-templates/chart-grid-ja/lib/mock-data.ts +139 -0
- package/ui-templates/chart-grid-ja/lib/types.ts +31 -0
- package/ui-templates/chart-grid-ja/manifest.json +10 -0
- package/ui-templates/chart-grid-ja/pages/index.tsx +331 -0
- package/ui-templates/chart-grid-ja/preview-square.png +0 -0
- package/ui-templates/chart-grid-ja/preview-wide.png +0 -0
- package/ui-templates/funnel/components/chart-helpers.ts +11 -0
- package/ui-templates/funnel/components/stage-table.tsx +63 -0
- package/ui-templates/funnel/lib/mock-data.ts +22 -0
- package/ui-templates/funnel/lib/types.ts +11 -0
- package/ui-templates/funnel/manifest.json +12 -0
- package/ui-templates/funnel/pages/index.tsx +252 -0
- package/ui-templates/funnel/preview-square.png +0 -0
- package/ui-templates/funnel/preview-wide.png +0 -0
- package/ui-templates/funnel-ja/components/chart-helpers.ts +11 -0
- package/ui-templates/funnel-ja/components/stage-table.tsx +63 -0
- package/ui-templates/funnel-ja/lib/mock-data.ts +22 -0
- package/ui-templates/funnel-ja/lib/types.ts +11 -0
- package/ui-templates/funnel-ja/manifest.json +12 -0
- package/ui-templates/funnel-ja/pages/index.tsx +251 -0
- package/ui-templates/funnel-ja/preview-square.png +0 -0
- package/ui-templates/funnel-ja/preview-wide.png +0 -0
- package/ui-templates/kpi-chart-advanced/components/campaign-table.tsx +69 -0
- package/ui-templates/kpi-chart-advanced/lib/mock-data.ts +109 -0
- package/ui-templates/kpi-chart-advanced/lib/types.ts +38 -0
- package/ui-templates/kpi-chart-advanced/manifest.json +11 -0
- package/ui-templates/kpi-chart-advanced/pages/index.tsx +339 -0
- package/ui-templates/kpi-chart-advanced/preview-square.png +0 -0
- package/ui-templates/kpi-chart-advanced/preview-wide.png +0 -0
- package/ui-templates/kpi-chart-advanced-ja/components/campaign-table.tsx +69 -0
- package/ui-templates/kpi-chart-advanced-ja/lib/mock-data.ts +109 -0
- package/ui-templates/kpi-chart-advanced-ja/lib/types.ts +38 -0
- package/ui-templates/kpi-chart-advanced-ja/manifest.json +11 -0
- package/ui-templates/kpi-chart-advanced-ja/pages/index.tsx +333 -0
- package/ui-templates/kpi-chart-advanced-ja/preview-square.png +0 -0
- package/ui-templates/kpi-chart-advanced-ja/preview-wide.png +0 -0
- package/ui-templates/kpi-chart-simple/components/top-items-table.tsx +73 -0
- package/ui-templates/kpi-chart-simple/lib/types.ts +44 -0
- package/ui-templates/kpi-chart-simple/manifest.json +11 -0
- package/ui-templates/kpi-chart-simple/pages/index.tsx +200 -0
- package/ui-templates/kpi-chart-simple/preview-square.png +0 -0
- package/ui-templates/kpi-chart-simple/preview-wide.png +0 -0
- package/ui-templates/kpi-chart-simple/server/kpi-summary.ts +141 -0
- package/ui-templates/kpi-chart-simple-ja/components/top-items-table.tsx +73 -0
- package/ui-templates/kpi-chart-simple-ja/lib/types.ts +44 -0
- package/ui-templates/kpi-chart-simple-ja/manifest.json +11 -0
- package/ui-templates/kpi-chart-simple-ja/pages/index.tsx +200 -0
- package/ui-templates/kpi-chart-simple-ja/preview-square.png +0 -0
- package/ui-templates/kpi-chart-simple-ja/preview-wide.png +0 -0
- package/ui-templates/kpi-chart-simple-ja/server/kpi-summary.ts +141 -0
- package/ui-templates/table-focus/components/detail-table.tsx +88 -0
- package/ui-templates/table-focus/lib/mock-data.ts +69 -0
- package/ui-templates/table-focus/lib/types.ts +24 -0
- package/ui-templates/table-focus/manifest.json +11 -0
- package/ui-templates/table-focus/pages/index.tsx +180 -0
- package/ui-templates/table-focus/preview-square.png +0 -0
- package/ui-templates/table-focus/preview-wide.png +0 -0
- package/ui-templates/table-focus-ja/components/detail-table.tsx +95 -0
- package/ui-templates/table-focus-ja/lib/mock-data.ts +69 -0
- package/ui-templates/table-focus-ja/lib/types.ts +24 -0
- package/ui-templates/table-focus-ja/manifest.json +11 -0
- package/ui-templates/table-focus-ja/pages/index.tsx +180 -0
- package/ui-templates/table-focus-ja/preview-square.png +0 -0
- package/ui-templates/table-focus-ja/preview-wide.png +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
import { subDays } from "date-fns"
|
|
3
|
+
import { definePage } from "@squadbase/vantage"
|
|
4
|
+
import {
|
|
5
|
+
DashboardCardPreset,
|
|
6
|
+
DateRangePicker,
|
|
7
|
+
EChart,
|
|
8
|
+
PageShell,
|
|
9
|
+
PageShellContent,
|
|
10
|
+
PageShellDescription,
|
|
11
|
+
PageShellHeader,
|
|
12
|
+
PageShellHeaderEnd,
|
|
13
|
+
PageShellHeading,
|
|
14
|
+
PageShellTitle,
|
|
15
|
+
} from "@squadbase/vantage/components"
|
|
16
|
+
import type { EChartsOption } from "@squadbase/vantage/components"
|
|
17
|
+
import { ToggleGroup, ToggleGroupItem } from "@squadbase/vantage/ui"
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
timeSeries,
|
|
21
|
+
barSeries,
|
|
22
|
+
scatterPoints,
|
|
23
|
+
radarAxes,
|
|
24
|
+
heatmapCells,
|
|
25
|
+
HEATMAP_X_AXIS,
|
|
26
|
+
HEATMAP_Y_AXIS,
|
|
27
|
+
} from "./components/chart-grid/mock-data"
|
|
28
|
+
import type {
|
|
29
|
+
TimePoint,
|
|
30
|
+
BarPoint,
|
|
31
|
+
ScatterPoint,
|
|
32
|
+
RadarPoint,
|
|
33
|
+
HeatmapCell,
|
|
34
|
+
DashboardFilters,
|
|
35
|
+
} from "./components/chart-grid/types"
|
|
36
|
+
|
|
37
|
+
export const page = definePage({
|
|
38
|
+
title: "Charts overview",
|
|
39
|
+
description:
|
|
40
|
+
"Six-chart grid (area, line, bar, scatter, radar, heatmap) with category filter chips in the header.",
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// ── chart helpers ───────────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
function getBaseGrid() {
|
|
46
|
+
return { left: "3%", right: "4%", bottom: "10%", containLabel: true }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function formatNumber(n: number): string {
|
|
50
|
+
const sign = n < 0 ? "-" : ""
|
|
51
|
+
const abs = Math.abs(n)
|
|
52
|
+
if (abs >= 1_000_000) return `${sign}${(abs / 1_000_000).toFixed(1)}M`
|
|
53
|
+
if (abs >= 1_000) return `${sign}${(abs / 1_000).toFixed(1)}K`
|
|
54
|
+
return n.toLocaleString("en-US")
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ── chart options ────────────────────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
function areaOption(data: TimePoint[]): EChartsOption {
|
|
60
|
+
return {
|
|
61
|
+
tooltip: { trigger: "axis" },
|
|
62
|
+
legend: { bottom: 0 },
|
|
63
|
+
grid: getBaseGrid(),
|
|
64
|
+
xAxis: {
|
|
65
|
+
type: "category",
|
|
66
|
+
data: data.map((d) => d.date),
|
|
67
|
+
boundaryGap: false,
|
|
68
|
+
axisLabel: { formatter: (v: string) => v.slice(5) },
|
|
69
|
+
},
|
|
70
|
+
yAxis: { type: "value", axisLabel: { formatter: (v: number) => formatNumber(v) } },
|
|
71
|
+
series: [
|
|
72
|
+
{
|
|
73
|
+
name: "Series A",
|
|
74
|
+
type: "line",
|
|
75
|
+
smooth: true,
|
|
76
|
+
showSymbol: false,
|
|
77
|
+
data: data.map((d) => d.series1),
|
|
78
|
+
areaStyle: { opacity: 0.22 },
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Series B",
|
|
82
|
+
type: "line",
|
|
83
|
+
smooth: true,
|
|
84
|
+
showSymbol: false,
|
|
85
|
+
data: data.map((d) => d.series2),
|
|
86
|
+
areaStyle: { opacity: 0.14 },
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function lineOption(data: TimePoint[]): EChartsOption {
|
|
93
|
+
return {
|
|
94
|
+
tooltip: { trigger: "axis" },
|
|
95
|
+
legend: { bottom: 0 },
|
|
96
|
+
grid: getBaseGrid(),
|
|
97
|
+
xAxis: {
|
|
98
|
+
type: "category",
|
|
99
|
+
data: data.map((d) => d.date),
|
|
100
|
+
boundaryGap: false,
|
|
101
|
+
axisLabel: { formatter: (v: string) => v.slice(5) },
|
|
102
|
+
},
|
|
103
|
+
yAxis: { type: "value", axisLabel: { formatter: (v: number) => formatNumber(v) } },
|
|
104
|
+
series: [
|
|
105
|
+
{
|
|
106
|
+
name: "Series A",
|
|
107
|
+
type: "line",
|
|
108
|
+
smooth: true,
|
|
109
|
+
showSymbol: false,
|
|
110
|
+
data: data.map((d) => d.series1),
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "Series B",
|
|
114
|
+
type: "line",
|
|
115
|
+
smooth: true,
|
|
116
|
+
showSymbol: false,
|
|
117
|
+
data: data.map((d) => d.series2),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const BAR_CATEGORIES = [
|
|
124
|
+
"Item 1",
|
|
125
|
+
"Item 2",
|
|
126
|
+
"Item 3",
|
|
127
|
+
"Item 4",
|
|
128
|
+
"Item 5",
|
|
129
|
+
"Item 6",
|
|
130
|
+
"Item 7",
|
|
131
|
+
"Item 8",
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
function barOption(data: BarPoint[]): EChartsOption {
|
|
135
|
+
return {
|
|
136
|
+
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
|
|
137
|
+
grid: getBaseGrid(),
|
|
138
|
+
xAxis: { type: "category", data: BAR_CATEGORIES },
|
|
139
|
+
yAxis: { type: "value", axisLabel: { formatter: (v: number) => formatNumber(v) } },
|
|
140
|
+
series: [
|
|
141
|
+
{
|
|
142
|
+
name: "Series A",
|
|
143
|
+
type: "bar",
|
|
144
|
+
data: data.map((d) => d.value),
|
|
145
|
+
barMaxWidth: 28,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function scatterOption(data: ScatterPoint[]): EChartsOption {
|
|
152
|
+
return {
|
|
153
|
+
tooltip: { trigger: "item" },
|
|
154
|
+
grid: getBaseGrid(),
|
|
155
|
+
xAxis: { type: "value" },
|
|
156
|
+
yAxis: { type: "value" },
|
|
157
|
+
series: [
|
|
158
|
+
{
|
|
159
|
+
type: "scatter",
|
|
160
|
+
data: data.map((p) => ({
|
|
161
|
+
value: [p.x, p.y, p.size] as [number, number, number],
|
|
162
|
+
label: p.label,
|
|
163
|
+
})),
|
|
164
|
+
symbolSize: (val: unknown) => {
|
|
165
|
+
const arr = val as [number, number, number]
|
|
166
|
+
return arr[2]
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
] as EChartsOption["series"],
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const RADAR_AXES = ["Axis 1", "Axis 2", "Axis 3", "Axis 4", "Axis 5", "Axis 6"]
|
|
174
|
+
|
|
175
|
+
function radarOption(data: RadarPoint[]): EChartsOption {
|
|
176
|
+
return {
|
|
177
|
+
tooltip: { trigger: "item" },
|
|
178
|
+
legend: { bottom: 0 },
|
|
179
|
+
radar: {
|
|
180
|
+
indicator: data.map((_, i) => ({ name: RADAR_AXES[i], max: 100 })),
|
|
181
|
+
radius: "65%",
|
|
182
|
+
},
|
|
183
|
+
series: [
|
|
184
|
+
{
|
|
185
|
+
type: "radar",
|
|
186
|
+
data: [
|
|
187
|
+
{
|
|
188
|
+
value: data.map((r) => r.current),
|
|
189
|
+
name: "Series A",
|
|
190
|
+
areaStyle: { opacity: 0.28 },
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
value: data.map((r) => r.benchmark),
|
|
194
|
+
name: "Series B",
|
|
195
|
+
areaStyle: { opacity: 0.18 },
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function heatmapOption(
|
|
204
|
+
data: HeatmapCell[],
|
|
205
|
+
xAxis: string[],
|
|
206
|
+
yAxis: string[],
|
|
207
|
+
): EChartsOption {
|
|
208
|
+
const max = Math.max(...data.map((c) => c.value))
|
|
209
|
+
return {
|
|
210
|
+
tooltip: { position: "top" },
|
|
211
|
+
grid: { height: "70%", top: "8%", left: "10%", right: "8%" },
|
|
212
|
+
xAxis: { type: "category", data: xAxis, splitArea: { show: true } },
|
|
213
|
+
yAxis: { type: "category", data: yAxis, splitArea: { show: true } },
|
|
214
|
+
visualMap: {
|
|
215
|
+
min: 0,
|
|
216
|
+
max,
|
|
217
|
+
calculable: true,
|
|
218
|
+
orient: "horizontal",
|
|
219
|
+
bottom: 0,
|
|
220
|
+
},
|
|
221
|
+
series: [
|
|
222
|
+
{
|
|
223
|
+
type: "heatmap",
|
|
224
|
+
data: data.map((c) => [xAxis.indexOf(c.x), yAxis.indexOf(c.y), c.value]),
|
|
225
|
+
label: { show: false },
|
|
226
|
+
emphasis: { itemStyle: { shadowBlur: 8, shadowColor: "rgba(0,0,0,0.4)" } },
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// ── page ─────────────────────────────────────────────────────────────────────
|
|
233
|
+
|
|
234
|
+
const today = new Date()
|
|
235
|
+
const initialFilters: DashboardFilters = {
|
|
236
|
+
dateRange: {
|
|
237
|
+
from: subDays(today, 29),
|
|
238
|
+
to: today,
|
|
239
|
+
},
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
type Category = "all" | "trend" | "ranking" | "distribution"
|
|
243
|
+
|
|
244
|
+
export default function HomePage() {
|
|
245
|
+
const [filters, setFilters] = useState<DashboardFilters>(initialFilters)
|
|
246
|
+
const [category, setCategory] = useState<Category>("all")
|
|
247
|
+
|
|
248
|
+
const show = (target: Exclude<Category, "all">) =>
|
|
249
|
+
category === "all" || category === target
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<PageShell>
|
|
253
|
+
<PageShellHeader>
|
|
254
|
+
<PageShellHeading>
|
|
255
|
+
<PageShellTitle>[Template] Charts overview</PageShellTitle>
|
|
256
|
+
<PageShellDescription>
|
|
257
|
+
A grid of charts for the selected period.
|
|
258
|
+
</PageShellDescription>
|
|
259
|
+
</PageShellHeading>
|
|
260
|
+
<PageShellHeaderEnd className="flex-row items-center gap-3">
|
|
261
|
+
{/* Base UI ToggleGroup is array-valued even for single select. */}
|
|
262
|
+
<ToggleGroup
|
|
263
|
+
value={[category]}
|
|
264
|
+
onValueChange={(values) => {
|
|
265
|
+
const next = values[0]
|
|
266
|
+
if (next) setCategory(next as Category)
|
|
267
|
+
}}
|
|
268
|
+
variant="outline"
|
|
269
|
+
size="sm"
|
|
270
|
+
>
|
|
271
|
+
<ToggleGroupItem value="all">All</ToggleGroupItem>
|
|
272
|
+
<ToggleGroupItem value="trend">Group A</ToggleGroupItem>
|
|
273
|
+
<ToggleGroupItem value="ranking">Group B</ToggleGroupItem>
|
|
274
|
+
<ToggleGroupItem value="distribution">Group C</ToggleGroupItem>
|
|
275
|
+
</ToggleGroup>
|
|
276
|
+
<DateRangePicker
|
|
277
|
+
value={filters.dateRange}
|
|
278
|
+
onChange={(range) =>
|
|
279
|
+
setFilters((prev) => ({ ...prev, dateRange: range }))
|
|
280
|
+
}
|
|
281
|
+
maxDate={today}
|
|
282
|
+
/>
|
|
283
|
+
</PageShellHeaderEnd>
|
|
284
|
+
</PageShellHeader>
|
|
285
|
+
|
|
286
|
+
<PageShellContent>
|
|
287
|
+
<div className="grid gap-4 lg:grid-cols-2">
|
|
288
|
+
{show("trend") && (
|
|
289
|
+
<DashboardCardPreset
|
|
290
|
+
title="Trend (area)"
|
|
291
|
+
description="Two series over the selected period"
|
|
292
|
+
>
|
|
293
|
+
<EChart option={areaOption(timeSeries)} height="280px" />
|
|
294
|
+
</DashboardCardPreset>
|
|
295
|
+
)}
|
|
296
|
+
{show("trend") && (
|
|
297
|
+
<DashboardCardPreset
|
|
298
|
+
title="Trend (line)"
|
|
299
|
+
description="Two series over the selected period"
|
|
300
|
+
>
|
|
301
|
+
<EChart option={lineOption(timeSeries)} height="280px" />
|
|
302
|
+
</DashboardCardPreset>
|
|
303
|
+
)}
|
|
304
|
+
{show("ranking") && (
|
|
305
|
+
<DashboardCardPreset title="Top categories" description="Ranked by value">
|
|
306
|
+
<EChart option={barOption(barSeries)} height="280px" />
|
|
307
|
+
</DashboardCardPreset>
|
|
308
|
+
)}
|
|
309
|
+
{show("distribution") && (
|
|
310
|
+
<DashboardCardPreset title="Correlation" description="Each point is an item">
|
|
311
|
+
<EChart option={scatterOption(scatterPoints)} height="280px" />
|
|
312
|
+
</DashboardCardPreset>
|
|
313
|
+
)}
|
|
314
|
+
{show("distribution") && (
|
|
315
|
+
<DashboardCardPreset title="Profile" description="Current vs benchmark">
|
|
316
|
+
<EChart option={radarOption(radarAxes)} height="280px" />
|
|
317
|
+
</DashboardCardPreset>
|
|
318
|
+
)}
|
|
319
|
+
{show("distribution") && (
|
|
320
|
+
<DashboardCardPreset title="Activity" description="Intensity by cell">
|
|
321
|
+
<EChart
|
|
322
|
+
option={heatmapOption(heatmapCells, HEATMAP_X_AXIS, HEATMAP_Y_AXIS)}
|
|
323
|
+
height="280px"
|
|
324
|
+
/>
|
|
325
|
+
</DashboardCardPreset>
|
|
326
|
+
)}
|
|
327
|
+
</div>
|
|
328
|
+
</PageShellContent>
|
|
329
|
+
</PageShell>
|
|
330
|
+
)
|
|
331
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TimePoint,
|
|
3
|
+
BarPoint,
|
|
4
|
+
ScatterPoint,
|
|
5
|
+
RadarPoint,
|
|
6
|
+
HeatmapCell,
|
|
7
|
+
} from "./types"
|
|
8
|
+
|
|
9
|
+
export const timeSeries: TimePoint[] = [
|
|
10
|
+
{ date: "2024-03-02", series1: 16462, series2: 12092 },
|
|
11
|
+
{ date: "2024-03-03", series1: 17807, series2: 11084 },
|
|
12
|
+
{ date: "2024-03-04", series1: 17272, series2: 13572 },
|
|
13
|
+
{ date: "2024-03-05", series1: 18462, series2: 13897 },
|
|
14
|
+
{ date: "2024-03-06", series1: 19943, series2: 12100 },
|
|
15
|
+
{ date: "2024-03-07", series1: 21026, series2: 13152 },
|
|
16
|
+
{ date: "2024-03-08", series1: 18203, series2: 14502 },
|
|
17
|
+
{ date: "2024-03-09", series1: 20265, series2: 13472 },
|
|
18
|
+
{ date: "2024-03-10", series1: 18075, series2: 13476 },
|
|
19
|
+
{ date: "2024-03-11", series1: 21018, series2: 15075 },
|
|
20
|
+
{ date: "2024-03-12", series1: 20104, series2: 12868 },
|
|
21
|
+
{ date: "2024-03-13", series1: 21755, series2: 15713 },
|
|
22
|
+
{ date: "2024-03-14", series1: 20240, series2: 13282 },
|
|
23
|
+
{ date: "2024-03-15", series1: 20796, series2: 14953 },
|
|
24
|
+
{ date: "2024-03-16", series1: 21397, series2: 14028 },
|
|
25
|
+
{ date: "2024-03-17", series1: 21203, series2: 13791 },
|
|
26
|
+
{ date: "2024-03-18", series1: 19673, series2: 13895 },
|
|
27
|
+
{ date: "2024-03-19", series1: 22335, series2: 16589 },
|
|
28
|
+
{ date: "2024-03-20", series1: 21241, series2: 14266 },
|
|
29
|
+
{ date: "2024-03-21", series1: 22068, series2: 14360 },
|
|
30
|
+
{ date: "2024-03-22", series1: 21903, series2: 14062 },
|
|
31
|
+
{ date: "2024-03-23", series1: 21685, series2: 15876 },
|
|
32
|
+
{ date: "2024-03-24", series1: 21315, series2: 17515 },
|
|
33
|
+
{ date: "2024-03-25", series1: 21435, series2: 14613 },
|
|
34
|
+
{ date: "2024-03-26", series1: 23871, series2: 16287 },
|
|
35
|
+
{ date: "2024-03-27", series1: 22747, series2: 17526 },
|
|
36
|
+
{ date: "2024-03-28", series1: 22262, series2: 15910 },
|
|
37
|
+
{ date: "2024-03-29", series1: 25130, series2: 16666 },
|
|
38
|
+
{ date: "2024-03-30", series1: 23698, series2: 15561 },
|
|
39
|
+
{ date: "2024-03-31", series1: 25719, series2: 15619 },
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
export const barSeries: BarPoint[] = [
|
|
43
|
+
{ value: 184_320 },
|
|
44
|
+
{ value: 162_480 },
|
|
45
|
+
{ value: 138_750 },
|
|
46
|
+
{ value: 121_900 },
|
|
47
|
+
{ value: 98_640 },
|
|
48
|
+
{ value: 87_220 },
|
|
49
|
+
{ value: 72_410 },
|
|
50
|
+
{ value: 54_220 },
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
export const scatterPoints: ScatterPoint[] = [
|
|
54
|
+
{ x: 24, y: 750, size: 23, label: "項目1" },
|
|
55
|
+
{ x: 30, y: 572, size: 23, label: "項目2" },
|
|
56
|
+
{ x: 79, y: 692, size: 19, label: "項目3" },
|
|
57
|
+
{ x: 43, y: 585, size: 20, label: "項目4" },
|
|
58
|
+
{ x: 35, y: 626, size: 13, label: "項目5" },
|
|
59
|
+
{ x: 90, y: 289, size: 29, label: "項目6" },
|
|
60
|
+
{ x: 80, y: 851, size: 11, label: "項目7" },
|
|
61
|
+
{ x: 39, y: 885, size: 13, label: "項目8" },
|
|
62
|
+
{ x: 79, y: 768, size: 21, label: "項目9" },
|
|
63
|
+
{ x: 75, y: 873, size: 24, label: "項目10" },
|
|
64
|
+
{ x: 60, y: 676, size: 29, label: "項目11" },
|
|
65
|
+
{ x: 67, y: 552, size: 25, label: "項目12" },
|
|
66
|
+
{ x: 49, y: 876, size: 20, label: "項目13" },
|
|
67
|
+
{ x: 40, y: 223, size: 23, label: "項目14" },
|
|
68
|
+
{ x: 73, y: 768, size: 22, label: "項目15" },
|
|
69
|
+
{ x: 21, y: 186, size: 26, label: "項目16" },
|
|
70
|
+
{ x: 78, y: 652, size: 22, label: "項目17" },
|
|
71
|
+
{ x: 37, y: 740, size: 19, label: "項目18" },
|
|
72
|
+
{ x: 92, y: 827, size: 26, label: "項目19" },
|
|
73
|
+
{ x: 35, y: 386, size: 9, label: "項目20" },
|
|
74
|
+
{ x: 60, y: 694, size: 21, label: "項目21" },
|
|
75
|
+
{ x: 41, y: 324, size: 26, label: "項目22" },
|
|
76
|
+
{ x: 90, y: 552, size: 12, label: "項目23" },
|
|
77
|
+
{ x: 81, y: 853, size: 11, label: "項目24" },
|
|
78
|
+
{ x: 48, y: 702, size: 9, label: "項目25" },
|
|
79
|
+
{ x: 23, y: 474, size: 15, label: "項目26" },
|
|
80
|
+
{ x: 41, y: 544, size: 17, label: "項目27" },
|
|
81
|
+
{ x: 53, y: 387, size: 24, label: "項目28" },
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
export const radarAxes: RadarPoint[] = [
|
|
85
|
+
{ current: 82, benchmark: 70 },
|
|
86
|
+
{ current: 91, benchmark: 78 },
|
|
87
|
+
{ current: 64, benchmark: 75 },
|
|
88
|
+
{ current: 88, benchmark: 80 },
|
|
89
|
+
{ current: 73, benchmark: 65 },
|
|
90
|
+
{ current: 79, benchmark: 70 },
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
export const HEATMAP_X_AXIS = ["0", "1", "2", "3", "4", "5"]
|
|
94
|
+
export const HEATMAP_Y_AXIS = ["行1", "行2", "行3", "行4", "行5", "行6", "行7"]
|
|
95
|
+
|
|
96
|
+
export const heatmapCells: HeatmapCell[] = [
|
|
97
|
+
{ x: "0", y: "行1", value: 57 },
|
|
98
|
+
{ x: "1", y: "行1", value: 25 },
|
|
99
|
+
{ x: "2", y: "行1", value: 91 },
|
|
100
|
+
{ x: "3", y: "行1", value: 77 },
|
|
101
|
+
{ x: "4", y: "行1", value: 96 },
|
|
102
|
+
{ x: "5", y: "行1", value: 45 },
|
|
103
|
+
{ x: "0", y: "行2", value: 46 },
|
|
104
|
+
{ x: "1", y: "行2", value: 32 },
|
|
105
|
+
{ x: "2", y: "行2", value: 75 },
|
|
106
|
+
{ x: "3", y: "行2", value: 94 },
|
|
107
|
+
{ x: "4", y: "行2", value: 83 },
|
|
108
|
+
{ x: "5", y: "行2", value: 37 },
|
|
109
|
+
{ x: "0", y: "行3", value: 56 },
|
|
110
|
+
{ x: "1", y: "行3", value: 22 },
|
|
111
|
+
{ x: "2", y: "行3", value: 76 },
|
|
112
|
+
{ x: "3", y: "行3", value: 85 },
|
|
113
|
+
{ x: "4", y: "行3", value: 79 },
|
|
114
|
+
{ x: "5", y: "行3", value: 39 },
|
|
115
|
+
{ x: "0", y: "行4", value: 56 },
|
|
116
|
+
{ x: "1", y: "行4", value: 12 },
|
|
117
|
+
{ x: "2", y: "行4", value: 73 },
|
|
118
|
+
{ x: "3", y: "行4", value: 88 },
|
|
119
|
+
{ x: "4", y: "行4", value: 95 },
|
|
120
|
+
{ x: "5", y: "行4", value: 19 },
|
|
121
|
+
{ x: "0", y: "行5", value: 60 },
|
|
122
|
+
{ x: "1", y: "行5", value: 17 },
|
|
123
|
+
{ x: "2", y: "行5", value: 77 },
|
|
124
|
+
{ x: "3", y: "行5", value: 85 },
|
|
125
|
+
{ x: "4", y: "行5", value: 81 },
|
|
126
|
+
{ x: "5", y: "行5", value: 43 },
|
|
127
|
+
{ x: "0", y: "行6", value: 36 },
|
|
128
|
+
{ x: "1", y: "行6", value: 56 },
|
|
129
|
+
{ x: "2", y: "行6", value: 55 },
|
|
130
|
+
{ x: "3", y: "行6", value: 34 },
|
|
131
|
+
{ x: "4", y: "行6", value: 20 },
|
|
132
|
+
{ x: "5", y: "行6", value: 27 },
|
|
133
|
+
{ x: "0", y: "行7", value: 50 },
|
|
134
|
+
{ x: "1", y: "行7", value: 44 },
|
|
135
|
+
{ x: "2", y: "行7", value: 32 },
|
|
136
|
+
{ x: "3", y: "行7", value: 55 },
|
|
137
|
+
{ x: "4", y: "行7", value: 46 },
|
|
138
|
+
{ x: "5", y: "行7", value: 39 },
|
|
139
|
+
]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface TimePoint {
|
|
2
|
+
date: string
|
|
3
|
+
series1: number
|
|
4
|
+
series2: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface BarPoint {
|
|
8
|
+
value: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ScatterPoint {
|
|
12
|
+
x: number
|
|
13
|
+
y: number
|
|
14
|
+
size: number
|
|
15
|
+
label: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface RadarPoint {
|
|
19
|
+
current: number
|
|
20
|
+
benchmark: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HeatmapCell {
|
|
24
|
+
x: string
|
|
25
|
+
y: string
|
|
26
|
+
value: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DashboardFilters {
|
|
30
|
+
dateRange: { from: Date | undefined; to: Date | undefined }
|
|
31
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chart-grid-ja",
|
|
3
|
+
"description": "[日本語] チャート格子 — エリア/折れ線/棒/散布/レーダー/ヒートマップの6チャート格子。ヘッダーにカテゴリフィルタチップを配置。チャートだけで構成する可視化重視のダッシュボード",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"files": [
|
|
6
|
+
{ "src": "pages/index.tsx", "dest": "index.tsx", "action": "replace" },
|
|
7
|
+
{ "src": "lib/mock-data.ts", "dest": "components/chart-grid/mock-data.ts", "action": "add", "relabel": false },
|
|
8
|
+
{ "src": "lib/types.ts", "dest": "components/chart-grid/types.ts", "action": "add", "relabel": false }
|
|
9
|
+
]
|
|
10
|
+
}
|