@zsherman/charts 0.0.0-stage → 0.1.1

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.
Files changed (180) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +373 -0
  3. package/README.md +13 -2
  4. package/THIRD_PARTY_NOTICES.md +33 -0
  5. package/dist/dom/bar-list/bar-list.js +386 -0
  6. package/dist/dom/bar-list/bar-list.styles.js +171 -0
  7. package/dist/dom/bar-list/index.js +1 -0
  8. package/dist/dom/chart/chart.js +716 -0
  9. package/dist/dom/chart/chart.styles.js +165 -0
  10. package/dist/dom/chart/index.js +1 -0
  11. package/dist/dom/chart-grid/chart-grid.js +67 -0
  12. package/dist/dom/chart-grid/index.js +1 -0
  13. package/dist/dom/donut/donut.js +565 -0
  14. package/dist/dom/donut/donut.styles.js +111 -0
  15. package/dist/dom/donut/index.js +1 -0
  16. package/dist/dom/heat-graph/calendar.js +118 -0
  17. package/dist/dom/heat-graph/heat-graph.js +423 -0
  18. package/dist/dom/heat-graph/heat-graph.styles.js +168 -0
  19. package/dist/dom/heat-graph/index.js +1 -0
  20. package/dist/dom/heat-matrix/heat-matrix.js +346 -0
  21. package/dist/dom/heat-matrix/heat-matrix.styles.js +155 -0
  22. package/dist/dom/heat-matrix/index.js +1 -0
  23. package/dist/dom/heat-matrix/model.js +41 -0
  24. package/dist/dom/index.js +13 -0
  25. package/dist/dom/internal/colors.js +44 -0
  26. package/dist/dom/internal/floating-tip.js +83 -0
  27. package/dist/dom/internal/format.js +43 -0
  28. package/dist/dom/internal/grid-context.js +5 -0
  29. package/dist/dom/internal/hidden.styles.js +16 -0
  30. package/dist/dom/internal/legend.js +112 -0
  31. package/dist/dom/internal/legend.styles.js +108 -0
  32. package/dist/dom/internal/markers.js +101 -0
  33. package/dist/dom/internal/options.js +300 -0
  34. package/dist/dom/internal/place.js +27 -0
  35. package/dist/dom/internal/scheme-watch.js +73 -0
  36. package/dist/dom/internal/share.js +28 -0
  37. package/dist/dom/internal/types.js +0 -0
  38. package/dist/dom/row-chart/index.js +1 -0
  39. package/dist/dom/row-chart/model.js +59 -0
  40. package/dist/dom/row-chart/row-chart.js +691 -0
  41. package/dist/dom/row-chart/row-chart.styles.js +242 -0
  42. package/dist/dom/segmented-bar/index.js +1 -0
  43. package/dist/dom/segmented-bar/segmented-bar.js +280 -0
  44. package/dist/dom/segmented-bar/segmented-bar.styles.js +88 -0
  45. package/dist/dom/sparkline/index.js +1 -0
  46. package/dist/dom/sparkline/sparkline.js +145 -0
  47. package/dist/dom/stacked-histogram/histogram.js +137 -0
  48. package/dist/dom/stacked-histogram/index.js +1 -0
  49. package/dist/dom/stacked-histogram/stacked-histogram.js +761 -0
  50. package/dist/dom/stacked-histogram/stacked-histogram.styles.js +211 -0
  51. package/dist/dom/state-timeline/index.js +1 -0
  52. package/dist/dom/state-timeline/model.js +166 -0
  53. package/dist/dom/state-timeline/state-timeline.js +729 -0
  54. package/dist/dom/state-timeline/state-timeline.styles.js +171 -0
  55. package/dist/dom/status-history/index.js +1 -0
  56. package/dist/dom/status-history/status-history.js +542 -0
  57. package/dist/dom/status-history/status-history.styles.js +171 -0
  58. package/dist/solid/bar-list/bar-list.jsx +139 -0
  59. package/dist/solid/bar-list/bar-list.styles.jsx +171 -0
  60. package/dist/solid/bar-list/index.jsx +1 -0
  61. package/dist/solid/chart/chart.jsx +454 -0
  62. package/dist/solid/chart/chart.styles.jsx +165 -0
  63. package/dist/solid/chart/index.jsx +1 -0
  64. package/dist/solid/chart-grid/chart-grid.jsx +46 -0
  65. package/dist/solid/chart-grid/index.jsx +1 -0
  66. package/dist/solid/donut/donut.jsx +291 -0
  67. package/dist/solid/donut/donut.styles.jsx +111 -0
  68. package/dist/solid/donut/index.jsx +1 -0
  69. package/dist/solid/heat-graph/calendar.jsx +118 -0
  70. package/dist/solid/heat-graph/heat-graph.jsx +228 -0
  71. package/dist/solid/heat-graph/heat-graph.styles.jsx +168 -0
  72. package/dist/solid/heat-graph/index.jsx +1 -0
  73. package/dist/solid/heat-matrix/heat-matrix.jsx +165 -0
  74. package/dist/solid/heat-matrix/heat-matrix.styles.jsx +155 -0
  75. package/dist/solid/heat-matrix/index.jsx +1 -0
  76. package/dist/solid/heat-matrix/model.jsx +41 -0
  77. package/dist/solid/index.jsx +13 -0
  78. package/dist/solid/internal/colors.jsx +44 -0
  79. package/dist/solid/internal/floating-tip.jsx +68 -0
  80. package/dist/solid/internal/format.jsx +43 -0
  81. package/dist/solid/internal/grid-context.jsx +5 -0
  82. package/dist/solid/internal/hidden.styles.jsx +16 -0
  83. package/dist/solid/internal/legend.jsx +35 -0
  84. package/dist/solid/internal/legend.styles.jsx +108 -0
  85. package/dist/solid/internal/markers.jsx +101 -0
  86. package/dist/solid/internal/options.jsx +300 -0
  87. package/dist/solid/internal/place.jsx +27 -0
  88. package/dist/solid/internal/scheme-watch.jsx +73 -0
  89. package/dist/solid/internal/share.jsx +28 -0
  90. package/dist/solid/internal/types.jsx +0 -0
  91. package/dist/solid/row-chart/index.jsx +1 -0
  92. package/dist/solid/row-chart/model.jsx +59 -0
  93. package/dist/solid/row-chart/row-chart.jsx +312 -0
  94. package/dist/solid/row-chart/row-chart.styles.jsx +242 -0
  95. package/dist/solid/segmented-bar/index.jsx +1 -0
  96. package/dist/solid/segmented-bar/segmented-bar.jsx +125 -0
  97. package/dist/solid/segmented-bar/segmented-bar.styles.jsx +88 -0
  98. package/dist/solid/sparkline/index.jsx +1 -0
  99. package/dist/solid/sparkline/sparkline.jsx +88 -0
  100. package/dist/solid/stacked-histogram/histogram.jsx +137 -0
  101. package/dist/solid/stacked-histogram/index.jsx +1 -0
  102. package/dist/solid/stacked-histogram/stacked-histogram.jsx +381 -0
  103. package/dist/solid/stacked-histogram/stacked-histogram.styles.jsx +211 -0
  104. package/dist/solid/state-timeline/index.jsx +1 -0
  105. package/dist/solid/state-timeline/model.jsx +166 -0
  106. package/dist/solid/state-timeline/state-timeline.jsx +387 -0
  107. package/dist/solid/state-timeline/state-timeline.styles.jsx +171 -0
  108. package/dist/solid/status-history/index.jsx +1 -0
  109. package/dist/solid/status-history/status-history.jsx +279 -0
  110. package/dist/solid/status-history/status-history.styles.jsx +171 -0
  111. package/dist/styles.css +1 -0
  112. package/dist/types/bar-list/bar-list.d.ts +91 -0
  113. package/dist/types/bar-list/bar-list.styles.d.ts +148 -0
  114. package/dist/types/bar-list/index.d.ts +3 -0
  115. package/dist/types/chart/chart.d.ts +98 -0
  116. package/dist/types/chart/chart.styles.d.ts +145 -0
  117. package/dist/types/chart/index.d.ts +3 -0
  118. package/dist/types/chart-grid/chart-grid.d.ts +35 -0
  119. package/dist/types/chart-grid/index.d.ts +2 -0
  120. package/dist/types/donut/donut.d.ts +124 -0
  121. package/dist/types/donut/donut.styles.d.ts +96 -0
  122. package/dist/types/donut/index.d.ts +3 -0
  123. package/dist/types/heat-graph/calendar.d.ts +61 -0
  124. package/dist/types/heat-graph/heat-graph.d.ts +82 -0
  125. package/dist/types/heat-graph/heat-graph.styles.d.ts +141 -0
  126. package/dist/types/heat-graph/index.d.ts +4 -0
  127. package/dist/types/heat-matrix/heat-matrix.d.ts +65 -0
  128. package/dist/types/heat-matrix/heat-matrix.styles.d.ts +135 -0
  129. package/dist/types/heat-matrix/index.d.ts +3 -0
  130. package/dist/types/heat-matrix/model.d.ts +15 -0
  131. package/dist/types/index.d.ts +12 -0
  132. package/dist/types/internal/colors.d.ts +22 -0
  133. package/dist/types/internal/floating-tip.d.ts +15 -0
  134. package/dist/types/internal/format.d.ts +7 -0
  135. package/dist/types/internal/grid-context.d.ts +9 -0
  136. package/dist/types/internal/hidden.styles.d.ts +15 -0
  137. package/dist/types/internal/legend.d.ts +18 -0
  138. package/dist/types/internal/legend.styles.d.ts +96 -0
  139. package/dist/types/internal/markers.d.ts +16 -0
  140. package/dist/types/internal/options.d.ts +59 -0
  141. package/dist/types/internal/place.d.ts +20 -0
  142. package/dist/types/internal/scheme-watch.d.ts +12 -0
  143. package/dist/types/internal/share.d.ts +19 -0
  144. package/dist/types/internal/types.d.ts +163 -0
  145. package/dist/types/row-chart/index.d.ts +4 -0
  146. package/dist/types/row-chart/model.d.ts +50 -0
  147. package/dist/types/row-chart/row-chart.d.ts +148 -0
  148. package/dist/types/row-chart/row-chart.styles.d.ts +216 -0
  149. package/dist/types/segmented-bar/index.d.ts +3 -0
  150. package/dist/types/segmented-bar/segmented-bar.d.ts +65 -0
  151. package/dist/types/segmented-bar/segmented-bar.styles.d.ts +75 -0
  152. package/dist/types/sparkline/index.d.ts +3 -0
  153. package/dist/types/sparkline/sparkline.d.ts +38 -0
  154. package/dist/types/stacked-histogram/histogram.d.ts +48 -0
  155. package/dist/types/stacked-histogram/index.d.ts +4 -0
  156. package/dist/types/stacked-histogram/stacked-histogram.d.ts +73 -0
  157. package/dist/types/stacked-histogram/stacked-histogram.styles.d.ts +187 -0
  158. package/dist/types/state-timeline/index.d.ts +3 -0
  159. package/dist/types/state-timeline/model.d.ts +63 -0
  160. package/dist/types/state-timeline/state-timeline.d.ts +108 -0
  161. package/dist/types/state-timeline/state-timeline.styles.d.ts +151 -0
  162. package/dist/types/status-history/index.d.ts +3 -0
  163. package/dist/types/status-history/status-history.d.ts +72 -0
  164. package/dist/types/status-history/status-history.styles.d.ts +150 -0
  165. package/docs/api.json +1346 -0
  166. package/docs/bar-list.md +190 -0
  167. package/docs/chart-grid.md +77 -0
  168. package/docs/chart.md +355 -0
  169. package/docs/donut.md +182 -0
  170. package/docs/heat-graph.md +121 -0
  171. package/docs/heat-matrix.md +108 -0
  172. package/docs/llms.txt +68 -0
  173. package/docs/row-chart.md +193 -0
  174. package/docs/search-index.json +291 -0
  175. package/docs/segmented-bar.md +128 -0
  176. package/docs/sparkline.md +82 -0
  177. package/docs/stacked-histogram.md +123 -0
  178. package/docs/state-timeline.md +141 -0
  179. package/docs/status-history.md +121 -0
  180. package/package.json +109 -4
