tinybase 8.4.2 → 8.5.0-beta.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 (141) hide show
  1. package/@types/ui-react-dom/index.d.ts +10 -10
  2. package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
  3. package/@types/ui-react-dom-charts/index.d.ts +242 -0
  4. package/@types/ui-react-dom-charts/with-schemas/index.d.ts +296 -0
  5. package/@types/ui-react-inspector/index.d.ts +1 -1
  6. package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
  7. package/@types/ui-solid-dom/index.d.ts +10 -10
  8. package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
  9. package/@types/ui-solid-inspector/index.d.ts +1 -1
  10. package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
  11. package/@types/ui-svelte-dom/index.d.ts +10 -10
  12. package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
  13. package/@types/ui-svelte-inspector/index.d.ts +1 -1
  14. package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
  15. package/common/index.js +3 -2
  16. package/common/with-schemas/index.js +3 -2
  17. package/index.js +5 -3
  18. package/mergeable-store/index.js +5 -3
  19. package/mergeable-store/with-schemas/index.js +5 -3
  20. package/metrics/index.js +1 -1
  21. package/metrics/with-schemas/index.js +1 -1
  22. package/min/common/index.js +1 -1
  23. package/min/common/index.js.gz +0 -0
  24. package/min/common/with-schemas/index.js +1 -1
  25. package/min/common/with-schemas/index.js.gz +0 -0
  26. package/min/index.js +1 -1
  27. package/min/index.js.gz +0 -0
  28. package/min/mergeable-store/index.js +1 -1
  29. package/min/mergeable-store/index.js.gz +0 -0
  30. package/min/mergeable-store/with-schemas/index.js +1 -1
  31. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  32. package/min/omni/index.js +1 -1
  33. package/min/omni/index.js.gz +0 -0
  34. package/min/omni/with-schemas/index.js +1 -1
  35. package/min/omni/with-schemas/index.js.gz +0 -0
  36. package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
  37. package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
  38. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
  39. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
  40. package/min/persisters/persister-partykit-server/index.js +1 -1
  41. package/min/persisters/persister-partykit-server/index.js.gz +0 -0
  42. package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
  43. package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
  44. package/min/queries/index.js +1 -1
  45. package/min/queries/index.js.gz +0 -0
  46. package/min/queries/with-schemas/index.js +1 -1
  47. package/min/queries/with-schemas/index.js.gz +0 -0
  48. package/min/synchronizers/index.js +1 -1
  49. package/min/synchronizers/index.js.gz +0 -0
  50. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  51. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  52. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  53. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  54. package/min/synchronizers/synchronizer-local/index.js +1 -1
  55. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  56. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  57. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  58. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  59. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  60. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  61. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  62. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  63. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  64. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  65. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  66. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  67. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  68. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  69. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  70. package/min/synchronizers/with-schemas/index.js +1 -1
  71. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  72. package/min/ui-react-dom/index.js +1 -1
  73. package/min/ui-react-dom/index.js.gz +0 -0
  74. package/min/ui-react-dom/with-schemas/index.js +1 -1
  75. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  76. package/min/ui-react-dom-charts/index.js +1 -0
  77. package/min/ui-react-dom-charts/index.js.gz +0 -0
  78. package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
  79. package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
  80. package/min/ui-react-inspector/index.js +1 -1
  81. package/min/ui-react-inspector/index.js.gz +0 -0
  82. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  83. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  84. package/min/ui-solid-dom/index.js +1 -1
  85. package/min/ui-solid-dom/index.js.gz +0 -0
  86. package/min/ui-solid-dom/with-schemas/index.js +1 -1
  87. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  88. package/min/ui-solid-inspector/index.js +1 -1
  89. package/min/ui-solid-inspector/index.js.gz +0 -0
  90. package/min/ui-solid-inspector/with-schemas/index.js +1 -1
  91. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  92. package/min/ui-svelte-dom/index.js +1 -1
  93. package/min/ui-svelte-dom/index.js.gz +0 -0
  94. package/min/ui-svelte-dom/with-schemas/index.js +1 -1
  95. package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
  96. package/min/ui-svelte-inspector/index.js +1 -1
  97. package/min/ui-svelte-inspector/index.js.gz +0 -0
  98. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  99. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  100. package/min/with-schemas/index.js +1 -1
  101. package/min/with-schemas/index.js.gz +0 -0
  102. package/omni/index.js +7 -4
  103. package/omni/with-schemas/index.js +7 -4
  104. package/package.json +38 -2
  105. package/persisters/persister-durable-object-sql-storage/index.js +13 -11
  106. package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
  107. package/persisters/persister-partykit-client/index.js +2 -1
  108. package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
  109. package/persisters/persister-partykit-server/index.js +2 -1
  110. package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
  111. package/queries/index.js +1 -1
  112. package/queries/with-schemas/index.js +1 -1
  113. package/readme.md +18 -14
  114. package/releases.md +91 -58
  115. package/synchronizers/index.js +3 -2
  116. package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
  117. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
  118. package/synchronizers/synchronizer-local/index.js +3 -2
  119. package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
  120. package/synchronizers/synchronizer-ws-client/index.js +3 -2
  121. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
  122. package/synchronizers/synchronizer-ws-server/index.js +3 -2
  123. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
  124. package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
  125. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
  126. package/synchronizers/with-schemas/index.js +3 -2
  127. package/ui-react-dom/index.js +10 -7
  128. package/ui-react-dom/with-schemas/index.js +10 -7
  129. package/ui-react-dom-charts/index.js +1229 -0
  130. package/ui-react-dom-charts/with-schemas/index.js +1229 -0
  131. package/ui-react-inspector/index.js +13 -9
  132. package/ui-react-inspector/with-schemas/index.js +13 -9
  133. package/ui-solid-dom/index.js +10 -7
  134. package/ui-solid-dom/with-schemas/index.js +10 -7
  135. package/ui-solid-inspector/index.js +13 -9
  136. package/ui-solid-inspector/with-schemas/index.js +13 -9
  137. package/ui-svelte-dom/index.js +11 -8
  138. package/ui-svelte-dom/with-schemas/index.js +11 -8
  139. package/ui-svelte-inspector/index.js +17 -13
  140. package/ui-svelte-inspector/with-schemas/index.js +17 -13
  141. package/with-schemas/index.js +5 -3
