reflex-silverpoint-react 0.2.0__tar.gz → 0.3.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.2.0 → reflex_silverpoint_react-0.3.0}/PKG-INFO +107 -10
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/README.md +104 -7
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/__init__.py +103 -2
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/base.py +8 -7
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/base.pyi +6 -6
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/charts.pyi +66 -66
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/dashboard.pyi +2 -2
- reflex_silverpoint_react-0.3.0/custom_components/reflex_silverpoint_react/ui.py +573 -0
- reflex_silverpoint_react-0.3.0/custom_components/reflex_silverpoint_react/ui.pyi +1687 -0
- reflex_silverpoint_react-0.3.0/custom_components/reflex_silverpoint_react/ui_catalog.py +330 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react.egg-info/PKG-INFO +107 -10
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react.egg-info/SOURCES.txt +3 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/pyproject.toml +3 -3
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/tests/test_components.py +91 -3
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/LICENSE +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/catalog.py +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/charts.py +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/dashboard.py +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react/helpers.py +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react.egg-info/dependency_links.txt +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react.egg-info/requires.txt +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/custom_components/reflex_silverpoint_react.egg-info/top_level.txt +0 -0
- {reflex_silverpoint_react-0.2.0 → reflex_silverpoint_react-0.3.0}/setup.cfg +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reflex-silverpoint-react
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The 33 silverpoint charts
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: The 33 silverpoint charts, the linked Dashboard and the 17 UI components (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
|
|
8
8
|
Project-URL: Source, https://github.com/ecrespo/reflex-silverpoint-react
|
|
9
9
|
Project-URL: Issues, https://github.com/ecrespo/reflex-silverpoint-react/issues
|
|
10
10
|
Project-URL: Upstream, https://github.com/ecrespo/silverpoint
|
|
11
|
-
Keywords: reflex,reflex-custom-components,charts,silverpoint,data-visualization,svg
|
|
11
|
+
Keywords: reflex,reflex-custom-components,charts,silverpoint,data-visualization,svg,ui-components
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -33,10 +33,22 @@ 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 **`Dashboard`** (a laid-out, linkable grid of charts), the
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.3.0 and exposes
|
|
37
|
+
**all 33 charts**, the **`Dashboard`** (a laid-out, linkable grid of charts), the **17 UI
|
|
38
|
+
components** (buttons, inputs, tabs, cards, alerts…), the `SilverpointProvider`, both grounds
|
|
39
|
+
(`silverpoint` and `cyanotype`), the interaction events, custom readouts and the imperative handle
|
|
40
|
+
(SVG export and geometry) as Python.
|
|
41
|
+
|
|
42
|
+
### New in 0.3
|
|
43
|
+
|
|
44
|
+
- **17 UI components**, drawn as the charts are: `sp_button`, `sp_input`, `sp_checkbox`,
|
|
45
|
+
`sp_switch`, `sp_radio_group`, `sp_slider`, `sp_rate`, `sp_segmented`, `sp_tabs` (with
|
|
46
|
+
`sp_tab_panel`), `sp_steps`, `sp_card`, `sp_tag`, `sp_badge`, `sp_divider`, `sp_progress`,
|
|
47
|
+
`sp_alert` and `sp_skeleton`. Native controls underneath, controlled from Python. See
|
|
48
|
+
[UI components](#ui-components).
|
|
49
|
+
- `UI_COMPONENTS` and `UI_DEMOS`: the catalog's 17 components, their 45 reference states, and
|
|
50
|
+
`ui_demo(slug, state)` to render any of them.
|
|
51
|
+
- `substrate="prussian"` is accepted everywhere (the `cyanotype` ground's substrate).
|
|
40
52
|
|
|
41
53
|
### New in 0.2
|
|
42
54
|
|
|
@@ -58,7 +70,8 @@ uv add reflex-silverpoint-react
|
|
|
58
70
|
Nothing else to do on the JavaScript side: Reflex installs `@silverpoint/react`,
|
|
59
71
|
`@silverpoint/core`, `@silverpoint/grounds` and `@silverpoint/fonts`, and every chart imports the two
|
|
60
72
|
stylesheets it needs (`@silverpoint/grounds/styles.css` and the self-hosted EB Garamond of
|
|
61
|
-
`@silverpoint/fonts/fonts.css`)
|
|
73
|
+
`@silverpoint/fonts/fonts.css`); the UI components also import `@silverpoint/grounds/ui.css`. No
|
|
74
|
+
Tailwind, no CDN.
|
|
62
75
|
|
|
63
76
|
Requires Reflex 0.9.12 or later (React 19).
|
|
64
77
|
|
|
@@ -192,6 +205,88 @@ dashboard(
|
|
|
192
205
|
can also pass a plain dict.
|
|
193
206
|
- The layout values and the charts' props can be state vars.
|
|
194
207
|
|
|
208
|
+
## UI components
|
|
209
|
+
|
|
210
|
+
New in silverpoint 0.3: seventeen interface components with frames hand-drawn by each ground's own
|
|
211
|
+
inker and tone laid as hatching (`silverpoint`) or as the weight of an exact white line
|
|
212
|
+
(`cyanotype`). Each is a native control underneath (a `<button>`, an `<input>`, a `<fieldset>` of
|
|
213
|
+
radios), so forms submit natively and the keyboard follows the WAI-ARIA patterns. They are imported
|
|
214
|
+
from `@silverpoint/react/ui`.
|
|
215
|
+
|
|
216
|
+

|
|
217
|
+
|
|
218
|
+
| Group | Components |
|
|
219
|
+
|---|---|
|
|
220
|
+
| Actions | `sp_button` |
|
|
221
|
+
| Data entry | `sp_input`, `sp_checkbox`, `sp_radio_group`, `sp_switch`, `sp_slider`, `sp_rate`, `sp_segmented` |
|
|
222
|
+
| Navigation | `sp_tabs` + `sp_tab_panel`, `sp_steps` |
|
|
223
|
+
| Data display | `sp_card`, `sp_tag`, `sp_badge`, `sp_divider` |
|
|
224
|
+
| Feedback | `sp_progress`, `sp_alert`, `sp_skeleton` |
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
from reflex_silverpoint_react import sp_button, sp_input, sp_switch, sp_tab_panel, sp_tabs, ui_item
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class State(rx.State):
|
|
231
|
+
city: str = "Caracas"
|
|
232
|
+
precision: bool = False
|
|
233
|
+
view: str = "traffic"
|
|
234
|
+
|
|
235
|
+
@rx.event
|
|
236
|
+
def set_city(self, value: str): # on_change gets the value, not an event
|
|
237
|
+
self.city = value
|
|
238
|
+
|
|
239
|
+
@rx.event
|
|
240
|
+
def set_precision(self, value: bool):
|
|
241
|
+
self.precision = value
|
|
242
|
+
|
|
243
|
+
@rx.event
|
|
244
|
+
def set_view(self, value: str):
|
|
245
|
+
self.view = value
|
|
246
|
+
|
|
247
|
+
@rx.event
|
|
248
|
+
def save(self, form: dict):
|
|
249
|
+
print(form) # {"city": "Caracas", ...}: the native inputs submit under their name
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
rx.el.form(
|
|
253
|
+
sp_input(
|
|
254
|
+
label="City",
|
|
255
|
+
name="city",
|
|
256
|
+
value=State.city,
|
|
257
|
+
on_change=State.set_city,
|
|
258
|
+
invalid=State.city == "",
|
|
259
|
+
message="Required: pick a city",
|
|
260
|
+
),
|
|
261
|
+
sp_switch(label="Precision", checked=State.precision, on_change=State.set_precision),
|
|
262
|
+
sp_tabs(
|
|
263
|
+
sp_tab_panel(line_chart(...), value="traffic"),
|
|
264
|
+
sp_tab_panel(bar_chart(...), value="errors"),
|
|
265
|
+
items=[ui_item("traffic", "Traffic"), ui_item("errors", "Errors")],
|
|
266
|
+
value=State.view,
|
|
267
|
+
on_change=State.set_view,
|
|
268
|
+
),
|
|
269
|
+
sp_button("Save", type="submit", variant="primary"),
|
|
270
|
+
on_submit=State.save,
|
|
271
|
+
)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
- **Shared props**: `id`, `ground`, `substrate`, `mode`, `seed`, `size` (`sm`/`md`/`lg`) and
|
|
275
|
+
`class_name`. Like charts, they fall back to the dashboard, then to `silverpoint_provider`.
|
|
276
|
+
- **Values**: value components are controlled (`value=` / `checked=` with `on_change`) or
|
|
277
|
+
uncontrolled (`default_value=` / `default_checked=`). `on_change` receives the new value itself (a
|
|
278
|
+
string, a bool or a number), never a DOM event.
|
|
279
|
+
- **Items**: `ui_item(key, label, disabled=False)` for tabs, segmented and radio groups;
|
|
280
|
+
`step_item(key, title, description=None, status=None)` for steps.
|
|
281
|
+
- **Slots**: children are a button's or tag's text, a card's or alert's body; `sp_card` also takes
|
|
282
|
+
`extra` and `footer`, and `sp_input` takes `prefix` and `suffix` (components or text).
|
|
283
|
+
- **Close events**: `sp_tag(closable=True, on_close=...)` and `sp_alert(closable=True, on_close=...)`.
|
|
284
|
+
- `UI_COMPONENTS` is the catalog (group, declared states, props reference) and `UI_DEMOS` the 45
|
|
285
|
+
reference states upstream ships; `ui_demo("radio-group", "selected", ground="cyanotype")` renders
|
|
286
|
+
one, uncontrolled.
|
|
287
|
+
- Text inputs controlled from state make a round trip per keystroke; for long text, prefer
|
|
288
|
+
`default_value` and read the value on submit.
|
|
289
|
+
|
|
195
290
|
## Interaction
|
|
196
291
|
|
|
197
292
|
```python
|
|
@@ -263,8 +358,10 @@ controls, demo datasets vs data from Python state with a re-roll), **Playground*
|
|
|
263
358
|
rendering choice and the Python that reproduces it), **Interaction** (events, custom readout, a
|
|
264
359
|
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export), **Dashboard** (a
|
|
265
360
|
linked operations dashboard fed from Python state with ground, substrate, mode and column controls, a
|
|
266
|
-
KPI strip, and `dashboard_link` on its own)
|
|
267
|
-
with
|
|
361
|
+
KPI strip, and `dashboard_link` on its own), **UI components** (`/ui`: the components controlled from
|
|
362
|
+
Python state with a native form submit, and the three reference panels of the upstream example apps
|
|
363
|
+
in silverpoint ink, precision and cyanotype), one **reference page per chart** (`/chart/<slug>`) and
|
|
364
|
+
one per UI component (`/ui/<slug>`: every declared state on both grounds, usage and props). The Gallery and Playground also get a ground control, for `cyanotype`.
|
|
268
365
|
|
|
269
366
|

|
|
270
367
|
|
|
@@ -7,10 +7,22 @@ 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 **`Dashboard`** (a laid-out, linkable grid of charts), the
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
It wraps [`@silverpoint/react`](https://www.npmjs.com/package/@silverpoint/react) 0.3.0 and exposes
|
|
11
|
+
**all 33 charts**, the **`Dashboard`** (a laid-out, linkable grid of charts), the **17 UI
|
|
12
|
+
components** (buttons, inputs, tabs, cards, alerts…), the `SilverpointProvider`, both grounds
|
|
13
|
+
(`silverpoint` and `cyanotype`), the interaction events, custom readouts and the imperative handle
|
|
14
|
+
(SVG export and geometry) as Python.
|
|
15
|
+
|
|
16
|
+
### New in 0.3
|
|
17
|
+
|
|
18
|
+
- **17 UI components**, drawn as the charts are: `sp_button`, `sp_input`, `sp_checkbox`,
|
|
19
|
+
`sp_switch`, `sp_radio_group`, `sp_slider`, `sp_rate`, `sp_segmented`, `sp_tabs` (with
|
|
20
|
+
`sp_tab_panel`), `sp_steps`, `sp_card`, `sp_tag`, `sp_badge`, `sp_divider`, `sp_progress`,
|
|
21
|
+
`sp_alert` and `sp_skeleton`. Native controls underneath, controlled from Python. See
|
|
22
|
+
[UI components](#ui-components).
|
|
23
|
+
- `UI_COMPONENTS` and `UI_DEMOS`: the catalog's 17 components, their 45 reference states, and
|
|
24
|
+
`ui_demo(slug, state)` to render any of them.
|
|
25
|
+
- `substrate="prussian"` is accepted everywhere (the `cyanotype` ground's substrate).
|
|
14
26
|
|
|
15
27
|
### New in 0.2
|
|
16
28
|
|
|
@@ -32,7 +44,8 @@ uv add reflex-silverpoint-react
|
|
|
32
44
|
Nothing else to do on the JavaScript side: Reflex installs `@silverpoint/react`,
|
|
33
45
|
`@silverpoint/core`, `@silverpoint/grounds` and `@silverpoint/fonts`, and every chart imports the two
|
|
34
46
|
stylesheets it needs (`@silverpoint/grounds/styles.css` and the self-hosted EB Garamond of
|
|
35
|
-
`@silverpoint/fonts/fonts.css`)
|
|
47
|
+
`@silverpoint/fonts/fonts.css`); the UI components also import `@silverpoint/grounds/ui.css`. No
|
|
48
|
+
Tailwind, no CDN.
|
|
36
49
|
|
|
37
50
|
Requires Reflex 0.9.12 or later (React 19).
|
|
38
51
|
|
|
@@ -166,6 +179,88 @@ dashboard(
|
|
|
166
179
|
can also pass a plain dict.
|
|
167
180
|
- The layout values and the charts' props can be state vars.
|
|
168
181
|
|
|
182
|
+
## UI components
|
|
183
|
+
|
|
184
|
+
New in silverpoint 0.3: seventeen interface components with frames hand-drawn by each ground's own
|
|
185
|
+
inker and tone laid as hatching (`silverpoint`) or as the weight of an exact white line
|
|
186
|
+
(`cyanotype`). Each is a native control underneath (a `<button>`, an `<input>`, a `<fieldset>` of
|
|
187
|
+
radios), so forms submit natively and the keyboard follows the WAI-ARIA patterns. They are imported
|
|
188
|
+
from `@silverpoint/react/ui`.
|
|
189
|
+
|
|
190
|
+

|
|
191
|
+
|
|
192
|
+
| Group | Components |
|
|
193
|
+
|---|---|
|
|
194
|
+
| Actions | `sp_button` |
|
|
195
|
+
| Data entry | `sp_input`, `sp_checkbox`, `sp_radio_group`, `sp_switch`, `sp_slider`, `sp_rate`, `sp_segmented` |
|
|
196
|
+
| Navigation | `sp_tabs` + `sp_tab_panel`, `sp_steps` |
|
|
197
|
+
| Data display | `sp_card`, `sp_tag`, `sp_badge`, `sp_divider` |
|
|
198
|
+
| Feedback | `sp_progress`, `sp_alert`, `sp_skeleton` |
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
from reflex_silverpoint_react import sp_button, sp_input, sp_switch, sp_tab_panel, sp_tabs, ui_item
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class State(rx.State):
|
|
205
|
+
city: str = "Caracas"
|
|
206
|
+
precision: bool = False
|
|
207
|
+
view: str = "traffic"
|
|
208
|
+
|
|
209
|
+
@rx.event
|
|
210
|
+
def set_city(self, value: str): # on_change gets the value, not an event
|
|
211
|
+
self.city = value
|
|
212
|
+
|
|
213
|
+
@rx.event
|
|
214
|
+
def set_precision(self, value: bool):
|
|
215
|
+
self.precision = value
|
|
216
|
+
|
|
217
|
+
@rx.event
|
|
218
|
+
def set_view(self, value: str):
|
|
219
|
+
self.view = value
|
|
220
|
+
|
|
221
|
+
@rx.event
|
|
222
|
+
def save(self, form: dict):
|
|
223
|
+
print(form) # {"city": "Caracas", ...}: the native inputs submit under their name
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
rx.el.form(
|
|
227
|
+
sp_input(
|
|
228
|
+
label="City",
|
|
229
|
+
name="city",
|
|
230
|
+
value=State.city,
|
|
231
|
+
on_change=State.set_city,
|
|
232
|
+
invalid=State.city == "",
|
|
233
|
+
message="Required: pick a city",
|
|
234
|
+
),
|
|
235
|
+
sp_switch(label="Precision", checked=State.precision, on_change=State.set_precision),
|
|
236
|
+
sp_tabs(
|
|
237
|
+
sp_tab_panel(line_chart(...), value="traffic"),
|
|
238
|
+
sp_tab_panel(bar_chart(...), value="errors"),
|
|
239
|
+
items=[ui_item("traffic", "Traffic"), ui_item("errors", "Errors")],
|
|
240
|
+
value=State.view,
|
|
241
|
+
on_change=State.set_view,
|
|
242
|
+
),
|
|
243
|
+
sp_button("Save", type="submit", variant="primary"),
|
|
244
|
+
on_submit=State.save,
|
|
245
|
+
)
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
- **Shared props**: `id`, `ground`, `substrate`, `mode`, `seed`, `size` (`sm`/`md`/`lg`) and
|
|
249
|
+
`class_name`. Like charts, they fall back to the dashboard, then to `silverpoint_provider`.
|
|
250
|
+
- **Values**: value components are controlled (`value=` / `checked=` with `on_change`) or
|
|
251
|
+
uncontrolled (`default_value=` / `default_checked=`). `on_change` receives the new value itself (a
|
|
252
|
+
string, a bool or a number), never a DOM event.
|
|
253
|
+
- **Items**: `ui_item(key, label, disabled=False)` for tabs, segmented and radio groups;
|
|
254
|
+
`step_item(key, title, description=None, status=None)` for steps.
|
|
255
|
+
- **Slots**: children are a button's or tag's text, a card's or alert's body; `sp_card` also takes
|
|
256
|
+
`extra` and `footer`, and `sp_input` takes `prefix` and `suffix` (components or text).
|
|
257
|
+
- **Close events**: `sp_tag(closable=True, on_close=...)` and `sp_alert(closable=True, on_close=...)`.
|
|
258
|
+
- `UI_COMPONENTS` is the catalog (group, declared states, props reference) and `UI_DEMOS` the 45
|
|
259
|
+
reference states upstream ships; `ui_demo("radio-group", "selected", ground="cyanotype")` renders
|
|
260
|
+
one, uncontrolled.
|
|
261
|
+
- Text inputs controlled from state make a round trip per keystroke; for long text, prefer
|
|
262
|
+
`default_value` and read the value on submit.
|
|
263
|
+
|
|
169
264
|
## Interaction
|
|
170
265
|
|
|
171
266
|
```python
|
|
@@ -237,8 +332,10 @@ controls, demo datasets vs data from Python state with a re-roll), **Playground*
|
|
|
237
332
|
rendering choice and the Python that reproduces it), **Interaction** (events, custom readout, a
|
|
238
333
|
volvelle that turns on click, live KPI/gauge/meter, SVG and geometry export), **Dashboard** (a
|
|
239
334
|
linked operations dashboard fed from Python state with ground, substrate, mode and column controls, a
|
|
240
|
-
KPI strip, and `dashboard_link` on its own)
|
|
241
|
-
with
|
|
335
|
+
KPI strip, and `dashboard_link` on its own), **UI components** (`/ui`: the components controlled from
|
|
336
|
+
Python state with a native form submit, and the three reference panels of the upstream example apps
|
|
337
|
+
in silverpoint ink, precision and cyanotype), one **reference page per chart** (`/chart/<slug>`) and
|
|
338
|
+
one per UI component (`/ui/<slug>`: every declared state on both grounds, usage and props). The Gallery and Playground also get a ground control, for `cyanotype`.
|
|
242
339
|
|
|
243
340
|