@@ -0,0 +1,165 @@
1
+ import "@stylexjs/stylex";
2
+ // src/chart/chart.styles.ts
3
+ const styles = {
4
+ root: {
5
+ kB7OPa: "x9f619",
6
+ k1xSpc: "x78zum5",
7
+ kXwgrk: "xdt5ytf",
8
+ kOIVth: "x8rwxmg",
9
+ k7Eaqz: "xeuugli",
10
+ kMv6JI: "x13rcfk",
11
+ kMwMTN: "x1yjpjgc",
12
+ $$css: true
13
+ },
14
+ title: {
15
+ kogj98: "x1ghz6dp",
16
+ kGuDYH: "x409pna",
17
+ k63SB2: "x1vmg6u2",
18
+ kLWn49: "xau0z5x",
19
+ kMwMTN: "x1yjpjgc",
20
+ $$css: true
21
+ },
22
+ plot: {
23
+ kVAEAm: "x1n2onr6",
24
+ kB7OPa: "x9f619",
25
+ k7Eaqz: "xeuugli",
26
+ kaIpWk: "x1b6xorz",
27
+ k3XXqK: "x1t137rt x9v5kkp",
28
+ kMeerF: "x1de99jn",
29
+ kInvED: "x1hl8ikr",
30
+ kjBf7l: "xi1ptex x1x84bn5",
31
+ kGuDYH: "xb5fjo1",
32
+ $$css: true
33
+ },
34
+ probe: {
35
+ k1xSpc: "x1s85apg",
36
+ $$css: true
37
+ },
38
+ tooltip: {
39
+ kB7OPa: "x9f619",
40
+ k1xSpc: "xrvj5dj",
41
+ kOIVth: "xz09phk",
42
+ k7Eaqz: "xzhy1st",
43
+ ks0D6T: "x2y036v",
44
+ k8WAf4: "xqy2vlu",
45
+ kg3NbH: "xxobuei",
46
+ kWkggS: "xm9f0jk",
47
+ kMwMTN: "x1yjpjgc",
48
+ kMzoRj: "xmkeg23",
49
+ ksu8eU: "x1y0btm7",
50
+ kVAM5u: "x1wpxzwl x1w1tqly",
51
+ kaIpWk: "x1ttroej",
52
+ kGVxlE: "xfw8du2",
53
+ kGuDYH: "xb5fjo1",
54
+ kLWn49: "xau0z5x",
55
+ kfzvcC: "x47corl",
56
+ khDVqt: "xuxw1ft",
57
+ $$css: true
58
+ },
59
+ tooltipHeading: {
60
+ kMwMTN: "xe2mk2a",
61
+ k63SB2: "x1vmg6u2",
62
+ $$css: true
63
+ },
64
+ row: {
65
+ k1xSpc: "x78zum5",
66
+ kGNEyG: "x6s0dn4",
67
+ kOIVth: "x8rwxmg",
68
+ $$css: true
69
+ },
70
+ rowFaded: {
71
+ kSiTet: "xwq05k6",
72
+ $$css: true
73
+ },
74
+ rowLabel: {
75
+ kzQI83: "x1iyjqo2",
76
+ kMwMTN: "xe2mk2a",
77
+ $$css: true
78
+ },
79
+ value: {
80
+ kcqcaj: "xss6m8b",
81
+ k63SB2: "x1vmg6u2",
82
+ kMwMTN: "x1yjpjgc",
83
+ kQ0QjF: "xa7awgv",
84
+ $$css: true
85
+ },
86
+ legend: {
87
+ k1xSpc: "x78zum5",
88
+ kwnvtZ: "x1a02dak",
89
+ kOIVth: "xz09phk",
90
+ kogj98: "x1ghz6dp",
91
+ keTefX: "x1pxmky9",
92
+ kmVPX3: "x1717udv",
93
+ kB88ic: "xe8uvvx",
94
+ $$css: true
95
+ },
96
+ legendButton: {
97
+ kB7OPa: "x9f619",
98
+ k1xSpc: "x3nfvp2",
99
+ kGNEyG: "x6s0dn4",
100
+ kOIVth: "x1xuqxfr",
101
+ kAzted: "x1pw4g4d",
102
+ kg3NbH: "x1d6xsf",
103
+ kogj98: "x1ghz6dp",
104
+ kMzoRj: "xc342km",
105
+ kaIpWk: "x1b6xorz",
106
+ kWkggS: "xjbqb8w x12f1u69",
107
+ kMwMTN: "x1yjpjgc x1b9byvc",
108
+ kMv6JI: "xjb2p0i",
109
+ kGuDYH: "xb5fjo1",
110
+ k63SB2: "x1vmg6u2",
111
+ kLWn49: "xau0z5x",
112
+ kkrTdU: "x1ypdohk",
113
+ k3XXqK: "x1t137rt x9v5kkp",
114
+ kMeerF: "x1de99jn",
115
+ kInvED: "x2ssjo2",
116
+ kjBf7l: "xi1ptex x1x84bn5",
117
+ kMnn75: "xkrqix3 x1f7ip12",
118
+ $$css: true
119
+ },
120
+ legendValue: {
121
+ kcqcaj: "xss6m8b",
122
+ kMwMTN: "xe2mk2a",
123
+ kQ0QjF: "xa7awgv",
124
+ $$css: true
125
+ },
126
+ swatch: {
127
+ kmuXW: "x2lah0s",
128
+ kB7OPa: "x9f619",
129
+ k1xSpc: "x1rg5ohu",
130
+ kzqmXN: "x1jw3ynk",
131
+ kZKoxP: "xvle69y",
132
+ kaIpWk: "x1cum3z5",
133
+ kWkggS: "xrmkqiu",
134
+ kAXs8y: "x1kzknox",
135
+ $$css: true
136
+ },
137
+ swatchLine: {
138
+ kzqmXN: "xcdlrvm",
139
+ kZKoxP: "x36qwtl",
140
+ kaIpWk: "x1nj7uno",
141
+ $$css: true
142
+ },
143
+ swatchDashed: {
144
+ kWkggS: "xjbqb8w",
145
+ kKwaWg: "x1fb1h6r",
146
+ $$css: true
147
+ },
148
+ swatchOff: {
149
+ kSiTet: "x3onkmb",
150
+ $$css: true
151
+ },
152
+ visuallyHidden: {
153
+ kVAEAm: "x10l6tqk",
154
+ kzqmXN: "x1i1rx1s",
155
+ kZKoxP: "xjm9jq1",
156
+ kogj98: "xkdpibf",
157
+ kmVPX3: "x1717udv",
158
+ kVQacm: "xb3r6kr",
159
+ kMcinP: "xeh89do",
160
+ khDVqt: "xuxw1ft",
161
+ kMzoRj: "xc342km",
162
+ $$css: true
163
+ }
164
+ };
165
+ export { styles };
@@ -0,0 +1 @@
1
+ export { Chart } from "./chart.js";
@@ -0,0 +1,67 @@
1
+ import { ChartGridContext } from "../internal/grid-context.js";
2
+ import { createComponent, getNextElement, insert, runHydrationEvents, scope, spread, template } from "@solidjs/web";
3
+ import * as stylex from "@stylexjs/stylex";
4
+ import { createUniqueId, omit } from "solid-js";
5
+ // src/chart-grid/chart-grid.tsx
6
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
7
+ const _temp = {
8
+ kumcoG: "xqketvx",
9
+ "$$css": true
10
+ };
11
+ const _temp2 = {
12
+ kumcoG: "xqketvx",
13
+ "$$css": true
14
+ };
15
+ const styles = {
16
+ grid: {
17
+ k1xSpc: "xrvj5dj",
18
+ kOIVth: "xcjfhwz",
19
+ k7Eaqz: "xeuugli",
20
+ $$css: true
21
+ },
22
+ auto: (min) => [_temp, { "--x-gridTemplateColumns": `repeat(auto-fill, minmax(min(100%, ${min}), 1fr))` != null ? `repeat(auto-fill, minmax(min(100%, ${min}), 1fr))` : void 0 }],
23
+ fixed: (columns) => [_temp2, { "--x-gridTemplateColumns": `repeat(${columns}, minmax(0, 1fr))` != null ? `repeat(${columns}, minmax(0, 1fr))` : void 0 }]
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
+ function ChartGrid(props) {
36
+ const rest = omit(props, "label", "children", "minColumnWidth", "columns", "sync", "chartHeight", "class");
37
+ const key = `chart-grid-${createUniqueId()}`;
38
+ const layout = () => stylex.props(styles.grid, props.columns ? styles.fixed(String(props.columns)) : styles.auto(`${props.minColumnWidth ?? 320}px`));
39
+ return createComponent(ChartGridContext, {
40
+ value: {
41
+ syncKey: () => props.sync === false ? void 0 : key,
42
+ height: () => props.chartHeight
43
+ },
44
+ get children() {
45
+ var _el$ = getNextElement(_tmpl$);
46
+ spread(_el$, [rest, {
47
+ role: "group",
48
+ get "aria-label"() {
49
+ return props.label;
50
+ },
51
+ "data-slot": "chart-grid",
52
+ get "class"() {
53
+ return [layout().className, props.class];
54
+ },
55
+ get style() {
56
+ return layout().style;
57
+ }
58
+ }], true);
59
+ insert(_el$, scope(() => {
60
+ return props.children;
61
+ }));
62
+ runHydrationEvents();
63
+ return _el$;
64
+ }
65
+ });
66
+ }
67
+ export { ChartGrid };
@@ -0,0 +1 @@
1
+ export { ChartGrid } from "./chart-grid.js";