@@ -692,7 +692,7 @@ export type SortedTablePaginatorProps = {
692
692
  *
693
693
  * See the <TableInHtmlTable /> (React) demo for this component in action:
694
694
  *
695
- * ![TableInHtmlTable example](https://tinybase.org/shots/tableinhtmltable-react-demo.png
695
+ * ![TableInHtmlTable example](https://beta.tinybase.org/shots/tableinhtmltable-react-demo.png
696
696
  * "TableInHtmlTable example")
697
697
  *
698
698
  * The component's props identify which Table to render based on Table Id, and
@@ -838,7 +838,7 @@ export function TableInHtmlTable(
838
838
  * See the <SortedTableInHtmlTable /> (React) demo for this component in
839
839
  * action:
840
840
  *
841
- * ![SortedTableInHtmlTable example](https://tinybase.org/shots/sortedtableinhtmltable-react-demo.png
841
+ * ![SortedTableInHtmlTable example](https://beta.tinybase.org/shots/sortedtableinhtmltable-react-demo.png
842
842
  * "SortedTableInHtmlTable example")
843
843
  *
844
844
  * The component's props identify which Table to render based on Table Id, and
@@ -1011,7 +1011,7 @@ export function SortedTableInHtmlTable(
1011
1011
  *
1012
1012
  * See the <ValuesInHtmlTable /> (React) demo for this component in action:
1013
1013
  *
1014
- * ![ValuesInHtmlTable example](https://tinybase.org/shots/valuesinhtmltable-react-demo.png
1014
+ * ![ValuesInHtmlTable example](https://beta.tinybase.org/shots/valuesinhtmltable-react-demo.png
1015
1015
  * "ValuesInHtmlTable example")
1016
1016
  *
1017
1017
  * The component's props identify which Row to render based on Table Id, Row Id,
@@ -1142,7 +1142,7 @@ export function ValuesInHtmlTable(
1142
1142
  *
1143
1143
  * See the <SliceInHtmlTable /> (React) demo for this component in action:
1144
1144
  *
1145
- * ![SliceInHtmlTable example](https://tinybase.org/shots/sliceinhtmltable-react-demo.png
1145
+ * ![SliceInHtmlTable example](https://beta.tinybase.org/shots/sliceinhtmltable-react-demo.png
1146
1146
  * "SliceInHtmlTable example")
1147
1147
  *
1148
1148
  * The component's props identify which Slice to render based on Index Id, Slice
@@ -1300,7 +1300,7 @@ export function SliceInHtmlTable(
1300
1300
  * See the <RelationshipInHtmlTable /> (React) demo for this component in
1301
1301
  * action:
1302
1302
  *
1303
- * ![RelationshipInHtmlTable example](https://tinybase.org/shots/relationshipinhtmltable-react-demo.png
1303
+ * ![RelationshipInHtmlTable example](https://beta.tinybase.org/shots/relationshipinhtmltable-react-demo.png
1304
1304
  * "RelationshipInHtmlTable example")
1305
1305
  *
1306
1306
  * The component's props identify which Relationship to render based on
@@ -1478,7 +1478,7 @@ export function RelationshipInHtmlTable(
1478
1478
  * See the <ResultTableInHtmlTable /> (React) demo for this component in
1479
1479
  * action:
1480
1480
  *
1481
- * ![ResultTableInHtmlTable example](https://tinybase.org/shots/resulttableinhtmltable-react-demo.png
1481
+ * ![ResultTableInHtmlTable example](https://beta.tinybase.org/shots/resulttableinhtmltable-react-demo.png
1482
1482
  * "ResultTableInHtmlTable example")
1483
1483
  *
1484
1484
  * The component's props identify which ResultTable to render based on query Id,
@@ -1631,7 +1631,7 @@ export function ResultTableInHtmlTable(
1631
1631
  * See the <ResultSortedTableInHtmlTable /> (React) demo for this component in
1632
1632
  * action:
1633
1633
  *
1634
- * ![ResultSortedTableInHtmlTable example](https://tinybase.org/shots/resultsortedtableinhtmltable-react-demo.png
1634
+ * ![ResultSortedTableInHtmlTable example](https://beta.tinybase.org/shots/resultsortedtableinhtmltable-react-demo.png
1635
1635
  * "ResultSortedTableInHtmlTable example")
1636
1636
  *
1637
1637
  * The component's props identify which ResultTable to render based on query Id,
@@ -1805,7 +1805,7 @@ export function ResultSortedTableInHtmlTable(
1805
1805
  *
1806
1806
  * See the <EditableCellView /> (React) demo for this component in action:
1807
1807
  *
1808
- * ![EditableCellView example](https://tinybase.org/shots/editablecellview-react-demo.png
1808
+ * ![EditableCellView example](https://beta.tinybase.org/shots/editablecellview-react-demo.png
1809
1809
  * "EditableCellView example")
1810
1810
  *
1811
1811
  * The component's props identify which Cell to render based on Table Id, Row
@@ -1876,7 +1876,7 @@ export function EditableCellView(
1876
1876
  *
1877
1877
  * See the <EditableValueView /> (React) demo for this component in action:
1878
1878
  *
1879
- * ![EditableValueView example](https://tinybase.org/shots/editablevalueview-react-demo.png
1879
+ * ![EditableValueView example](https://beta.tinybase.org/shots/editablevalueview-react-demo.png
1880
1880
  * "EditableValueView example")
1881
1881
  *
1882
1882
  * The component's props identify which Value to render based on Table Id, Row
@@ -1947,7 +1947,7 @@ export function EditableValueView(
1947
1947
  * See the <SortedTableInHtmlTable /> (React) demo for this component in
1948
1948
  * action:
1949
1949
  *
1950
- * ![SortedTablePaginator example](https://tinybase.org/shots/sortedtablepaginator-react-demo.png
1950
+ * ![SortedTablePaginator example](https://beta.tinybase.org/shots/sortedtablepaginator-react-demo.png
1951
1951
  * "SortedTablePaginator example")
1952
1952
  *
1953
1953
  * The component displays 'previous' and 'next' buttons for paging through the
@@ -674,7 +674,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
674
674
  *
675
675
  * See the <TableInHtmlTable /> (React) demo for this component in action:
676
676
  *
677
- * ![TableInHtmlTable example](https://tinybase.org/shots/tableinhtmltable-react-demo.png
677
+ * ![TableInHtmlTable example](https://beta.tinybase.org/shots/tableinhtmltable-react-demo.png
678
678
  * "TableInHtmlTable example")
679
679
  *
680
680
  * The component's props identify which Table to render based on Table Id, and
@@ -828,7 +828,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
828
828
  * See the <SortedTableInHtmlTable /> (React) demo for this component in
829
829
  * action:
830
830
  *
831
- * ![SortedTableInHtmlTable example](https://tinybase.org/shots/sortedtableinhtmltable-react-demo.png
831
+ * ![SortedTableInHtmlTable example](https://beta.tinybase.org/shots/sortedtableinhtmltable-react-demo.png
832
832
  * "SortedTableInHtmlTable example")
833
833
  *
834
834
  * The component's props identify which Table to render based on Table Id, and
@@ -1009,7 +1009,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1009
1009
  *
1010
1010
  * See the <ValuesInHtmlTable /> (React) demo for this component in action:
1011
1011
  *
1012
- * ![ValuesInHtmlTable example](https://tinybase.org/shots/valuesinhtmltable-react-demo.png
1012
+ * ![ValuesInHtmlTable example](https://beta.tinybase.org/shots/valuesinhtmltable-react-demo.png
1013
1013
  * "ValuesInHtmlTable example")
1014
1014
  *
1015
1015
  * The component's props identify which Row to render based on Table Id, Row Id,
@@ -1148,7 +1148,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1148
1148
  *
1149
1149
  * See the <SliceInHtmlTable /> (React) demo for this component in action:
1150
1150
  *
1151
- * ![SliceInHtmlTable example](https://tinybase.org/shots/sliceinhtmltable-react-demo.png
1151
+ * ![SliceInHtmlTable example](https://beta.tinybase.org/shots/sliceinhtmltable-react-demo.png
1152
1152
  * "SliceInHtmlTable example")
1153
1153
  *
1154
1154
  * The component's props identify which Slice to render based on Index Id, Slice
@@ -1314,7 +1314,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1314
1314
  * See the <RelationshipInHtmlTable /> (React) demo for this component in
1315
1315
  * action:
1316
1316
  *
1317
- * ![RelationshipInHtmlTable example](https://tinybase.org/shots/relationshipinhtmltable-react-demo.png
1317
+ * ![RelationshipInHtmlTable example](https://beta.tinybase.org/shots/relationshipinhtmltable-react-demo.png
1318
1318
  * "RelationshipInHtmlTable example")
1319
1319
  *
1320
1320
  * The component's props identify which Relationship to render based on
@@ -1500,7 +1500,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1500
1500
  * See the <ResultTableInHtmlTable /> (React) demo for this component in
1501
1501
  * action:
1502
1502
  *
1503
- * ![ResultTableInHtmlTable example](https://tinybase.org/shots/resulttableinhtmltable-react-demo.png
1503
+ * ![ResultTableInHtmlTable example](https://beta.tinybase.org/shots/resulttableinhtmltable-react-demo.png
1504
1504
  * "ResultTableInHtmlTable example")
1505
1505
  *
1506
1506
  * The component's props identify which ResultTable to render based on query Id,
@@ -1661,7 +1661,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1661
1661
  * See the <ResultSortedTableInHtmlTable /> (React) demo for this component in
1662
1662
  * action:
1663
1663
  *
1664
- * ![ResultSortedTableInHtmlTable example](https://tinybase.org/shots/resultsortedtableinhtmltable-react-demo.png
1664
+ * ![ResultSortedTableInHtmlTable example](https://beta.tinybase.org/shots/resultsortedtableinhtmltable-react-demo.png
1665
1665
  * "ResultSortedTableInHtmlTable example")
1666
1666
  *
1667
1667
  * The component's props identify which ResultTable to render based on query Id,
@@ -1843,7 +1843,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1843
1843
  *
1844
1844
  * See the <EditableCellView /> (React) demo for this component in action:
1845
1845
  *
1846
- * ![EditableCellView example](https://tinybase.org/shots/editablecellview-react-demo.png
1846
+ * ![EditableCellView example](https://beta.tinybase.org/shots/editablecellview-react-demo.png
1847
1847
  * "EditableCellView example")
1848
1848
  *
1849
1849
  * The component's props identify which Cell to render based on Table Id, Row
@@ -1928,7 +1928,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1928
1928
  *
1929
1929
  * See the <EditableValueView /> (React) demo for this component in action:
1930
1930
  *
1931
- * ![EditableValueView example](https://tinybase.org/shots/editablevalueview-react-demo.png
1931
+ * ![EditableValueView example](https://beta.tinybase.org/shots/editablevalueview-react-demo.png
1932
1932
  * "EditableValueView example")
1933
1933
  *
1934
1934
  * The component's props identify which Value to render based on Table Id, Row
@@ -1999,7 +1999,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
1999
1999
  * See the <SortedTableInHtmlTable /> (React) demo for this component in
2000
2000
  * action:
2001
2001
  *
2002
- * ![SortedTablePaginator example](https://tinybase.org/shots/sortedtablepaginator-react-demo.png
2002
+ * ![SortedTablePaginator example](https://beta.tinybase.org/shots/sortedtablepaginator-react-demo.png
2003
2003
  * "SortedTablePaginator example")
2004
2004
  *
2005
2005
  * The component displays 'previous' and 'next' buttons for paging through the
@@ -0,0 +1,242 @@
1
+ /**
2
+ * The ui-react-dom-charts module of the TinyBase project provides components
3
+ * to make it easy to create web-based reactive charts with Store and Queries
4
+ * objects.
5
+ *
6
+ * The components in this module use the react-dom module and so are not
7
+ * appropriate for environments like React Native (although those in the
8
+ * lower-level ui-react module are).
9
+ *
10
+ * For a full list of SVG class names that can be styled with CSS, see the
11
+ * Using Charts guide.
12
+ * @packageDocumentation
13
+ * @module ui-react-dom-charts
14
+ * @since v8.5.0
15
+ */
16
+ import type {Id} from '../common/index.d.ts';
17
+ import type {
18
+ ComponentReturnType,
19
+ QueriesOrQueriesId,
20
+ StoreOrStoreId,
21
+ } from '../ui-react/index.d.ts';
22
+
23
+ /**
24
+ * The ChartProps type describes the props that are used to configure the
25
+ * chart element that renders a chart.
26
+ * @category Configuration
27
+ * @since v8.5.0
28
+ */
29
+ export type ChartProps = {
30
+ /**
31
+ * An optional string that will be used as the class attribute of the chart's
32
+ * SVG element. This can be used as the root selector for styling chart
33
+ * internals, as shown in the Using Charts guide.
34
+ * @category Prop
35
+ * @since v8.5.0
36
+ */
37
+ readonly className?: string;
38
+ };
39
+
40
+ /**
41
+ * The ChartTableSourceProps type describes the props that bind a chart to a
42
+ * Table in a Store.
43
+ * @category Configuration
44
+ * @since v8.5.0
45
+ */
46
+ export type ChartTableSourceProps = {
47
+ /**
48
+ * The Id of the Table in the Store to chart.
49
+ * @category Prop
50
+ * @since v8.5.0
51
+ */
52
+ readonly tableId: Id;
53
+ /**
54
+ * The Store to chart, or the Id of a Store that is registered with the
55
+ * Provider component.
56
+ * @category Prop
57
+ * @since v8.5.0
58
+ */
59
+ readonly store?: StoreOrStoreId;
60
+ /**
61
+ * This prop is not used when binding a chart to a Table.
62
+ * @category Prop
63
+ * @since v8.5.0
64
+ */
65
+ readonly queryId?: never;
66
+ /**
67
+ * This prop is not used when binding a chart to a Table.
68
+ * @category Prop
69
+ * @since v8.5.0
70
+ */
71
+ readonly queries?: never;
72
+ };
73
+
74
+ /**
75
+ * The ChartQuerySourceProps type describes the props that bind a chart to a
76
+ * Query in a Queries object.
77
+ * @category Configuration
78
+ * @since v8.5.0
79
+ */
80
+ export type ChartQuerySourceProps = {
81
+ /**
82
+ * The Id of the query in the Queries object to chart.
83
+ * @category Prop
84
+ * @since v8.5.0
85
+ */
86
+ readonly queryId: Id;
87
+ /**
88
+ * The Queries object to chart, or the Id of a Queries object that is
89
+ * registered with the Provider component.
90
+ * @category Prop
91
+ * @since v8.5.0
92
+ */
93
+ readonly queries?: QueriesOrQueriesId;
94
+ /**
95
+ * This prop is not used when binding a chart to a Query.
96
+ * @category Prop
97
+ * @since v8.5.0
98
+ */
99
+ readonly tableId?: never;
100
+ /**
101
+ * This prop is not used when binding a chart to a Query.
102
+ * @category Prop
103
+ * @since v8.5.0
104
+ */
105
+ readonly store?: never;
106
+ };
107
+
108
+ /**
109
+ * The ChartBindingProps type describes the props that bind a chart to Cell
110
+ * values in TinyBase data.
111
+ * @category Configuration
112
+ * @since v8.5.0
113
+ */
114
+ export type ChartBindingProps = {
115
+ /**
116
+ * The Id of the Cell that provides each data point's x value.
117
+ * @category Prop
118
+ * @since v8.5.0
119
+ */
120
+ readonly xCellId: Id;
121
+ /**
122
+ * The Id of the Cell that provides each data point's y value.
123
+ * @category Prop
124
+ * @since v8.5.0
125
+ */
126
+ readonly yCellId: Id;
127
+ /**
128
+ * The Id of the Cell used to sort the charted rows.
129
+ * @category Prop
130
+ * @since v8.5.0
131
+ */
132
+ readonly sortCellId?: Id;
133
+ /**
134
+ * Whether the charted rows should be sorted in descending order.
135
+ * @category Prop
136
+ * @since v8.5.0
137
+ */
138
+ readonly descending?: boolean;
139
+ /**
140
+ * The number of sorted rows to skip before charting.
141
+ * @category Prop
142
+ * @since v8.5.0
143
+ */
144
+ readonly offset?: number;
145
+ /**
146
+ * The maximum number of sorted rows to chart.
147
+ * @category Prop
148
+ * @since v8.5.0
149
+ */
150
+ readonly limit?: number;
151
+ };
152
+
153
+ /**
154
+ * The LineChart component renders a line chart from TinyBase data.
155
+ * @category Store components
156
+ * @since v8.5.0
157
+ * @example
158
+ * This example creates a Provider context into which a default Store is
159
+ * provided. The LineChart component then renders an SVG chart from Cells in the
160
+ * `pets` Table.
161
+ *
162
+ * ```jsx
163
+ * import React from 'react';
164
+ * import {createRoot} from 'react-dom/client';
165
+ * import {createStore} from 'tinybase';
166
+ * import {Provider} from 'tinybase/ui-react';
167
+ * import {LineChart} from 'tinybase/ui-react-dom-charts';
168
+ *
169
+ * const App = ({store}) => (
170
+ * <Provider store={store}>
171
+ * <LineChart
172
+ * tableId="pets"
173
+ * xCellId="order"
174
+ * yCellId="sold"
175
+ * className="sales"
176
+ * />
177
+ * </Provider>
178
+ * );
179
+ *
180
+ * const store = createStore().setTable('pets', {
181
+ * hamsters: {order: 1, sold: 12},
182
+ * rabbits: {order: 2, sold: 9},
183
+ * });
184
+ * const app = document.createElement('div');
185
+ * createRoot(app).render(<App store={store} />); // !act
186
+ * console.log(app.firstChild?.nodeName.toLowerCase());
187
+ * // -> 'svg'
188
+ * console.log(app.firstChild?.getAttribute('class'));
189
+ * // -> 'sales'
190
+ * ```
191
+ */
192
+ export function LineChart(
193
+ props: (ChartTableSourceProps | ChartQuerySourceProps) &
194
+ ChartBindingProps &
195
+ ChartProps,
196
+ ): ComponentReturnType;
197
+
198
+ /**
199
+ * The BarChart component renders a bar chart from TinyBase data.
200
+ * @category Store components
201
+ * @since v8.5.0
202
+ * @example
203
+ * This example creates a Queries object and provides it through Provider
204
+ * context. The BarChart component then renders an SVG chart from Cells in the
205
+ * `bySpecies` query.
206
+ *
207
+ * ```jsx
208
+ * import React from 'react';
209
+ * import {createRoot} from 'react-dom/client';
210
+ * import {createQueries, createStore} from 'tinybase';
211
+ * import {Provider} from 'tinybase/ui-react';
212
+ * import {BarChart} from 'tinybase/ui-react-dom-charts';
213
+ *
214
+ * const App = ({queries}) => (
215
+ * <Provider queries={queries}>
216
+ * <BarChart queryId="bySpecies" xCellId="species" yCellId="sold" />
217
+ * </Provider>
218
+ * );
219
+ *
220
+ * const store = createStore().setTable('pets', {
221
+ * hamsters: {species: 'hamster', sold: 12},
222
+ * rabbits: {species: 'rabbit', sold: 9},
223
+ * });
224
+ * const queries = createQueries(store).setQueryDefinition(
225
+ * 'bySpecies',
226
+ * 'pets',
227
+ * ({select}) => {
228
+ * select('species');
229
+ * select('sold');
230
+ * },
231
+ * );
232
+ * const app = document.createElement('div');
233
+ * createRoot(app).render(<App queries={queries} />); // !act
234
+ * console.log(app.firstChild?.nodeName.toLowerCase());
235
+ * // -> 'svg'
236
+ * ```
237
+ */
238
+ export function BarChart(
239
+ props: (ChartTableSourceProps | ChartQuerySourceProps) &
240
+ ChartBindingProps &
241
+ ChartProps,
242
+ ): ComponentReturnType;