@zsherman/charts 0.0.0-stage → 0.1.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/CHANGELOG.md +7 -0
- package/LICENSE +373 -0
- package/README.md +13 -2
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/dist/dom/bar-list/bar-list.js +386 -0
- package/dist/dom/bar-list/bar-list.styles.js +171 -0
- package/dist/dom/bar-list/index.js +1 -0
- package/dist/dom/chart/chart.js +716 -0
- package/dist/dom/chart/chart.styles.js +165 -0
- package/dist/dom/chart/index.js +1 -0
- package/dist/dom/chart-grid/chart-grid.js +67 -0
- package/dist/dom/chart-grid/index.js +1 -0
- package/dist/dom/donut/donut.js +565 -0
- package/dist/dom/donut/donut.styles.js +111 -0
- package/dist/dom/donut/index.js +1 -0
- package/dist/dom/heat-graph/calendar.js +118 -0
- package/dist/dom/heat-graph/heat-graph.js +423 -0
- package/dist/dom/heat-graph/heat-graph.styles.js +168 -0
- package/dist/dom/heat-graph/index.js +1 -0
- package/dist/dom/heat-matrix/heat-matrix.js +346 -0
- package/dist/dom/heat-matrix/heat-matrix.styles.js +155 -0
- package/dist/dom/heat-matrix/index.js +1 -0
- package/dist/dom/heat-matrix/model.js +41 -0
- package/dist/dom/index.js +13 -0
- package/dist/dom/internal/colors.js +44 -0
- package/dist/dom/internal/floating-tip.js +83 -0
- package/dist/dom/internal/format.js +43 -0
- package/dist/dom/internal/grid-context.js +5 -0
- package/dist/dom/internal/hidden.styles.js +16 -0
- package/dist/dom/internal/legend.js +112 -0
- package/dist/dom/internal/legend.styles.js +108 -0
- package/dist/dom/internal/markers.js +101 -0
- package/dist/dom/internal/options.js +300 -0
- package/dist/dom/internal/place.js +27 -0
- package/dist/dom/internal/scheme-watch.js +73 -0
- package/dist/dom/internal/share.js +28 -0
- package/dist/dom/internal/types.js +0 -0
- package/dist/dom/row-chart/index.js +1 -0
- package/dist/dom/row-chart/model.js +59 -0
- package/dist/dom/row-chart/row-chart.js +691 -0
- package/dist/dom/row-chart/row-chart.styles.js +242 -0
- package/dist/dom/segmented-bar/index.js +1 -0
- package/dist/dom/segmented-bar/segmented-bar.js +280 -0
- package/dist/dom/segmented-bar/segmented-bar.styles.js +88 -0
- package/dist/dom/sparkline/index.js +1 -0
- package/dist/dom/sparkline/sparkline.js +145 -0
- package/dist/dom/stacked-histogram/histogram.js +137 -0
- package/dist/dom/stacked-histogram/index.js +1 -0
- package/dist/dom/stacked-histogram/stacked-histogram.js +761 -0
- package/dist/dom/stacked-histogram/stacked-histogram.styles.js +211 -0
- package/dist/dom/state-timeline/index.js +1 -0
- package/dist/dom/state-timeline/model.js +166 -0
- package/dist/dom/state-timeline/state-timeline.js +729 -0
- package/dist/dom/state-timeline/state-timeline.styles.js +171 -0
- package/dist/dom/status-history/index.js +1 -0
- package/dist/dom/status-history/status-history.js +542 -0
- package/dist/dom/status-history/status-history.styles.js +171 -0
- package/dist/solid/bar-list/bar-list.jsx +139 -0
- package/dist/solid/bar-list/bar-list.styles.jsx +171 -0
- package/dist/solid/bar-list/index.jsx +1 -0
- package/dist/solid/chart/chart.jsx +454 -0
- package/dist/solid/chart/chart.styles.jsx +165 -0
- package/dist/solid/chart/index.jsx +1 -0
- package/dist/solid/chart-grid/chart-grid.jsx +46 -0
- package/dist/solid/chart-grid/index.jsx +1 -0
- package/dist/solid/donut/donut.jsx +291 -0
- package/dist/solid/donut/donut.styles.jsx +111 -0
- package/dist/solid/donut/index.jsx +1 -0
- package/dist/solid/heat-graph/calendar.jsx +118 -0
- package/dist/solid/heat-graph/heat-graph.jsx +228 -0
- package/dist/solid/heat-graph/heat-graph.styles.jsx +168 -0
- package/dist/solid/heat-graph/index.jsx +1 -0
- package/dist/solid/heat-matrix/heat-matrix.jsx +165 -0
- package/dist/solid/heat-matrix/heat-matrix.styles.jsx +155 -0
- package/dist/solid/heat-matrix/index.jsx +1 -0
- package/dist/solid/heat-matrix/model.jsx +41 -0
- package/dist/solid/index.jsx +13 -0
- package/dist/solid/internal/colors.jsx +44 -0
- package/dist/solid/internal/floating-tip.jsx +68 -0
- package/dist/solid/internal/format.jsx +43 -0
- package/dist/solid/internal/grid-context.jsx +5 -0
- package/dist/solid/internal/hidden.styles.jsx +16 -0
- package/dist/solid/internal/legend.jsx +35 -0
- package/dist/solid/internal/legend.styles.jsx +108 -0
- package/dist/solid/internal/markers.jsx +101 -0
- package/dist/solid/internal/options.jsx +300 -0
- package/dist/solid/internal/place.jsx +27 -0
- package/dist/solid/internal/scheme-watch.jsx +73 -0
- package/dist/solid/internal/share.jsx +28 -0
- package/dist/solid/internal/types.jsx +0 -0
- package/dist/solid/row-chart/index.jsx +1 -0
- package/dist/solid/row-chart/model.jsx +59 -0
- package/dist/solid/row-chart/row-chart.jsx +312 -0
- package/dist/solid/row-chart/row-chart.styles.jsx +242 -0
- package/dist/solid/segmented-bar/index.jsx +1 -0
- package/dist/solid/segmented-bar/segmented-bar.jsx +125 -0
- package/dist/solid/segmented-bar/segmented-bar.styles.jsx +88 -0
- package/dist/solid/sparkline/index.jsx +1 -0
- package/dist/solid/sparkline/sparkline.jsx +88 -0
- package/dist/solid/stacked-histogram/histogram.jsx +137 -0
- package/dist/solid/stacked-histogram/index.jsx +1 -0
- package/dist/solid/stacked-histogram/stacked-histogram.jsx +381 -0
- package/dist/solid/stacked-histogram/stacked-histogram.styles.jsx +211 -0
- package/dist/solid/state-timeline/index.jsx +1 -0
- package/dist/solid/state-timeline/model.jsx +166 -0
- package/dist/solid/state-timeline/state-timeline.jsx +387 -0
- package/dist/solid/state-timeline/state-timeline.styles.jsx +171 -0
- package/dist/solid/status-history/index.jsx +1 -0
- package/dist/solid/status-history/status-history.jsx +279 -0
- package/dist/solid/status-history/status-history.styles.jsx +171 -0
- package/dist/styles.css +1 -0
- package/dist/types/bar-list/bar-list.d.ts +91 -0
- package/dist/types/bar-list/bar-list.styles.d.ts +148 -0
- package/dist/types/bar-list/index.d.ts +3 -0
- package/dist/types/chart/chart.d.ts +98 -0
- package/dist/types/chart/chart.styles.d.ts +145 -0
- package/dist/types/chart/index.d.ts +3 -0
- package/dist/types/chart-grid/chart-grid.d.ts +35 -0
- package/dist/types/chart-grid/index.d.ts +2 -0
- package/dist/types/donut/donut.d.ts +124 -0
- package/dist/types/donut/donut.styles.d.ts +96 -0
- package/dist/types/donut/index.d.ts +3 -0
- package/dist/types/heat-graph/calendar.d.ts +61 -0
- package/dist/types/heat-graph/heat-graph.d.ts +82 -0
- package/dist/types/heat-graph/heat-graph.styles.d.ts +141 -0
- package/dist/types/heat-graph/index.d.ts +4 -0
- package/dist/types/heat-matrix/heat-matrix.d.ts +65 -0
- package/dist/types/heat-matrix/heat-matrix.styles.d.ts +135 -0
- package/dist/types/heat-matrix/index.d.ts +3 -0
- package/dist/types/heat-matrix/model.d.ts +15 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/internal/colors.d.ts +22 -0
- package/dist/types/internal/floating-tip.d.ts +15 -0
- package/dist/types/internal/format.d.ts +7 -0
- package/dist/types/internal/grid-context.d.ts +9 -0
- package/dist/types/internal/hidden.styles.d.ts +15 -0
- package/dist/types/internal/legend.d.ts +18 -0
- package/dist/types/internal/legend.styles.d.ts +96 -0
- package/dist/types/internal/markers.d.ts +16 -0
- package/dist/types/internal/options.d.ts +59 -0
- package/dist/types/internal/place.d.ts +20 -0
- package/dist/types/internal/scheme-watch.d.ts +12 -0
- package/dist/types/internal/share.d.ts +19 -0
- package/dist/types/internal/types.d.ts +163 -0
- package/dist/types/row-chart/index.d.ts +4 -0
- package/dist/types/row-chart/model.d.ts +50 -0
- package/dist/types/row-chart/row-chart.d.ts +148 -0
- package/dist/types/row-chart/row-chart.styles.d.ts +216 -0
- package/dist/types/segmented-bar/index.d.ts +3 -0
- package/dist/types/segmented-bar/segmented-bar.d.ts +65 -0
- package/dist/types/segmented-bar/segmented-bar.styles.d.ts +75 -0
- package/dist/types/sparkline/index.d.ts +3 -0
- package/dist/types/sparkline/sparkline.d.ts +38 -0
- package/dist/types/stacked-histogram/histogram.d.ts +48 -0
- package/dist/types/stacked-histogram/index.d.ts +4 -0
- package/dist/types/stacked-histogram/stacked-histogram.d.ts +73 -0
- package/dist/types/stacked-histogram/stacked-histogram.styles.d.ts +187 -0
- package/dist/types/state-timeline/index.d.ts +3 -0
- package/dist/types/state-timeline/model.d.ts +63 -0
- package/dist/types/state-timeline/state-timeline.d.ts +108 -0
- package/dist/types/state-timeline/state-timeline.styles.d.ts +151 -0
- package/dist/types/status-history/index.d.ts +3 -0
- package/dist/types/status-history/status-history.d.ts +72 -0
- package/dist/types/status-history/status-history.styles.d.ts +150 -0
- package/docs/api.json +1346 -0
- package/docs/bar-list.md +190 -0
- package/docs/chart-grid.md +77 -0
- package/docs/chart.md +355 -0
- package/docs/donut.md +182 -0
- package/docs/heat-graph.md +121 -0
- package/docs/heat-matrix.md +108 -0
- package/docs/llms.txt +68 -0
- package/docs/row-chart.md +193 -0
- package/docs/search-index.json +291 -0
- package/docs/segmented-bar.md +128 -0
- package/docs/sparkline.md +82 -0
- package/docs/stacked-histogram.md +123 -0
- package/docs/state-timeline.md +141 -0
- package/docs/status-history.md +121 -0
- package/package.json +104 -4
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
2
|
+
import type { ChartColor } from "../internal/types.js";
|
|
3
|
+
/** One ranked row. */
|
|
4
|
+
export interface BarListItem<T = unknown> {
|
|
5
|
+
/** What is ranked: a page, a customer, a country. Long labels are cut short with an ellipsis (the full text is in its name and `title`). */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Its amount. A missing or negative value draws no bar and counts as 0. */
|
|
8
|
+
value: number | null;
|
|
9
|
+
/** Makes the row a link. */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** An icon or logo before the label (`<Icon icon={Globe} />`), decorative. */
|
|
12
|
+
icon?: JSX.Element;
|
|
13
|
+
/** Identifies the row for `selected` when labels repeat. Defaults to `label`. */
|
|
14
|
+
key?: string;
|
|
15
|
+
/** Your own data, handed back to `onSelect`. */
|
|
16
|
+
data?: T;
|
|
17
|
+
}
|
|
18
|
+
/** The words the list writes. Also set app-wide with the kit's `LocaleProvider messages={{ barList }}`. */
|
|
19
|
+
export interface BarListLabels {
|
|
20
|
+
/** The button that shows the rows past `limit`. */
|
|
21
|
+
showMore: string;
|
|
22
|
+
/** The same button once the inline list is expanded. */
|
|
23
|
+
showLess: string;
|
|
24
|
+
/** In place of the rows when there are none. */
|
|
25
|
+
empty: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BarListProps<T = unknown> extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "class" | "onSelect"> {
|
|
28
|
+
/** The list's name for assistive technology: what is ranked, by what, over which period ("Top pages by visitors, last 7 days"). */
|
|
29
|
+
label: string;
|
|
30
|
+
/** The rows. They're ranked by value unless `sort` says otherwise. */
|
|
31
|
+
data: readonly BarListItem<T>[];
|
|
32
|
+
/**
|
|
33
|
+
* The order: largest first, smallest first, or as given.
|
|
34
|
+
* @defaultValue "descending"
|
|
35
|
+
*/
|
|
36
|
+
sort?: "descending" | "ascending" | "none";
|
|
37
|
+
/** Show the first `limit` rows, and a Show more button for the rest. */
|
|
38
|
+
limit?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Called by Show more (with `limit`): open your own view of every row, a dialog with search. Without it,
|
|
41
|
+
* Show more expands the list in place, and the last rows fade out while it's collapsed.
|
|
42
|
+
*/
|
|
43
|
+
onShowMore?: () => void;
|
|
44
|
+
/** A column with each row's share of the total (of every row, not only those shown). */
|
|
45
|
+
share?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The value a full bar stands for. Defaults to the largest in `data`. Pass the whole list's largest when
|
|
48
|
+
* `data` is part of it (search results, a page of it), so a bar keeps its length as others are left out.
|
|
49
|
+
*/
|
|
50
|
+
max?: number;
|
|
51
|
+
/**
|
|
52
|
+
* The total the shares are of. Defaults to the sum of `data`. Pass the whole list's total when `data` is
|
|
53
|
+
* part of it, so a row's share doesn't grow as others are left out.
|
|
54
|
+
*/
|
|
55
|
+
total?: number;
|
|
56
|
+
/** A header over the labels ("Page"). */
|
|
57
|
+
labelHeader?: JSX.Element;
|
|
58
|
+
/** A header over the values ("Visitors"). */
|
|
59
|
+
valueHeader?: JSX.Element;
|
|
60
|
+
/** A header over the shares, with `share` ("Share"). */
|
|
61
|
+
shareHeader?: JSX.Element;
|
|
62
|
+
/** How values are written. Defaults to the locale's numbers, compact from 10,000 (12.9K), as Chart's axes. */
|
|
63
|
+
format?: (value: number) => string;
|
|
64
|
+
/**
|
|
65
|
+
* The bars' color: a chart token (`chart-1` … `chart-8`) or any CSS color, drawn as a light wash so the
|
|
66
|
+
* label on it stays legible.
|
|
67
|
+
* @defaultValue "chart-1"
|
|
68
|
+
*/
|
|
69
|
+
color?: ChartColor;
|
|
70
|
+
/** Makes each row a toggle button (for rows with no `href`): filter the page by the chosen row. */
|
|
71
|
+
onSelect?: (item: BarListItem<T>, index: number) => void;
|
|
72
|
+
/**
|
|
73
|
+
* The `key` (or label) of the row that is on, for a filter: its button is pressed and its bar darker.
|
|
74
|
+
* `null` or nothing: none is on.
|
|
75
|
+
*/
|
|
76
|
+
selected?: string | null;
|
|
77
|
+
/** The words, in your wording or language (app-wide: `LocaleProvider messages.barList`). */
|
|
78
|
+
labels?: Partial<BarListLabels>;
|
|
79
|
+
/** Extra classes on the root. */
|
|
80
|
+
class?: JSX.ClassValue;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Ranked horizontal bars: top pages, top customers, top countries. Each bar is scaled to the largest value,
|
|
84
|
+
* the label sits on it and the value is at the end. Plain DOM, so it renders on the server. A list: each
|
|
85
|
+
* row is named "Label, value, share", and is a link (`href`) or a button (`onSelect`) when it leads
|
|
86
|
+
* somewhere.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <BarList label="Top pages, last 7 days" data={[{ label: "/", value: 8400 }, { label: "/pricing", value: 3100 }]} />
|
|
90
|
+
*/
|
|
91
|
+
export declare function BarList<T = unknown>(props: BarListProps<T>): JSX.Element;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as stylex from "@stylexjs/stylex";
|
|
2
|
+
export declare const styles: Readonly<{
|
|
3
|
+
readonly root: Readonly<{
|
|
4
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
5
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
6
|
+
readonly justifyItems: stylex.StyleXClassNameFor<"justifyItems", "start">;
|
|
7
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
8
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
9
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
10
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
11
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
12
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
13
|
+
}>;
|
|
14
|
+
readonly table: Readonly<{
|
|
15
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
16
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, 1fr) auto">;
|
|
17
|
+
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
|
|
18
|
+
readonly width: stylex.StyleXClassNameFor<"width", "100%">;
|
|
19
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
20
|
+
}>;
|
|
21
|
+
readonly withShare: Readonly<{
|
|
22
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, 1fr) auto auto">;
|
|
23
|
+
}>;
|
|
24
|
+
readonly header: Readonly<{
|
|
25
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
26
|
+
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
27
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "subgrid">;
|
|
28
|
+
readonly paddingInlineEnd: stylex.StyleXClassNameFor<"paddingInlineEnd", string>;
|
|
29
|
+
readonly paddingBlockEnd: stylex.StyleXClassNameFor<"paddingBlockEnd", string>;
|
|
30
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
31
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
32
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
33
|
+
}>;
|
|
34
|
+
readonly headerStart: Readonly<{
|
|
35
|
+
readonly paddingInlineStart: stylex.StyleXClassNameFor<"paddingInlineStart", string>;
|
|
36
|
+
}>;
|
|
37
|
+
readonly headerEnd: Readonly<{
|
|
38
|
+
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
39
|
+
}>;
|
|
40
|
+
readonly list: Readonly<{
|
|
41
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
42
|
+
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
43
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "subgrid">;
|
|
44
|
+
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", string>;
|
|
45
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
46
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
47
|
+
readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
|
|
48
|
+
}>;
|
|
49
|
+
readonly faded: Readonly<{
|
|
50
|
+
readonly maskImage: stylex.StyleXClassNameFor<"maskImage", "linear-gradient(to bottom, black calc(100% - 3.5rem), transparent)">;
|
|
51
|
+
}>;
|
|
52
|
+
readonly item: Readonly<{
|
|
53
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
54
|
+
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
55
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "subgrid">;
|
|
56
|
+
}>;
|
|
57
|
+
readonly row: Readonly<{
|
|
58
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
59
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
60
|
+
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
61
|
+
readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "subgrid">;
|
|
62
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
63
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
64
|
+
readonly paddingInlineEnd: stylex.StyleXClassNameFor<"paddingInlineEnd", string>;
|
|
65
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
66
|
+
readonly color: stylex.StyleXClassNameFor<"color", "inherit">;
|
|
67
|
+
readonly textDecoration: stylex.StyleXClassNameFor<"textDecoration", "none">;
|
|
68
|
+
}>;
|
|
69
|
+
readonly action: Readonly<{
|
|
70
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
71
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
72
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
|
|
73
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
74
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", "inherit">;
|
|
75
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "inherit">;
|
|
76
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", "inherit">;
|
|
77
|
+
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "start">;
|
|
78
|
+
readonly cursor: stylex.StyleXClassNameFor<"cursor", "pointer">;
|
|
79
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
80
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "2px">;
|
|
81
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "2px">;
|
|
82
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
|
|
83
|
+
readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "background-color">;
|
|
84
|
+
readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", string>;
|
|
85
|
+
}>;
|
|
86
|
+
readonly track: Readonly<{
|
|
87
|
+
readonly position: stylex.StyleXClassNameFor<"position", "relative">;
|
|
88
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
89
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
90
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
91
|
+
readonly height: stylex.StyleXClassNameFor<"height", string>;
|
|
92
|
+
}>;
|
|
93
|
+
readonly fill: Readonly<{
|
|
94
|
+
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
95
|
+
readonly insetBlock: stylex.StyleXClassNameFor<"insetBlock", 0>;
|
|
96
|
+
readonly insetInlineStart: stylex.StyleXClassNameFor<"insetInlineStart", 0>;
|
|
97
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
98
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "color-mix(in oklab, var(--bar) 22%, transparent)">;
|
|
99
|
+
readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
|
|
100
|
+
}>;
|
|
101
|
+
readonly fillSelected: Readonly<{
|
|
102
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "color-mix(in oklab, var(--bar) 42%, transparent)">;
|
|
103
|
+
}>;
|
|
104
|
+
readonly label: Readonly<{
|
|
105
|
+
readonly position: stylex.StyleXClassNameFor<"position", "relative">;
|
|
106
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
107
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
108
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
109
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
110
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
111
|
+
}>;
|
|
112
|
+
readonly labelSelected: Readonly<{
|
|
113
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
114
|
+
}>;
|
|
115
|
+
readonly icon: Readonly<{
|
|
116
|
+
readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
|
|
117
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
|
|
118
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
119
|
+
}>;
|
|
120
|
+
readonly text: Readonly<{
|
|
121
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
122
|
+
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
123
|
+
readonly textOverflow: stylex.StyleXClassNameFor<"textOverflow", "ellipsis">;
|
|
124
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
125
|
+
}>;
|
|
126
|
+
readonly value: Readonly<{
|
|
127
|
+
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
128
|
+
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
129
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
130
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
131
|
+
readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
|
|
132
|
+
}>;
|
|
133
|
+
readonly share: Readonly<{
|
|
134
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "3rem">;
|
|
135
|
+
readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "end">;
|
|
136
|
+
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
137
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
138
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
139
|
+
readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
|
|
140
|
+
}>;
|
|
141
|
+
readonly empty: Readonly<{
|
|
142
|
+
readonly gridColumn: stylex.StyleXClassNameFor<"gridColumn", "1 / -1">;
|
|
143
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
144
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
145
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
|
|
146
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
147
|
+
}>;
|
|
148
|
+
}>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
2
|
+
import uPlot from "uplot";
|
|
3
|
+
import type { ChartAxis, ChartController, ChartData, ChartLabels, ChartMarker, ChartPoint, ChartRange, ChartSeries, ChartTooltip, ChartXAxis } from "../internal/types.js";
|
|
4
|
+
export interface ChartProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "title" | "children" | "onSelect" | "class"> {
|
|
5
|
+
/**
|
|
6
|
+
* What the chart shows, for assistive technology: the metric, the period and the main finding
|
|
7
|
+
* ("Requests per minute, last hour: steady at about 1,200"). The canvas has no other name.
|
|
8
|
+
*/
|
|
9
|
+
label: string;
|
|
10
|
+
/** A longer description read after the label (a trend, the peak). */
|
|
11
|
+
description?: string;
|
|
12
|
+
/** A visible title above the plot. Leave it out when the page already names the chart. */
|
|
13
|
+
title?: JSX.Element;
|
|
14
|
+
/** `[x, ...ys]`: x values first, then one array per series. Updates without rebuilding the chart. */
|
|
15
|
+
data: ChartData;
|
|
16
|
+
/** One entry per y array, in the same order. */
|
|
17
|
+
series: ChartSeries[];
|
|
18
|
+
/**
|
|
19
|
+
* The plot's height in pixels, axes included (the legend and title sit outside it). The width follows
|
|
20
|
+
* the container.
|
|
21
|
+
* @defaultValue 240
|
|
22
|
+
*/
|
|
23
|
+
height?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Reference lines and bands: a target or a threshold on y, a deploy or an incident on x. The y axis
|
|
26
|
+
* keeps them in view, and their labels are read out after the chart's label.
|
|
27
|
+
*/
|
|
28
|
+
markers?: ChartMarker[];
|
|
29
|
+
/** Stack the series: each sits on the ones before it. The tooltip and legend show each series' own value. */
|
|
30
|
+
stacked?: boolean;
|
|
31
|
+
/** The x axis: time (the default), numbers or categories. */
|
|
32
|
+
x?: ChartXAxis;
|
|
33
|
+
/** The y axis. */
|
|
34
|
+
y?: ChartAxis;
|
|
35
|
+
/**
|
|
36
|
+
* The series legend under the plot; each entry toggles its series. `"live"` also shows each value at the
|
|
37
|
+
* cursor (the latest value otherwise). Defaults to on for two or more series.
|
|
38
|
+
*/
|
|
39
|
+
legend?: boolean | "live";
|
|
40
|
+
/**
|
|
41
|
+
* The tooltip at the cursor, also driven by the keyboard (arrow keys on the focused plot).
|
|
42
|
+
* @defaultValue true
|
|
43
|
+
*/
|
|
44
|
+
tooltip?: boolean | ChartTooltip;
|
|
45
|
+
/**
|
|
46
|
+
* Drag across the plot to zoom the x axis; double-click to zoom out.
|
|
47
|
+
* @defaultValue true
|
|
48
|
+
*/
|
|
49
|
+
zoom?: boolean;
|
|
50
|
+
/** Called after a zoom with the new x range, and with `null` when the chart zooms back out. */
|
|
51
|
+
onZoom?: (range: ChartRange | null) => void;
|
|
52
|
+
/** Called with the dragged x range instead of zooming (brush selection; set `zoom={false}`). */
|
|
53
|
+
onSelect?: (range: ChartRange) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Called when the cursor moves to another point, or the focused series changes, with what's under it;
|
|
56
|
+
* `null` when it leaves the plot. For your own legend, a readout beside the chart, or the matching row
|
|
57
|
+
* of a table. Fires for the keyboard's cursor and a ChartGrid's shared one too.
|
|
58
|
+
*/
|
|
59
|
+
onCursor?: (point: ChartPoint | null) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Fade the other series while one is focused: the pointer near a line or an area, or a legend entry
|
|
62
|
+
* hovered or focused (any series type). The tooltip sets the focused series' row apart.
|
|
63
|
+
* @defaultValue true
|
|
64
|
+
*/
|
|
65
|
+
focus?: boolean;
|
|
66
|
+
/** Charts with the same key share a cursor. Charts in a ChartGrid share one by default. */
|
|
67
|
+
syncKey?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Show the cursor line and points on hover.
|
|
70
|
+
* @defaultValue true
|
|
71
|
+
*/
|
|
72
|
+
cursor?: boolean;
|
|
73
|
+
/** Space around the plot in pixels: `[top, right, bottom, left]`. */
|
|
74
|
+
padding?: [number, number, number, number];
|
|
75
|
+
/** Receives the chart's controller once it mounts: push data, set ranges, reach uPlot. */
|
|
76
|
+
controller?: (controller: ChartController) => void;
|
|
77
|
+
/** uPlot plugins of your own (annotations, custom drawing). */
|
|
78
|
+
plugins?: uPlot.Plugin[];
|
|
79
|
+
/** uPlot hooks of your own. */
|
|
80
|
+
hooks?: uPlot.Hooks.Arrays;
|
|
81
|
+
/** The chart's built-in strings, in your words or language (app-wide: `LocaleProvider messages.chart`). */
|
|
82
|
+
labels?: Partial<ChartLabels>;
|
|
83
|
+
/** Extra classes on the root. Unlayered app CSS wins over the chart's. */
|
|
84
|
+
class?: JSX.ClassValue;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A canvas chart for values over time or across categories: lines, areas and bars, grouped or stacked,
|
|
88
|
+
* with a tooltip, a legend that toggles series, drag to zoom and live data. Built on uPlot and themed with
|
|
89
|
+
* the kit's tokens (`--sui-chart-1` … `-8`); the plot is a named image whose values the keyboard reads out.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* <Chart
|
|
93
|
+
* label="Requests per minute, last hour"
|
|
94
|
+
* data={[times, inbound, outbound]}
|
|
95
|
+
* series={[{ label: "Inbound" }, { label: "Outbound" }]}
|
|
96
|
+
* />
|
|
97
|
+
*/
|
|
98
|
+
export declare function Chart(props: ChartProps): JSX.Element;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as stylex from "@stylexjs/stylex";
|
|
2
|
+
export declare const styles: Readonly<{
|
|
3
|
+
readonly root: Readonly<{
|
|
4
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
5
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
6
|
+
readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
|
|
7
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
8
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
9
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
|
|
10
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
11
|
+
}>;
|
|
12
|
+
readonly title: Readonly<{
|
|
13
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
14
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
15
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
16
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
17
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
18
|
+
}>;
|
|
19
|
+
readonly plot: Readonly<{
|
|
20
|
+
readonly position: stylex.StyleXClassNameFor<"position", "relative">;
|
|
21
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
22
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", 0>;
|
|
23
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
24
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
25
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "2px">;
|
|
26
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "2px">;
|
|
27
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
|
|
28
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
29
|
+
}>;
|
|
30
|
+
readonly probe: Readonly<{
|
|
31
|
+
readonly display: stylex.StyleXClassNameFor<"display", "none">;
|
|
32
|
+
}>;
|
|
33
|
+
readonly tooltip: Readonly<{
|
|
34
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
35
|
+
readonly display: stylex.StyleXClassNameFor<"display", "grid">;
|
|
36
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
37
|
+
readonly minWidth: stylex.StyleXClassNameFor<"minWidth", "8rem">;
|
|
38
|
+
readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "min(18rem, calc(100vw - 16px))">;
|
|
39
|
+
readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
|
|
40
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
41
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
42
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
43
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", "1px">;
|
|
44
|
+
readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
|
|
45
|
+
readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
|
|
46
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
47
|
+
readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", string>;
|
|
48
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
49
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
50
|
+
readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
|
|
51
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
52
|
+
}>;
|
|
53
|
+
readonly tooltipHeading: Readonly<{
|
|
54
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
55
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
56
|
+
}>;
|
|
57
|
+
readonly row: Readonly<{
|
|
58
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
59
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
60
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
61
|
+
}>;
|
|
62
|
+
readonly rowFaded: Readonly<{
|
|
63
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.55>;
|
|
64
|
+
}>;
|
|
65
|
+
readonly rowLabel: Readonly<{
|
|
66
|
+
readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 1>;
|
|
67
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
68
|
+
}>;
|
|
69
|
+
readonly value: Readonly<{
|
|
70
|
+
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
71
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
72
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
73
|
+
readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
|
|
74
|
+
}>;
|
|
75
|
+
readonly legend: Readonly<{
|
|
76
|
+
readonly display: stylex.StyleXClassNameFor<"display", "flex">;
|
|
77
|
+
readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
|
|
78
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
79
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
80
|
+
readonly marginInlineStart: stylex.StyleXClassNameFor<"marginInlineStart", "calc(-1 * var(--sui-space-2))">;
|
|
81
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
82
|
+
readonly listStyle: stylex.StyleXClassNameFor<"listStyle", "none">;
|
|
83
|
+
}>;
|
|
84
|
+
readonly legendButton: Readonly<{
|
|
85
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
86
|
+
readonly display: stylex.StyleXClassNameFor<"display", "inline-flex">;
|
|
87
|
+
readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
|
|
88
|
+
readonly gap: stylex.StyleXClassNameFor<"gap", string>;
|
|
89
|
+
readonly minHeight: stylex.StyleXClassNameFor<"minHeight", "1.75rem">;
|
|
90
|
+
readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
|
|
91
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
|
|
92
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
|
|
93
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
|
|
94
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
|
|
95
|
+
readonly color: stylex.StyleXClassNameFor<"color", unknown>;
|
|
96
|
+
readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", "inherit">;
|
|
97
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
|
|
98
|
+
readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
|
|
99
|
+
readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
|
|
100
|
+
readonly cursor: stylex.StyleXClassNameFor<"cursor", "pointer">;
|
|
101
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
102
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "2px">;
|
|
103
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "-2px">;
|
|
104
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", string>;
|
|
105
|
+
readonly textDecorationLine: stylex.StyleXClassNameFor<"textDecorationLine", unknown>;
|
|
106
|
+
}>;
|
|
107
|
+
readonly legendValue: Readonly<{
|
|
108
|
+
readonly fontVariantNumeric: stylex.StyleXClassNameFor<"fontVariantNumeric", "tabular-nums">;
|
|
109
|
+
readonly color: stylex.StyleXClassNameFor<"color", string>;
|
|
110
|
+
readonly unicodeBidi: stylex.StyleXClassNameFor<"unicodeBidi", "plaintext">;
|
|
111
|
+
}>;
|
|
112
|
+
readonly swatch: Readonly<{
|
|
113
|
+
readonly flexShrink: stylex.StyleXClassNameFor<"flexShrink", 0>;
|
|
114
|
+
readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
115
|
+
readonly display: stylex.StyleXClassNameFor<"display", "inline-block">;
|
|
116
|
+
readonly width: stylex.StyleXClassNameFor<"width", "0.75rem">;
|
|
117
|
+
readonly height: stylex.StyleXClassNameFor<"height", "0.75rem">;
|
|
118
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "2px">;
|
|
119
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "var(--swatch)">;
|
|
120
|
+
readonly forcedColorAdjust: stylex.StyleXClassNameFor<"forcedColorAdjust", "none">;
|
|
121
|
+
}>;
|
|
122
|
+
readonly swatchLine: Readonly<{
|
|
123
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1rem">;
|
|
124
|
+
readonly height: stylex.StyleXClassNameFor<"height", "2px">;
|
|
125
|
+
readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", "1px">;
|
|
126
|
+
}>;
|
|
127
|
+
readonly swatchDashed: Readonly<{
|
|
128
|
+
readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
|
|
129
|
+
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", "repeating-linear-gradient(to right, var(--swatch) 0 4px, transparent 4px 7px)">;
|
|
130
|
+
}>;
|
|
131
|
+
readonly swatchOff: Readonly<{
|
|
132
|
+
readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.35>;
|
|
133
|
+
}>;
|
|
134
|
+
readonly visuallyHidden: Readonly<{
|
|
135
|
+
readonly position: stylex.StyleXClassNameFor<"position", "absolute">;
|
|
136
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1px">;
|
|
137
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1px">;
|
|
138
|
+
readonly margin: stylex.StyleXClassNameFor<"margin", "-1px">;
|
|
139
|
+
readonly padding: stylex.StyleXClassNameFor<"padding", 0>;
|
|
140
|
+
readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
|
|
141
|
+
readonly clip: stylex.StyleXClassNameFor<"clip", "rect(0 0 0 0)">;
|
|
142
|
+
readonly whiteSpace: stylex.StyleXClassNameFor<"whiteSpace", "nowrap">;
|
|
143
|
+
readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
|
|
144
|
+
}>;
|
|
145
|
+
}>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Chart } from "./chart.js";
|
|
2
|
+
export type { ChartProps } from "./chart.js";
|
|
3
|
+
export type { ChartAxis, ChartColor, ChartController, ChartData, ChartLabels, ChartMarker, ChartPoint, ChartPointSeries, ChartRange, ChartSeries, ChartTooltip, ChartXAxis, SeriesType, } from "../internal/types.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
2
|
+
export interface ChartGridProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "class"> {
|
|
3
|
+
/** Names the panel and its period for assistive technology ("Network, last hour"). */
|
|
4
|
+
label: string;
|
|
5
|
+
/** The charts: `Chart` elements, each with a `title`. */
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* The narrowest a column gets, in pixels: the grid fits as many columns as the width allows.
|
|
9
|
+
* @defaultValue 320
|
|
10
|
+
*/
|
|
11
|
+
minColumnWidth?: number;
|
|
12
|
+
/** A fixed number of columns instead (they still shrink to fit). */
|
|
13
|
+
columns?: number;
|
|
14
|
+
/**
|
|
15
|
+
* One cursor for every chart in the grid: point at a moment in one, read it in all. Turn it off when
|
|
16
|
+
* the charts don't share an x axis.
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
sync?: boolean;
|
|
20
|
+
/** Plot height for charts that don't set `height`. */
|
|
21
|
+
chartHeight?: number;
|
|
22
|
+
/** Extra classes on the root. */
|
|
23
|
+
class?: JSX.ClassValue;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Several charts on one time axis, laid out in columns that follow the width, with one shared cursor.
|
|
27
|
+
* For a diagnostics or metrics panel read together. Each chart keeps its own label and title.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <ChartGrid label="Network, last hour">
|
|
31
|
+
* <Chart title="Throughput (Mbps)" label="Throughput, last hour" data={throughput} series={[{ label: "In" }]} />
|
|
32
|
+
* <Chart title="Latency (ms)" label="Latency, last hour" data={latency} series={[{ label: "p95" }]} />
|
|
33
|
+
* </ChartGrid>
|
|
34
|
+
*/
|
|
35
|
+
export declare function ChartGrid(props: ChartGridProps): JSX.Element;
|