reflex-silverpoint-react 0.1.0__tar.gz → 0.2.0__tar.gz
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.
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/PKG-INFO +67 -9
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/README.md +65 -7
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/__init__.py +22 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/base.py +12 -6
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/base.pyi +82 -78
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/catalog.py +12 -2
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/charts.pyi +934 -866
- reflex_silverpoint_react-0.2.0/custom_components/reflex_silverpoint_react/dashboard.py +240 -0
- reflex_silverpoint_react-0.2.0/custom_components/reflex_silverpoint_react/dashboard.pyi +314 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react.egg-info/PKG-INFO +67 -9
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react.egg-info/SOURCES.txt +2 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/pyproject.toml +2 -2
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/tests/test_components.py +57 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/LICENSE +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/charts.py +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react/helpers.py +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react.egg-info/dependency_links.txt +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react.egg-info/requires.txt +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/custom_components/reflex_silverpoint_react.egg-info/top_level.txt +0 -0
- {reflex_silverpoint_react-0.1.0 → reflex_silverpoint_react-0.2.0}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reflex-silverpoint-react
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The 33 silverpoint charts (Renaissance silverpoint drawing style) for Reflex, wrapping @silverpoint/react
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: The 33 silverpoint charts and the linked Dashboard (Renaissance silverpoint drawing style) for Reflex, wrapping @silverpoint/react
|
|
5
5
|
Author-email: Ernesto Crespo <ecrespo@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/ecrespo/reflex-silverpoint-react
|
|
@@ -33,9 +33,17 @@ prepared ground, tone built from hatching, and white heightening on the live val
|
|
|
33
33
|
The hand-drawn irregularity lives only in the ornament. The data geometry is exact, and every chart
|
|
34
34
|
has a `precision` mode that turns the inking off.
|
|
35
35
|
|
|
36
|
-
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.
|
|
37
|
-
**all 33 charts**, the
|
|
38
|
-
|
|
36
|
+
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.2.0 and exposes
|
|
37
|
+
**all 33 charts**, the **`Dashboard`** (a laid-out, linkable grid of charts), the
|
|
38
|
+
`SilverpointProvider`, both grounds (`silverpoint` and `cyanotype`), the interaction events, custom
|
|
39
|
+
readouts and the imperative handle (SVG export and geometry) as Python.
|
|
40
|
+
|
|
41
|
+
### New in 0.2
|
|
42
|
+
|
|
43
|
+
- **`dashboard`**, **`dashboard_cell`** and **`dashboard_link`**: a titled grid of cards laid out from
|
|
44
|
+
a data-only layout, charts sized to their cells, and charts linked on a datum field.
|
|
45
|
+
- **The `cyanotype` ground**: a white line on Prussian blue. Tone is the weight of an exact line, so
|
|
46
|
+
nothing is hatched. Use `ground="cyanotype"` on a chart, the provider or a dashboard.
|
|
39
47
|
|
|
40
48
|

