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.
- package/@types/ui-react-dom/index.d.ts +10 -10
- package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-react-dom-charts/index.d.ts +242 -0
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +296 -0
- package/@types/ui-react-inspector/index.d.ts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-solid-dom/index.d.ts +10 -10
- package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-solid-inspector/index.d.ts +1 -1
- package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-svelte-dom/index.d.ts +10 -10
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-svelte-inspector/index.d.ts +1 -1
- package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
- package/common/index.js +3 -2
- package/common/with-schemas/index.js +3 -2
- package/index.js +5 -3
- package/mergeable-store/index.js +5 -3
- package/mergeable-store/with-schemas/index.js +5 -3
- package/metrics/index.js +1 -1
- package/metrics/with-schemas/index.js +1 -1
- package/min/common/index.js +1 -1
- package/min/common/index.js.gz +0 -0
- package/min/common/with-schemas/index.js +1 -1
- package/min/common/with-schemas/index.js.gz +0 -0
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/index.js +1 -1
- package/min/persisters/persister-partykit-server/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
- package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
- package/min/queries/index.js +1 -1
- package/min/queries/index.js.gz +0 -0
- package/min/queries/with-schemas/index.js +1 -1
- package/min/queries/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/index.js +1 -1
- package/min/synchronizers/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/index.js +1 -1
- package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/with-schemas/index.js +1 -1
- package/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom-charts/index.js +1 -0
- package/min/ui-react-dom-charts/index.js.gz +0 -0
- package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
- package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-dom/index.js +1 -1
- package/min/ui-solid-dom/index.js.gz +0 -0
- package/min/ui-solid-dom/with-schemas/index.js +1 -1
- package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-dom/index.js +1 -1
- package/min/ui-svelte-dom/index.js.gz +0 -0
- package/min/ui-svelte-dom/with-schemas/index.js +1 -1
- package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +7 -4
- package/omni/with-schemas/index.js +7 -4
- package/package.json +38 -2
- package/persisters/persister-durable-object-sql-storage/index.js +13 -11
- package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
- package/persisters/persister-partykit-client/index.js +2 -1
- package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
- package/persisters/persister-partykit-server/index.js +2 -1
- package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
- package/queries/index.js +1 -1
- package/queries/with-schemas/index.js +1 -1
- package/readme.md +18 -14
- package/releases.md +91 -58
- package/synchronizers/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-local/index.js +3 -2
- package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
- package/synchronizers/with-schemas/index.js +3 -2
- package/ui-react-dom/index.js +10 -7
- package/ui-react-dom/with-schemas/index.js +10 -7
- package/ui-react-dom-charts/index.js +1229 -0
- package/ui-react-dom-charts/with-schemas/index.js +1229 -0
- package/ui-react-inspector/index.js +13 -9
- package/ui-react-inspector/with-schemas/index.js +13 -9
- package/ui-solid-dom/index.js +10 -7
- package/ui-solid-dom/with-schemas/index.js +10 -7
- package/ui-solid-inspector/index.js +13 -9
- package/ui-solid-inspector/with-schemas/index.js +13 -9
- package/ui-svelte-dom/index.js +11 -8
- package/ui-svelte-dom/with-schemas/index.js +11 -8
- package/ui-svelte-inspector/index.js +17 -13
- package/ui-svelte-inspector/with-schemas/index.js +17 -13
- 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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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
|
-
* 
|
|
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;
|