@bikdotai/bik-component-library 0.0.860-beta.2 → 0.0.860-beta.3
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 +0 -9
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +54 -44
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +3 -3
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +23 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +99 -86
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +47 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js +82 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +2 -0
- package/dist/esm/components/agent-listing/AgentTableRow.js +71 -38
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +0 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +172 -182
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +15 -16
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/index.d.ts +0 -4
- package/dist/esm/index.js +448 -450
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ChartLayout.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ChartLayout.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.js +0 -50
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.js +0 -43
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/chartPalette.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/chartPalette.js.map +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/formatChartValue.js +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/formatChartValue.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.d.ts +0 -16
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.js +0 -69
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ChartLayout.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.d.ts +0 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js +0 -110
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.model.d.ts +0 -21
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.d.ts +0 -16
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.js +0 -61
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.d.ts +0 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js +0 -109
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.model.d.ts +0 -19
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.d.ts +0 -16
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.js +0 -54
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.d.ts +0 -23
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js +0 -48
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.d.ts +0 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.js +0 -18
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/chartPalette.js.map +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.d.ts +0 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.js +0 -13
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/formatChartValue.js.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as s } from "react";
|
|
3
|
-
import { BodyTiny as C } from "../../../TypographyStyle.js";
|
|
4
|
-
import { COLORS as S } from "../../../../constants/Theme.js";
|
|
5
|
-
import { ChartCard as k, ChartValueRow as w } from "../ChartLayout.js";
|
|
6
|
-
import { pickColor as g, FUNNEL_BAND_COLORS as E } from "../chartPalette.js";
|
|
7
|
-
import { toChartValue as m, formatPercent as O, formatChartValue as R } from "../formatChartValue.js";
|
|
8
|
-
import { PlotArea as A, BandsSvg as _, SeparatorLine as v, HeaderRow as B, StageHeaderColumn as D, StageLabelRow as N, StageColorDot as P } from "./FunnelChart.styled.js";
|
|
9
|
-
import { buildFunnelLayout as V, FUNNEL_VIEW_WIDTH as L } from "./funnelGeometry.js";
|
|
10
|
-
const F = Array.from(
|
|
11
|
-
{ length: 4 },
|
|
12
|
-
(r, n) => ({ key: `placeholder-${n}`, label: "", value: 0 })
|
|
13
|
-
), T = (r, n) => {
|
|
14
|
-
const a = r[n];
|
|
15
|
-
if (a.percentageLabel !== void 0)
|
|
16
|
-
return a.percentageLabel;
|
|
17
|
-
if (n === 0)
|
|
18
|
-
return m(a.value) > 0 ? "100%" : "";
|
|
19
|
-
const t = a.branchOf ? r.find((u) => u.key === a.branchOf) : r[n - 1], l = m(t?.value);
|
|
20
|
-
if (!t || l === 0)
|
|
21
|
-
return "";
|
|
22
|
-
const h = m(a.value) / l * 100;
|
|
23
|
-
return `${O(h)}% of ${t.label}`;
|
|
24
|
-
}, j = ({
|
|
25
|
-
stage: r,
|
|
26
|
-
color: n,
|
|
27
|
-
chip: a,
|
|
28
|
-
locale: t
|
|
29
|
-
}) => /* @__PURE__ */ y(D, { "data-test": `funnel-chart-header-${r.key}`, children: [
|
|
30
|
-
r.label && /* @__PURE__ */ y(N, { children: [
|
|
31
|
-
/* @__PURE__ */ o(P, { $color: n }),
|
|
32
|
-
/* @__PURE__ */ o(C, { color: S.content.secondary, children: r.label })
|
|
33
|
-
] }),
|
|
34
|
-
/* @__PURE__ */ o(
|
|
35
|
-
w,
|
|
36
|
-
{
|
|
37
|
-
value: r.valueLabel ?? R(m(r.value), t),
|
|
38
|
-
chip: a
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
] }), K = ({
|
|
42
|
-
stages: r = [],
|
|
43
|
-
title: n,
|
|
44
|
-
plotHeight: a = 291,
|
|
45
|
-
headerHeight: t = 83,
|
|
46
|
-
colors: l = E,
|
|
47
|
-
locale: h,
|
|
48
|
-
wrapperStyle: u
|
|
49
|
-
}) => {
|
|
50
|
-
const c = r.length ? r : F, i = s(
|
|
51
|
-
() => V(c, { plotHeight: a, headerHeight: t }),
|
|
52
|
-
[c, a, t]
|
|
53
|
-
), p = !i.isEmpty, $ = (e) => `${e / L * 100}%`, d = s(
|
|
54
|
-
() => c.map((e, f) => ({
|
|
55
|
-
stage: e,
|
|
56
|
-
color: p ? e.color ?? g(l, f) : S.content.inactive,
|
|
57
|
-
chip: p ? T(c, f) : ""
|
|
58
|
-
})),
|
|
59
|
-
[c, l, p]
|
|
60
|
-
), b = s(
|
|
61
|
-
() => new Map(d.map(({ stage: e, color: f }) => [e.key, f])),
|
|
62
|
-
[d]
|
|
63
|
-
);
|
|
64
|
-
return /* @__PURE__ */ o(
|
|
65
|
-
k,
|
|
66
|
-
{
|
|
67
|
-
dataTest: "funnel-chart",
|
|
68
|
-
title: n,
|
|
69
|
-
padding: "18px 24px",
|
|
70
|
-
gap: 14,
|
|
71
|
-
wrapperStyle: { overflow: "hidden", ...u },
|
|
72
|
-
children: /* @__PURE__ */ y(A, { $height: a, children: [
|
|
73
|
-
/* @__PURE__ */ o(
|
|
74
|
-
_,
|
|
75
|
-
{
|
|
76
|
-
width: "100%",
|
|
77
|
-
height: "100%",
|
|
78
|
-
viewBox: `0 0 ${L} ${a}`,
|
|
79
|
-
preserveAspectRatio: "none",
|
|
80
|
-
"aria-hidden": !0,
|
|
81
|
-
children: i.bands.map((e) => /* @__PURE__ */ o(
|
|
82
|
-
"path",
|
|
83
|
-
{
|
|
84
|
-
"data-test": `funnel-chart-band-${e.key}`,
|
|
85
|
-
d: e.d,
|
|
86
|
-
fill: p ? b.get(e.key) : "transparent"
|
|
87
|
-
},
|
|
88
|
-
e.key
|
|
89
|
-
))
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
i.separators.full.map((e) => /* @__PURE__ */ o(v, { $left: $(e) }, `full-${e}`)),
|
|
93
|
-
i.separators.header.map((e) => /* @__PURE__ */ o(
|
|
94
|
-
v,
|
|
95
|
-
{
|
|
96
|
-
$left: $(e),
|
|
97
|
-
$height: t
|
|
98
|
-
},
|
|
99
|
-
`header-${e}`
|
|
100
|
-
)),
|
|
101
|
-
/* @__PURE__ */ o(B, { $height: t, children: d.map((e) => /* @__PURE__ */ o(j, { ...e, locale: h }, e.stage.key)) })
|
|
102
|
-
] })
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
export {
|
|
107
|
-
K as FunnelChart
|
|
108
|
-
};
|
|
109
|
-
//# sourceMappingURL=FunnelChart.js.map
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunnelChart.js","sources":["../../../../../../src/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { BodyTiny } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { ChartCard, ChartValueRow } from '../ChartLayout';\nimport { FUNNEL_BAND_COLORS, pickColor } from '../chartPalette';\nimport {\n\tformatChartValue,\n\tformatPercent,\n\ttoChartValue,\n} from '../formatChartValue';\nimport type { FunnelChartI, FunnelStageI } from './FunnelChart.model';\nimport {\n\tBandsSvg,\n\tHeaderRow,\n\tPlotArea,\n\tSeparatorLine,\n\tStageColorDot,\n\tStageHeaderColumn,\n\tStageLabelRow,\n} from './FunnelChart.styled';\nimport { buildFunnelLayout, FUNNEL_VIEW_WIDTH } from './funnelGeometry';\n\nconst PLACEHOLDER_STAGES: FunnelStageI[] = Array.from(\n\t{ length: 4 },\n\t(_, index) => ({ key: `placeholder-${index}`, label: '', value: 0 }),\n);\n\nconst derivePercentageLabel = (\n\tstages: FunnelStageI[],\n\tindex: number,\n): string => {\n\tconst stage = stages[index];\n\tif (stage.percentageLabel !== undefined) {\n\t\treturn stage.percentageLabel;\n\t}\n\tif (index === 0) {\n\t\treturn toChartValue(stage.value) > 0 ? '100%' : '';\n\t}\n\tconst reference = stage.branchOf\n\t\t? stages.find((candidate) => candidate.key === stage.branchOf)\n\t\t: stages[index - 1];\n\tconst referenceValue = toChartValue(reference?.value);\n\tif (!reference || referenceValue === 0) {\n\t\treturn '';\n\t}\n\tconst share = (toChartValue(stage.value) / referenceValue) * 100;\n\treturn `${formatPercent(share)}% of ${reference.label}`;\n};\n\ninterface StageHeaderProps {\n\tstage: FunnelStageI;\n\tcolor?: string;\n\tchip: string;\n\tlocale?: string;\n}\n\nconst StageHeader: React.FC<StageHeaderProps> = ({\n\tstage,\n\tcolor,\n\tchip,\n\tlocale,\n}) => (\n\t<StageHeaderColumn data-test={`funnel-chart-header-${stage.key}`}>\n\t\t{stage.label && (\n\t\t\t<StageLabelRow>\n\t\t\t\t<StageColorDot $color={color} />\n\t\t\t\t<BodyTiny color={COLORS.content.secondary}>{stage.label}</BodyTiny>\n\t\t\t</StageLabelRow>\n\t\t)}\n\t\t<ChartValueRow\n\t\t\tvalue={\n\t\t\t\tstage.valueLabel ?? formatChartValue(toChartValue(stage.value), locale)\n\t\t\t}\n\t\t\tchip={chip}\n\t\t/>\n\t</StageHeaderColumn>\n);\n\nexport const FunnelChart: React.FC<FunnelChartI> = ({\n\tstages = [],\n\ttitle,\n\tplotHeight = 291,\n\theaderHeight = 83,\n\tcolors = FUNNEL_BAND_COLORS,\n\tlocale,\n\twrapperStyle,\n}) => {\n\tconst visibleStages = stages.length ? stages : PLACEHOLDER_STAGES;\n\n\tconst layout = useMemo(\n\t\t() => buildFunnelLayout(visibleStages, { plotHeight, headerHeight }),\n\t\t[visibleStages, plotHeight, headerHeight],\n\t);\n\n\tconst hasData = !layout.isEmpty;\n\tconst toPercent = (x: number) => `${(x / FUNNEL_VIEW_WIDTH) * 100}%`;\n\n\tconst headers = useMemo(\n\t\t() =>\n\t\t\tvisibleStages.map((stage, index) => ({\n\t\t\t\tstage,\n\t\t\t\tcolor: hasData\n\t\t\t\t\t? stage.color ?? pickColor(colors, index)\n\t\t\t\t\t: COLORS.content.inactive,\n\t\t\t\tchip: hasData ? derivePercentageLabel(visibleStages, index) : '',\n\t\t\t})),\n\t\t[visibleStages, colors, hasData],\n\t);\n\n\tconst colorByStage = useMemo(\n\t\t() => new Map(headers.map(({ stage, color }) => [stage.key, color])),\n\t\t[headers],\n\t);\n\n\treturn (\n\t\t<ChartCard\n\t\t\tdataTest=\"funnel-chart\"\n\t\t\ttitle={title}\n\t\t\tpadding=\"18px 24px\"\n\t\t\tgap={14}\n\t\t\twrapperStyle={{ overflow: 'hidden', ...wrapperStyle }}\n\t\t>\n\t\t\t<PlotArea $height={plotHeight}>\n\t\t\t\t<BandsSvg\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tviewBox={`0 0 ${FUNNEL_VIEW_WIDTH} ${plotHeight}`}\n\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{layout.bands.map((band) => (\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\tkey={band.key}\n\t\t\t\t\t\t\tdata-test={`funnel-chart-band-${band.key}`}\n\t\t\t\t\t\t\td={band.d}\n\t\t\t\t\t\t\tfill={hasData ? colorByStage.get(band.key) : 'transparent'}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</BandsSvg>\n\n\t\t\t\t{layout.separators.full.map((x) => (\n\t\t\t\t\t<SeparatorLine key={`full-${x}`} $left={toPercent(x)} />\n\t\t\t\t))}\n\t\t\t\t{layout.separators.header.map((x) => (\n\t\t\t\t\t<SeparatorLine\n\t\t\t\t\t\tkey={`header-${x}`}\n\t\t\t\t\t\t$left={toPercent(x)}\n\t\t\t\t\t\t$height={headerHeight}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\n\t\t\t\t<HeaderRow $height={headerHeight}>\n\t\t\t\t\t{headers.map((header) => (\n\t\t\t\t\t\t<StageHeader key={header.stage.key} {...header} locale={locale} />\n\t\t\t\t\t))}\n\t\t\t\t</HeaderRow>\n\t\t\t</PlotArea>\n\t\t</ChartCard>\n\t);\n};\n"],"names":["PLACEHOLDER_STAGES","_","index","derivePercentageLabel","stages","stage","toChartValue","reference","candidate","referenceValue","share","formatPercent","StageHeader","color","chip","locale","StageHeaderColumn","StageLabelRow","jsx","StageColorDot","BodyTiny","COLORS","ChartValueRow","formatChartValue","FunnelChart","title","plotHeight","headerHeight","colors","FUNNEL_BAND_COLORS","wrapperStyle","visibleStages","layout","useMemo","buildFunnelLayout","hasData","toPercent","x","FUNNEL_VIEW_WIDTH","headers","pickColor","colorByStage","ChartCard","jsxs","PlotArea","BandsSvg","band","SeparatorLine","HeaderRow","header"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAAqC,MAAM;AAAA,EAChD,EAAE,QAAQ,EAAA;AAAA,EACV,CAACC,GAAGC,OAAW,EAAE,KAAK,eAAeA,CAAK,IAAI,OAAO,IAAI,OAAO,EAAA;AACjE,GAEMC,IAAwB,CAC7BC,GACAF,MACY;AACZ,QAAMG,IAAQD,EAAOF,CAAK;AAC1B,MAAIG,EAAM,oBAAoB;AAC7B,WAAOA,EAAM;AAEd,MAAIH,MAAU;AACb,WAAOI,EAAaD,EAAM,KAAK,IAAI,IAAI,SAAS;AAEjD,QAAME,IAAYF,EAAM,WACrBD,EAAO,KAAK,CAACI,MAAcA,EAAU,QAAQH,EAAM,QAAQ,IAC3DD,EAAOF,IAAQ,CAAC,GACbO,IAAiBH,EAAaC,GAAW,KAAK;AACpD,MAAI,CAACA,KAAaE,MAAmB;AACpC,WAAO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AA,UAAA;AAAA,YAEA,OAAOX,EAAUC,CAAC;AAAA,YAClB,SAASV;AAAA,UAAA;AAAA,UAFJ,UAAUU,CAAC;AAAA,QAAA,CAIjB;AAAA,0BAEAW,GAAA,EAAU,SAASrB,GAClB,UAAAY,EAAQ,IAAI,CAACU,MACb,gBAAA/B,EAACN,GAAA,EAAoC,GAAGqC,GAAQ,QAAAlC,EAAA,GAA9BkC,EAAO,MAAM,GAAiC,CAChE,EAAA,CACF;AAAA,MAAA,EAAA,CACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.model.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
export interface FunnelStageI {
|
|
3
|
-
key: string;
|
|
4
|
-
label: string;
|
|
5
|
-
value: number;
|
|
6
|
-
valueLabel?: string;
|
|
7
|
-
percentageLabel?: string;
|
|
8
|
-
color?: string;
|
|
9
|
-
branchOf?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface FunnelChartI {
|
|
12
|
-
stages: FunnelStageI[];
|
|
13
|
-
title?: string;
|
|
14
|
-
plotHeight?: number;
|
|
15
|
-
headerHeight?: number;
|
|
16
|
-
colors?: string[];
|
|
17
|
-
locale?: string;
|
|
18
|
-
wrapperStyle?: CSSProperties;
|
|
19
|
-
}
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const SeparatorLine: import('styled-components').StyledComponent<"div", any, {
|
|
2
|
-
$left: string;
|
|
3
|
-
$height?: number | undefined;
|
|
4
|
-
}, never>;
|
|
5
|
-
export declare const PlotArea: import('styled-components').StyledComponent<"div", any, {
|
|
6
|
-
$height: number;
|
|
7
|
-
}, never>;
|
|
8
|
-
export declare const BandsSvg: import('styled-components').StyledComponent<"svg", any, {}, never>;
|
|
9
|
-
export declare const HeaderRow: import('styled-components').StyledComponent<"div", any, {
|
|
10
|
-
$height: number;
|
|
11
|
-
}, never>;
|
|
12
|
-
export declare const StageHeaderColumn: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
13
|
-
export declare const StageLabelRow: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
14
|
-
export declare const StageColorDot: import('styled-components').StyledComponent<"span", any, {
|
|
15
|
-
$color?: string | undefined;
|
|
16
|
-
}, never>;
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import i from "styled-components";
|
|
2
|
-
import { COLORS as o } from "../../../../constants/Theme.js";
|
|
3
|
-
const p = i.div`
|
|
4
|
-
position: absolute;
|
|
5
|
-
top: 0;
|
|
6
|
-
${(t) => t.$height === void 0 ? "bottom: 0;" : `height: ${t.$height}px;`}
|
|
7
|
-
left: ${(t) => t.$left};
|
|
8
|
-
width: 1px;
|
|
9
|
-
background-color: ${o.stroke.primary};
|
|
10
|
-
`, r = i.div`
|
|
11
|
-
position: relative;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: ${(t) => t.$height}px;
|
|
14
|
-
`, l = i.svg`
|
|
15
|
-
position: absolute;
|
|
16
|
-
inset: 0;
|
|
17
|
-
`, n = i.div`
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
height: ${(t) => t.$height}px;
|
|
23
|
-
display: flex;
|
|
24
|
-
`, s = i.div`
|
|
25
|
-
flex: 1;
|
|
26
|
-
min-width: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
gap: 8px;
|
|
30
|
-
align-items: flex-start;
|
|
31
|
-
padding: 0 8px 0 12px;
|
|
32
|
-
`, d = i.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: 8px;
|
|
36
|
-
width: 100%;
|
|
37
|
-
opacity: 0.8;
|
|
38
|
-
`, h = i.span`
|
|
39
|
-
width: 16px;
|
|
40
|
-
height: 16px;
|
|
41
|
-
border-radius: 2.667px;
|
|
42
|
-
background-color: ${(t) => t.$color ?? "transparent"};
|
|
43
|
-
flex-shrink: 0;
|
|
44
|
-
`;
|
|
45
|
-
export {
|
|
46
|
-
l as BandsSvg,
|
|
47
|
-
n as HeaderRow,
|
|
48
|
-
r as PlotArea,
|
|
49
|
-
p as SeparatorLine,
|
|
50
|
-
h as StageColorDot,
|
|
51
|
-
s as StageHeaderColumn,
|
|
52
|
-
d as StageLabelRow
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=FunnelChart.styled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunnelChart.styled.js","sources":["../../../../../../src/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport const SeparatorLine = styled.div<{ $left: string; $height?: number }>`\n\tposition: absolute;\n\ttop: 0;\n\t${(props) =>\n\t\tprops.$height === undefined ? 'bottom: 0;' : `height: ${props.$height}px;`}\n\tleft: ${(props) => props.$left};\n\twidth: 1px;\n\tbackground-color: ${COLORS.stroke.primary};\n`;\n\nexport const PlotArea = styled.div<{ $height: number }>`\n\tposition: relative;\n\twidth: 100%;\n\theight: ${(props) => props.$height}px;\n`;\n\nexport const BandsSvg = styled.svg`\n\tposition: absolute;\n\tinset: 0;\n`;\n\nexport const HeaderRow = styled.div<{ $height: number }>`\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\theight: ${(props) => props.$height}px;\n\tdisplay: flex;\n`;\n\nexport const StageHeaderColumn = styled.div`\n\tflex: 1;\n\tmin-width: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\talign-items: flex-start;\n\tpadding: 0 8px 0 12px;\n`;\n\nexport const StageLabelRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\topacity: 0.8;\n`;\n\nexport const StageColorDot = styled.span<{ $color?: string }>`\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 2.667px;\n\tbackground-color: ${(props) => props.$color ?? 'transparent'};\n\tflex-shrink: 0;\n`;\n"],"names":["SeparatorLine","styled","props","COLORS","PlotArea","BandsSvg","HeaderRow","StageHeaderColumn","StageLabelRow","StageColorDot"],"mappings":";;AAGO,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA,GAGjC,CAACC,MACFA,EAAM,YAAY,SAAY,eAAe,WAAWA,EAAM,OAAO,KAAK;AAAA,SACnE,CAACA,MAAUA,EAAM,KAAK;AAAA;AAAA,qBAEVC,EAAO,OAAO,OAAO;AAAA,GAG7BC,IAAWH,EAAO;AAAA;AAAA;AAAA,WAGpB,CAACC,MAAUA,EAAM,OAAO;AAAA,GAGtBG,IAAWJ,EAAO;AAAA;AAAA;AAAA,GAKlBK,IAAYL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,WAKrB,CAACC,MAAUA,EAAM,OAAO;AAAA;AAAA,GAItBK,IAAoBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAU3BO,IAAgBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQvBQ,IAAgBR,EAAO;AAAA;AAAA;AAAA;AAAA,qBAIf,CAACC,MAAUA,EAAM,UAAU,aAAa;AAAA;AAAA;"}
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const FUNNEL_VIEW_WIDTH = 1000;
|
|
2
|
-
export interface FunnelGeometryStage {
|
|
3
|
-
key: string;
|
|
4
|
-
value: number;
|
|
5
|
-
branchOf?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface FunnelGeometryOptions {
|
|
8
|
-
plotHeight: number;
|
|
9
|
-
headerHeight: number;
|
|
10
|
-
}
|
|
11
|
-
export interface FunnelBandLayout {
|
|
12
|
-
key: string;
|
|
13
|
-
d: string;
|
|
14
|
-
}
|
|
15
|
-
export interface FunnelLayout {
|
|
16
|
-
bands: FunnelBandLayout[];
|
|
17
|
-
separators: {
|
|
18
|
-
full: number[];
|
|
19
|
-
header: number[];
|
|
20
|
-
};
|
|
21
|
-
isEmpty: boolean;
|
|
22
|
-
}
|
|
23
|
-
export declare const buildFunnelLayout: (stages: FunnelGeometryStage[], { plotHeight, headerHeight }: FunnelGeometryOptions) => FunnelLayout;
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { toChartValue as x, clamp as k } from "../formatChartValue.js";
|
|
2
|
-
const B = 1e3, a = (n) => Math.round(n * 100) / 100, F = (n) => n.reduce((c, s, o) => {
|
|
3
|
-
const r = c[c.length - 1];
|
|
4
|
-
return s.branchOf && r?.branchOf === s.branchOf ? r.stageIndexes.push(o) : c.push({ branchOf: s.branchOf, stageIndexes: [o] }), c;
|
|
5
|
-
}, []), N = (n, { plotHeight: c, headerHeight: s }) => {
|
|
6
|
-
const o = Math.max(c - s, 0), r = s + o / 2, b = x(n[0]?.value), $ = n.length === 0 || b === 0 || o === 0, p = (t) => a(t / n.length * B), g = (t) => $ ? 0 : k(t / b * o, 0, o), l = F(n);
|
|
7
|
-
let m = 0;
|
|
8
|
-
const h = l.map((t) => {
|
|
9
|
-
const e = p(m);
|
|
10
|
-
return m += t.stageIndexes.length, { x0: e, x1: p(m) };
|
|
11
|
-
}), I = l.map(
|
|
12
|
-
(t) => t.stageIndexes.reduce(
|
|
13
|
-
(e, u) => e + x(n[u].value),
|
|
14
|
-
0
|
|
15
|
-
)
|
|
16
|
-
), O = [];
|
|
17
|
-
return l.forEach((t, e) => {
|
|
18
|
-
const { x0: u, x1: T } = h[e], f = I[e], V = I[e + 1] ?? f, E = g(f), L = g(V);
|
|
19
|
-
let i = r - E / 2, d = r - L / 2;
|
|
20
|
-
t.stageIndexes.forEach((y) => {
|
|
21
|
-
const M = f > 0 ? x(n[y].value) / f : 0, v = i + E * M, C = d + L * M;
|
|
22
|
-
O.push({
|
|
23
|
-
key: n[y].key,
|
|
24
|
-
d: [
|
|
25
|
-
`M${u} ${a(i)}`,
|
|
26
|
-
`L${T} ${a(d)}`,
|
|
27
|
-
`L${T} ${a(C)}`,
|
|
28
|
-
`L${u} ${a(v)}`,
|
|
29
|
-
"Z"
|
|
30
|
-
].join(" ")
|
|
31
|
-
}), i = v, d = C;
|
|
32
|
-
});
|
|
33
|
-
}), {
|
|
34
|
-
bands: O,
|
|
35
|
-
separators: {
|
|
36
|
-
full: h.length ? [h[0].x0, ...h.map((t) => t.x1)] : [],
|
|
37
|
-
header: l.flatMap(
|
|
38
|
-
(t) => t.stageIndexes.slice(1).map((e) => p(e))
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
isEmpty: $
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
B as FUNNEL_VIEW_WIDTH,
|
|
46
|
-
N as buildFunnelLayout
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=funnelGeometry.js.map
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"funnelGeometry.js","sources":["../../../../../../src/components/analytics-chips-and-dropdowns/chart/FunnelChart/funnelGeometry.ts"],"sourcesContent":["import { clamp, toChartValue } from '../formatChartValue';\n\nexport const FUNNEL_VIEW_WIDTH = 1000;\n\nexport interface FunnelGeometryStage {\n\tkey: string;\n\tvalue: number;\n\tbranchOf?: string;\n}\n\nexport interface FunnelGeometryOptions {\n\tplotHeight: number;\n\theaderHeight: number;\n}\n\nexport interface FunnelBandLayout {\n\tkey: string;\n\td: string;\n}\n\nexport interface FunnelLayout {\n\tbands: FunnelBandLayout[];\n\tseparators: {\n\t\tfull: number[];\n\t\theader: number[];\n\t};\n\tisEmpty: boolean;\n}\n\ninterface ColumnGroup {\n\tbranchOf?: string;\n\tstageIndexes: number[];\n}\n\nconst round = (value: number) => Math.round(value * 100) / 100;\n\n// Consecutive stages sharing a `branchOf` share one column, stacked vertically within it.\nconst groupIntoColumns = (stages: FunnelGeometryStage[]): ColumnGroup[] =>\n\tstages.reduce<ColumnGroup[]>((groups, stage, index) => {\n\t\tconst current = groups[groups.length - 1];\n\t\tif (stage.branchOf && current?.branchOf === stage.branchOf) {\n\t\t\tcurrent.stageIndexes.push(index);\n\t\t} else {\n\t\t\tgroups.push({ branchOf: stage.branchOf, stageIndexes: [index] });\n\t\t}\n\t\treturn groups;\n\t}, []);\n\nexport const buildFunnelLayout = (\n\tstages: FunnelGeometryStage[],\n\t{ plotHeight, headerHeight }: FunnelGeometryOptions,\n): FunnelLayout => {\n\tconst bandArea = Math.max(plotHeight - headerHeight, 0);\n\tconst centerY = headerHeight + bandArea / 2;\n\t// Every height is a fraction of the first stage, so it always fills the full band area.\n\tconst baseValue = toChartValue(stages[0]?.value);\n\tconst isEmpty = stages.length === 0 || baseValue === 0 || bandArea === 0;\n\n\tconst toX = (cellIndex: number) =>\n\t\tround((cellIndex / stages.length) * FUNNEL_VIEW_WIDTH);\n\tconst heightOf = (value: number) =>\n\t\tisEmpty ? 0 : clamp((value / baseValue) * bandArea, 0, bandArea);\n\n\tconst groups = groupIntoColumns(stages);\n\tlet cellCursor = 0;\n\tconst columns = groups.map((group) => {\n\t\tconst x0 = toX(cellCursor);\n\t\tcellCursor += group.stageIndexes.length;\n\t\treturn { x0, x1: toX(cellCursor) };\n\t});\n\n\tconst columnTotals = groups.map((group) =>\n\t\tgroup.stageIndexes.reduce(\n\t\t\t(total, index) => total + toChartValue(stages[index].value),\n\t\t\t0,\n\t\t),\n\t);\n\n\tconst bands: FunnelBandLayout[] = [];\n\tgroups.forEach((group, columnIndex) => {\n\t\tconst { x0, x1 } = columns[columnIndex];\n\t\tconst leftTotal = columnTotals[columnIndex];\n\t\tconst rightTotal = columnTotals[columnIndex + 1] ?? leftTotal;\n\t\tconst leftHeight = heightOf(leftTotal);\n\t\tconst rightHeight = heightOf(rightTotal);\n\n\t\tlet leftTop = centerY - leftHeight / 2;\n\t\tlet rightTop = centerY - rightHeight / 2;\n\n\t\t// Each stage takes its share of the column edge, stacking downward from the previous one,\n\t\t// so a band's left and right edges line up with its neighbours in adjacent columns.\n\t\tgroup.stageIndexes.forEach((stageIndex) => {\n\t\t\tconst share =\n\t\t\t\tleftTotal > 0 ? toChartValue(stages[stageIndex].value) / leftTotal : 0;\n\t\t\tconst leftBottom = leftTop + leftHeight * share;\n\t\t\tconst rightBottom = rightTop + rightHeight * share;\n\t\t\tbands.push({\n\t\t\t\tkey: stages[stageIndex].key,\n\t\t\t\td: [\n\t\t\t\t\t`M${x0} ${round(leftTop)}`,\n\t\t\t\t\t`L${x1} ${round(rightTop)}`,\n\t\t\t\t\t`L${x1} ${round(rightBottom)}`,\n\t\t\t\t\t`L${x0} ${round(leftBottom)}`,\n\t\t\t\t\t'Z',\n\t\t\t\t].join(' '),\n\t\t\t});\n\t\t\tleftTop = leftBottom;\n\t\t\trightTop = rightBottom;\n\t\t});\n\t});\n\n\treturn {\n\t\tbands,\n\t\tseparators: {\n\t\t\tfull: columns.length ? [columns[0].x0, ...columns.map((c) => c.x1)] : [],\n\t\t\theader: groups.flatMap((group) =>\n\t\t\t\tgroup.stageIndexes.slice(1).map((index) => toX(index)),\n\t\t\t),\n\t\t},\n\t\tisEmpty,\n\t};\n};\n"],"names":["FUNNEL_VIEW_WIDTH","round","value","groupIntoColumns","stages","groups","stage","index","current","buildFunnelLayout","plotHeight","headerHeight","bandArea","centerY","baseValue","toChartValue","isEmpty","toX","cellIndex","heightOf","clamp","cellCursor","columns","group","x0","columnTotals","total","bands","columnIndex","x1","leftTot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AAA;AAAA,IACtD;AAAA,IAED,SAAAS;AAAA,EAAA;AAEF;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { COLORS as n } from "../../../constants/Theme.js";
|
|
2
|
-
const b = [
|
|
3
|
-
n.stroke.brandLightAlt,
|
|
4
|
-
n.background.brandLight,
|
|
5
|
-
n.background.brandTint,
|
|
6
|
-
n.background.brandVeryLight
|
|
7
|
-
], a = [
|
|
8
|
-
n.background.brand,
|
|
9
|
-
n.stroke.brandSubdued,
|
|
10
|
-
n.stroke.brandLightAlt,
|
|
11
|
-
n.background.brandTint
|
|
12
|
-
], o = (r, t) => r.length ? r[t % r.length] : void 0;
|
|
13
|
-
export {
|
|
14
|
-
a as COMPARISON_BAR_COLORS,
|
|
15
|
-
b as FUNNEL_BAND_COLORS,
|
|
16
|
-
o as pickColor
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chartPalette.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chartPalette.js","sources":["../../../../../src/components/analytics-chips-and-dropdowns/chart/chartPalette.ts"],"sourcesContent":["import { COLORS } from '@src/constants/Theme';\n\nexport const FUNNEL_BAND_COLORS = [\n\tCOLORS.stroke.brandLightAlt,\n\tCOLORS.background.brandLight,\n\tCOLORS.background.brandTint,\n\tCOLORS.background.brandVeryLight,\n];\n\nexport const COMPARISON_BAR_COLORS = [\n\tCOLORS.background.brand,\n\tCOLORS.stroke.brandSubdued,\n\tCOLORS.stroke.brandLightAlt,\n\tCOLORS.background.brandTint,\n];\n\nexport const pickColor = (colors: string[], index: number) =>\n\tcolors.length ? colors[index % colors.length] : undefined;\n"],"names":["FUNNEL_BAND_COLORS","COLORS","COMPARISON_BAR_COLORS","pickColor","colors","index"],"mappings":";AAEO,MAAMA,IAAqB;AAAA,EACjCC,EAAO,OAAO;AAAA,EACdA,EAAO,WAAW;AAAA,EAClBA,EAAO,WAAW;AAAA,EAClBA,EAAO,WAAW;AACnB,GAEaC,IAAwB;AAAA,EACpCD,EAAO,WAAW;AAAA,EAClBA,EAAO,OAAO;AAAA,EACdA,EAAO,OAAO;AAAA,EACdA,EAAO,WAAW;AACnB,GAEaE,IAAY,CAACC,GAAkBC,MAC3CD,EAAO,SAASA,EAAOC,IAAQD,EAAO,MAAM,IAAI;"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const toChartValue: (value: number | undefined) => number;
|
|
2
|
-
export declare const formatChartValue: (value: number, locale?: string) => string;
|
|
3
|
-
export declare const formatPercent: (value: number) => string;
|
|
4
|
-
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const e = (t) => typeof t == "number" && Number.isFinite(t) && t > 0 ? t : 0, o = (t, r = "en-IN") => Number.isFinite(t) ? new Intl.NumberFormat(r).format(t) : "0", i = (t) => {
|
|
2
|
-
if (!Number.isFinite(t))
|
|
3
|
-
return "0";
|
|
4
|
-
const r = Math.round(t * 10) / 10;
|
|
5
|
-
return Number.isInteger(r) ? `${r}` : r.toFixed(1);
|
|
6
|
-
}, m = (t, r, n) => Math.min(Math.max(t, r), n);
|
|
7
|
-
export {
|
|
8
|
-
m as clamp,
|
|
9
|
-
o as formatChartValue,
|
|
10
|
-
i as formatPercent,
|
|
11
|
-
e as toChartValue
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=formatChartValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatChartValue.js","sources":["../../../../../src/components/analytics-chips-and-dropdowns/chart/formatChartValue.ts"],"sourcesContent":["export const toChartValue = (value: number | undefined): number =>\n\ttypeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;\n\nexport const formatChartValue = (value: number, locale = 'en-IN'): string =>\n\tNumber.isFinite(value) ? new Intl.NumberFormat(locale).format(value) : '0';\n\nexport const formatPercent = (value: number): string => {\n\tif (!Number.isFinite(value)) {\n\t\treturn '0';\n\t}\n\tconst rounded = Math.round(value * 10) / 10;\n\treturn Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(1);\n};\n\nexport const clamp = (value: number, min: number, max: number): number =>\n\tMath.min(Math.max(value, min), max);\n"],"names":["toChartValue","value","formatChartValue","locale","formatPercent","rounded","clamp","min","max"],"mappings":"AAAO,MAAMA,IAAe,CAACC,MAC5B,OAAOA,KAAU,YAAY,OAAO,SAASA,CAAK,KAAKA,IAAQ,IAAIA,IAAQ,GAE/DC,IAAmB,CAACD,GAAeE,IAAS,YACxD,OAAO,SAASF,CAAK,IAAI,IAAI,KAAK,aAAaE,CAAM,EAAE,OAAOF,CAAK,IAAI,KAE3DG,IAAgB,CAACH,MAA0B;AACvD,MAAI,CAAC,OAAO,SAASA,CAAK;AACzB,WAAO;AAER,QAAMI,IAAU,KAAK,MAAMJ,IAAQ,EAAE,IAAI;AACzC,SAAO,OAAO,UAAUI,CAAO,IAAI,GAAGA,CAAO,KAAKA,EAAQ,QAAQ,CAAC;AACpE,GAEaC,IAAQ,CAACL,GAAeM,GAAaC,MACjD,KAAK,IAAI,KAAK,IAAIP,GAAOM,CAAG,GAAGC,CAAG;"}
|