|
|
41
49
|
|
|
@@ -107,8 +115,8 @@ its own props (`COMMON_PROPS` holds the shared ones), handy for galleries and do
|
|
|
107
115
|
|
|
108
116
|
| Prop | Default | |
|
|
109
117
|
|---|---|---|
|
|
110
|
-
| `data` | demo dataset | The rows to draw: a list of dicts. |
|
|
111
|
-
| `ground` / `substrate` / `mode` | `"silverpoint"` / `"cream"` / `"ink"` | Style.
|
|
118
|
+
| `data` | demo dataset | The rows to draw: a list of dicts. Without it, the accessor props (`*_key`, `keys`, `names`) are ignored. |
|
|
119
|
+
| `ground` / `substrate` / `mode` | `"silverpoint"` / `"cream"` / `"ink"` | Style. Grounds: `silverpoint` and `cyanotype`. The `silverpoint` substrates are `cream`, `green`, `blue` and `ochre`; `cyanotype` has one, `prussian`, whatever substrate a chart names. `mode="precision"` turns the inking off. |
|
|
112
120
|
| `seed`, `id` | derived, stable | The hand drawing is deterministic: same props, same strokes. |
|
|
113
121
|
| `height`, `width` | `160`, container width | Size of the drawing area in px. |
|
|
114
122
|
| `chrome` | `"card"` | `"bare"` draws only the plot. |
|
|
@@ -136,6 +144,54 @@ silverpoint_provider(
|
|
|
136
144
|
A prop on a chart always wins over the provider. The provider's props can be state vars, so one
|
|
137
145
|
select can re-ground a whole dashboard.
|
|
138
146
|
|
|
147
|
+
## Dashboards
|
|
148
|
+
|
|
149
|
+
`dashboard` lays charts out in a titled grid. The layout is plain data: the number of columns, each
|
|
150
|
+
cell's column and row spans (per breakpoint if you like), the row height and the gap. The
|
|
151
|
+
breakpoints are the dashboard's own width: `sm` below 640 px, `md` up to 1024 px, and `lg` above.
|
|
152
|
+
The defaults are 1, 2 and 4 columns. Each chart is sized to its cell, and `ground`, `substrate`,
|
|
153
|
+
`mode` and `locale` pass to every chart inside.
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from reflex_silverpoint_react import (
|
|
157
|
+
bar_chart,
|
|
158
|
+
dashboard,
|
|
159
|
+
dashboard_cell,
|
|
160
|
+
dashboard_cell_layout,
|
|
161
|
+
dashboard_layout,
|
|
162
|
+
kpi_card,
|
|
163
|
+
line_chart,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
dashboard(
|
|
167
|
+
dashboard_cell(kpi_card(title="Revenue", metric="thousands", delta=6.4), cell="revenue"),
|
|
168
|
+
dashboard_cell(line_chart(data=State.ops, x_key="hour", value_key="hits", title="Traffic"), cell="traffic"),
|
|
169
|
+
dashboard_cell(bar_chart(data=State.ops, x_key="hour", value_key="errors", title="Errors"), cell="errors"),
|
|
170
|
+
id="ops", # required
|
|
171
|
+
title="Operations", # or label=... for no visible heading
|
|
172
|
+
description="Service health over the last day.",
|
|
173
|
+
layout=dashboard_layout(
|
|
174
|
+
["revenue", dashboard_cell_layout("traffic", col_span={"md": 2, "lg": 3}, row_span=2), "errors"],
|
|
175
|
+
columns={"sm": 1, "md": 2, "lg": 4},
|
|
176
|
+
row_height=240,
|
|
177
|
+
gap=16,
|
|
178
|
+
),
|
|
179
|
+
link="hour", # link the charts on the rows' "hour" field
|
|
180
|
+
on_link_change=State.on_link, # {"key": "hour", "value": "18"}, or None when it clears
|
|
181
|
+
)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- `dashboard_cell(chart, cell="id")` puts a chart in a named layout cell. Children without one follow
|
|
185
|
+
the named cells, in source order, with span 1.
|
|
186
|
+
- With `link`, pointing at or focusing an item in one chart marks every item in the other charts
|
|
187
|
+
that has the same value in that field. `dashboard_link(..., link="hour")` does the same for charts
|
|
188
|
+
you lay out yourself, outside a dashboard grid.
|
|
189
|
+
- `heading_level` (2-6) sets the title's heading level. `ssr_width` is the width the grid is laid
|
|
190
|
+
out for before the browser measures it.
|
|
191
|
+
- `dashboard_layout` and `dashboard_cell_layout` write the camelCase keys the component reads. You
|
|
192
|
+
can also pass a plain dict.
|
|
193
|
+
- The layout values and the charts' props can be state vars.
|
|
194
|
+
|
|
139
195
|
## Interaction
|
|
140
196
|
|
|
141
197
|
```python
|
|
@@ -205,8 +261,10 @@ uv run reflex run
|
|
|
205
261
|
Pages: **Start** (quickstart, provider, ink vs precision), **Gallery** (the 33 charts, ground
|
|
206
262
|
controls, demo datasets vs data from Python state with a re-roll), **Playground** (one chart, every
|
|
207
263
|
rendering choice and the Python that reproduces it), **Interaction** (events, custom readout, a
|
|
208
|
-
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export)
|
|
209
|
-
|
|
264
|
+
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export), **Dashboard** (a
|
|
265
|
+
linked operations dashboard fed from Python state with ground, substrate, mode and column controls, a
|
|
266
|
+
KPI strip, and `dashboard_link` on its own) and one **reference page per chart** (`/chart/<slug>`)
|
|
267
|
+
with its props. The Gallery and Playground also get a ground control, for `cyanotype`.
|
|
210
268
|
|
|
211
269
|

|
|
212
270
|
|
|
@@ -7,9 +7,17 @@ prepared ground, tone built from hatching, and white heightening on the live val
|
|
|
7
7
|
The hand-drawn irregularity lives only in the ornament. The data geometry is exact, and every chart
|
|
8
8
|
has a `precision` mode that turns the inking off.
|
|
9
9
|
|
|
10
|
-
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.
|
|
11
|
-
**all 33 charts**, the
|
|
12
|
-
|
|
10
|
+
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.2.0 and exposes
|
|
11
|
+
**all 33 charts**, the **`Dashboard`** (a laid-out, linkable grid of charts), the
|
|
12
|
+
`SilverpointProvider`, both grounds (`silverpoint` and `cyanotype`), the interaction events, custom
|
|
13
|
+
readouts and the imperative handle (SVG export and geometry) as Python.
|
|
14
|
+
|
|
15
|
+
### New in 0.2
|
|
16
|
+
|
|
17
|
+
- **`dashboard`**, **`dashboard_cell`** and **`dashboard_link`**: a titled grid of cards laid out from
|
|
18
|
+
a data-only layout, charts sized to their cells, and charts linked on a datum field.
|
|
19
|
+
- **The `cyanotype` ground**: a white line on Prussian blue. Tone is the weight of an exact line, so
|
|
20
|
+
nothing is hatched. Use `ground="cyanotype"` on a chart, the provider or a dashboard.
|
|
13
21
|
|
|
14
22
|

|
|
15
23
|
|
|
@@ -81,8 +89,8 @@ its own props (`COMMON_PROPS` holds the shared ones), handy for galleries and do
|
|
|
81
89
|
|
|
82
90
|
| Prop | Default | |
|
|
83
91
|
|---|---|---|
|
|
84
|
-
| `data` | demo dataset | The rows to draw: a list of dicts. |
|
|
85
|
-
| `ground` / `substrate` / `mode` | `"silverpoint"` / `"cream"` / `"ink"` | Style.
|
|
92
|
+
| `data` | demo dataset | The rows to draw: a list of dicts. Without it, the accessor props (`*_key`, `keys`, `names`) are ignored. |
|
|
93
|
+
| `ground` / `substrate` / `mode` | `"silverpoint"` / `"cream"` / `"ink"` | Style. Grounds: `silverpoint` and `cyanotype`. The `silverpoint` substrates are `cream`, `green`, `blue` and `ochre`; `cyanotype` has one, `prussian`, whatever substrate a chart names. `mode="precision"` turns the inking off. |
|
|
86
94
|
| `seed`, `id` | derived, stable | The hand drawing is deterministic: same props, same strokes. |
|
|
87
95
|
| `height`, `width` | `160`, container width | Size of the drawing area in px. |
|
|
88
96
|
| `chrome` | `"card"` | `"bare"` draws only the plot. |
|
|
@@ -110,6 +118,54 @@ silverpoint_provider(
|
|
|
110
118
|
A prop on a chart always wins over the provider. The provider's props can be state vars, so one
|
|
111
119
|
select can re-ground a whole dashboard.
|
|
112
120
|
|
|
121
|
+
## Dashboards
|
|
122
|
+
|
|
123
|
+
`dashboard` lays charts out in a titled grid. The layout is plain data: the number of columns, each
|
|
124
|
+
cell's column and row spans (per breakpoint if you like), the row height and the gap. The
|
|
125
|
+
breakpoints are the dashboard's own width: `sm` below 640 px, `md` up to 1024 px, and `lg` above.
|
|
126
|
+
The defaults are 1, 2 and 4 columns. Each chart is sized to its cell, and `ground`, `substrate`,
|
|
127
|
+
`mode` and `locale` pass to every chart inside.
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from reflex_silverpoint_react import (
|
|
131
|
+
bar_chart,
|
|
132
|
+
dashboard,
|
|
133
|
+
dashboard_cell,
|
|
134
|
+
dashboard_cell_layout,
|
|
135
|
+
dashboard_layout,
|
|
136
|
+
kpi_card,
|
|
137
|
+
line_chart,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
dashboard(
|
|
141
|
+
dashboard_cell(kpi_card(title="Revenue", metric="thousands", delta=6.4), cell="revenue"),
|
|
142
|
+
dashboard_cell(line_chart(data=State.ops, x_key="hour", value_key="hits", title="Traffic"), cell="traffic"),
|
|
143
|
+
dashboard_cell(bar_chart(data=State.ops, x_key="hour", value_key="errors", title="Errors"), cell="errors"),
|
|
144
|
+
id="ops", # required
|
|
145
|
+
title="Operations", # or label=... for no visible heading
|
|
146
|
+
description="Service health over the last day.",
|
|
147
|
+
layout=dashboard_layout(
|
|
148
|
+
["revenue", dashboard_cell_layout("traffic", col_span={"md": 2, "lg": 3}, row_span=2), "errors"],
|
|
149
|
+
columns={"sm": 1, "md": 2, "lg": 4},
|
|
150
|
+
row_height=240,
|
|
151
|
+
gap=16,
|
|
152
|
+
),
|
|
153
|
+
link="hour", # link the charts on the rows' "hour" field
|
|
154
|
+
on_link_change=State.on_link, # {"key": "hour", "value": "18"}, or None when it clears
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
- `dashboard_cell(chart, cell="id")` puts a chart in a named layout cell. Children without one follow
|
|
159
|
+
the named cells, in source order, with span 1.
|
|
160
|
+
- With `link`, pointing at or focusing an item in one chart marks every item in the other charts
|
|
161
|
+
that has the same value in that field. `dashboard_link(..., link="hour")` does the same for charts
|
|
162
|
+
you lay out yourself, outside a dashboard grid.
|
|
163
|
+
- `heading_level` (2-6) sets the title's heading level. `ssr_width` is the width the grid is laid
|
|
164
|
+
out for before the browser measures it.
|
|
165
|
+
- `dashboard_layout` and `dashboard_cell_layout` write the camelCase keys the component reads. You
|
|
166
|
+
can also pass a plain dict.
|
|
167
|
+
- The layout values and the charts' props can be state vars.
|
|
168
|
+
|
|
113
169
|
## Interaction
|
|
114
170
|
|
|
115
171
|
```python
|
|
@@ -179,8 +235,10 @@ uv run reflex run
|
|
|
179
235
|
Pages: **Start** (quickstart, provider, ink vs precision), **Gallery** (the 33 charts, ground
|
|
180
236
|
controls, demo datasets vs data from Python state with a re-roll), **Playground** (one chart, every
|
|
181
237
|
rendering choice and the Python that reproduces it), **Interaction** (events, custom readout, a
|
|
182
|
-
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export)
|
|
183
|
-
|
|
238
|
+
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export), **Dashboard** (a
|
|
239
|
+
linked operations dashboard fed from Python state with ground, substrate, mode and column controls, a
|
|
240
|
+
KPI strip, and `dashboard_link` on its own) and one **reference page per chart** (`/chart/<slug>`)
|
|
241
|
+
with its props. The Gallery and Playground also get a ground control, for `cyanotype`.
|
|
184
242
|
|
|
185
243
|

|
|
186
244
|
|
|
@@ -7,6 +7,7 @@ from .base import (
|
|
|
7
7
|
SILVERPOINT_LIBRARY,
|
|
8
8
|
SILVERPOINT_STYLESHEETS,
|
|
9
9
|
SILVERPOINT_VERSION,
|
|
10
|
+
GroundName,
|
|
10
11
|
SilverpointChart,
|
|
11
12
|
SilverpointProvider,
|
|
12
13
|
silverpoint_provider,
|
|
@@ -80,11 +81,23 @@ from .charts import (
|
|
|
80
81
|
waterfall_chart,
|
|
81
82
|
wind_rose,
|
|
82
83
|
)
|
|
84
|
+
from .dashboard import (
|
|
85
|
+
DASHBOARD_DEFAULTS,
|
|
86
|
+
Dashboard,
|
|
87
|
+
DashboardCell,
|
|
88
|
+
DashboardLink,
|
|
89
|
+
dashboard,
|
|
90
|
+
dashboard_cell,
|
|
91
|
+
dashboard_cell_layout,
|
|
92
|
+
dashboard_layout,
|
|
93
|
+
dashboard_link,
|
|
94
|
+
)
|
|
83
95
|
from .helpers import chart_ref, download_svg, get_geometry, get_svg, tooltip_template
|
|
84
96
|
|
|
85
97
|
__all__ = [
|
|
86
98
|
"CHARTS",
|
|
87
99
|
"COMMON_PROPS",
|
|
100
|
+
"DASHBOARD_DEFAULTS",
|
|
88
101
|
"FAMILIES",
|
|
89
102
|
"SILVERPOINT_LIBRARY",
|
|
90
103
|
"SILVERPOINT_STYLESHEETS",
|
|
@@ -99,9 +112,13 @@ __all__ = [
|
|
|
99
112
|
"ChordRing",
|
|
100
113
|
"ComposedChart",
|
|
101
114
|
"CoxcombChart",
|
|
115
|
+
"Dashboard",
|
|
116
|
+
"DashboardCell",
|
|
117
|
+
"DashboardLink",
|
|
102
118
|
"DonutChart",
|
|
103
119
|
"FunnelChart",
|
|
104
120
|
"GaugeArc",
|
|
121
|
+
"GroundName",
|
|
105
122
|
"HeatmapChart",
|
|
106
123
|
"KpiCard",
|
|
107
124
|
"LineChart",
|
|
@@ -138,6 +155,11 @@ __all__ = [
|
|
|
138
155
|
"chord_ring",
|
|
139
156
|
"composed_chart",
|
|
140
157
|
"coxcomb_chart",
|
|
158
|
+
"dashboard",
|
|
159
|
+
"dashboard_cell",
|
|
160
|
+
"dashboard_cell_layout",
|
|
161
|
+
"dashboard_layout",
|
|
162
|
+
"dashboard_link",
|
|
141
163
|
"donut_chart",
|
|
142
164
|
"download_svg",
|
|
143
165
|
"funnel_chart",
|
|
@@ -5,7 +5,7 @@ on a prepared ground, tone built from hatching, and white heightening on the liv
|
|
|
5
5
|
irregularity lives only in the ornament; the data geometry is exact, and every chart has a
|
|
6
6
|
``precision`` mode that switches the inking off.
|
|
7
7
|
|
|
8
|
-
The npm side is ``@silverpoint/react`` (client components), ``@silverpoint/grounds`` (the
|
|
8
|
+
The npm side is ``@silverpoint/react`` (client components, and since 0.2 the ``Dashboard`` grid), ``@silverpoint/grounds`` (the
|
|
9
9
|
stylesheet that colours the strokes, required) and ``@silverpoint/fonts`` (self-hosted
|
|
10
10
|
EB Garamond). Both stylesheets are imported once by any page that renders a chart.
|
|
11
11
|
"""
|
|
@@ -15,7 +15,7 @@ from typing import Any, Literal
|
|
|
15
15
|
import reflex as rx
|
|
16
16
|
|
|
17
17
|
#: The silverpoint npm release these wrappers are written against.
|
|
18
|
-
SILVERPOINT_VERSION = "0.
|
|
18
|
+
SILVERPOINT_VERSION = "0.2.0"
|
|
19
19
|
|
|
20
20
|
#: The npm package every chart is imported from (the barrel; it is side-effect free, so the
|
|
21
21
|
#: bundler keeps only the charts a page uses).
|
|
@@ -27,6 +27,12 @@ SILVERPOINT_STYLESHEETS = (
|
|
|
27
27
|
"@silverpoint/grounds/styles.css",
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
+
#: The grounds ``@silverpoint/grounds`` registers by default. ``silverpoint`` builds tone by
|
|
31
|
+
#: hatching; ``cyanotype`` (new in 0.2) by the weight of an exact white line on Prussian blue.
|
|
32
|
+
GroundName = Literal["silverpoint", "cyanotype"]
|
|
33
|
+
|
|
34
|
+
#: The ``silverpoint`` ground's substrates. ``cyanotype`` has one substrate (``prussian``) and
|
|
35
|
+
#: prints on it whatever substrate a chart names.
|
|
30
36
|
Substrate = Literal["cream", "green", "blue", "ochre"]
|
|
31
37
|
InkMode = Literal["ink", "precision"]
|
|
32
38
|
Chrome = Literal["card", "bare"]
|
|
@@ -88,8 +94,8 @@ class SilverpointChart(_SilverpointBase):
|
|
|
88
94
|
# Rows to draw. If omitted, the chart renders its own demo dataset.
|
|
89
95
|
data: rx.Var[list[dict[str, Any]]]
|
|
90
96
|
|
|
91
|
-
# Style ground, by name (``"silverpoint"``) or as a complete ground object.
|
|
92
|
-
ground: rx.Var[str | dict[str, Any]]
|
|
97
|
+
# Style ground, by name (``"silverpoint"`` or ``"cyanotype"``) or as a complete ground object.
|
|
98
|
+
ground: rx.Var[GroundName | str | dict[str, Any]]
|
|
93
99
|
|
|
94
100
|
# Prepared substrate within the ground: cream (default), green, blue or ochre.
|
|
95
101
|
substrate: rx.Var[Substrate]
|
|
@@ -164,8 +170,8 @@ class SilverpointProvider(_SilverpointBase):
|
|
|
164
170
|
|
|
165
171
|
tag = "SilverpointProvider"
|
|
166
172
|
|
|
167
|
-
# Style ground for every chart below.
|
|
168
|
-
ground: rx.Var[str | dict[str, Any]]
|
|
173
|
+
# Style ground for every chart below: ``"silverpoint"``, ``"cyanotype"`` or a ground object.
|
|
174
|
+
ground: rx.Var[GroundName | str | dict[str, Any]]
|
|
169
175
|
|
|
170
176
|
# Substrate for every chart below.
|
|
171
177
|
substrate: rx.Var[Substrate]
|
|
@@ -4,23 +4,25 @@
|
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
from collections.abc import Mapping, Sequence
|
|
7
|
-
from typing import Any, Literal,
|
|
8
|
-
|
|
7
|
+
from typing import Any, Literal, TypeAlias
|
|
8
|
+
|
|
9
|
+
import reflex as rx
|
|
9
10
|
from reflex_base.event import (
|
|
10
11
|
EventType,
|
|
11
12
|
PointerEventInfo,
|
|
12
13
|
)
|
|
13
14
|
from reflex_base.vars.base import Var
|
|
14
|
-
|
|
15
|
+
from reflex_components_core.core.breakpoints import Breakpoints
|
|
15
16
|
|
|
16
|
-
SILVERPOINT_VERSION = "0.
|
|
17
|
-
SILVERPOINT_LIBRARY =
|
|
17
|
+
SILVERPOINT_VERSION = "0.2.0"
|
|
18
|
+
SILVERPOINT_LIBRARY = ...
|
|
18
19
|
SILVERPOINT_STYLESHEETS = ("@silverpoint/fonts/fonts.css", "@silverpoint/grounds/styles.css")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
GroundName: TypeAlias = Literal["silverpoint", "cyanotype"]
|
|
21
|
+
Substrate: TypeAlias = Literal["cream", "green", "blue", "ochre"]
|
|
22
|
+
InkMode: TypeAlias = Literal["ink", "precision"]
|
|
23
|
+
Chrome: TypeAlias = Literal["card", "bare"]
|
|
24
|
+
HatchFill: TypeAlias = Literal["tile", "per-shape"]
|
|
25
|
+
DataTable: TypeAlias = Literal["visible", "hidden", "none"]
|
|
24
26
|
|
|
25
27
|
class _SilverpointBase(rx.Component):
|
|
26
28
|
def add_imports(self) -> dict[str, list[str]]: ...
|
|
@@ -34,24 +36,24 @@ class _SilverpointBase(rx.Component):
|
|
|
34
36
|
ref: Var | None = None,
|
|
35
37
|
class_name: Any | None = None,
|
|
36
38
|
custom_attrs: dict[str, Any | Var] | None = None,
|
|
37
|
-
on_blur:
|
|
38
|
-
on_click:
|
|
39
|
-
on_context_menu:
|
|
40
|
-
on_double_click:
|
|
41
|
-
on_focus:
|
|
42
|
-
on_mount:
|
|
43
|
-
on_mouse_down:
|
|
44
|
-
on_mouse_enter:
|
|
45
|
-
on_mouse_leave:
|
|
46
|
-
on_mouse_move:
|
|
47
|
-
on_mouse_out:
|
|
48
|
-
on_mouse_over:
|
|
49
|
-
on_mouse_up:
|
|
50
|
-
on_scroll:
|
|
51
|
-
on_scroll_end:
|
|
52
|
-
on_unmount:
|
|
39
|
+
on_blur: EventType[()] | None = None,
|
|
40
|
+
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
41
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
42
|
+
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
43
|
+
on_focus: EventType[()] | None = None,
|
|
44
|
+
on_mount: EventType[()] | None = None,
|
|
45
|
+
on_mouse_down: EventType[()] | None = None,
|
|
46
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
47
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
48
|
+
on_mouse_move: EventType[()] | None = None,
|
|
49
|
+
on_mouse_out: EventType[()] | None = None,
|
|
50
|
+
on_mouse_over: EventType[()] | None = None,
|
|
51
|
+
on_mouse_up: EventType[()] | None = None,
|
|
52
|
+
on_scroll: EventType[()] | None = None,
|
|
53
|
+
on_scroll_end: EventType[()] | None = None,
|
|
54
|
+
on_unmount: EventType[()] | None = None,
|
|
53
55
|
**props,
|
|
54
|
-
) ->
|
|
56
|
+
) -> _SilverpointBase:
|
|
55
57
|
"""Create the component.
|
|
56
58
|
|
|
57
59
|
Args:
|
|
@@ -81,9 +83,7 @@ class _SilverpointBase(rx.Component):
|
|
|
81
83
|
**props: The props of the component.
|
|
82
84
|
|
|
83
85
|
Returns:
|
|
84
|
-
The component.
|
|
85
|
-
"""
|
|
86
|
-
...
|
|
86
|
+
The component."""
|
|
87
87
|
|
|
88
88
|
class SilverpointChart(_SilverpointBase):
|
|
89
89
|
@classmethod
|
|
@@ -91,19 +91,23 @@ class SilverpointChart(_SilverpointBase):
|
|
|
91
91
|
cls,
|
|
92
92
|
*children,
|
|
93
93
|
data: Var[list[dict[str, Any]]] | list[dict[str, Any]] | None = None,
|
|
94
|
-
ground:
|
|
94
|
+
ground: Literal["cyanotype", "silverpoint"]
|
|
95
|
+
| Var[Literal["cyanotype", "silverpoint"] | dict[str, Any] | str]
|
|
96
|
+
| dict[str, Any]
|
|
97
|
+
| str
|
|
98
|
+
| None = None,
|
|
95
99
|
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
96
100
|
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
97
101
|
| None = None,
|
|
98
102
|
mode: Literal["ink", "precision"] | Var[Literal["ink", "precision"]] | None = None,
|
|
99
103
|
seed: Var[int | str] | int | str | None = None,
|
|
100
|
-
height: Var[float | int] | float |
|
|
101
|
-
width: Var[float | int] | float |
|
|
104
|
+
height: Var[float | int] | float | None = None,
|
|
105
|
+
width: Var[float | int] | float | None = None,
|
|
102
106
|
chrome: Literal["bare", "card"] | Var[Literal["bare", "card"]] | None = None,
|
|
103
107
|
hatch_fill: Literal["per-shape", "tile"] | Var[Literal["per-shape", "tile"]] | None = None,
|
|
104
108
|
title: Var[str] | str | None = None,
|
|
105
109
|
badge: Var[str] | str | None = None,
|
|
106
|
-
value: Var[float | int | str] | float |
|
|
110
|
+
value: Var[float | int | str] | float | str | None = None,
|
|
107
111
|
unit: Var[str] | str | None = None,
|
|
108
112
|
footer_left: Var[str] | str | None = None,
|
|
109
113
|
footer_right: Var[str] | str | None = None,
|
|
@@ -119,26 +123,26 @@ class SilverpointChart(_SilverpointBase):
|
|
|
119
123
|
ref: Var | None = None,
|
|
120
124
|
class_name: Any | None = None,
|
|
121
125
|
custom_attrs: dict[str, Any | Var] | None = None,
|
|
122
|
-
on_active_change:
|
|
123
|
-
on_blur:
|
|
124
|
-
on_click:
|
|
125
|
-
on_context_menu:
|
|
126
|
-
on_double_click:
|
|
127
|
-
on_focus:
|
|
128
|
-
on_mount:
|
|
129
|
-
on_mouse_down:
|
|
130
|
-
on_mouse_enter:
|
|
131
|
-
on_mouse_leave:
|
|
132
|
-
on_mouse_move:
|
|
133
|
-
on_mouse_out:
|
|
134
|
-
on_mouse_over:
|
|
135
|
-
on_mouse_up:
|
|
136
|
-
on_scroll:
|
|
137
|
-
on_scroll_end:
|
|
138
|
-
on_select:
|
|
139
|
-
on_unmount:
|
|
126
|
+
on_active_change: EventType[Any] | None = None,
|
|
127
|
+
on_blur: EventType[()] | None = None,
|
|
128
|
+
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
129
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
130
|
+
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
131
|
+
on_focus: EventType[()] | None = None,
|
|
132
|
+
on_mount: EventType[()] | None = None,
|
|
133
|
+
on_mouse_down: EventType[()] | None = None,
|
|
134
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
135
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
136
|
+
on_mouse_move: EventType[()] | None = None,
|
|
137
|
+
on_mouse_out: EventType[()] | None = None,
|
|
138
|
+
on_mouse_over: EventType[()] | None = None,
|
|
139
|
+
on_mouse_up: EventType[()] | None = None,
|
|
140
|
+
on_scroll: EventType[()] | None = None,
|
|
141
|
+
on_scroll_end: EventType[()] | None = None,
|
|
142
|
+
on_select: EventType[Any] | None = None,
|
|
143
|
+
on_unmount: EventType[()] | None = None,
|
|
140
144
|
**props,
|
|
141
|
-
) ->
|
|
145
|
+
) -> SilverpointChart:
|
|
142
146
|
"""Create the component.
|
|
143
147
|
|
|
144
148
|
Args:
|
|
@@ -191,16 +195,18 @@ class SilverpointChart(_SilverpointBase):
|
|
|
191
195
|
**props: The props of the component.
|
|
192
196
|
|
|
193
197
|
Returns:
|
|
194
|
-
The component.
|
|
195
|
-
"""
|
|
196
|
-
...
|
|
198
|
+
The component."""
|
|
197
199
|
|
|
198
200
|
class SilverpointProvider(_SilverpointBase):
|
|
199
201
|
@classmethod
|
|
200
202
|
def create(
|
|
201
203
|
cls,
|
|
202
204
|
*children,
|
|
203
|
-
ground:
|
|
205
|
+
ground: Literal["cyanotype", "silverpoint"]
|
|
206
|
+
| Var[Literal["cyanotype", "silverpoint"] | dict[str, Any] | str]
|
|
207
|
+
| dict[str, Any]
|
|
208
|
+
| str
|
|
209
|
+
| None = None,
|
|
204
210
|
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
205
211
|
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
206
212
|
| None = None,
|
|
@@ -212,29 +218,29 @@ class SilverpointProvider(_SilverpointBase):
|
|
|
212
218
|
ref: Var | None = None,
|
|
213
219
|
class_name: Any | None = None,
|
|
214
220
|
custom_attrs: dict[str, Any | Var] | None = None,
|
|
215
|
-
on_blur:
|
|
216
|
-
on_click:
|
|
217
|
-
on_context_menu:
|
|
218
|
-
on_double_click:
|
|
219
|
-
on_focus:
|
|
220
|
-
on_mount:
|
|
221
|
-
on_mouse_down:
|
|
222
|
-
on_mouse_enter:
|
|
223
|
-
on_mouse_leave:
|
|
224
|
-
on_mouse_move:
|
|
225
|
-
on_mouse_out:
|
|
226
|
-
on_mouse_over:
|
|
227
|
-
on_mouse_up:
|
|
228
|
-
on_scroll:
|
|
229
|
-
on_scroll_end:
|
|
230
|
-
on_unmount:
|
|
221
|
+
on_blur: EventType[()] | None = None,
|
|
222
|
+
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
223
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
224
|
+
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
225
|
+
on_focus: EventType[()] | None = None,
|
|
226
|
+
on_mount: EventType[()] | None = None,
|
|
227
|
+
on_mouse_down: EventType[()] | None = None,
|
|
228
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
229
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
230
|
+
on_mouse_move: EventType[()] | None = None,
|
|
231
|
+
on_mouse_out: EventType[()] | None = None,
|
|
232
|
+
on_mouse_over: EventType[()] | None = None,
|
|
233
|
+
on_mouse_up: EventType[()] | None = None,
|
|
234
|
+
on_scroll: EventType[()] | None = None,
|
|
235
|
+
on_scroll_end: EventType[()] | None = None,
|
|
236
|
+
on_unmount: EventType[()] | None = None,
|
|
231
237
|
**props,
|
|
232
|
-
) ->
|
|
238
|
+
) -> SilverpointProvider:
|
|
233
239
|
"""Create the component.
|
|
234
240
|
|
|
235
241
|
Args:
|
|
236
242
|
*children: The children of the component.
|
|
237
|
-
ground: Style ground for every chart below.
|
|
243
|
+
ground: Style ground for every chart below: ``"silverpoint"``, ``"cyanotype"`` or a ground object.
|
|
238
244
|
substrate: Substrate for every chart below.
|
|
239
245
|
mode: Inking mode for every chart below.
|
|
240
246
|
locale: Locale for every chart below.
|
|
@@ -263,8 +269,6 @@ class SilverpointProvider(_SilverpointBase):
|
|
|
263
269
|
**props: The props of the component.
|
|
264
270
|
|
|
265
271
|
Returns:
|
|
266
|
-
The component.
|
|
267
|
-
"""
|
|
268
|
-
...
|
|
272
|
+
The component."""
|
|
269
273
|
|
|
270
274
|
silverpoint_provider = SilverpointProvider.create
|
|
@@ -45,8 +45,18 @@ class ChartInfo:
|
|
|
45
45
|
|
|
46
46
|
#: Props every chart takes.
|
|
47
47
|
COMMON_PROPS: tuple[PropDoc, ...] = (
|
|
48
|
-
PropDoc(
|
|
49
|
-
|
|
48
|
+
PropDoc(
|
|
49
|
+
"data",
|
|
50
|
+
"data",
|
|
51
|
+
"readonly Datum[]",
|
|
52
|
+
"Rows to draw. If omitted, the demo dataset is rendered (REQ-093) and the accessor props (`…_key`, `keys`, `names`) are ignored.",
|
|
53
|
+
),
|
|
54
|
+
PropDoc(
|
|
55
|
+
"ground",
|
|
56
|
+
"ground",
|
|
57
|
+
"GroundRef",
|
|
58
|
+
"Style ground: `silverpoint` or `cyanotype`, or a ground object. Defaults to the app provider's, or `silverpoint`.",
|
|
59
|
+
),
|
|
50
60
|
PropDoc("substrate", "substrate", "SubstrateName", "Prepared substrate within the ground (REQ-046)."),
|
|
51
61
|
PropDoc("mode", "mode", "InkMode", "`ink` by default; `precision` disables inking (REQ-021)."),
|
|
52
62
|
PropDoc("seed", "seed", "Seed", "Seed. If omitted, it is derived from `id` stably (REQ-003)."),
|