@lobehub/charts 5.3.1 → 5.5.0
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/es/AccuracyBarChart/index.mdx +52 -0
- package/es/AreaChart/index.mdx +49 -0
- package/es/BarChart/index.mdx +73 -0
- package/es/BarList/index.mdx +34 -0
- package/es/BenchmarkColumnChart/index.d.ts +140 -0
- package/es/BenchmarkColumnChart/index.js +686 -0
- package/es/BenchmarkColumnChart/index.mdx +66 -0
- package/es/BenchmarkColumnChart/styles.d.ts +16 -0
- package/es/BenchmarkColumnChart/styles.js +23 -0
- package/es/BenchmarkRankingChart/index.d.ts +87 -0
- package/es/BenchmarkRankingChart/index.js +448 -0
- package/es/BenchmarkRankingChart/index.mdx +59 -0
- package/es/BenchmarkRankingChart/styles.d.ts +33 -0
- package/es/BenchmarkRankingChart/styles.js +41 -0
- package/es/ComposedChart/index.mdx +43 -0
- package/es/DataBars/index.mdx +36 -0
- package/es/DonutChart/index.mdx +48 -0
- package/es/FunnelChart/index.mdx +21 -0
- package/es/Heatmaps/index.mdx +70 -0
- package/es/Legend/index.mdx +13 -0
- package/es/LineChart/index.mdx +49 -0
- package/es/RadarChart/index.mdx +52 -0
- package/es/ScatterChart/index.mdx +49 -0
- package/es/SparkChart/index.mdx +29 -0
- package/es/Tracker/index.mdx +41 -0
- package/es/common/ChartTooltip/ChartTooltipFrame.js +1 -1
- package/es/common/ChartTooltip/ChartTooltipRow.js +3 -1
- package/es/common/ChartTooltip/index.js +2 -0
- package/es/common/benchmark/index.d.ts +2 -0
- package/es/common/benchmark/index.js +1 -0
- package/es/common/benchmark/types.d.ts +117 -0
- package/es/common/benchmark/types.js +1 -0
- package/es/common/benchmark/utils.d.ts +56 -0
- package/es/common/benchmark/utils.js +159 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +2 -0
- package/package.json +1 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: BenchmarkRankingChart
|
|
3
|
+
description: Horizontal leaderboard chart for model benchmark rankings with injectable brand icons.
|
|
4
|
+
category: Benchmark
|
|
5
|
+
order: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
+
import DemoAccuracy from './demos/accuracy.tsx?demo';
|
|
10
|
+
import DemoHighlighted from './demos/highlighted.tsx?demo';
|
|
11
|
+
|
|
12
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Pass model icons and brand colors from the consumer (e.g. `@lobehub/icons`). The chart package does not bundle icons or brand color logic.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { BenchmarkRankingChart } from '@lobehub/charts';
|
|
20
|
+
import { Gemini, OpenAI } from '@lobehub/icons';
|
|
21
|
+
|
|
22
|
+
export default () => (
|
|
23
|
+
<BenchmarkRankingChart
|
|
24
|
+
data={[
|
|
25
|
+
{
|
|
26
|
+
color: Gemini.colorPrimary,
|
|
27
|
+
icon: <Gemini.Avatar size={22} />,
|
|
28
|
+
name: 'Gemini 3.8',
|
|
29
|
+
provider: 'Google',
|
|
30
|
+
score: 82.6,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
color: OpenAI.colorPrimary,
|
|
34
|
+
icon: <OpenAI.Avatar size={22} />,
|
|
35
|
+
name: 'GPT-6 Pro',
|
|
36
|
+
provider: 'OpenAI',
|
|
37
|
+
score: 73.9,
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
labelWidth={280}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Accuracy with error bars
|
|
46
|
+
|
|
47
|
+
Use `accuracyFormatter`, `error`, and `showErrorBars` for AccuracyBar-style percentage, ± uncertainty, and horizontal error whiskers. Pass `labelWidth` to cap the left label column; omit it to fit the longest name. The X axis is off by default — set `showXAxis` / `showYAxis` to show coordinate axes.
|
|
48
|
+
|
|
49
|
+
<Demo of={DemoAccuracy} />
|
|
50
|
+
|
|
51
|
+
## Highlighted items
|
|
52
|
+
|
|
53
|
+
Set `highlighted: true` on a record to accent its name / provider / score with `highlightColor` (defaults to `theme.gold`). Bar fill colors are unchanged.
|
|
54
|
+
|
|
55
|
+
<Demo of={DemoHighlighted} />
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
<Api name="BenchmarkRankingChart" />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
axisLabelSpacer: string;
|
|
3
|
+
bar: string;
|
|
4
|
+
barHover: string;
|
|
5
|
+
barTrack: string;
|
|
6
|
+
container: string;
|
|
7
|
+
emphasis: string;
|
|
8
|
+
errorBar: string;
|
|
9
|
+
gridLine: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
identity: string;
|
|
12
|
+
labelColumn: string;
|
|
13
|
+
labelRow: string;
|
|
14
|
+
labelStack: string;
|
|
15
|
+
name: string;
|
|
16
|
+
nameLink: string;
|
|
17
|
+
plot: string;
|
|
18
|
+
plotRow: string;
|
|
19
|
+
plotRows: string;
|
|
20
|
+
provider: string;
|
|
21
|
+
rank: string;
|
|
22
|
+
score: string;
|
|
23
|
+
scoreColumn: string;
|
|
24
|
+
scoreError: string;
|
|
25
|
+
scoreRow: string;
|
|
26
|
+
tooltipTrigger: string;
|
|
27
|
+
xAxis: string;
|
|
28
|
+
xAxisLabel: string;
|
|
29
|
+
xAxisLine: string;
|
|
30
|
+
xAxisTick: string;
|
|
31
|
+
xAxisTicks: string;
|
|
32
|
+
yAxisLine: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStaticStyles } from 'antd-style';
|
|
4
|
+
var prefixCls = 'ant';
|
|
5
|
+
export var styles = createStaticStyles(function (_ref) {
|
|
6
|
+
var css = _ref.css,
|
|
7
|
+
cssVar = _ref.cssVar;
|
|
8
|
+
return {
|
|
9
|
+
axisLabelSpacer: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-shrink: 0;\n width: 100%;\n "]))),
|
|
10
|
+
bar: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n\n max-width: 100%;\n border-radius: 0;\n\n transition: all 0.25s ", ";\n "])), cssVar.motionEaseInOut),
|
|
11
|
+
barHover: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:hover {\n .", "-benchmark-ranking-bar {\n filter: brightness(1.08);\n }\n }\n "])), prefixCls),
|
|
12
|
+
barTrack: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: visible;\n width: 100%;\n height: 100%;\n "]))),
|
|
13
|
+
container: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n align-items: stretch;\n min-width: 0;\n "]))),
|
|
14
|
+
emphasis: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
|
|
15
|
+
errorBar: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 2;\n top: 50%;\n transform: translateY(-50%);\n\n height: 0;\n border-top: 1.5px solid #fff;\n\n mix-blend-mode: difference;\n\n &::before,\n &::after {\n content: '';\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n\n width: 0;\n height: 10px;\n border-left: 1.5px solid #fff;\n }\n\n &::before {\n left: 0;\n }\n\n &::after {\n right: 0;\n }\n "]))),
|
|
16
|
+
gridLine: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 0;\n top: 0;\n\n width: 0;\n border-left: 1px dashed ", ";\n "])), cssVar.colorBorderSecondary),
|
|
17
|
+
icon: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n\n width: 24px;\n height: 24px;\n "]))),
|
|
18
|
+
identity: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n gap: 10px;\n align-items: center;\n\n min-width: 0;\n "]))),
|
|
19
|
+
labelColumn: css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n min-width: 0;\n padding-right: 16px;\n "]))),
|
|
20
|
+
labelRow: css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n min-width: 0;\n "]))),
|
|
21
|
+
labelStack: css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: 2px;\n justify-content: center;\n\n min-width: 0;\n "]))),
|
|
22
|
+
name: css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n font-size: var(--benchmark-label-font-size, 14px);\n font-weight: 600;\n line-height: 1.3;\n color: ", ";\n text-overflow: ellipsis;\n white-space: pre-line;\n "])), cssVar.colorText),
|
|
23
|
+
nameLink: css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n font-size: var(--benchmark-label-font-size, 14px);\n font-weight: 600;\n line-height: 1.3;\n color: ", " !important;\n text-overflow: ellipsis;\n white-space: pre-line;\n\n &:hover {\n color: ", " !important;\n }\n "])), cssVar.colorText, cssVar.colorLinkHover),
|
|
24
|
+
plot: css(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n position: relative;\n overflow: visible;\n flex: 1;\n min-width: 80px;\n "]))),
|
|
25
|
+
plotRow: css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n min-width: 0;\n "]))),
|
|
26
|
+
plotRows: css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n width: 100%;\n "]))),
|
|
27
|
+
provider: css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n overflow: hidden;\n\n font-size: var(--benchmark-subtitle-font-size, 12px);\n line-height: 1.3;\n color: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n "])), cssVar.colorTextDescription),
|
|
28
|
+
rank: css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n\n min-width: 20px;\n margin-right: 12px;\n\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: var(--benchmark-value-label-font-size, 14px);\n font-variant-numeric: tabular-nums;\n line-height: 1.3;\n color: ", ";\n text-align: left;\n "])), cssVar.colorTextQuaternary),
|
|
29
|
+
score: css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n\n min-width: 40px;\n\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: var(--benchmark-value-label-font-size, 14px);\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n line-height: 1.3;\n color: ", ";\n text-align: right;\n "])), cssVar.colorText),
|
|
30
|
+
scoreColumn: css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n min-width: 48px;\n padding-left: 16px;\n "]))),
|
|
31
|
+
scoreError: css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n margin-left: 4px;\n\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: calc(var(--benchmark-value-label-font-size, 14px) - 2px);\n font-weight: 400;\n color: ", ";\n "])), cssVar.colorTextSecondary),
|
|
32
|
+
scoreRow: css(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n width: 100%;\n "]))),
|
|
33
|
+
tooltipTrigger: css(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n width: 100%;\n min-width: 0;\n height: 100%;\n "]))),
|
|
34
|
+
xAxis: css(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n position: relative;\n margin-top: 4px;\n padding-top: 0;\n "]))),
|
|
35
|
+
xAxisLabel: css(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n margin-top: 8px;\n\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n text-align: center;\n "])), cssVar.colorTextSecondary),
|
|
36
|
+
xAxisLine: css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n width: 100%;\n height: 0;\n border-top: 1px solid ", ";\n "])), cssVar.colorBorder),
|
|
37
|
+
xAxisTick: css(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n position: absolute;\n top: 6px;\n\n font-family: 'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n white-space: nowrap;\n "])), cssVar.colorTextDescription),
|
|
38
|
+
xAxisTicks: css(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n position: relative;\n height: 22px;\n "]))),
|
|
39
|
+
yAxisLine: css(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 2;\n top: 0;\n bottom: 0;\n left: 0;\n\n width: 0;\n border-left: 1px solid ", ";\n "])), cssVar.colorBorder)
|
|
40
|
+
};
|
|
41
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ComposedChart
|
|
3
|
+
description: ComposedChart renders bar and line series on the same chart with independent left and right y-axes, sharing a single x-axis and a unified tooltip.
|
|
4
|
+
category: Charts
|
|
5
|
+
order: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoAxis from './demos/axis.tsx?demo';
|
|
9
|
+
import DemoDomain from './demos/domain.tsx?demo';
|
|
10
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
11
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
12
|
+
import DemoLoading from './demos/loading.tsx?demo';
|
|
13
|
+
import DemoNoData from './demos/noData.tsx?demo';
|
|
14
|
+
|
|
15
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
16
|
+
|
|
17
|
+
## Usage example
|
|
18
|
+
|
|
19
|
+
A classic dual-axes chart: request count (bar, left axis) + average cost (line, right axis).
|
|
20
|
+
|
|
21
|
+
<Demo of={DemoExample} />
|
|
22
|
+
|
|
23
|
+
## Usage example with axis labels
|
|
24
|
+
|
|
25
|
+
<Demo of={DemoAxis} />
|
|
26
|
+
|
|
27
|
+
## Custom y-axis domain
|
|
28
|
+
|
|
29
|
+
Recharts defaults number axes to `[0, auto]`, which flattens series in a narrow range (e.g. success rate 80–95%). Pass `domain` on `yAxisLeft` / `yAxisRight` to control the scale — same values as [recharts `YAxis.domain`](https://recharts.org/en-US/api/YAxis#domain).
|
|
30
|
+
|
|
31
|
+
<Demo of={DemoDomain} />
|
|
32
|
+
|
|
33
|
+
## No Data
|
|
34
|
+
|
|
35
|
+
<Demo of={DemoNoData} />
|
|
36
|
+
|
|
37
|
+
## Loading
|
|
38
|
+
|
|
39
|
+
<Demo of={DemoLoading} />
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
<Api name="ComposedChart" />
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DataBars
|
|
3
|
+
description: Components to indicate progress, performance, or status. For example, an individual score compared to a benchmark, the length of a process, or the deviation of a value.
|
|
4
|
+
category: Visualizations
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoProgressBar from './demos/ProgressBar.tsx?demo';
|
|
8
|
+
import DemoMarkerBar from './demos/MarkerBar.tsx?demo';
|
|
9
|
+
import DemoDeltaBar from './demos/DeltaBar.tsx?demo';
|
|
10
|
+
import DemoCategoryBar from './demos/CategoryBar.tsx?demo';
|
|
11
|
+
|
|
12
|
+
## Progress Bar
|
|
13
|
+
|
|
14
|
+
<Demo of={DemoProgressBar} layout="center" />
|
|
15
|
+
|
|
16
|
+
## Marker Bar
|
|
17
|
+
|
|
18
|
+
<Demo of={DemoMarkerBar} layout="center" />
|
|
19
|
+
|
|
20
|
+
## Delta Bar
|
|
21
|
+
|
|
22
|
+
<Demo of={DemoDeltaBar} layout="center" />
|
|
23
|
+
|
|
24
|
+
## Category Bar
|
|
25
|
+
|
|
26
|
+
<Demo of={DemoCategoryBar} layout="center" />
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
<Api name="ProgressBar" />
|
|
31
|
+
|
|
32
|
+
<Api name="MarkerBar" />
|
|
33
|
+
|
|
34
|
+
<Api name="DeltaBar" />
|
|
35
|
+
|
|
36
|
+
<Api name="CategoryBar" />
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: DonutChart
|
|
3
|
+
description: A donut chart displays quantitative information through a circular visualization.
|
|
4
|
+
category: Charts
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
8
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
9
|
+
import DemoWithLegend from './demos/withLegend.tsx?demo';
|
|
10
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
11
|
+
import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
|
|
12
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
13
|
+
|
|
14
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
15
|
+
|
|
16
|
+
## Usage example
|
|
17
|
+
|
|
18
|
+
The example below shows a composition of a `DonutChart` component.
|
|
19
|
+
|
|
20
|
+
<Demo of={DemoExample} />
|
|
21
|
+
|
|
22
|
+
## Usage example with legend
|
|
23
|
+
|
|
24
|
+
The example below shows a composition of a `DonutChart` and `Legend` component.
|
|
25
|
+
|
|
26
|
+
<Demo of={DemoWithLegend} />
|
|
27
|
+
|
|
28
|
+
## Usage example with click event
|
|
29
|
+
|
|
30
|
+
The example below shows an interacive chart using the `onValueChange` prop.
|
|
31
|
+
|
|
32
|
+
<Demo of={DemoClickEvent} />
|
|
33
|
+
|
|
34
|
+
## Usage example with custom tooltip
|
|
35
|
+
|
|
36
|
+
The example below shows a custom tooltip using `customTooltip` prop.
|
|
37
|
+
|
|
38
|
+
<Demo of={DemoCustomTooltip} />
|
|
39
|
+
|
|
40
|
+
## Usage example with a custom colors
|
|
41
|
+
|
|
42
|
+
The example below shows a chart with custom `colors`.
|
|
43
|
+
|
|
44
|
+
<Demo of={DemoCustomColors} />
|
|
45
|
+
|
|
46
|
+
## API
|
|
47
|
+
|
|
48
|
+
<Api name="DonutChart" />
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: FunnelChart
|
|
3
|
+
description: A funnel chart illustrates the progression or conversion rates through successive stages of a process.
|
|
4
|
+
category: Charts
|
|
5
|
+
order: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
+
import DemoCalculateFrom from './demos/CalculateFrom.tsx?demo';
|
|
10
|
+
|
|
11
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
12
|
+
|
|
13
|
+
## Usage example with evolution gradient
|
|
14
|
+
|
|
15
|
+
The `calculateFrom` prop controls the referenced value to calculate the drop-off between steps. Here we set it to previous, to always reference the preceding bar as the calculation base. We also set `showArrow` to false.
|
|
16
|
+
|
|
17
|
+
<Demo of={DemoCalculateFrom} />
|
|
18
|
+
|
|
19
|
+
## API
|
|
20
|
+
|
|
21
|
+
<Api name="FunnelChart" />
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Heatmaps
|
|
3
|
+
description: A flexible React component to display activity data in a heatmaps chart.
|
|
4
|
+
category: Visualizations
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
8
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
9
|
+
import DemoLoading from './demos/loading.tsx?demo';
|
|
10
|
+
import DemoActivityLevels from './demos/activityLevels.tsx?demo';
|
|
11
|
+
import DemoDataRanges from './demos/dataRanges.tsx?demo';
|
|
12
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
13
|
+
import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
|
|
14
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
15
|
+
import DemoCustomization from './demos/customization.tsx?demo';
|
|
16
|
+
import DemoI18n from './demos/i18n.tsx?demo';
|
|
17
|
+
|
|
18
|
+
<Demo of={DemoIndex} isolated layout="bare" />
|
|
19
|
+
|
|
20
|
+
## Usage example
|
|
21
|
+
|
|
22
|
+
The example below shows a composition of a `Heatmaps` component.
|
|
23
|
+
|
|
24
|
+
<Demo of={DemoExample} isolated />
|
|
25
|
+
|
|
26
|
+
## Loading
|
|
27
|
+
|
|
28
|
+
<Demo of={DemoLoading} isolated />
|
|
29
|
+
|
|
30
|
+
## Activity Levels
|
|
31
|
+
|
|
32
|
+
Use the `maxLevel` prop to control the number of activity levels. This value is zero indexed (0 represents no activity),
|
|
33
|
+
so for example a maxLevel of 2 will total in 3 levels as above. Each activity level must be in the interval from 0 to `maxLevel`,
|
|
34
|
+
which is 4 per default.
|
|
35
|
+
|
|
36
|
+
<Demo of={DemoActivityLevels} isolated />
|
|
37
|
+
|
|
38
|
+
## Date Ranges
|
|
39
|
+
|
|
40
|
+
<Demo of={DemoDataRanges} isolated />
|
|
41
|
+
|
|
42
|
+
## Usage example with click event
|
|
43
|
+
|
|
44
|
+
The example below shows an interacive chart using the `onValueChange` prop.
|
|
45
|
+
|
|
46
|
+
<Demo of={DemoClickEvent} isolated />
|
|
47
|
+
|
|
48
|
+
## Usage example with custom tooltip
|
|
49
|
+
|
|
50
|
+
The example below shows a custom tooltip using `customTooltip` prop.
|
|
51
|
+
|
|
52
|
+
<Demo of={DemoCustomTooltip} isolated />
|
|
53
|
+
|
|
54
|
+
## Usage example with a custom colors
|
|
55
|
+
|
|
56
|
+
The example below shows a chart with custom `colors`.
|
|
57
|
+
|
|
58
|
+
<Demo of={DemoCustomColors} isolated />
|
|
59
|
+
|
|
60
|
+
## Customization
|
|
61
|
+
|
|
62
|
+
<Demo of={DemoCustomization} isolated />
|
|
63
|
+
|
|
64
|
+
## Localization
|
|
65
|
+
|
|
66
|
+
<Demo of={DemoI18n} isolated />
|
|
67
|
+
|
|
68
|
+
## API
|
|
69
|
+
|
|
70
|
+
<Api name="Heatmaps" />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Legend
|
|
3
|
+
description: A color-coded legend which goes well with data bar components.
|
|
4
|
+
category: Visualizations
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
8
|
+
|
|
9
|
+
<Demo of={DemoIndex} layout="center" />
|
|
10
|
+
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
<Api name="Legend" />
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: LineChart
|
|
3
|
+
description: A line chart is a graphical representation that connects one or more series of data points with a continuous line.
|
|
4
|
+
category: Charts
|
|
5
|
+
order: 1
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
10
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
11
|
+
import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
|
|
12
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
13
|
+
import DemoAxis from './demos/axis.tsx?demo';
|
|
14
|
+
|
|
15
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
16
|
+
|
|
17
|
+
## Usage example
|
|
18
|
+
|
|
19
|
+
The example below shows a composition combining an `AreaChart` with text elements.
|
|
20
|
+
|
|
21
|
+
<Demo of={DemoExample} />
|
|
22
|
+
|
|
23
|
+
## Usage example with click event
|
|
24
|
+
|
|
25
|
+
The example below shows an interacive chart using the `onValueChange` prop.
|
|
26
|
+
|
|
27
|
+
<Demo of={DemoClickEvent} />
|
|
28
|
+
|
|
29
|
+
## Usage example with custom tooltip
|
|
30
|
+
|
|
31
|
+
The example below shows a custom tooltip using `customTooltip` prop.
|
|
32
|
+
|
|
33
|
+
<Demo of={DemoCustomTooltip} />
|
|
34
|
+
|
|
35
|
+
## Usage example with a custom colors
|
|
36
|
+
|
|
37
|
+
The example below shows a chart with custom `colors`.
|
|
38
|
+
|
|
39
|
+
<Demo of={DemoCustomColors} />
|
|
40
|
+
|
|
41
|
+
## Usage example with x-axis and y-axis labels
|
|
42
|
+
|
|
43
|
+
The example below shows added axis labels using `xAxisLabel` and `yAxisLabel` prop.
|
|
44
|
+
|
|
45
|
+
<Demo of={DemoAxis} />
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
<Api name="LineChart" />
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: RadarChart
|
|
3
|
+
description: Radar charts compare multiple quantitative variables across categories on a polar grid.
|
|
4
|
+
category: Charts
|
|
5
|
+
order: 6
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoAngleAxisLabelFormatter from './demos/angleAxisLabelFormatter.tsx?demo';
|
|
9
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
10
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
11
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
12
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
13
|
+
import DemoLoading from './demos/loading.tsx?demo';
|
|
14
|
+
import DemoNoData from './demos/noData.tsx?demo';
|
|
15
|
+
|
|
16
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
17
|
+
|
|
18
|
+
## Usage example
|
|
19
|
+
|
|
20
|
+
The example below shows a chart composition combining a `RadarChart` with text elements.
|
|
21
|
+
|
|
22
|
+
<Demo of={DemoExample} />
|
|
23
|
+
|
|
24
|
+
## Usage example with custom angle axis labels
|
|
25
|
+
|
|
26
|
+
The example below shows custom angle-axis labels using the `angleAxisLabelFormatter` prop, appending Product A values after each subject name.
|
|
27
|
+
|
|
28
|
+
<Demo of={DemoAngleAxisLabelFormatter} />
|
|
29
|
+
|
|
30
|
+
## Usage example with click event
|
|
31
|
+
|
|
32
|
+
The example below shows an interactive chart using the `onValueChange` prop.
|
|
33
|
+
|
|
34
|
+
<Demo of={DemoClickEvent} />
|
|
35
|
+
|
|
36
|
+
## Usage example with a custom colors
|
|
37
|
+
|
|
38
|
+
The example below shows a chart with custom `colors`.
|
|
39
|
+
|
|
40
|
+
<Demo of={DemoCustomColors} />
|
|
41
|
+
|
|
42
|
+
## No Data
|
|
43
|
+
|
|
44
|
+
<Demo of={DemoNoData} />
|
|
45
|
+
|
|
46
|
+
## Loading
|
|
47
|
+
|
|
48
|
+
<Demo of={DemoLoading} />
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
<Api name="RadarChart" />
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ScatterChart
|
|
3
|
+
description: A scatter chart visualizes relationships between two or three variables.
|
|
4
|
+
category: Charts
|
|
5
|
+
order: 4
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
9
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
10
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
11
|
+
import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
|
|
12
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
13
|
+
import DemoAxis from './demos/axis.tsx?demo';
|
|
14
|
+
|
|
15
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
16
|
+
|
|
17
|
+
## Usage example
|
|
18
|
+
|
|
19
|
+
The example below shows a chart composition combining a `ScatterChart` with text elements.
|
|
20
|
+
|
|
21
|
+
<Demo of={DemoExample} />
|
|
22
|
+
|
|
23
|
+
## Usage example with click event
|
|
24
|
+
|
|
25
|
+
The example below shows an interacive chart using the `onValueChange` prop.
|
|
26
|
+
|
|
27
|
+
<Demo of={DemoClickEvent} />
|
|
28
|
+
|
|
29
|
+
## Usage example with custom tooltip
|
|
30
|
+
|
|
31
|
+
The example below shows a custom tooltip using `customTooltip` prop.
|
|
32
|
+
|
|
33
|
+
<Demo of={DemoCustomTooltip} />
|
|
34
|
+
|
|
35
|
+
## Usage example with a custom colors
|
|
36
|
+
|
|
37
|
+
The example below shows a chart with custom `colors`.
|
|
38
|
+
|
|
39
|
+
<Demo of={DemoCustomColors} />
|
|
40
|
+
|
|
41
|
+
## Usage example with x-axis and y-axis labels
|
|
42
|
+
|
|
43
|
+
The example below shows added axis labels using `xAxisLabel` and `yAxisLabel` props.
|
|
44
|
+
|
|
45
|
+
<Demo of={DemoAxis} />
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
<Api name="ScatterChart" />
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SparkChart
|
|
3
|
+
description: A small graph capable of visualizing data in a simplified form.
|
|
4
|
+
category: Visualizations
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoSparkAreaChart from './demos/SparkAreaChart.tsx?demo';
|
|
8
|
+
import DemoSparkBarChart from './demos/SparkBarChart.tsx?demo';
|
|
9
|
+
import DemoSparkLineChart from './demos/SparkLineChart.tsx?demo';
|
|
10
|
+
|
|
11
|
+
## Spark AreaC hart
|
|
12
|
+
|
|
13
|
+
<Demo of={DemoSparkAreaChart} layout="center" />
|
|
14
|
+
|
|
15
|
+
## Spark Bar Chart
|
|
16
|
+
|
|
17
|
+
<Demo of={DemoSparkBarChart} layout="center" />
|
|
18
|
+
|
|
19
|
+
## Spark Line Chart
|
|
20
|
+
|
|
21
|
+
<Demo of={DemoSparkLineChart} layout="center" />
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
<Api name="SparkAreaChart" />
|
|
26
|
+
|
|
27
|
+
<Api name="SparkBarChart" />
|
|
28
|
+
|
|
29
|
+
<Api name="SparkLineChart" />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tracker
|
|
3
|
+
description: Component for visualizing activity logs or other data related to monitoring.
|
|
4
|
+
category: Visualizations
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import DemoIndex from './demos/index.tsx?demo';
|
|
8
|
+
import DemoExample from './demos/example.tsx?demo';
|
|
9
|
+
import DemoClickEvent from './demos/clickEvent.tsx?demo';
|
|
10
|
+
import DemoCustomTooltip from './demos/customTooltip.tsx?demo';
|
|
11
|
+
import DemoCustomColors from './demos/customColors.tsx?demo';
|
|
12
|
+
|
|
13
|
+
<Demo of={DemoIndex} layout="bare" />
|
|
14
|
+
|
|
15
|
+
## Usage example
|
|
16
|
+
|
|
17
|
+
The example below shows a composition of an uptime monitor with a `Tracker` component. The \`tooltip property acts as pop-up information and displays the provided status.
|
|
18
|
+
|
|
19
|
+
<Demo of={DemoExample} layout="center" />
|
|
20
|
+
|
|
21
|
+
## Usage example with click event
|
|
22
|
+
|
|
23
|
+
The example below shows an interacive chart using the `onValueChange` prop.
|
|
24
|
+
|
|
25
|
+
<Demo of={DemoClickEvent} />
|
|
26
|
+
|
|
27
|
+
## Usage example with custom tooltip
|
|
28
|
+
|
|
29
|
+
The example below shows a custom tooltip using `customTooltip` prop.
|
|
30
|
+
|
|
31
|
+
<Demo of={DemoCustomTooltip} layout="center" />
|
|
32
|
+
|
|
33
|
+
## Usage example with a custom colors
|
|
34
|
+
|
|
35
|
+
The example below shows a chart with custom `colors`.
|
|
36
|
+
|
|
37
|
+
<Demo of={DemoCustomColors} layout="center" />
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
<Api name="Tracker" />
|
|
@@ -17,7 +17,7 @@ export var styles = createStaticStyles(function (_ref) {
|
|
|
17
17
|
var css = _ref.css,
|
|
18
18
|
cssVar = _ref.cssVar;
|
|
19
19
|
return {
|
|
20
|
-
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n\n border: 1px solid ", ";\n border-radius: ", ";\n\n background: ", ";\n box-shadow: ", ";\n "])), cssVar.colorBorderSecondary, cssVar.borderRadiusLG, cssVar.colorBgElevated, cssVar.boxShadow)
|
|
20
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: hidden;\n\n width: max-content;\n min-width: 160px;\n border: 1px solid ", ";\n border-radius: ", ";\n\n background: ", ";\n box-shadow: ", ";\n "])), cssVar.colorBorderSecondary, cssVar.borderRadiusLG, cssVar.colorBgElevated, cssVar.boxShadow)
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
23
|
export var ChartTooltipFrame = /*#__PURE__*/memo(function (_ref2) {
|
|
@@ -11,7 +11,7 @@ var styles = createStaticStyles(function (_ref) {
|
|
|
11
11
|
var css = _ref.css,
|
|
12
12
|
cssVar = _ref.cssVar;
|
|
13
13
|
return {
|
|
14
|
-
number: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 500;\n "]))),
|
|
14
|
+
number: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-shrink: 0;\n font-weight: 500;\n white-space: nowrap;\n "]))),
|
|
15
15
|
title: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n "])), cssVar.colorTextSecondary)
|
|
16
16
|
};
|
|
17
17
|
});
|
|
@@ -24,10 +24,12 @@ var ChartTooltipRow = /*#__PURE__*/memo(function (_ref2) {
|
|
|
24
24
|
gap: 32,
|
|
25
25
|
horizontal: true,
|
|
26
26
|
justify: 'space-between',
|
|
27
|
+
width: 'max-content',
|
|
27
28
|
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
28
29
|
align: 'center',
|
|
29
30
|
gap: 8,
|
|
30
31
|
horizontal: true,
|
|
32
|
+
width: 'auto',
|
|
31
33
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
32
34
|
color: color,
|
|
33
35
|
fill: color,
|
|
@@ -31,6 +31,7 @@ var ChartTooltip = function ChartTooltip(_ref2) {
|
|
|
31
31
|
className: cx(styles.header),
|
|
32
32
|
paddingBlock: 8,
|
|
33
33
|
paddingInline: 16,
|
|
34
|
+
width: 'auto',
|
|
34
35
|
children: /*#__PURE__*/_jsx(Typography.Paragraph, {
|
|
35
36
|
ellipsis: true,
|
|
36
37
|
style: {
|
|
@@ -46,6 +47,7 @@ var ChartTooltip = function ChartTooltip(_ref2) {
|
|
|
46
47
|
flexDirection: 'column-reverse',
|
|
47
48
|
marginTop: 4
|
|
48
49
|
},
|
|
50
|
+
width: 'auto',
|
|
49
51
|
children: filteredPayload.map(function (_ref3, idx) {
|
|
50
52
|
var _categoryColors$get;
|
|
51
53
|
var value = _ref3.value,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { BenchmarkBaseProps, BenchmarkEventProps, BenchmarkFieldKeys, BenchmarkRecord, BenchmarkRenderIcon, NormalizedBenchmarkItem, } from './types';
|
|
2
|
+
export { DEFAULT_BENCHMARK_KEYS, defaultBenchmarkAccuracyFormatter, defaultBenchmarkErrorFormatter, defaultBenchmarkValueFormatter, formatBenchmarkAccuracyDisplay, getBenchmarkBarPercent, getBenchmarkIcon, getBenchmarkLabelMetrics, getBenchmarkMaxValue, normalizeBenchmarkData, resolveBenchmarkKeys, splitBenchmarkLabel, } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DEFAULT_BENCHMARK_KEYS, defaultBenchmarkAccuracyFormatter, defaultBenchmarkErrorFormatter, defaultBenchmarkValueFormatter, formatBenchmarkAccuracyDisplay, getBenchmarkBarPercent, getBenchmarkIcon, getBenchmarkLabelMetrics, getBenchmarkMaxValue, normalizeBenchmarkData, resolveBenchmarkKeys, splitBenchmarkLabel } from "./utils";
|