react-semaphor 0.1.62 → 0.1.63
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/dist/chunks/dashboard-plus-BT1JEFt7.js +17438 -0
- package/dist/chunks/dashboard-plus-C7mXurPl.js +235 -0
- package/dist/chunks/index-DHzLB6Yx.js +1045 -0
- package/dist/chunks/{index--MUeDITx.js → index-Dji-XteI.js} +25747 -28323
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +106 -107
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +0 -8
- package/package.json +1 -1
- package/dist/chunks/axis-mapping-8ZVwlkl6.js +0 -315
- package/dist/chunks/axis-mapping-Cwa3KrDR.js +0 -16
- package/dist/chunks/bar-chart-settings-B_WyC-7g.js +0 -52
- package/dist/chunks/bar-chart-settings-CvorW7RD.js +0 -1
- package/dist/chunks/bubble-chart-settings-BPtESqYK.js +0 -1
- package/dist/chunks/bubble-chart-settings-CxFAlErV.js +0 -50
- package/dist/chunks/common-chart-settings-CvRrQf-H.js +0 -1
- package/dist/chunks/common-chart-settings-D3ww0Xtx.js +0 -147
- package/dist/chunks/custom-visual-settings-DXWyN2Dr.js +0 -11
- package/dist/chunks/custom-visual-settings-m5o8R5tL.js +0 -243
- package/dist/chunks/dashboard-plus-B8-ocT_Z.js +0 -41
- package/dist/chunks/dashboard-plus-DSUKhvcv.js +0 -2941
- package/dist/chunks/display-labels-BYsRReye.js +0 -1
- package/dist/chunks/display-labels-C_jsL0Jo.js +0 -74
- package/dist/chunks/editor-C7xQi9Ab.js +0 -105
- package/dist/chunks/editor-DqvyBUrl.js +0 -8321
- package/dist/chunks/filter-on-click-columns-6dRYhvgz.js +0 -1
- package/dist/chunks/filter-on-click-columns-BJUGTE6W.js +0 -120
- package/dist/chunks/frame-filters-D9sDN4Vm.js +0 -1
- package/dist/chunks/frame-filters-DFgqSoV2.js +0 -75
- package/dist/chunks/index-Bvtpj-_R.js +0 -1080
- package/dist/chunks/kpi-settings-BONvmfNr.js +0 -1
- package/dist/chunks/kpi-settings-CI-9fp4Z.js +0 -286
- package/dist/chunks/map-chart-settings-CSxZdu_g.js +0 -1
- package/dist/chunks/map-chart-settings-DQIN7Pn8.js +0 -334
- package/dist/chunks/pie-chart-settings-CN3JCLdP.js +0 -86
- package/dist/chunks/pie-chart-settings-CsErfZOL.js +0 -1
- package/dist/chunks/reusable-select-CQbD03nT.js +0 -40
- package/dist/chunks/reusable-select-CVRzPWkg.js +0 -1
- package/dist/chunks/stacked-chart-settings-BfqHFFqA.js +0 -1
- package/dist/chunks/stacked-chart-settings-poYotO6Q.js +0 -90
- package/dist/chunks/table-visual-settings-B46pdUra.js +0 -46
- package/dist/chunks/table-visual-settings-ZKWuNokZ.js +0 -1
- package/dist/chunks/tag-BrxBSbSe.js +0 -20
- package/dist/chunks/tag-D9G2kz2B.js +0 -6
- package/dist/chunks/use-assign-filter-5gplfsO1.js +0 -83
- package/dist/chunks/use-assign-filter-DzmBSsyO.js +0 -1
- package/dist/chunks/use-local-storage-state-CBh2HHB9.js +0 -16
- package/dist/chunks/use-local-storage-state-CL0JsTZM.js +0 -1745
- package/dist/chunks/use-plugin-query-DA6Yrp7P.js +0 -12
- package/dist/chunks/use-plugin-query-JdHNPYZS.js +0 -1
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-C7mXurPl.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
|
package/dist/surfboard/index.js
CHANGED
package/dist/types/main.d.ts
CHANGED
|
@@ -2466,14 +2466,6 @@ export declare function useTextFilterHook(filterId: string): {
|
|
|
2466
2466
|
|
|
2467
2467
|
export declare function Visual(props: VisualProps): JSX_2.Element;
|
|
2468
2468
|
|
|
2469
|
-
export declare function VisualBadge({ type, isLinked, className, }: VisualBadgeProps): JSX_2.Element | null;
|
|
2470
|
-
|
|
2471
|
-
declare interface VisualBadgeProps {
|
|
2472
|
-
type?: 'local' | 'linked' | 'library';
|
|
2473
|
-
isLinked?: boolean;
|
|
2474
|
-
className?: string;
|
|
2475
|
-
}
|
|
2476
|
-
|
|
2477
2469
|
/**
|
|
2478
2470
|
* Display mode for visual components - controls which UI elements are shown
|
|
2479
2471
|
*/
|
package/package.json
CHANGED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { E as g, u as h, P as M, g as b, i as w, a0 as K, q as m, aI as L, aJ as A, aK as N, aL as v, aM as D, aN as O, aO as T, aP as P, aQ as H, aR as j, L as k, aS as z, aT as S, aU as E } from "./index--MUeDITx.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
import { T as I } from "./tag-BrxBSbSe.js";
|
|
6
|
-
/**
|
|
7
|
-
* @license lucide-react v0.453.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
const X = g("ListEnd", [
|
|
13
|
-
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
14
|
-
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
15
|
-
["path", { d: "M10 18H3", key: "13769t" }],
|
|
16
|
-
["path", { d: "M21 6v10a2 2 0 0 1-2 2h-5", key: "ilrcs8" }],
|
|
17
|
-
["path", { d: "m16 16-2 2 2 2", key: "kkc6pm" }]
|
|
18
|
-
]);
|
|
19
|
-
/**
|
|
20
|
-
* @license lucide-react v0.453.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/
|
|
25
|
-
const B = g("ListStart", [
|
|
26
|
-
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
27
|
-
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
28
|
-
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
29
|
-
["path", { d: "M21 18V8a2 2 0 0 0-2-2h-5", key: "1hghli" }],
|
|
30
|
-
["path", { d: "m16 8-2-2 2-2", key: "160uvd" }]
|
|
31
|
-
]);
|
|
32
|
-
/**
|
|
33
|
-
* @license lucide-react v0.453.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/
|
|
38
|
-
const Q = g("ListX", [
|
|
39
|
-
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
40
|
-
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
41
|
-
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
42
|
-
["path", { d: "m19 10-4 4", key: "1tz659" }],
|
|
43
|
-
["path", { d: "m15 10 4 4", key: "1n7nei" }]
|
|
44
|
-
]);
|
|
45
|
-
function V({ idx: s }) {
|
|
46
|
-
var f;
|
|
47
|
-
const t = h((e) => {
|
|
48
|
-
var o;
|
|
49
|
-
return (o = e.card) == null ? void 0 : o.preferences;
|
|
50
|
-
}), n = h(
|
|
51
|
-
(e) => {
|
|
52
|
-
var o;
|
|
53
|
-
return (o = e.card.preferences) == null ? void 0 : o.datasetOptions;
|
|
54
|
-
}
|
|
55
|
-
), l = h(
|
|
56
|
-
(e) => e.actions.setCardPreferences
|
|
57
|
-
), p = (f = t == null ? void 0 : t.chartOptions) == null ? void 0 : f.indexAxis, d = n == null ? void 0 : n.find((e) => e.idx === s);
|
|
58
|
-
function i(e, o) {
|
|
59
|
-
(e === "end" || e === "start") && L(A());
|
|
60
|
-
const r = {
|
|
61
|
-
display: e !== "none",
|
|
62
|
-
align: e,
|
|
63
|
-
anchor: e,
|
|
64
|
-
clamp: !0
|
|
65
|
-
};
|
|
66
|
-
if (!d)
|
|
67
|
-
l({
|
|
68
|
-
...t,
|
|
69
|
-
datasetOptions: [
|
|
70
|
-
...n || [],
|
|
71
|
-
{
|
|
72
|
-
idx: o,
|
|
73
|
-
datalabels: r
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
else {
|
|
78
|
-
const c = { ...d };
|
|
79
|
-
c.datalabels = r;
|
|
80
|
-
const x = n == null ? void 0 : n.map(
|
|
81
|
-
(y) => y.idx === o ? c : y
|
|
82
|
-
);
|
|
83
|
-
l({
|
|
84
|
-
...t,
|
|
85
|
-
datasetOptions: x
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return /* @__PURE__ */ u(M, { children: [
|
|
90
|
-
/* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(I, { className: "size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
91
|
-
/* @__PURE__ */ a(w, { className: "w-fit px-2 py-1", children: /* @__PURE__ */ u("div", { className: "flex gap-1", children: [
|
|
92
|
-
/* @__PURE__ */ a(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
onClick: () => i("none", s),
|
|
96
|
-
className: "h-7 p-1 text-xs font-normal",
|
|
97
|
-
children: /* @__PURE__ */ a(K, { className: "size-3.5" })
|
|
98
|
-
}
|
|
99
|
-
),
|
|
100
|
-
/* @__PURE__ */ a(
|
|
101
|
-
"button",
|
|
102
|
-
{
|
|
103
|
-
onClick: () => i("start", s),
|
|
104
|
-
className: "h-7 p-1 text-xs font-normal",
|
|
105
|
-
children: /* @__PURE__ */ a(
|
|
106
|
-
X,
|
|
107
|
-
{
|
|
108
|
-
className: m("h-4 w-4", {
|
|
109
|
-
"rotate-90": p === "y"
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ a(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
onClick: () => i("center", s),
|
|
119
|
-
className: "h-7 p-1 text-xs font-normal",
|
|
120
|
-
children: /* @__PURE__ */ a(
|
|
121
|
-
Q,
|
|
122
|
-
{
|
|
123
|
-
className: m("h-4 w-4", {
|
|
124
|
-
"rotate-90": p === "y"
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
/* @__PURE__ */ a(
|
|
131
|
-
"button",
|
|
132
|
-
{
|
|
133
|
-
onClick: () => i("end", s),
|
|
134
|
-
className: "h-7 p-1 text-xs font-normal",
|
|
135
|
-
children: /* @__PURE__ */ a(
|
|
136
|
-
B,
|
|
137
|
-
{
|
|
138
|
-
className: m("h-4 w-4", {
|
|
139
|
-
"rotate-90": p === "y"
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
] }) })
|
|
146
|
-
] });
|
|
147
|
-
}
|
|
148
|
-
function q() {
|
|
149
|
-
const s = h((d) => d.card), { data: t } = N(s), { keys: n } = v((t == null ? void 0 : t.records) || []), l = n.slice(1).filter((d) => !D.includes(d));
|
|
150
|
-
let p = l;
|
|
151
|
-
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
152
|
-
const d = O({
|
|
153
|
-
dataArray: (t == null ? void 0 : t.records) || [],
|
|
154
|
-
groupKey: n[0],
|
|
155
|
-
pivotKey: n[1],
|
|
156
|
-
valueKey: n[2]
|
|
157
|
-
}), { keys: i } = v(d);
|
|
158
|
-
p = i.slice(1);
|
|
159
|
-
}
|
|
160
|
-
return {
|
|
161
|
-
transformedMetricKeys: p,
|
|
162
|
-
dimensionKeys: n.slice(0, 1),
|
|
163
|
-
keys: n,
|
|
164
|
-
defaultMetricKeys: l
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
function F({
|
|
168
|
-
children: s,
|
|
169
|
-
className: t,
|
|
170
|
-
delayDuration: n
|
|
171
|
-
}) {
|
|
172
|
-
return /* @__PURE__ */ a(T, { children: /* @__PURE__ */ u(P, { delayDuration: n, children: [
|
|
173
|
-
/* @__PURE__ */ a(H, { asChild: !0, children: /* @__PURE__ */ a(
|
|
174
|
-
"span",
|
|
175
|
-
{
|
|
176
|
-
className: m(
|
|
177
|
-
"overflow-hidden text-ellipsis whitespace-nowrap",
|
|
178
|
-
t
|
|
179
|
-
),
|
|
180
|
-
children: s
|
|
181
|
-
}
|
|
182
|
-
) }),
|
|
183
|
-
/* @__PURE__ */ a(j, { children: s })
|
|
184
|
-
] }) });
|
|
185
|
-
}
|
|
186
|
-
function W() {
|
|
187
|
-
const s = h((e) => e.card), t = h(
|
|
188
|
-
(e) => {
|
|
189
|
-
var o, r, c;
|
|
190
|
-
return (c = (r = (o = e == null ? void 0 : e.card) == null ? void 0 : o.preferences) == null ? void 0 : r.chartOptions) == null ? void 0 : c.indexAxis;
|
|
191
|
-
}
|
|
192
|
-
), { data: n } = N(s), l = t === "y" ? "Metric" : "Dimension", p = t === "y" ? "Dimension" : "Metric", { dimensionKeys: d, transformedMetricKeys: i, keys: f } = q();
|
|
193
|
-
return f.length === 0 ? null : /* @__PURE__ */ u("div", { className: "space-y-4", children: [
|
|
194
|
-
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
195
|
-
/* @__PURE__ */ a(k, { children: l }),
|
|
196
|
-
/* @__PURE__ */ a("div", { className: "max-h-[125px] space-y-1 overflow-y-auto", children: d.map((e) => /* @__PURE__ */ a(
|
|
197
|
-
"p",
|
|
198
|
-
{
|
|
199
|
-
className: "flex h-8 items-center rounded-md bg-muted/70 px-3 hover:bg-muted",
|
|
200
|
-
title: e,
|
|
201
|
-
children: C(e)
|
|
202
|
-
},
|
|
203
|
-
e
|
|
204
|
-
)) })
|
|
205
|
-
] }),
|
|
206
|
-
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
207
|
-
/* @__PURE__ */ a(k, { children: p }),
|
|
208
|
-
/* @__PURE__ */ a("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: i.map((e, o) => /* @__PURE__ */ a(
|
|
209
|
-
J,
|
|
210
|
-
{
|
|
211
|
-
className: "flex h-8 items-center bg-muted/70 px-3 hover:bg-muted",
|
|
212
|
-
iconClassName: "invisible group-hover:visible",
|
|
213
|
-
col: e,
|
|
214
|
-
idx: o
|
|
215
|
-
},
|
|
216
|
-
e
|
|
217
|
-
)) })
|
|
218
|
-
] })
|
|
219
|
-
] });
|
|
220
|
-
}
|
|
221
|
-
function C(s, t = 30) {
|
|
222
|
-
return s.length > t ? s.slice(0, t) + "..." : s;
|
|
223
|
-
}
|
|
224
|
-
function J({
|
|
225
|
-
col: s,
|
|
226
|
-
idx: t,
|
|
227
|
-
className: n,
|
|
228
|
-
iconClassName: l,
|
|
229
|
-
children: p
|
|
230
|
-
}) {
|
|
231
|
-
const d = h((r) => {
|
|
232
|
-
var c;
|
|
233
|
-
return (c = r.card) == null ? void 0 : c.preferences;
|
|
234
|
-
}), i = h(
|
|
235
|
-
(r) => {
|
|
236
|
-
var c, x;
|
|
237
|
-
return (x = (c = r.card) == null ? void 0 : c.preferences) == null ? void 0 : x.datasetOptions;
|
|
238
|
-
}
|
|
239
|
-
), f = i == null ? void 0 : i.find((r) => r.idx === t), { setCardPreferences: e } = h((r) => r.actions);
|
|
240
|
-
function o(r) {
|
|
241
|
-
if (!f)
|
|
242
|
-
e({
|
|
243
|
-
...d,
|
|
244
|
-
datasetOptions: [
|
|
245
|
-
...i || [],
|
|
246
|
-
{
|
|
247
|
-
idx: t,
|
|
248
|
-
type: r === "area" ? "line" : r,
|
|
249
|
-
fill: r === "area" ? "origin" : ""
|
|
250
|
-
}
|
|
251
|
-
]
|
|
252
|
-
});
|
|
253
|
-
else {
|
|
254
|
-
const c = { ...f };
|
|
255
|
-
c.type = r === "area" ? "line" : r, c.fill = r === "area" ? "origin" : "";
|
|
256
|
-
const x = i == null ? void 0 : i.map(
|
|
257
|
-
(y) => y.idx === t ? c : y
|
|
258
|
-
);
|
|
259
|
-
e({
|
|
260
|
-
...d,
|
|
261
|
-
datasetOptions: x
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return /* @__PURE__ */ u(
|
|
266
|
-
"div",
|
|
267
|
-
{
|
|
268
|
-
className: m(
|
|
269
|
-
"group flex items-center justify-between gap-2 rounded-md",
|
|
270
|
-
n
|
|
271
|
-
),
|
|
272
|
-
children: [
|
|
273
|
-
p || /* @__PURE__ */ a(F, { className: "max-w-[100px]", title: s, children: C(s) }),
|
|
274
|
-
/* @__PURE__ */ u("div", { className: "flex gap-2", children: [
|
|
275
|
-
/* @__PURE__ */ a(
|
|
276
|
-
z,
|
|
277
|
-
{
|
|
278
|
-
onClick: () => o("bar"),
|
|
279
|
-
className: m(
|
|
280
|
-
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
281
|
-
l
|
|
282
|
-
)
|
|
283
|
-
}
|
|
284
|
-
),
|
|
285
|
-
/* @__PURE__ */ a(
|
|
286
|
-
S,
|
|
287
|
-
{
|
|
288
|
-
onClick: () => o("line"),
|
|
289
|
-
className: m(
|
|
290
|
-
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
291
|
-
l
|
|
292
|
-
)
|
|
293
|
-
}
|
|
294
|
-
),
|
|
295
|
-
/* @__PURE__ */ a(
|
|
296
|
-
E,
|
|
297
|
-
{
|
|
298
|
-
onClick: () => o("area"),
|
|
299
|
-
className: m(
|
|
300
|
-
"size-4 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
301
|
-
l
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
),
|
|
305
|
-
/* @__PURE__ */ a(V, { idx: t })
|
|
306
|
-
] })
|
|
307
|
-
]
|
|
308
|
-
}
|
|
309
|
-
);
|
|
310
|
-
}
|
|
311
|
-
export {
|
|
312
|
-
W as A,
|
|
313
|
-
J as M,
|
|
314
|
-
F as O
|
|
315
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),e=require("./index-Bvtpj-_R.js");require("react");require("react-dom");const j=require("./tag-D9G2kz2B.js");/**
|
|
2
|
-
* @license lucide-react v0.453.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const v=e.createLucideIcon("ListEnd",[["path",{d:"M16 12H3",key:"1a2rj7"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M10 18H3",key:"13769t"}],["path",{d:"M21 6v10a2 2 0 0 1-2 2h-5",key:"ilrcs8"}],["path",{d:"m16 16-2 2 2 2",key:"kkc6pm"}]]);/**
|
|
7
|
-
* @license lucide-react v0.453.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const k=e.createLucideIcon("ListStart",[["path",{d:"M16 12H3",key:"1a2rj7"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M10 6H3",key:"lf8lx7"}],["path",{d:"M21 18V8a2 2 0 0 0-2-2h-5",key:"1hghli"}],["path",{d:"m16 8-2-2 2-2",key:"160uvd"}]]);/**
|
|
12
|
-
* @license lucide-react v0.453.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const C=e.createLucideIcon("ListX",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"m19 10-4 4",key:"1tz659"}],["path",{d:"m15 10 4 4",key:"1n7nei"}]]);function N({idx:n}){var x;const r=e.useEditorStore(s=>{var i;return(i=s.card)==null?void 0:i.preferences}),o=e.useEditorStore(s=>{var i;return(i=s.card.preferences)==null?void 0:i.datasetOptions}),p=e.useEditorStore(s=>s.actions.setCardPreferences),u=(x=r==null?void 0:r.chartOptions)==null?void 0:x.indexAxis,l=o==null?void 0:o.find(s=>s.idx===n);function c(s,i){(s==="end"||s==="start")&&e.getContrastColor(e.getCanvasBackgroundColor());const a={display:s!=="none",align:s,anchor:s,clamp:!0};if(!l)p({...r,datasetOptions:[...o||[],{idx:i,datalabels:a}]});else{const d={...l};d.datalabels=a;const h=o==null?void 0:o.map(m=>m.idx===i?d:m);p({...r,datasetOptions:h})}}return t.jsxs(e.Popover,{children:[t.jsx(e.PopoverTrigger,{children:t.jsx(j.Tag,{className:"size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground"})}),t.jsx(e.PopoverContent,{className:"w-fit px-2 py-1",children:t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:()=>c("none",n),className:"h-7 p-1 text-xs font-normal",children:t.jsx(e.X,{className:"size-3.5"})}),t.jsx("button",{onClick:()=>c("start",n),className:"h-7 p-1 text-xs font-normal",children:t.jsx(v,{className:e.cn("h-4 w-4",{"rotate-90":u==="y"})})}),t.jsx("button",{onClick:()=>c("center",n),className:"h-7 p-1 text-xs font-normal",children:t.jsx(C,{className:e.cn("h-4 w-4",{"rotate-90":u==="y"})})}),t.jsx("button",{onClick:()=>c("end",n),className:"h-7 p-1 text-xs font-normal",children:t.jsx(k,{className:e.cn("h-4 w-4",{"rotate-90":u==="y"})})})]})})]})}function M(){const n=e.useEditorStore(l=>l.card),{data:r}=e.useDashboardCardQuery(n),{keys:o}=e.getKeys((r==null?void 0:r.records)||[]),p=o.slice(1).filter(l=>!e.METADATA_KEYS.includes(l));let u=p;if(["stackedBar","stackedLine"].includes(n.type)){const l=e.pivotData({dataArray:(r==null?void 0:r.records)||[],groupKey:o[0],pivotKey:o[1],valueKey:o[2]}),{keys:c}=e.getKeys(l);u=c.slice(1)}return{transformedMetricKeys:u,dimensionKeys:o.slice(0,1),keys:o,defaultMetricKeys:p}}function f({children:n,className:r,delayDuration:o}){return t.jsx(e.TooltipProvider,{children:t.jsxs(e.Tooltip,{delayDuration:o,children:[t.jsx(e.TooltipTrigger,{asChild:!0,children:t.jsx("span",{className:e.cn("overflow-hidden text-ellipsis whitespace-nowrap",r),children:n})}),t.jsx(e.TooltipContent,{children:n})]})})}function b(){const n=e.useEditorStore(s=>s.card),r=e.useEditorStore(s=>{var i,a,d;return(d=(a=(i=s==null?void 0:s.card)==null?void 0:i.preferences)==null?void 0:a.chartOptions)==null?void 0:d.indexAxis}),{data:o}=e.useDashboardCardQuery(n),p=r==="y"?"Metric":"Dimension",u=r==="y"?"Dimension":"Metric",{dimensionKeys:l,transformedMetricKeys:c,keys:x}=M();return x.length===0?null:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(e.Label,{children:p}),t.jsx("div",{className:"max-h-[125px] space-y-1 overflow-y-auto",children:l.map(s=>t.jsx("p",{className:"flex h-8 items-center rounded-md bg-muted/70 px-3 hover:bg-muted",title:s,children:y(s)},s))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(e.Label,{children:u}),t.jsx("div",{className:"my-1 max-h-[125px] space-y-1 overflow-y-auto",children:c.map((s,i)=>t.jsx(g,{className:"flex h-8 items-center bg-muted/70 px-3 hover:bg-muted",iconClassName:"invisible group-hover:visible",col:s,idx:i},s))})]})]})}function y(n,r=30){return n.length>r?n.slice(0,r)+"...":n}function g({col:n,idx:r,className:o,iconClassName:p,children:u}){const l=e.useEditorStore(a=>{var d;return(d=a.card)==null?void 0:d.preferences}),c=e.useEditorStore(a=>{var d,h;return(h=(d=a.card)==null?void 0:d.preferences)==null?void 0:h.datasetOptions}),x=c==null?void 0:c.find(a=>a.idx===r),{setCardPreferences:s}=e.useEditorStore(a=>a.actions);function i(a){if(!x)s({...l,datasetOptions:[...c||[],{idx:r,type:a==="area"?"line":a,fill:a==="area"?"origin":""}]});else{const d={...x};d.type=a==="area"?"line":a,d.fill=a==="area"?"origin":"";const h=c==null?void 0:c.map(m=>m.idx===r?d:m);s({...l,datasetOptions:h})}}return t.jsxs("div",{className:e.cn("group flex items-center justify-between gap-2 rounded-md",o),children:[u||t.jsx(f,{className:"max-w-[100px]",title:n,children:y(n)}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(e.ChartColumnIncreasing,{onClick:()=>i("bar"),className:e.cn("size-4 cursor-pointer text-muted-foreground hover:text-foreground",p)}),t.jsx(e.ChartLine,{onClick:()=>i("line"),className:e.cn("size-4 cursor-pointer text-muted-foreground hover:text-foreground",p)}),t.jsx(e.ChartArea,{onClick:()=>i("area"),className:e.cn("size-4 cursor-pointer text-muted-foreground hover:text-foreground",p)}),t.jsx(N,{idx:r})]})]})}exports.AxisMapping=b;exports.MetricFragment=g;exports.OverflowSpan=f;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { memo as c } from "react";
|
|
3
|
-
import { A as n, a, b as r, t as o, c as t } from "./index--MUeDITx.js";
|
|
4
|
-
import { F as m } from "./filter-on-click-columns-BJUGTE6W.js";
|
|
5
|
-
import { A as d } from "./axis-mapping-8ZVwlkl6.js";
|
|
6
|
-
import { F as h } from "./frame-filters-DFgqSoV2.js";
|
|
7
|
-
function p({
|
|
8
|
-
cardType: s
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ i(n, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
11
|
-
/* @__PURE__ */ i(a, { value: "item-1", children: [
|
|
12
|
-
/* @__PURE__ */ e(r, { children: `${o(s)} Chart` }),
|
|
13
|
-
/* @__PURE__ */ i(t, { className: "space-y-4 font-mono text-xs", children: [
|
|
14
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
15
|
-
/* @__PURE__ */ i("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
16
|
-
/* @__PURE__ */ e("li", { children: "x-axis - category" }),
|
|
17
|
-
/* @__PURE__ */ e("li", { children: "y-axis1 - number" }),
|
|
18
|
-
/* @__PURE__ */ e("li", { children: "y-axis2 - number" })
|
|
19
|
-
] }),
|
|
20
|
-
/* @__PURE__ */ i("div", { children: [
|
|
21
|
-
"See ",
|
|
22
|
-
/* @__PURE__ */ e(
|
|
23
|
-
"a",
|
|
24
|
-
{
|
|
25
|
-
target: "_blank",
|
|
26
|
-
onClick: (l) => l.stopPropagation(),
|
|
27
|
-
className: "text-blue-700",
|
|
28
|
-
href: "https://docs.semaphor.cloud/docs/charts/bar-line-area",
|
|
29
|
-
children: "example"
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
" in the docs."
|
|
33
|
-
] })
|
|
34
|
-
] })
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ i(a, { value: "item-2", children: [
|
|
37
|
-
/* @__PURE__ */ e(r, { children: "Settings" }),
|
|
38
|
-
/* @__PURE__ */ e(t, { className: "space-y-4 px-2", children: /* @__PURE__ */ e(d, {}) })
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ i(a, { value: "item-3", children: [
|
|
41
|
-
/* @__PURE__ */ e(r, { children: "Click Filters" }),
|
|
42
|
-
/* @__PURE__ */ i(t, { className: "space-y-4 px-2", children: [
|
|
43
|
-
/* @__PURE__ */ e(m, {}),
|
|
44
|
-
/* @__PURE__ */ e(h, {})
|
|
45
|
-
] })
|
|
46
|
-
] })
|
|
47
|
-
] }) });
|
|
48
|
-
}
|
|
49
|
-
const b = c(p);
|
|
50
|
-
export {
|
|
51
|
-
b as default
|
|
52
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index-Bvtpj-_R.js"),c=require("./filter-on-click-columns-6dRYhvgz.js"),n=require("./axis-mapping-Cwa3KrDR.js"),l=require("./frame-filters-D9sDN4Vm.js");function a({cardType:i}){return e.jsx("div",{className:"space-y-6 px-6 py-2",children:e.jsxs(s.Accordion,{defaultValue:["item-2"],type:"multiple",children:[e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{children:`${s.titleCase(i)} Chart`}),e.jsxs(s.AccordionContent,{className:"space-y-4 font-mono text-xs",children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2,... FROM table"}),e.jsxs("ul",{className:"ml-6 list-disc text-xs [&>li]:mt-2",children:[e.jsx("li",{children:"x-axis - category"}),e.jsx("li",{children:"y-axis1 - number"}),e.jsx("li",{children:"y-axis2 - number"})]}),e.jsxs("div",{children:["See ",e.jsx("a",{target:"_blank",onClick:r=>r.stopPropagation(),className:"text-blue-700",href:"https://docs.semaphor.cloud/docs/charts/bar-line-area",children:"example"})," in the docs."]})]})]}),e.jsxs(s.AccordionItem,{value:"item-2",children:[e.jsx(s.AccordionTrigger,{children:"Settings"}),e.jsx(s.AccordionContent,{className:"space-y-4 px-2",children:e.jsx(n.AxisMapping,{})})]}),e.jsxs(s.AccordionItem,{value:"item-3",children:[e.jsx(s.AccordionTrigger,{children:"Click Filters"}),e.jsxs(s.AccordionContent,{className:"space-y-4 px-2",children:[e.jsx(c.FilterOnClickColumns,{}),e.jsx(l.FrameFilters,{})]})]})]})})}const o=t.memo(a);exports.default=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-Bvtpj-_R.js"),c=require("./filter-on-click-columns-6dRYhvgz.js"),n=require("./frame-filters-D9sDN4Vm.js");function a({cardType:i}){function l(r){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 text-xs",children:r==="bubble"?"SELECT label, [group], x-axis, y-axis, radius FROM table":"SELECT label, [group], x-axis, y-axis FROM table"}),e.jsxs("ul",{className:"ml-6 list-disc text-xs [&>li]:mt-2",children:[e.jsx("li",{children:"label - category"}),e.jsx("li",{children:"group (optional) - category"}),e.jsx("li",{children:"x-axis - number"}),e.jsx("li",{children:"y-axis - number"}),r==="bubble"&&e.jsx("li",{children:"radius - number"})]}),e.jsxs("div",{children:["See ",e.jsx("a",{target:"_blank",onClick:t=>t.stopPropagation(),className:"text-blue-700",href:"https://docs.semaphor.cloud/docs/charts/bubble",children:"example"})," in the docs."]})]})}return e.jsx("div",{className:"space-y-6 px-6 py-2",children:e.jsxs(s.Accordion,{defaultValue:["item-2"],type:"multiple",children:[e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{children:`${s.titleCase(i)} Chart`}),e.jsx(s.AccordionContent,{className:"space-y-4 font-mono text-xs",children:l(i)})]}),e.jsxs(s.AccordionItem,{value:"item-3",children:[e.jsx(s.AccordionTrigger,{children:"Click Filters"}),e.jsxs(s.AccordionContent,{className:"space-y-4 px-2",children:[e.jsx(c.FilterOnClickColumns,{}),e.jsx(n.FrameFilters,{})]})]})]})})}exports.default=a;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as l, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import { A as d, a as t, b as a, t as u, c as s } from "./index--MUeDITx.js";
|
|
3
|
-
import { F as m } from "./filter-on-click-columns-BJUGTE6W.js";
|
|
4
|
-
import { F as b } from "./frame-filters-DFgqSoV2.js";
|
|
5
|
-
function C({
|
|
6
|
-
cardType: r
|
|
7
|
-
}) {
|
|
8
|
-
function c(i) {
|
|
9
|
-
return /* @__PURE__ */ l(o, { children: [
|
|
10
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: i === "bubble" ? "SELECT label, [group], x-axis, y-axis, radius FROM table" : "SELECT label, [group], x-axis, y-axis FROM table" }),
|
|
11
|
-
/* @__PURE__ */ l("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
12
|
-
/* @__PURE__ */ e("li", { children: "label - category" }),
|
|
13
|
-
/* @__PURE__ */ e("li", { children: "group (optional) - category" }),
|
|
14
|
-
/* @__PURE__ */ e("li", { children: "x-axis - number" }),
|
|
15
|
-
/* @__PURE__ */ e("li", { children: "y-axis - number" }),
|
|
16
|
-
i === "bubble" && /* @__PURE__ */ e("li", { children: "radius - number" })
|
|
17
|
-
] }),
|
|
18
|
-
/* @__PURE__ */ l("div", { children: [
|
|
19
|
-
"See ",
|
|
20
|
-
/* @__PURE__ */ e(
|
|
21
|
-
"a",
|
|
22
|
-
{
|
|
23
|
-
target: "_blank",
|
|
24
|
-
onClick: (n) => n.stopPropagation(),
|
|
25
|
-
className: "text-blue-700",
|
|
26
|
-
href: "https://docs.semaphor.cloud/docs/charts/bubble",
|
|
27
|
-
children: "example"
|
|
28
|
-
}
|
|
29
|
-
),
|
|
30
|
-
" in the docs."
|
|
31
|
-
] })
|
|
32
|
-
] });
|
|
33
|
-
}
|
|
34
|
-
return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ l(d, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
35
|
-
/* @__PURE__ */ l(t, { value: "item-1", children: [
|
|
36
|
-
/* @__PURE__ */ e(a, { children: `${u(r)} Chart` }),
|
|
37
|
-
/* @__PURE__ */ e(s, { className: "space-y-4 font-mono text-xs", children: c(r) })
|
|
38
|
-
] }),
|
|
39
|
-
/* @__PURE__ */ l(t, { value: "item-3", children: [
|
|
40
|
-
/* @__PURE__ */ e(a, { children: "Click Filters" }),
|
|
41
|
-
/* @__PURE__ */ l(s, { className: "space-y-4 px-2", children: [
|
|
42
|
-
/* @__PURE__ */ e(m, {}),
|
|
43
|
-
/* @__PURE__ */ e(b, {})
|
|
44
|
-
] })
|
|
45
|
-
] })
|
|
46
|
-
] }) });
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
C as default
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-Bvtpj-_R.js"),r=require("./display-labels-BYsRReye.js"),n=require("./filter-on-click-columns-6dRYhvgz.js"),t=require("./frame-filters-D9sDN4Vm.js"),a={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},c={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function o(){const i=s.useEditorStore(l=>l.card.type);return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx(s.Accordion,{className:" ",type:"single",collapsible:!0,children:d(i)}),!["kpi"].includes(i)&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(r.DisplayLabels,{}),e.jsx(n.FilterOnClickColumns,{}),e.jsx(t.FrameFilters,{})]})]})}function d(i){if(["line","bar"].includes(i))return e.jsxs(e.Fragment,{children:[e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:e.jsx("p",{children:"Chart Query"})}),e.jsxs(s.AccordionContent,{className:" ",children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 font-mono text-xs font-semibold",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),e.jsxs("ul",{className:"my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2",children:[e.jsx("li",{children:"X-axis - Category (ex. city)"}),e.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),e.jsxs(s.AccordionItem,{value:"item-2",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:"Mixed Chart"}),e.jsxs(s.AccordionContent,{className:"space-y-2 text-xs",children:[e.jsxs("p",{children:["Click ",e.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),e.jsx("pre",{children:JSON.stringify(a,null,2)})]})]}),e.jsxs(s.AccordionItem,{value:"item-3",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:"Area Chart"}),e.jsxs(s.AccordionContent,{className:"space-y-2 text-xs",children:[e.jsxs("p",{children:["Click ",e.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",e.jsx("a",{className:"mx-1 text-blue-500 hover:underline",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),e.jsx("pre",{children:JSON.stringify(c,null,2)})]})]})]});if(i==="bubble")return e.jsx(e.Fragment,{children:e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:e.jsxs("p",{children:["How to create a ",e.jsx("span",{children:i})," chart query?"]})}),e.jsxs(s.AccordionContent,{className:" ",children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 font-mono text-xs font-semibold",children:"SELECT label, x-axis, y-axis, radius FROM table"}),e.jsxs("ul",{className:"my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2",children:[e.jsx("li",{children:"Label - Category (ex. city)"}),e.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),e.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),e.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),e.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(i==="scatter")return e.jsx(e.Fragment,{children:e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:e.jsxs("p",{children:["How to create a ",e.jsx("span",{children:i})," chart query?"]})}),e.jsxs(s.AccordionContent,{className:" ",children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 font-mono text-xs font-semibold",children:"SELECT label, x-axis, y-axis FROM table"}),e.jsxs("ul",{className:"my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2",children:[e.jsx("li",{children:"Label - Category (ex. city)"}),e.jsx("li",{children:"Group (opt) - Category (ex. state)"}),e.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),e.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea","funnel"].includes(i))return e.jsx(e.Fragment,{children:e.jsxs(s.AccordionItem,{value:"item-1",children:[e.jsx(s.AccordionTrigger,{className:"font-normal",children:e.jsxs("p",{children:[e.jsx("span",{children:i==="polarArea"?"Polar":i.charAt(0).toUpperCase()+i.slice(1)})," ","chart query"]})}),e.jsxs(s.AccordionContent,{className:" ",children:[e.jsx("div",{className:"rounded bg-muted px-2 py-1 font-mono text-xs font-semibold",children:"SELECT label, measure FROM table"}),e.jsxs("ul",{className:"my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2",children:[e.jsx("li",{children:"Label - Category (ex. city)"}),e.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}exports.default=o;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
2
|
-
import { u as c, A as o, a as i, b as r, c as t } from "./index--MUeDITx.js";
|
|
3
|
-
import { D as d } from "./display-labels-C_jsL0Jo.js";
|
|
4
|
-
import { F as m } from "./filter-on-click-columns-BJUGTE6W.js";
|
|
5
|
-
import { F as h } from "./frame-filters-DFgqSoV2.js";
|
|
6
|
-
const u = {
|
|
7
|
-
datasets: [
|
|
8
|
-
{
|
|
9
|
-
type: "line",
|
|
10
|
-
label: "Sum_sales",
|
|
11
|
-
data: []
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
type: "bar",
|
|
15
|
-
label: "Sum_profit",
|
|
16
|
-
data: []
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}, x = {
|
|
20
|
-
datasets: [
|
|
21
|
-
{
|
|
22
|
-
fill: "origin",
|
|
23
|
-
type: "line",
|
|
24
|
-
label: "Sum_sales",
|
|
25
|
-
data: []
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
};
|
|
29
|
-
function C() {
|
|
30
|
-
const a = c((s) => s.card.type);
|
|
31
|
-
return /* @__PURE__ */ l("div", { className: "space-y-6 p-6", children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
o,
|
|
34
|
-
{
|
|
35
|
-
className: " ",
|
|
36
|
-
type: "single",
|
|
37
|
-
collapsible: !0,
|
|
38
|
-
children: p(a)
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
!["kpi"].includes(a) && /* @__PURE__ */ l("div", { className: "space-y-4", children: [
|
|
42
|
-
/* @__PURE__ */ e(d, {}),
|
|
43
|
-
/* @__PURE__ */ e(m, {}),
|
|
44
|
-
/* @__PURE__ */ e(h, {})
|
|
45
|
-
] })
|
|
46
|
-
] });
|
|
47
|
-
}
|
|
48
|
-
function p(a) {
|
|
49
|
-
if (["line", "bar"].includes(a))
|
|
50
|
-
return /* @__PURE__ */ l(n, { children: [
|
|
51
|
-
/* @__PURE__ */ l(i, { value: "item-1", children: [
|
|
52
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: /* @__PURE__ */ e("p", { children: "Chart Query" }) }),
|
|
53
|
-
/* @__PURE__ */ l(t, { className: " ", children: [
|
|
54
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
|
|
55
|
-
/* @__PURE__ */ l("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
56
|
-
/* @__PURE__ */ e("li", { children: "X-axis - Category (ex. city)" }),
|
|
57
|
-
/* @__PURE__ */ e("li", { children: "Y-axis - Number (ex. population)" })
|
|
58
|
-
] })
|
|
59
|
-
] })
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ l(i, { value: "item-2", children: [
|
|
62
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: "Mixed Chart" }),
|
|
63
|
-
/* @__PURE__ */ l(t, { className: "space-y-2 text-xs", children: [
|
|
64
|
-
/* @__PURE__ */ l("p", { children: [
|
|
65
|
-
"Click ",
|
|
66
|
-
/* @__PURE__ */ e("b", { children: "Customize" }),
|
|
67
|
-
" and change the `type` property in the dataset."
|
|
68
|
-
] }),
|
|
69
|
-
/* @__PURE__ */ e("pre", { children: JSON.stringify(u, null, 2) })
|
|
70
|
-
] })
|
|
71
|
-
] }),
|
|
72
|
-
/* @__PURE__ */ l(i, { value: "item-3", children: [
|
|
73
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: "Area Chart" }),
|
|
74
|
-
/* @__PURE__ */ l(t, { className: "space-y-2 text-xs", children: [
|
|
75
|
-
/* @__PURE__ */ l("p", { children: [
|
|
76
|
-
"Click ",
|
|
77
|
-
/* @__PURE__ */ e("b", { children: "Customize" }),
|
|
78
|
-
" and add `fill` property to the dataset. See",
|
|
79
|
-
/* @__PURE__ */ e(
|
|
80
|
-
"a",
|
|
81
|
-
{
|
|
82
|
-
className: "mx-1 text-blue-500 hover:underline",
|
|
83
|
-
href: "https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",
|
|
84
|
-
target: "_blank",
|
|
85
|
-
children: "docs"
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
"for more options."
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ e("pre", { children: JSON.stringify(x, null, 2) })
|
|
91
|
-
] })
|
|
92
|
-
] })
|
|
93
|
-
] });
|
|
94
|
-
if (a === "bubble")
|
|
95
|
-
return /* @__PURE__ */ e(n, { children: /* @__PURE__ */ l(i, { value: "item-1", children: [
|
|
96
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: /* @__PURE__ */ l("p", { children: [
|
|
97
|
-
"How to create a ",
|
|
98
|
-
/* @__PURE__ */ e("span", { children: a }),
|
|
99
|
-
" chart query?"
|
|
100
|
-
] }) }),
|
|
101
|
-
/* @__PURE__ */ l(t, { className: " ", children: [
|
|
102
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
|
|
103
|
-
/* @__PURE__ */ l("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
104
|
-
/* @__PURE__ */ e("li", { children: "Label - Category (ex. city)" }),
|
|
105
|
-
/* @__PURE__ */ e("li", { children: "Bubble Group (opt) - Category (ex. state)" }),
|
|
106
|
-
/* @__PURE__ */ e("li", { children: "X-axis - Number (ex. avg. age)" }),
|
|
107
|
-
/* @__PURE__ */ e("li", { children: "Y-axis - Number (ex. avg. weight)" }),
|
|
108
|
-
/* @__PURE__ */ e("li", { children: "Radius - Number (ex. population)" })
|
|
109
|
-
] })
|
|
110
|
-
] })
|
|
111
|
-
] }) });
|
|
112
|
-
if (a === "scatter")
|
|
113
|
-
return /* @__PURE__ */ e(n, { children: /* @__PURE__ */ l(i, { value: "item-1", children: [
|
|
114
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: /* @__PURE__ */ l("p", { children: [
|
|
115
|
-
"How to create a ",
|
|
116
|
-
/* @__PURE__ */ e("span", { children: a }),
|
|
117
|
-
" chart query?"
|
|
118
|
-
] }) }),
|
|
119
|
-
/* @__PURE__ */ l(t, { className: " ", children: [
|
|
120
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
|
|
121
|
-
/* @__PURE__ */ l("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
122
|
-
/* @__PURE__ */ e("li", { children: "Label - Category (ex. city)" }),
|
|
123
|
-
/* @__PURE__ */ e("li", { children: "Group (opt) - Category (ex. state)" }),
|
|
124
|
-
/* @__PURE__ */ e("li", { children: "X-axis - Number (ex. avg. age)" }),
|
|
125
|
-
/* @__PURE__ */ e("li", { children: "Y-axis - Number (ex. avg. weight)" })
|
|
126
|
-
] })
|
|
127
|
-
] })
|
|
128
|
-
] }) });
|
|
129
|
-
if (["pie", "doughnut", "polarArea", "funnel"].includes(a))
|
|
130
|
-
return /* @__PURE__ */ e(n, { children: /* @__PURE__ */ l(i, { value: "item-1", children: [
|
|
131
|
-
/* @__PURE__ */ e(r, { className: "font-normal", children: /* @__PURE__ */ l("p", { children: [
|
|
132
|
-
/* @__PURE__ */ e("span", { children: a === "polarArea" ? "Polar" : a.charAt(0).toUpperCase() + a.slice(1) }),
|
|
133
|
-
" ",
|
|
134
|
-
"chart query"
|
|
135
|
-
] }) }),
|
|
136
|
-
/* @__PURE__ */ l(t, { className: " ", children: [
|
|
137
|
-
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
|
|
138
|
-
/* @__PURE__ */ l("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
|
|
139
|
-
/* @__PURE__ */ e("li", { children: "Label - Category (ex. city)" }),
|
|
140
|
-
/* @__PURE__ */ e("li", { children: "Measure - Number (ex. population)" })
|
|
141
|
-
] })
|
|
142
|
-
] })
|
|
143
|
-
] }) });
|
|
144
|
-
}
|
|
145
|
-
export {
|
|
146
|
-
C as default
|
|
147
|
-
};
|