|
|
244
341
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"""reflex-silverpoint-react: silverpoint charts for Reflex.
|
|
1
|
+
"""reflex-silverpoint-react: silverpoint charts and UI components for Reflex.
|
|
2
2
|
|
|
3
|
-
Charts drawn in the manner of a Renaissance silverpoint drawing,
|
|
3
|
+
Charts and interface components drawn in the manner of a Renaissance silverpoint drawing,
|
|
4
|
+
wrapping ``@silverpoint/react``.
|
|
4
5
|
"""
|
|
5
6
|
|
|
6
7
|
from .base import (
|
|
@@ -93,6 +94,58 @@ from .dashboard import (
|
|
|
93
94
|
dashboard_link,
|
|
94
95
|
)
|
|
95
96
|
from .helpers import chart_ref, download_svg, get_geometry, get_svg, tooltip_template
|
|
97
|
+
from .ui import (
|
|
98
|
+
SILVERPOINT_UI_STYLESHEET,
|
|
99
|
+
SilverpointUi,
|
|
100
|
+
SpAlert,
|
|
101
|
+
SpBadge,
|
|
102
|
+
SpButton,
|
|
103
|
+
SpCard,
|
|
104
|
+
SpCheckbox,
|
|
105
|
+
SpDivider,
|
|
106
|
+
SpInput,
|
|
107
|
+
SpProgress,
|
|
108
|
+
SpRadioGroup,
|
|
109
|
+
SpRate,
|
|
110
|
+
SpSegmented,
|
|
111
|
+
SpSkeleton,
|
|
112
|
+
SpSlider,
|
|
113
|
+
SpSteps,
|
|
114
|
+
SpSwitch,
|
|
115
|
+
SpTabPanel,
|
|
116
|
+
SpTabs,
|
|
117
|
+
SpTag,
|
|
118
|
+
sp_alert,
|
|
119
|
+
sp_badge,
|
|
120
|
+
sp_button,
|
|
121
|
+
sp_card,
|
|
122
|
+
sp_checkbox,
|
|
123
|
+
sp_divider,
|
|
124
|
+
sp_input,
|
|
125
|
+
sp_progress,
|
|
126
|
+
sp_radio_group,
|
|
127
|
+
sp_rate,
|
|
128
|
+
sp_segmented,
|
|
129
|
+
sp_skeleton,
|
|
130
|
+
sp_slider,
|
|
131
|
+
sp_steps,
|
|
132
|
+
sp_switch,
|
|
133
|
+
sp_tab_panel,
|
|
134
|
+
sp_tabs,
|
|
135
|
+
sp_tag,
|
|
136
|
+
step_item,
|
|
137
|
+
ui_item,
|
|
138
|
+
)
|
|
139
|
+
from .ui_catalog import (
|
|
140
|
+
UI_COMMON_PROPS,
|
|
141
|
+
UI_COMPONENTS,
|
|
142
|
+
UI_DEMOS,
|
|
143
|
+
UI_GROUPS,
|
|
144
|
+
UI_VALUE_COMPONENTS,
|
|
145
|
+
UiComponentInfo,
|
|
146
|
+
ui_component_by_slug,
|
|
147
|
+
ui_demo,
|
|
148
|
+
)
|
|
96
149
|
|
|
97
150
|
__all__ = [
|
|
98
151
|
"CHARTS",
|
|
@@ -101,7 +154,13 @@ __all__ = [
|
|
|
101
154
|
"FAMILIES",
|
|
102
155
|
"SILVERPOINT_LIBRARY",
|
|
103
156
|
"SILVERPOINT_STYLESHEETS",
|
|
157
|
+
"SILVERPOINT_UI_STYLESHEET",
|
|
104
158
|
"SILVERPOINT_VERSION",
|
|
159
|
+
"UI_COMMON_PROPS",
|
|
160
|
+
"UI_COMPONENTS",
|
|
161
|
+
"UI_DEMOS",
|
|
162
|
+
"UI_GROUPS",
|
|
163
|
+
"UI_VALUE_COMPONENTS",
|
|
105
164
|
"ActivityGrid",
|
|
106
165
|
"AreaChart",
|
|
107
166
|
"BarChart",
|
|
@@ -135,11 +194,31 @@ __all__ = [
|
|
|
135
194
|
"ScatterChart",
|
|
136
195
|
"SilverpointChart",
|
|
137
196
|
"SilverpointProvider",
|
|
197
|
+
"SilverpointUi",
|
|
198
|
+
"SpAlert",
|
|
199
|
+
"SpBadge",
|
|
200
|
+
"SpButton",
|
|
201
|
+
"SpCard",
|
|
202
|
+
"SpCheckbox",
|
|
203
|
+
"SpDivider",
|
|
204
|
+
"SpInput",
|
|
205
|
+
"SpProgress",
|
|
206
|
+
"SpRadioGroup",
|
|
207
|
+
"SpRate",
|
|
208
|
+
"SpSegmented",
|
|
209
|
+
"SpSkeleton",
|
|
210
|
+
"SpSlider",
|
|
211
|
+
"SpSteps",
|
|
212
|
+
"SpSwitch",
|
|
213
|
+
"SpTabPanel",
|
|
214
|
+
"SpTabs",
|
|
215
|
+
"SpTag",
|
|
138
216
|
"SparklineRows",
|
|
139
217
|
"StackedBarChart",
|
|
140
218
|
"StepChart",
|
|
141
219
|
"StreamChart",
|
|
142
220
|
"TreemapChart",
|
|
221
|
+
"UiComponentInfo",
|
|
143
222
|
"VolvelleChart",
|
|
144
223
|
"WaterfallChart",
|
|
145
224
|
"WindRose",
|
|
@@ -180,12 +259,34 @@ __all__ = [
|
|
|
180
259
|
"sankey_chart",
|
|
181
260
|
"scatter_chart",
|
|
182
261
|
"silverpoint_provider",
|
|
262
|
+
"sp_alert",
|
|
263
|
+
"sp_badge",
|
|
264
|
+
"sp_button",
|
|
265
|
+
"sp_card",
|
|
266
|
+
"sp_checkbox",
|
|
267
|
+
"sp_divider",
|
|
268
|
+
"sp_input",
|
|
269
|
+
"sp_progress",
|
|
270
|
+
"sp_radio_group",
|
|
271
|
+
"sp_rate",
|
|
272
|
+
"sp_segmented",
|
|
273
|
+
"sp_skeleton",
|
|
274
|
+
"sp_slider",
|
|
275
|
+
"sp_steps",
|
|
276
|
+
"sp_switch",
|
|
277
|
+
"sp_tab_panel",
|
|
278
|
+
"sp_tabs",
|
|
279
|
+
"sp_tag",
|
|
183
280
|
"sparkline_rows",
|
|
184
281
|
"stacked_bar_chart",
|
|
185
282
|
"step_chart",
|
|
283
|
+
"step_item",
|
|
186
284
|
"stream_chart",
|
|
187
285
|
"tooltip_template",
|
|
188
286
|
"treemap_chart",
|
|
287
|
+
"ui_component_by_slug",
|
|
288
|
+
"ui_demo",
|
|
289
|
+
"ui_item",
|
|
189
290
|
"volvelle_chart",
|
|
190
291
|
"waterfall_chart",
|
|
191
292
|
"wind_rose",
|
|
@@ -5,9 +5,10 @@ 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
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
The npm side is ``@silverpoint/react`` (client components; since 0.2 the ``Dashboard`` grid and
|
|
9
|
+
since 0.3 the ``Sp`` UI components), ``@silverpoint/grounds`` (the stylesheet that colours the
|
|
10
|
+
strokes, required, plus ``ui.css`` for the UI components) and ``@silverpoint/fonts`` (self-hosted
|
|
11
|
+
EB Garamond). The stylesheets are imported once by any page that renders a chart or a component.
|
|
11
12
|
"""
|
|
12
13
|
|
|
13
14
|
from typing import Any, Literal
|
|
@@ -15,7 +16,7 @@ from typing import Any, Literal
|
|
|
15
16
|
import reflex as rx
|
|
16
17
|
|
|
17
18
|
#: The silverpoint npm release these wrappers are written against.
|
|
18
|
-
SILVERPOINT_VERSION = "0.
|
|
19
|
+
SILVERPOINT_VERSION = "0.3.0"
|
|
19
20
|
|
|
20
21
|
#: The npm package every chart is imported from (the barrel; it is side-effect free, so the
|
|
21
22
|
#: bundler keeps only the charts a page uses).
|
|
@@ -31,9 +32,9 @@ SILVERPOINT_STYLESHEETS = (
|
|
|
31
32
|
#: hatching; ``cyanotype`` (new in 0.2) by the weight of an exact white line on Prussian blue.
|
|
32
33
|
GroundName = Literal["silverpoint", "cyanotype"]
|
|
33
34
|
|
|
34
|
-
#: The
|
|
35
|
-
#: prints on it whatever substrate a
|
|
36
|
-
Substrate = Literal["cream", "green", "blue", "ochre"]
|
|
35
|
+
#: The substrates of the two grounds: ``silverpoint`` has cream, green, blue and ochre;
|
|
36
|
+
#: ``cyanotype`` has one, ``prussian``, and prints on it whatever substrate a component names.
|
|
37
|
+
Substrate = Literal["cream", "green", "blue", "ochre", "prussian"]
|
|
37
38
|
InkMode = Literal["ink", "precision"]
|
|
38
39
|
Chrome = Literal["card", "bare"]
|
|
39
40
|
HatchFill = Literal["tile", "per-shape"]
|
|
@@ -14,11 +14,11 @@ from reflex_base.event import (
|
|
|
14
14
|
from reflex_base.vars.base import Var
|
|
15
15
|
from reflex_components_core.core.breakpoints import Breakpoints
|
|
16
16
|
|
|
17
|
-
SILVERPOINT_VERSION = "0.
|
|
17
|
+
SILVERPOINT_VERSION = "0.3.0"
|
|
18
18
|
SILVERPOINT_LIBRARY = ...
|
|
19
19
|
SILVERPOINT_STYLESHEETS = ("@silverpoint/fonts/fonts.css", "@silverpoint/grounds/styles.css")
|
|
20
20
|
GroundName: TypeAlias = Literal["silverpoint", "cyanotype"]
|
|
21
|
-
Substrate: TypeAlias = Literal["cream", "green", "blue", "ochre"]
|
|
21
|
+
Substrate: TypeAlias = Literal["cream", "green", "blue", "ochre", "prussian"]
|
|
22
22
|
InkMode: TypeAlias = Literal["ink", "precision"]
|
|
23
23
|
Chrome: TypeAlias = Literal["card", "bare"]
|
|
24
24
|
HatchFill: TypeAlias = Literal["tile", "per-shape"]
|
|
@@ -96,8 +96,8 @@ class SilverpointChart(_SilverpointBase):
|
|
|
96
96
|
| dict[str, Any]
|
|
97
97
|
| str
|
|
98
98
|
| None = None,
|
|
99
|
-
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
100
|
-
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
99
|
+
substrate: Literal["blue", "cream", "green", "ochre", "prussian"]
|
|
100
|
+
| Var[Literal["blue", "cream", "green", "ochre", "prussian"]]
|
|
101
101
|
| None = None,
|
|
102
102
|
mode: Literal["ink", "precision"] | Var[Literal["ink", "precision"]] | None = None,
|
|
103
103
|
seed: Var[int | str] | int | str | None = None,
|
|
@@ -207,8 +207,8 @@ class SilverpointProvider(_SilverpointBase):
|
|
|
207
207
|
| dict[str, Any]
|
|
208
208
|
| str
|
|
209
209
|
| None = None,
|
|
210
|
-
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
211
|
-
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
210
|
+
substrate: Literal["blue", "cream", "green", "ochre", "prussian"]
|
|
211
|
+
| Var[Literal["blue", "cream", "green", "ochre", "prussian"]]
|
|
212
212
|
| None = None,
|
|
213
213
|
mode: Literal["ink", "precision"] | Var[Literal["ink", "precision"]] | None = None,
|
|
214
214
|
locale: Var[str] | str | None = None,
|