@siyahi/ui 0.1.9-next.2 → 0.1.9-next.21
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/DESIGN.md +30 -0
- package/README.md +82 -176
- package/THIRD_PARTY_NOTICES.md +11 -11
- package/agents/examples/accordion.tsx +39 -0
- package/agents/examples/alert.tsx +23 -0
- package/agents/examples/app-sidebar.tsx +38 -0
- package/agents/examples/avatar.tsx +14 -0
- package/agents/examples/badge.tsx +18 -0
- package/agents/examples/bar-list-labels.tsx +22 -0
- package/agents/examples/bar-list-sides.tsx +38 -0
- package/agents/examples/bar-list.tsx +24 -0
- package/agents/examples/breadcrumb.tsx +28 -0
- package/agents/examples/button-states.tsx +23 -0
- package/agents/examples/button.tsx +21 -0
- package/agents/examples/calendar.tsx +15 -0
- package/agents/examples/callout.tsx +33 -0
- package/agents/examples/card.tsx +34 -0
- package/agents/examples/change-bar.tsx +104 -0
- package/agents/examples/chart-area.tsx +39 -0
- package/agents/examples/chart-bar-flows.tsx +32 -0
- package/agents/examples/chart-bar-hourly.tsx +28 -0
- package/agents/examples/chart-bar-losses.tsx +29 -0
- package/agents/examples/chart-bar-sectors.tsx +72 -0
- package/agents/examples/chart-bar-years.tsx +40 -0
- package/agents/examples/chart-bar.tsx +56 -0
- package/agents/examples/chart-category-ticks.tsx +50 -0
- package/agents/examples/chart-line-events.tsx +47 -0
- package/agents/examples/chart-line-timeline.tsx +41 -0
- package/agents/examples/chart-line.tsx +57 -0
- package/agents/examples/code-block.tsx +38 -0
- package/agents/examples/collapsible.tsx +16 -0
- package/agents/examples/command.tsx +27 -0
- package/agents/examples/context-menu.tsx +15 -0
- package/agents/examples/copy-button.tsx +8 -0
- package/agents/examples/data-bar.tsx +121 -0
- package/agents/examples/data-table-compact.tsx +95 -0
- package/agents/examples/data-table-filters.tsx +103 -0
- package/agents/examples/data-table.tsx +98 -0
- package/agents/examples/delta.tsx +13 -0
- package/agents/examples/dialog.tsx +28 -0
- package/agents/examples/distribution-bar-budget.tsx +30 -0
- package/agents/examples/distribution-bar-tug.tsx +72 -0
- package/agents/examples/dropdown-menu.tsx +31 -0
- package/agents/examples/formatters.tsx +42 -0
- package/agents/examples/heatmap-calendar.tsx +60 -0
- package/agents/examples/heatmap-status.tsx +57 -0
- package/agents/examples/heatmap-weekday.tsx +75 -0
- package/agents/examples/input-states.tsx +33 -0
- package/agents/examples/input.tsx +17 -0
- package/agents/examples/local-time.tsx +14 -0
- package/agents/examples/metric-strip.tsx +46 -0
- package/agents/examples/overview-dashboard.tsx +18 -0
- package/agents/examples/page-hero.tsx +38 -0
- package/agents/examples/page-section.tsx +52 -0
- package/agents/examples/popover.tsx +23 -0
- package/agents/examples/price-chart.tsx +32 -0
- package/agents/examples/progress-tone.tsx +28 -0
- package/agents/examples/progress.tsx +10 -0
- package/agents/examples/range-position-table.tsx +101 -0
- package/agents/examples/range-position.tsx +53 -0
- package/agents/examples/scroll-area.tsx +20 -0
- package/agents/examples/section-cards-select.tsx +30 -0
- package/agents/examples/section-cards-trend.tsx +30 -0
- package/agents/examples/section-cards.tsx +48 -0
- package/agents/examples/select.tsx +27 -0
- package/agents/examples/separator.tsx +13 -0
- package/agents/examples/sheet.tsx +15 -0
- package/agents/examples/skeleton.tsx +11 -0
- package/agents/examples/slider.tsx +5 -0
- package/agents/examples/surfaces.tsx +116 -0
- package/agents/examples/table.tsx +50 -0
- package/agents/examples/tabs.tsx +16 -0
- package/agents/examples/target-rows.tsx +70 -0
- package/agents/examples/toggle-group.tsx +12 -0
- package/agents/examples/toggle.tsx +11 -0
- package/agents/examples/tooltip.tsx +13 -0
- package/agents/examples/treemap.tsx +88 -0
- package/agents/manifest.json +1081 -0
- package/agents/report-rules.json +7 -0
- package/dist/components/registry/charts/area-chart-card.js +25 -7
- package/dist/components/registry/charts/bar-chart-card.d.ts +0 -1
- package/dist/components/registry/charts/bar-chart-card.js +40 -26
- package/dist/components/registry/charts/line-chart-card.js +2 -2
- package/dist/components/registry/dashboard-01/section-cards.d.ts +2 -0
- package/dist/components/registry/dashboard-01/section-cards.js +42 -35
- package/dist/components/registry/dashboardcn/bar-list.js +18 -11
- package/dist/components/registry/dashboardcn/distribution-bar.js +1 -1
- package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +29 -0
- package/dist/components/registry/dashboardcn/kpi-row-card.js +81 -0
- package/dist/components/registry/dashboardcn/sparkline.d.ts +22 -0
- package/dist/components/registry/dashboardcn/sparkline.js +117 -0
- package/dist/components/registry/heatmap/calendar-heatmap.d.ts +4 -2
- package/dist/components/registry/heatmap/calendar-heatmap.js +74 -33
- package/dist/components/registry/heatmap/status-heatmap.d.ts +5 -3
- package/dist/components/registry/heatmap/status-heatmap.js +37 -15
- package/dist/components/registry/heatmap/weekday-heatmap.d.ts +9 -3
- package/dist/components/registry/heatmap/weekday-heatmap.js +82 -47
- package/dist/components/registry/niko-table/core/data-table-context.d.ts +18 -1
- package/dist/components/registry/niko-table/core/data-table-context.js +7 -1
- package/dist/components/registry/niko-table/core/data-table-grouped-row.js +3 -1
- package/dist/components/registry/niko-table/core/data-table-root.js +39 -4
- package/dist/components/registry/niko-table/core/data-table-structure.js +17 -12
- package/dist/components/registry/niko-table/core/data-table.d.ts +2 -2
- package/dist/components/registry/niko-table/core/data-table.js +5 -1
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +4 -4
- package/dist/components/registry/niko-table/filters/table-search-filter.js +1 -1
- package/dist/components/registry/niko-table/lib/flex-columns.d.ts +1 -1
- package/dist/components/registry/niko-table/lib/flex-columns.js +3 -3
- package/dist/components/registry/niko-table/lib/styles.d.ts +1 -1
- package/dist/components/registry/niko-table/lib/styles.js +3 -3
- package/dist/components/registry/niko-table/types/index.d.ts +9 -0
- package/dist/components/registry/niko-table/ui/table.js +2 -2
- package/dist/components/registry/sidebar-07/app-sidebar.d.ts +1 -1
- package/dist/components/registry/sidebar-07/app-sidebar.js +3 -1
- package/dist/components/registry/sidebar-07/nav-main.d.ts +2 -1
- package/dist/components/registry/sidebar-07/nav-main.js +16 -3
- package/dist/components/siyahi/callout.d.ts +24 -0
- package/dist/components/siyahi/callout.js +40 -0
- package/dist/components/siyahi/change-bar.d.ts +21 -0
- package/dist/components/siyahi/change-bar.js +35 -0
- package/dist/components/siyahi/data-bar.d.ts +19 -0
- package/dist/components/siyahi/data-bar.js +29 -0
- package/dist/components/siyahi/data-table-compact-columns-toggle.d.ts +4 -0
- package/dist/components/siyahi/data-table-compact-columns-toggle.js +19 -0
- package/dist/components/siyahi/data-table-footnote.d.ts +12 -0
- package/dist/components/siyahi/data-table-footnote.js +35 -0
- package/dist/components/siyahi/default-sidebar-open.d.ts +8 -0
- package/dist/components/siyahi/default-sidebar-open.js +13 -0
- package/dist/components/siyahi/page-hero.d.ts +25 -0
- package/dist/components/siyahi/page-hero.js +41 -0
- package/dist/components/siyahi/page-section.d.ts +4 -1
- package/dist/components/siyahi/page-section.js +6 -3
- package/dist/components/siyahi/page-toc.d.ts +20 -0
- package/dist/components/siyahi/page-toc.js +76 -0
- package/dist/components/siyahi/panel-grid.d.ts +22 -0
- package/dist/components/siyahi/panel-grid.js +34 -0
- package/dist/components/siyahi/quote.d.ts +12 -0
- package/dist/components/siyahi/quote.js +23 -0
- package/dist/components/siyahi/range-position.d.ts +24 -0
- package/dist/components/siyahi/range-position.js +105 -0
- package/dist/components/siyahi/siyahi-provider.d.ts +13 -2
- package/dist/components/siyahi/siyahi-provider.js +17 -4
- package/dist/components/siyahi/target-rows.d.ts +34 -0
- package/dist/components/siyahi/target-rows.js +97 -0
- package/dist/components/siyahi/treemap.d.ts +4 -1
- package/dist/components/siyahi/treemap.js +78 -28
- package/dist/components/siyahi/warning-alert.d.ts +10 -0
- package/dist/components/siyahi/warning-alert.js +20 -0
- package/dist/components/ui/accordion.js +5 -5
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/breadcrumb.js +2 -2
- package/dist/components/ui/button.js +10 -10
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/card.js +4 -4
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/code-block.js +13 -12
- package/dist/components/ui/command.js +7 -6
- package/dist/components/ui/context-menu.js +7 -7
- package/dist/components/ui/dialog.js +5 -5
- package/dist/components/ui/dropdown-menu.js +8 -8
- package/dist/components/ui/input-group.js +11 -11
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/popover.js +3 -3
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/select.js +6 -6
- package/dist/components/ui/sheet.js +5 -5
- package/dist/components/ui/sidebar.js +17 -18
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/table.js +2 -2
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/toggle.js +4 -4
- package/dist/components/ui/tooltip.js +2 -2
- package/dist/index.d.ts +21 -7
- package/dist/index.js +18 -4
- package/dist/lib/chart-frame.d.ts +25 -7
- package/dist/lib/chart-frame.js +251 -127
- package/dist/lib/chart-series.d.ts +12 -6
- package/dist/lib/compact-columns.d.ts +19 -0
- package/dist/lib/compact-columns.js +55 -0
- package/dist/lib/format.d.ts +7 -2
- package/dist/lib/format.js +54 -16
- package/dist/lib/heatmap-navigation.d.ts +8 -0
- package/dist/lib/heatmap-navigation.js +49 -0
- package/dist/lib/treemap.js +6 -1
- package/dist/lib/use-element-width.d.ts +5 -0
- package/dist/lib/use-element-width.js +15 -0
- package/package.json +4 -1
- package/registry.lock.json +16 -0
- package/report.css +33 -32
- package/styles/siyahi.css +221 -39
- package/dist/lib/recharts.d.ts +0 -2
- package/dist/lib/recharts.js +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Breadcrumb,
|
|
3
|
+
BreadcrumbItem,
|
|
4
|
+
BreadcrumbLink,
|
|
5
|
+
BreadcrumbList,
|
|
6
|
+
BreadcrumbPage,
|
|
7
|
+
BreadcrumbSeparator,
|
|
8
|
+
} from "@siyahi/ui";
|
|
9
|
+
|
|
10
|
+
export default function BreadcrumbExample() {
|
|
11
|
+
return (
|
|
12
|
+
<Breadcrumb>
|
|
13
|
+
<BreadcrumbList>
|
|
14
|
+
<BreadcrumbItem>
|
|
15
|
+
<BreadcrumbLink href="#/components">Portfolio</BreadcrumbLink>
|
|
16
|
+
</BreadcrumbItem>
|
|
17
|
+
<BreadcrumbSeparator />
|
|
18
|
+
<BreadcrumbItem>
|
|
19
|
+
<BreadcrumbLink href="#/components">Equity</BreadcrumbLink>
|
|
20
|
+
</BreadcrumbItem>
|
|
21
|
+
<BreadcrumbSeparator />
|
|
22
|
+
<BreadcrumbItem>
|
|
23
|
+
<BreadcrumbPage>INFY</BreadcrumbPage>
|
|
24
|
+
</BreadcrumbItem>
|
|
25
|
+
</BreadcrumbList>
|
|
26
|
+
</Breadcrumb>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button, Toggle } from "@siyahi/ui";
|
|
2
|
+
import { DownloadIcon, Loader2Icon, PinIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
export default function ButtonStatesExample() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
7
|
+
<Button disabled>Save</Button>
|
|
8
|
+
<Button variant="outline" disabled>
|
|
9
|
+
<DownloadIcon />
|
|
10
|
+
Export
|
|
11
|
+
</Button>
|
|
12
|
+
{/* Busy: the label stays and the icon spins, so the button keeps its width while the work runs. */}
|
|
13
|
+
<Button disabled aria-busy>
|
|
14
|
+
<Loader2Icon className="motion-safe:animate-spin" />
|
|
15
|
+
Saving
|
|
16
|
+
</Button>
|
|
17
|
+
<Toggle variant="outline" defaultPressed aria-label="Pin to top">
|
|
18
|
+
<PinIcon />
|
|
19
|
+
Pinned
|
|
20
|
+
</Toggle>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Button } from "@siyahi/ui";
|
|
2
|
+
import { DownloadIcon, RefreshCwIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
export default function ButtonExample() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
7
|
+
<Button>Save</Button>
|
|
8
|
+
<Button variant="outline">
|
|
9
|
+
<DownloadIcon />
|
|
10
|
+
Export
|
|
11
|
+
</Button>
|
|
12
|
+
<Button variant="secondary">Secondary</Button>
|
|
13
|
+
<Button variant="ghost">Ghost</Button>
|
|
14
|
+
<Button variant="destructive">Delete</Button>
|
|
15
|
+
<Button variant="link">Link</Button>
|
|
16
|
+
<Button variant="outline" size="icon" aria-label="Refresh">
|
|
17
|
+
<RefreshCwIcon />
|
|
18
|
+
</Button>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Calendar } from "@siyahi/ui";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
export default function CalendarExample() {
|
|
5
|
+
const [date, setDate] = useState<Date | undefined>(new Date(2026, 9, 20));
|
|
6
|
+
return (
|
|
7
|
+
<Calendar
|
|
8
|
+
mode="single"
|
|
9
|
+
selected={date}
|
|
10
|
+
onSelect={setDate}
|
|
11
|
+
defaultMonth={new Date(2026, 9, 1)}
|
|
12
|
+
className="w-fit rounded-lg border"
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Callout, Quote, WarningAlert, AlertDescription, AlertTitle } from "@siyahi/ui";
|
|
2
|
+
import { LightbulbIcon, InfoIcon, TriangleAlertIcon, TrendingUpIcon, TrendingDownIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
export default function CalloutExample() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="grid max-w-2xl gap-3">
|
|
7
|
+
<Callout tone="accent" icon={<LightbulbIcon />} title="The takeaway">
|
|
8
|
+
Two of eleven gold rules made a profit in the final test; <strong>none</strong> held up in both metals.
|
|
9
|
+
</Callout>
|
|
10
|
+
<Callout icon={<InfoIcon />} title="How the test was run">
|
|
11
|
+
One mini lot per trade, after charges and a harsher assumed execution cost.
|
|
12
|
+
</Callout>
|
|
13
|
+
<Callout tone="warning" icon={<TriangleAlertIcon />} title="Do not use the combined result">
|
|
14
|
+
Its test used later information, so its profit claims are withdrawn.
|
|
15
|
+
</Callout>
|
|
16
|
+
<div className="grid gap-3 sm:grid-cols-2">
|
|
17
|
+
<Callout tone="positive" icon={<TrendingUpIcon />} title="Best rule">
|
|
18
|
+
A failed range break reverses: <strong>▲₹10,616</strong>.
|
|
19
|
+
</Callout>
|
|
20
|
+
<Callout tone="negative" icon={<TrendingDownIcon />} title="Worst rule">
|
|
21
|
+
Break the first-hour range: <strong>▼₹70,679</strong>.
|
|
22
|
+
</Callout>
|
|
23
|
+
</div>
|
|
24
|
+
<Quote source="eMudhra's incident notice, 21 Oct 2026">
|
|
25
|
+
The affected intermediate keys were generated with insufficient entropy and have been revoked.
|
|
26
|
+
</Quote>
|
|
27
|
+
<WarningAlert>
|
|
28
|
+
<AlertTitle>Ledger history is incomplete</AlertTitle>
|
|
29
|
+
<AlertDescription>Dhan's cash ledger starts in April 2024; earlier flows are missing.</AlertDescription>
|
|
30
|
+
</WarningAlert>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Card,
|
|
4
|
+
CardAction,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardFooter,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
useFormat,
|
|
11
|
+
} from "@siyahi/ui";
|
|
12
|
+
import { DownloadIcon } from "lucide-react";
|
|
13
|
+
|
|
14
|
+
export default function CardExample() {
|
|
15
|
+
const { money } = useFormat();
|
|
16
|
+
return (
|
|
17
|
+
<Card>
|
|
18
|
+
<CardHeader>
|
|
19
|
+
<CardTitle>Portfolio value</CardTitle>
|
|
20
|
+
<CardDescription>Across all accounts</CardDescription>
|
|
21
|
+
<CardAction>
|
|
22
|
+
<Button variant="outline" size="sm">
|
|
23
|
+
<DownloadIcon />
|
|
24
|
+
CSV
|
|
25
|
+
</Button>
|
|
26
|
+
</CardAction>
|
|
27
|
+
</CardHeader>
|
|
28
|
+
<CardContent>
|
|
29
|
+
<p className="text-3xl font-semibold">{money(4512300)}</p>
|
|
30
|
+
</CardContent>
|
|
31
|
+
<CardFooter className="text-muted-foreground">Updated after the market close</CardFooter>
|
|
32
|
+
</Card>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardDescription,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardTitle,
|
|
7
|
+
ChangeBar,
|
|
8
|
+
DataTable,
|
|
9
|
+
DataTableBody,
|
|
10
|
+
DataTableCompactColumnsToggle,
|
|
11
|
+
DataTableFootnote,
|
|
12
|
+
DataTableHeader,
|
|
13
|
+
DataTableRoot,
|
|
14
|
+
DataTableSortHeader,
|
|
15
|
+
DataTableToolbarSection,
|
|
16
|
+
useFormat,
|
|
17
|
+
type DataTableColumnDef,
|
|
18
|
+
} from "@siyahi/ui";
|
|
19
|
+
|
|
20
|
+
interface Holding {
|
|
21
|
+
symbol: string;
|
|
22
|
+
/** Value at the close of 31 January and of 28 February, in rupees; made-up figures. */
|
|
23
|
+
january: number;
|
|
24
|
+
february: number;
|
|
25
|
+
change: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const holding = (symbol: string, january: number, february: number): Holding => ({
|
|
29
|
+
symbol,
|
|
30
|
+
january,
|
|
31
|
+
february,
|
|
32
|
+
change: february / january - 1,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const holdings: Holding[] = [
|
|
36
|
+
holding("ICICIBANK", 231900, 258000),
|
|
37
|
+
holding("HDFCBANK", 248300, 262500),
|
|
38
|
+
holding("TCS", 161300, 166000),
|
|
39
|
+
holding("NIFTYBEES", 250400, 255600),
|
|
40
|
+
holding("ITC", 283100, 276000),
|
|
41
|
+
holding("INFY", 241800, 224400),
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// Every bar is a share of the column's largest move, and the column holds gains and losses, so the bars diverge.
|
|
45
|
+
const largestChange = Math.max(...holdings.map((h) => Math.abs(h.change)));
|
|
46
|
+
const diverging = holdings.some((h) => h.change < 0) && holdings.some((h) => h.change > 0);
|
|
47
|
+
|
|
48
|
+
function Money({ amount, muted = false }: { amount: number; muted?: boolean }) {
|
|
49
|
+
const text = useFormat().money(amount);
|
|
50
|
+
return muted ? <span className="text-muted-foreground">{text}</span> : text;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const header = () => <DataTableSortHeader />;
|
|
54
|
+
|
|
55
|
+
const columns: DataTableColumnDef<Holding>[] = [
|
|
56
|
+
{ accessorKey: "symbol", header, size: 130, meta: { label: "Holding", compact: true } },
|
|
57
|
+
{
|
|
58
|
+
accessorKey: "january",
|
|
59
|
+
header,
|
|
60
|
+
size: 130,
|
|
61
|
+
meta: { label: "31 Jan", variant: "number" },
|
|
62
|
+
cell: ({ row }) => <Money amount={row.original.january} muted />,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
accessorKey: "february",
|
|
66
|
+
header,
|
|
67
|
+
size: 130,
|
|
68
|
+
meta: { label: "28 Feb", variant: "number", compact: true },
|
|
69
|
+
cell: ({ row }) => <Money amount={row.original.february} />,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
accessorKey: "change",
|
|
73
|
+
header,
|
|
74
|
+
size: 150,
|
|
75
|
+
meta: { label: "Change", variant: "number", compact: true },
|
|
76
|
+
cell: ({ row }) => <ChangeBar value={row.original.change} max={largestChange} diverging={diverging} />,
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export default function ChangeBarExample() {
|
|
81
|
+
return (
|
|
82
|
+
<Card>
|
|
83
|
+
<CardHeader>
|
|
84
|
+
<CardTitle>ICICIBANK rose 11.3% in February, INFY fell 7.2%</CardTitle>
|
|
85
|
+
<CardDescription>Each holding's value at the end of February against the end of January</CardDescription>
|
|
86
|
+
</CardHeader>
|
|
87
|
+
<CardContent>
|
|
88
|
+
<DataTableRoot data={holdings} columns={columns}>
|
|
89
|
+
<DataTableToolbarSection>
|
|
90
|
+
<DataTableCompactColumnsToggle />
|
|
91
|
+
</DataTableToolbarSection>
|
|
92
|
+
<DataTable aria-label="February against January">
|
|
93
|
+
<DataTableHeader />
|
|
94
|
+
<DataTableBody />
|
|
95
|
+
<DataTableFootnote>
|
|
96
|
+
Each percent is the change on January's value, and the bar is its size against the largest move. Gains run
|
|
97
|
+
right of the centre line, losses left.
|
|
98
|
+
</DataTableFootnote>
|
|
99
|
+
</DataTable>
|
|
100
|
+
</DataTableRoot>
|
|
101
|
+
</CardContent>
|
|
102
|
+
</Card>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AreaChartCard, ToggleGroup, ToggleGroupItem, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
const data = [
|
|
4
|
+
{ month: "May", value: 3820000, invested: 3600000 },
|
|
5
|
+
{ month: "Jun", value: 3950000, invested: 3685000 },
|
|
6
|
+
{ month: "Jul", value: 4110000, invested: 3770000 },
|
|
7
|
+
{ month: "Aug", value: 4020000, invested: 3855000 },
|
|
8
|
+
{ month: "Sep", value: 4380000, invested: 3940000 },
|
|
9
|
+
{ month: "Oct", value: 4512300, invested: 4025000 },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
// The title states the finding, not the measure: what the reader would say after looking.
|
|
13
|
+
// The first series fills; the money put in draws as a line over it.
|
|
14
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
15
|
+
{ key: "value", label: "Value", color: "var(--chart-1)" },
|
|
16
|
+
{ key: "invested", label: "Invested", color: "var(--chart-2)" },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default function ChartAreaExample() {
|
|
20
|
+
const { money, moneyCompact } = useFormat();
|
|
21
|
+
return (
|
|
22
|
+
<AreaChartCard
|
|
23
|
+
title="₹4.9L ahead of the money put in"
|
|
24
|
+
description="Portfolio value against money invested, at each month end"
|
|
25
|
+
action={
|
|
26
|
+
<ToggleGroup defaultValue={["6M"]} variant="outline" size="sm" aria-label="Range">
|
|
27
|
+
<ToggleGroupItem value="6M">6M</ToggleGroupItem>
|
|
28
|
+
<ToggleGroupItem value="1Y">1Y</ToggleGroupItem>
|
|
29
|
+
</ToggleGroup>
|
|
30
|
+
}
|
|
31
|
+
data={data}
|
|
32
|
+
xKey="month"
|
|
33
|
+
series={series}
|
|
34
|
+
valueFormatter={money}
|
|
35
|
+
yTickFormatter={moneyCompact}
|
|
36
|
+
height={256}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BarChartCard, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
// Money into and out of the account each month; out is negative. Made-up figures.
|
|
4
|
+
const data = [
|
|
5
|
+
{ month: "Jul", in: 84000, out: -52000 },
|
|
6
|
+
{ month: "Aug", in: 61000, out: -73000 },
|
|
7
|
+
{ month: "Sep", in: 92000, out: -48000 },
|
|
8
|
+
{ month: "Oct", in: 70000, out: -66000 },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// Money moving is not a gain or a loss, so in and out take chart colours, not green and red.
|
|
12
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
13
|
+
{ key: "in", label: "In", color: "var(--chart-1)" },
|
|
14
|
+
{ key: "out", label: "Out", color: "var(--chart-2)" },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
export default function ChartBarFlowsExample() {
|
|
18
|
+
const { money, moneyCompact } = useFormat();
|
|
19
|
+
return (
|
|
20
|
+
<BarChartCard
|
|
21
|
+
title="Cash in and out by month"
|
|
22
|
+
description="Money in above the line, money out below it"
|
|
23
|
+
data={data}
|
|
24
|
+
xKey="month"
|
|
25
|
+
series={series}
|
|
26
|
+
stacked
|
|
27
|
+
valueFormatter={money}
|
|
28
|
+
yTickFormatter={moneyCompact}
|
|
29
|
+
height={256}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BarChartCard } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
// Market hours in IST; each row is the hour an order was placed in.
|
|
4
|
+
const data = [
|
|
5
|
+
{ hour: 9, orders: 42 },
|
|
6
|
+
{ hour: 10, orders: 31 },
|
|
7
|
+
{ hour: 11, orders: 18 },
|
|
8
|
+
{ hour: 12, orders: 12 },
|
|
9
|
+
{ hour: 13, orders: 15 },
|
|
10
|
+
{ hour: 14, orders: 24 },
|
|
11
|
+
{ hour: 15, orders: 38 },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export default function ChartBarHourlyExample() {
|
|
15
|
+
return (
|
|
16
|
+
<BarChartCard
|
|
17
|
+
title="Orders by hour"
|
|
18
|
+
description="Last 30 days, by the hour each order was placed"
|
|
19
|
+
data={data}
|
|
20
|
+
xKey="hour"
|
|
21
|
+
xFormatter={(hour) => `${String(hour).padStart(2, "0")}:00`}
|
|
22
|
+
xLabel="Hour of day (IST)"
|
|
23
|
+
yLabel="Orders"
|
|
24
|
+
series={[{ key: "orders", label: "Orders", color: "var(--chart-1)" }]}
|
|
25
|
+
height={256}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BarChartCard, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
// F&O net realized per financial year, a loss every year; made-up figures.
|
|
4
|
+
const data = [
|
|
5
|
+
{ fy: "FY23", net: -48000 },
|
|
6
|
+
{ fy: "FY24", net: -91000 },
|
|
7
|
+
{ fy: "FY25", net: -27000 },
|
|
8
|
+
{ fy: "FY26", net: -63000 },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
12
|
+
{ key: "net", label: "F&O net realized", color: "var(--positive)", negativeColor: "var(--negative)" },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export default function ChartBarLossesExample() {
|
|
16
|
+
const { money, moneyCompact } = useFormat();
|
|
17
|
+
return (
|
|
18
|
+
<BarChartCard
|
|
19
|
+
title="F&O realized by financial year"
|
|
20
|
+
description="A loss every year, so every bar runs down from zero"
|
|
21
|
+
data={data}
|
|
22
|
+
xKey="fy"
|
|
23
|
+
series={series}
|
|
24
|
+
valueFormatter={money}
|
|
25
|
+
yTickFormatter={moneyCompact}
|
|
26
|
+
height={240}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { BarChartCard, ToggleGroup, ToggleGroupItem, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
3
|
+
|
|
4
|
+
// Share of equity by sector against an index's weights; made-up figures.
|
|
5
|
+
const WEIGHTS = {
|
|
6
|
+
"Nifty 50": [
|
|
7
|
+
{ sector: "Financial Services", you: 0.34, index: 0.37 },
|
|
8
|
+
{ sector: "Information Technology", you: 0.21, index: 0.13 },
|
|
9
|
+
{ sector: "Oil, Gas & Consumable Fuels", you: 0.06, index: 0.1 },
|
|
10
|
+
{ sector: "Fast Moving Consumer Goods", you: 0.12, index: 0.08 },
|
|
11
|
+
{ sector: "Automobile and Auto Components", you: 0.09, index: 0.07 },
|
|
12
|
+
{ sector: "Healthcare", you: 0.08, index: 0.04 },
|
|
13
|
+
],
|
|
14
|
+
"Nifty 500": [
|
|
15
|
+
{ sector: "Financial Services", you: 0.34, index: 0.31 },
|
|
16
|
+
{ sector: "Information Technology", you: 0.21, index: 0.1 },
|
|
17
|
+
{ sector: "Oil, Gas & Consumable Fuels", you: 0.06, index: 0.08 },
|
|
18
|
+
{ sector: "Fast Moving Consumer Goods", you: 0.12, index: 0.07 },
|
|
19
|
+
{ sector: "Automobile and Auto Components", you: 0.09, index: 0.07 },
|
|
20
|
+
{ sector: "Healthcare", you: 0.08, index: 0.06 },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
type Index = keyof typeof WEIGHTS;
|
|
24
|
+
type Row = (typeof WEIGHTS)[Index][number];
|
|
25
|
+
|
|
26
|
+
export default function ChartBarSectorsExample() {
|
|
27
|
+
const { pct } = useFormat();
|
|
28
|
+
const [index, setIndex] = useState<Index>("Nifty 50");
|
|
29
|
+
const rows = WEIGHTS[index];
|
|
30
|
+
const series: ChartSeries<Row> = [
|
|
31
|
+
{ key: "you", label: "You", color: "var(--chart-1)" },
|
|
32
|
+
{ key: "index", label: index, color: "var(--chart-2)" },
|
|
33
|
+
];
|
|
34
|
+
const gap = (row: Row) => {
|
|
35
|
+
const points = Math.abs(row.you - row.index) * 100;
|
|
36
|
+
return row.you >= row.index ? `▲${points.toFixed(1)} pts over` : `▼${points.toFixed(1)} pts under`;
|
|
37
|
+
};
|
|
38
|
+
return (
|
|
39
|
+
<BarChartCard
|
|
40
|
+
title="Sectors against the index"
|
|
41
|
+
description="Share of your equity and of the index, by sector"
|
|
42
|
+
action={
|
|
43
|
+
<ToggleGroup
|
|
44
|
+
value={[index]}
|
|
45
|
+
onValueChange={([next]) => {
|
|
46
|
+
// Pressing the selected index again would leave none selected; keep it.
|
|
47
|
+
if (next) setIndex(next as Index);
|
|
48
|
+
}}
|
|
49
|
+
variant="outline"
|
|
50
|
+
size="sm"
|
|
51
|
+
aria-label="Index"
|
|
52
|
+
>
|
|
53
|
+
<ToggleGroupItem value="Nifty 50">Nifty 50</ToggleGroupItem>
|
|
54
|
+
<ToggleGroupItem value="Nifty 500">Nifty 500</ToggleGroupItem>
|
|
55
|
+
</ToggleGroup>
|
|
56
|
+
}
|
|
57
|
+
horizontal
|
|
58
|
+
data={rows}
|
|
59
|
+
xKey="sector"
|
|
60
|
+
xTickDetail={(row) => `${pct(row.you)} vs ${pct(row.index)} · ${gap(row)}`}
|
|
61
|
+
series={series}
|
|
62
|
+
valueFormatter={(v) => pct(v)}
|
|
63
|
+
// A tick format puts the value axis along the bottom of the sideways bars.
|
|
64
|
+
yTickFormatter={(v) => pct(v, 0)}
|
|
65
|
+
// Sideways, y is still the value: the axis runs 0 to 40% and the cap is a value level.
|
|
66
|
+
yDomain={[0, 0.4]}
|
|
67
|
+
referenceLines={[{ y: 0.3, label: "cap 30%", labelPosition: "insideBottomRight" }]}
|
|
68
|
+
height={rows.length * 56 + 48}
|
|
69
|
+
footer={<p className="text-muted-foreground">Company shares only; ETFs and funds are left out.</p>}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { BarChartCard, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
3
|
+
|
|
4
|
+
// Net realized gain per financial year (April to March); made-up figures.
|
|
5
|
+
const data = [
|
|
6
|
+
{ fy: "FY22", net: 142000 },
|
|
7
|
+
{ fy: "FY23", net: 186000 },
|
|
8
|
+
{ fy: "FY24", net: -164000 },
|
|
9
|
+
{ fy: "FY25", net: 128000 },
|
|
10
|
+
{ fy: "FY26", net: -121000 },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
// A gain and a loss take the meaning colours; the arrow in each tick says the same without colour.
|
|
14
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
15
|
+
{ key: "net", label: "Net realized", color: "var(--positive)", negativeColor: "var(--negative)" },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export default function ChartBarYearsExample() {
|
|
19
|
+
const { money, moneyCompact } = useFormat();
|
|
20
|
+
// The page owns the pick, so it can narrow the rest of the page to that year.
|
|
21
|
+
const [year, setYear] = useState<string | null>(null);
|
|
22
|
+
const signed = (v: number) => `${v < 0 ? "▼" : "▲"}${moneyCompact(Math.abs(v))}`;
|
|
23
|
+
return (
|
|
24
|
+
<BarChartCard
|
|
25
|
+
title="Realized by financial year"
|
|
26
|
+
description={
|
|
27
|
+
year ? `${year} picked; click it again for every year` : "April to March, gross. Click a year to pick it."
|
|
28
|
+
}
|
|
29
|
+
data={data}
|
|
30
|
+
xKey="fy"
|
|
31
|
+
xTickDetail={(row) => signed(row.net)}
|
|
32
|
+
selected={year}
|
|
33
|
+
onSelect={setYear}
|
|
34
|
+
series={series}
|
|
35
|
+
valueFormatter={money}
|
|
36
|
+
yTickFormatter={moneyCompact}
|
|
37
|
+
height={272}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { BarChartCard, ToggleGroup, ToggleGroupItem, useFormat, type ChartSeries } from "@siyahi/ui";
|
|
3
|
+
|
|
4
|
+
const data = [
|
|
5
|
+
{ quarter: "Q1", equity: 120000, debt: 40000, gold: 15000, cash: 9000, reits: 4000 },
|
|
6
|
+
{ quarter: "Q2", equity: 95000, debt: 52000, gold: 20000, cash: 6000, reits: 3000 },
|
|
7
|
+
{ quarter: "Q3", equity: 140000, debt: 38000, gold: 12000, cash: 11000, reits: 5000 },
|
|
8
|
+
{ quarter: "Q4", equity: 160000, debt: 45000, gold: 25000, cash: 7000, reits: 2000 },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// Series take the slots in order: neighbours differ in lightness, slots two
|
|
12
|
+
// apart differ in hue.
|
|
13
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
14
|
+
{ key: "equity", label: "Equity", color: "var(--chart-1)" },
|
|
15
|
+
{ key: "debt", label: "Debt", color: "var(--chart-2)" },
|
|
16
|
+
{ key: "gold", label: "Gold", color: "var(--chart-3)" },
|
|
17
|
+
{ key: "cash", label: "Cash", color: "var(--chart-4)" },
|
|
18
|
+
{ key: "reits", label: "REITs", color: "var(--chart-5)" },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export default function ChartBarExample() {
|
|
22
|
+
const { money, moneyCompact } = useFormat();
|
|
23
|
+
const [layout, setLayout] = useState("grouped");
|
|
24
|
+
return (
|
|
25
|
+
<BarChartCard
|
|
26
|
+
title="Money invested by quarter"
|
|
27
|
+
description={
|
|
28
|
+
layout === "grouped"
|
|
29
|
+
? "All five chart colours side by side, in series order"
|
|
30
|
+
: "All five chart colours stacked into the quarter's total"
|
|
31
|
+
}
|
|
32
|
+
action={
|
|
33
|
+
<ToggleGroup
|
|
34
|
+
value={[layout]}
|
|
35
|
+
onValueChange={([next]) => {
|
|
36
|
+
// Pressing the selected layout again would leave none selected; keep it.
|
|
37
|
+
if (next) setLayout(next);
|
|
38
|
+
}}
|
|
39
|
+
variant="outline"
|
|
40
|
+
size="sm"
|
|
41
|
+
aria-label="Layout"
|
|
42
|
+
>
|
|
43
|
+
<ToggleGroupItem value="grouped">Grouped</ToggleGroupItem>
|
|
44
|
+
<ToggleGroupItem value="stacked">Stacked</ToggleGroupItem>
|
|
45
|
+
</ToggleGroup>
|
|
46
|
+
}
|
|
47
|
+
data={data}
|
|
48
|
+
xKey="quarter"
|
|
49
|
+
series={series}
|
|
50
|
+
stacked={layout === "stacked"}
|
|
51
|
+
valueFormatter={money}
|
|
52
|
+
yTickFormatter={moneyCompact}
|
|
53
|
+
height={256}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AreaChartCard, BarChartCard, LineChartCard, type SeriesChartProps } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
const data = Array.from({ length: 84 }, (_, index) => ({
|
|
4
|
+
month: `${2019 + Math.floor(index / 12)}-${String((index % 12) + 1).padStart(2, "0")}`,
|
|
5
|
+
orders: 20 + ((index * 7) % 31),
|
|
6
|
+
}));
|
|
7
|
+
const props: SeriesChartProps<(typeof data)[number], "month"> = {
|
|
8
|
+
title: "Monthly orders, bars",
|
|
9
|
+
description: "Demo orders per month, 2019–2025; only April is labelled",
|
|
10
|
+
data,
|
|
11
|
+
xKey: "month",
|
|
12
|
+
xTicks: data.filter(({ month }) => month.endsWith("-04")).map(({ month }) => month),
|
|
13
|
+
xFormatter: (month) => `Apr ${month.slice(2, 4)}`,
|
|
14
|
+
xTooltipFormatter: (month) => month,
|
|
15
|
+
series: [{ key: "orders", label: "Orders", color: "var(--chart-1)" }],
|
|
16
|
+
height: 200,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default function ChartCategoryTicksExample() {
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex flex-col gap-4">
|
|
22
|
+
<BarChartCard {...props} />
|
|
23
|
+
<BarChartCard
|
|
24
|
+
{...props}
|
|
25
|
+
title="Monthly orders, sideways"
|
|
26
|
+
description="Demo orders per month in 2019; only April is labelled"
|
|
27
|
+
data={data.slice(0, 12)}
|
|
28
|
+
xTicks={["2019-04"]}
|
|
29
|
+
horizontal
|
|
30
|
+
height={300}
|
|
31
|
+
/>
|
|
32
|
+
<BarChartCard
|
|
33
|
+
title="Orders by sector"
|
|
34
|
+
description="Demo orders; one long category label on a narrow chart"
|
|
35
|
+
data={[
|
|
36
|
+
{ sector: "Information Technology and Services", orders: 100 },
|
|
37
|
+
{ sector: "Other", orders: 50 },
|
|
38
|
+
{ sector: "Third", orders: 70 },
|
|
39
|
+
]}
|
|
40
|
+
xKey="sector"
|
|
41
|
+
xTicks={["Information Technology and Services"]}
|
|
42
|
+
series={[{ key: "orders", label: "Orders", color: "var(--chart-1)" }]}
|
|
43
|
+
horizontal
|
|
44
|
+
height={220}
|
|
45
|
+
/>
|
|
46
|
+
<LineChartCard {...props} title="Monthly orders, line" />
|
|
47
|
+
<AreaChartCard {...props} title="Monthly orders, area" />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { LineChartCard, type ChartSeries } from "@siyahi/ui";
|
|
2
|
+
|
|
3
|
+
// A sample every 15 s from 19:33:58; the numbers are made up for the catalogue.
|
|
4
|
+
const START = (19 * 60 + 33) * 60 + 58;
|
|
5
|
+
const PRESSURE = [
|
|
6
|
+
4, 18, 41, 58, 63, 66, 61, 70, 72, 68, 64, 71, 74, 69, 66, 62, 67, 73, 70, 65, 68, 71, 66, 63, 69, 72,
|
|
7
|
+
];
|
|
8
|
+
const data = PRESSURE.map((pressure, i) => ({ second: i * 15, pressure }));
|
|
9
|
+
|
|
10
|
+
const series: ChartSeries<(typeof data)[number]> = [
|
|
11
|
+
{ key: "pressure", label: "Full pressure", color: "var(--chart-1)" },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const pad = (n: number) => String(n).padStart(2, "0");
|
|
15
|
+
|
|
16
|
+
function clock(second: number) {
|
|
17
|
+
const t = START + second;
|
|
18
|
+
return `${Math.floor(t / 3600)}:${pad(Math.floor(t / 60) % 60)}:${pad(t % 60)}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function ChartLineEventsExample() {
|
|
22
|
+
return (
|
|
23
|
+
<LineChartCard
|
|
24
|
+
title="Memory pressure of a test group, %"
|
|
25
|
+
description="avg10, sampled every 15 s"
|
|
26
|
+
data={data}
|
|
27
|
+
xKey="second"
|
|
28
|
+
// A numeric axis: ticks fall on whole minutes, 2 s after the first sample.
|
|
29
|
+
xDomain={[0, 390]}
|
|
30
|
+
xTicks={[2, 62, 122, 182, 242, 302, 362]}
|
|
31
|
+
xFormatter={(second) => clock(second).slice(0, 5)}
|
|
32
|
+
xTooltipFormatter={(second) => `${clock(second)} IST, 10 s average`}
|
|
33
|
+
series={series}
|
|
34
|
+
curve="linear"
|
|
35
|
+
valueFormatter={(v) => `${v}%`}
|
|
36
|
+
yDomain={[0, 100]}
|
|
37
|
+
yTicks={[0, 25, 50, 75, 100]}
|
|
38
|
+
referenceLines={[
|
|
39
|
+
{ y: 80, label: "old limit, 80%" },
|
|
40
|
+
{ y: 50, label: "new limit, 50%", emphasis: "strong" },
|
|
41
|
+
{ x: 313, label: "limit 50%", labelPosition: "insideBottomRight" },
|
|
42
|
+
{ x: 367, label: "killed", emphasis: "strong", labelPosition: "insideTopRight" },
|
|
43
|
+
]}
|
|
44
|
+
height={224}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|