reflex-silverpoint-react 0.1.0__py3-none-any.whl
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/__init__.py +170 -0
- reflex_silverpoint_react/base.py +180 -0
- reflex_silverpoint_react/base.pyi +270 -0
- reflex_silverpoint_react/catalog.py +637 -0
- reflex_silverpoint_react/charts.py +645 -0
- reflex_silverpoint_react/charts.pyi +3944 -0
- reflex_silverpoint_react/helpers.py +148 -0
- reflex_silverpoint_react-0.1.0.dist-info/METADATA +224 -0
- reflex_silverpoint_react-0.1.0.dist-info/RECORD +12 -0
- reflex_silverpoint_react-0.1.0.dist-info/WHEEL +5 -0
- reflex_silverpoint_react-0.1.0.dist-info/licenses/LICENSE +21 -0
- reflex_silverpoint_react-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"""reflex-silverpoint-react: silverpoint charts for Reflex.
|
|
2
|
+
|
|
3
|
+
Charts drawn in the manner of a Renaissance silverpoint drawing, wrapping ``@silverpoint/react``.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .base import (
|
|
7
|
+
SILVERPOINT_LIBRARY,
|
|
8
|
+
SILVERPOINT_STYLESHEETS,
|
|
9
|
+
SILVERPOINT_VERSION,
|
|
10
|
+
SilverpointChart,
|
|
11
|
+
SilverpointProvider,
|
|
12
|
+
silverpoint_provider,
|
|
13
|
+
)
|
|
14
|
+
from .catalog import CHARTS, COMMON_PROPS, FAMILIES, ChartInfo, PropDoc, chart_by_name, chart_by_slug
|
|
15
|
+
from .charts import (
|
|
16
|
+
ActivityGrid,
|
|
17
|
+
AreaChart,
|
|
18
|
+
BarChart,
|
|
19
|
+
BubbleChart,
|
|
20
|
+
BulletChart,
|
|
21
|
+
CandlestickChart,
|
|
22
|
+
ChordRing,
|
|
23
|
+
ComposedChart,
|
|
24
|
+
CoxcombChart,
|
|
25
|
+
DonutChart,
|
|
26
|
+
FunnelChart,
|
|
27
|
+
GaugeArc,
|
|
28
|
+
HeatmapChart,
|
|
29
|
+
KpiCard,
|
|
30
|
+
LineChart,
|
|
31
|
+
MeterChart,
|
|
32
|
+
OrbitChart,
|
|
33
|
+
PolarBarChart,
|
|
34
|
+
PyramidChart,
|
|
35
|
+
RadarChart,
|
|
36
|
+
RadialArcGroup,
|
|
37
|
+
RadialRings,
|
|
38
|
+
RangeBandChart,
|
|
39
|
+
SankeyChart,
|
|
40
|
+
ScatterChart,
|
|
41
|
+
SparklineRows,
|
|
42
|
+
StackedBarChart,
|
|
43
|
+
StepChart,
|
|
44
|
+
StreamChart,
|
|
45
|
+
TreemapChart,
|
|
46
|
+
VolvelleChart,
|
|
47
|
+
WaterfallChart,
|
|
48
|
+
WindRose,
|
|
49
|
+
activity_grid,
|
|
50
|
+
area_chart,
|
|
51
|
+
bar_chart,
|
|
52
|
+
bubble_chart,
|
|
53
|
+
bullet_chart,
|
|
54
|
+
candlestick_chart,
|
|
55
|
+
chord_ring,
|
|
56
|
+
composed_chart,
|
|
57
|
+
coxcomb_chart,
|
|
58
|
+
donut_chart,
|
|
59
|
+
funnel_chart,
|
|
60
|
+
gauge_arc,
|
|
61
|
+
heatmap_chart,
|
|
62
|
+
kpi_card,
|
|
63
|
+
line_chart,
|
|
64
|
+
meter_chart,
|
|
65
|
+
orbit_chart,
|
|
66
|
+
polar_bar_chart,
|
|
67
|
+
pyramid_chart,
|
|
68
|
+
radar_chart,
|
|
69
|
+
radial_arc_group,
|
|
70
|
+
radial_rings,
|
|
71
|
+
range_band_chart,
|
|
72
|
+
sankey_chart,
|
|
73
|
+
scatter_chart,
|
|
74
|
+
sparkline_rows,
|
|
75
|
+
stacked_bar_chart,
|
|
76
|
+
step_chart,
|
|
77
|
+
stream_chart,
|
|
78
|
+
treemap_chart,
|
|
79
|
+
volvelle_chart,
|
|
80
|
+
waterfall_chart,
|
|
81
|
+
wind_rose,
|
|
82
|
+
)
|
|
83
|
+
from .helpers import chart_ref, download_svg, get_geometry, get_svg, tooltip_template
|
|
84
|
+
|
|
85
|
+
__all__ = [
|
|
86
|
+
"CHARTS",
|
|
87
|
+
"COMMON_PROPS",
|
|
88
|
+
"FAMILIES",
|
|
89
|
+
"SILVERPOINT_LIBRARY",
|
|
90
|
+
"SILVERPOINT_STYLESHEETS",
|
|
91
|
+
"SILVERPOINT_VERSION",
|
|
92
|
+
"ActivityGrid",
|
|
93
|
+
"AreaChart",
|
|
94
|
+
"BarChart",
|
|
95
|
+
"BubbleChart",
|
|
96
|
+
"BulletChart",
|
|
97
|
+
"CandlestickChart",
|
|
98
|
+
"ChartInfo",
|
|
99
|
+
"ChordRing",
|
|
100
|
+
"ComposedChart",
|
|
101
|
+
"CoxcombChart",
|
|
102
|
+
"DonutChart",
|
|
103
|
+
"FunnelChart",
|
|
104
|
+
"GaugeArc",
|
|
105
|
+
"HeatmapChart",
|
|
106
|
+
"KpiCard",
|
|
107
|
+
"LineChart",
|
|
108
|
+
"MeterChart",
|
|
109
|
+
"OrbitChart",
|
|
110
|
+
"PolarBarChart",
|
|
111
|
+
"PropDoc",
|
|
112
|
+
"PyramidChart",
|
|
113
|
+
"RadarChart",
|
|
114
|
+
"RadialArcGroup",
|
|
115
|
+
"RadialRings",
|
|
116
|
+
"RangeBandChart",
|
|
117
|
+
"SankeyChart",
|
|
118
|
+
"ScatterChart",
|
|
119
|
+
"SilverpointChart",
|
|
120
|
+
"SilverpointProvider",
|
|
121
|
+
"SparklineRows",
|
|
122
|
+
"StackedBarChart",
|
|
123
|
+
"StepChart",
|
|
124
|
+
"StreamChart",
|
|
125
|
+
"TreemapChart",
|
|
126
|
+
"VolvelleChart",
|
|
127
|
+
"WaterfallChart",
|
|
128
|
+
"WindRose",
|
|
129
|
+
"activity_grid",
|
|
130
|
+
"area_chart",
|
|
131
|
+
"bar_chart",
|
|
132
|
+
"bubble_chart",
|
|
133
|
+
"bullet_chart",
|
|
134
|
+
"candlestick_chart",
|
|
135
|
+
"chart_by_name",
|
|
136
|
+
"chart_by_slug",
|
|
137
|
+
"chart_ref",
|
|
138
|
+
"chord_ring",
|
|
139
|
+
"composed_chart",
|
|
140
|
+
"coxcomb_chart",
|
|
141
|
+
"donut_chart",
|
|
142
|
+
"download_svg",
|
|
143
|
+
"funnel_chart",
|
|
144
|
+
"gauge_arc",
|
|
145
|
+
"get_geometry",
|
|
146
|
+
"get_svg",
|
|
147
|
+
"heatmap_chart",
|
|
148
|
+
"kpi_card",
|
|
149
|
+
"line_chart",
|
|
150
|
+
"meter_chart",
|
|
151
|
+
"orbit_chart",
|
|
152
|
+
"polar_bar_chart",
|
|
153
|
+
"pyramid_chart",
|
|
154
|
+
"radar_chart",
|
|
155
|
+
"radial_arc_group",
|
|
156
|
+
"radial_rings",
|
|
157
|
+
"range_band_chart",
|
|
158
|
+
"sankey_chart",
|
|
159
|
+
"scatter_chart",
|
|
160
|
+
"silverpoint_provider",
|
|
161
|
+
"sparkline_rows",
|
|
162
|
+
"stacked_bar_chart",
|
|
163
|
+
"step_chart",
|
|
164
|
+
"stream_chart",
|
|
165
|
+
"tooltip_template",
|
|
166
|
+
"treemap_chart",
|
|
167
|
+
"volvelle_chart",
|
|
168
|
+
"waterfall_chart",
|
|
169
|
+
"wind_rose",
|
|
170
|
+
]
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"""Shared pieces of the silverpoint wrappers: the chart base class and the provider.
|
|
2
|
+
|
|
3
|
+
silverpoint draws charts in the manner of a Renaissance silverpoint drawing: a fine silver line
|
|
4
|
+
on a prepared ground, tone built from hatching, and white heightening on the live value. The
|
|
5
|
+
irregularity lives only in the ornament; the data geometry is exact, and every chart has a
|
|
6
|
+
``precision`` mode that switches the inking off.
|
|
7
|
+
|
|
8
|
+
The npm side is ``@silverpoint/react`` (client components), ``@silverpoint/grounds`` (the
|
|
9
|
+
stylesheet that colours the strokes, required) and ``@silverpoint/fonts`` (self-hosted
|
|
10
|
+
EB Garamond). Both stylesheets are imported once by any page that renders a chart.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from typing import Any, Literal
|
|
14
|
+
|
|
15
|
+
import reflex as rx
|
|
16
|
+
|
|
17
|
+
#: The silverpoint npm release these wrappers are written against.
|
|
18
|
+
SILVERPOINT_VERSION = "0.1.1"
|
|
19
|
+
|
|
20
|
+
#: The npm package every chart is imported from (the barrel; it is side-effect free, so the
|
|
21
|
+
#: bundler keeps only the charts a page uses).
|
|
22
|
+
SILVERPOINT_LIBRARY = f"@silverpoint/react@{SILVERPOINT_VERSION}"
|
|
23
|
+
|
|
24
|
+
#: Stylesheets every app needs once: the typeface, then the grounds.
|
|
25
|
+
SILVERPOINT_STYLESHEETS = (
|
|
26
|
+
"@silverpoint/fonts/fonts.css",
|
|
27
|
+
"@silverpoint/grounds/styles.css",
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
Substrate = Literal["cream", "green", "blue", "ochre"]
|
|
31
|
+
InkMode = Literal["ink", "precision"]
|
|
32
|
+
Chrome = Literal["card", "bare"]
|
|
33
|
+
HatchFill = Literal["tile", "per-shape"]
|
|
34
|
+
DataTable = Literal["visible", "hidden", "none"]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _SilverpointBase(rx.Component):
|
|
38
|
+
"""Library, npm dependencies and stylesheet imports shared by every wrapper."""
|
|
39
|
+
|
|
40
|
+
library = SILVERPOINT_LIBRARY
|
|
41
|
+
|
|
42
|
+
lib_dependencies: list[str] = [ # noqa: RUF012 - Reflex reads it as a class attribute
|
|
43
|
+
f"@silverpoint/core@{SILVERPOINT_VERSION}",
|
|
44
|
+
f"@silverpoint/grounds@{SILVERPOINT_VERSION}",
|
|
45
|
+
f"@silverpoint/fonts@{SILVERPOINT_VERSION}",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
def add_imports(self) -> dict[str, list[str]]:
|
|
49
|
+
"""Import the typeface and the grounds stylesheet next to the component.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
Side-effect imports of the two stylesheets.
|
|
53
|
+
"""
|
|
54
|
+
return {"": list(SILVERPOINT_STYLESHEETS)}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _active_item_spec(item):
|
|
58
|
+
"""The item under the pointer or keyboard focus, or ``None`` when it clears.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
item: ``{seriesKey, index, datum, value, point: {x, y}}`` from the chart, or null.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
The item, forwarded unchanged to the backend handler (annotate it ``dict | None``).
|
|
65
|
+
"""
|
|
66
|
+
return (item,)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _selected_item_spec(item):
|
|
70
|
+
"""The item chosen by click, Enter or Space.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
item: ``{seriesKey, index, datum, value, point: {x, y}}`` from the chart.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
The item, forwarded unchanged to the backend handler.
|
|
77
|
+
"""
|
|
78
|
+
return (item,)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class SilverpointChart(_SilverpointBase):
|
|
82
|
+
"""Props every silverpoint chart shares (API Spec §7, "Props every chart shares").
|
|
83
|
+
|
|
84
|
+
Give a chart an ``id`` when you want a stable seed across renders or when you want to use
|
|
85
|
+
:func:`download_svg`, :func:`get_svg` or :func:`get_geometry` on it.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
# Rows to draw. If omitted, the chart renders its own demo dataset.
|
|
89
|
+
data: rx.Var[list[dict[str, Any]]]
|
|
90
|
+
|
|
91
|
+
# Style ground, by name (``"silverpoint"``) or as a complete ground object.
|
|
92
|
+
ground: rx.Var[str | dict[str, Any]]
|
|
93
|
+
|
|
94
|
+
# Prepared substrate within the ground: cream (default), green, blue or ochre.
|
|
95
|
+
substrate: rx.Var[Substrate]
|
|
96
|
+
|
|
97
|
+
# ``ink`` by default; ``precision`` switches inking off and draws exact, even strokes.
|
|
98
|
+
mode: rx.Var[InkMode]
|
|
99
|
+
|
|
100
|
+
# Seed of the hand. Same props and seed, same strokes. Derived from ``id`` when omitted.
|
|
101
|
+
seed: rx.Var[int | str]
|
|
102
|
+
|
|
103
|
+
# Height of the drawing area in px (160 by default).
|
|
104
|
+
height: rx.Var[int | float]
|
|
105
|
+
|
|
106
|
+
# Width in px. The chart takes its container's width unless this pins it.
|
|
107
|
+
width: rx.Var[int | float]
|
|
108
|
+
|
|
109
|
+
# ``card`` draws the full frame; ``bare`` only the drawing area.
|
|
110
|
+
chrome: rx.Var[Chrome]
|
|
111
|
+
|
|
112
|
+
# How areas are filled: ``tile`` (default) or ``per-shape`` (richer, much heavier).
|
|
113
|
+
hatch_fill: rx.Var[HatchFill]
|
|
114
|
+
|
|
115
|
+
# Card title.
|
|
116
|
+
title: rx.Var[str]
|
|
117
|
+
|
|
118
|
+
# Small badge printed at the top right of the card.
|
|
119
|
+
badge: rx.Var[str]
|
|
120
|
+
|
|
121
|
+
# Headline figure printed on the card.
|
|
122
|
+
value: rx.Var[str | int | float]
|
|
123
|
+
|
|
124
|
+
# Unit printed after the headline figure.
|
|
125
|
+
unit: rx.Var[str]
|
|
126
|
+
|
|
127
|
+
# Footer text, left.
|
|
128
|
+
footer_left: rx.Var[str]
|
|
129
|
+
|
|
130
|
+
# Footer text, right.
|
|
131
|
+
footer_right: rx.Var[str]
|
|
132
|
+
|
|
133
|
+
# Accessible name. Derived from ``title`` when omitted.
|
|
134
|
+
label: rx.Var[str]
|
|
135
|
+
|
|
136
|
+
# Long description for screen readers.
|
|
137
|
+
description: rx.Var[str]
|
|
138
|
+
|
|
139
|
+
# Tabular alternative: ``hidden`` (default, for assistive technology only), ``visible`` or ``none``.
|
|
140
|
+
data_table: rx.Var[DataTable]
|
|
141
|
+
|
|
142
|
+
# BCP 47 locale for number formatting, e.g. ``"es-VE"``.
|
|
143
|
+
locale: rx.Var[str]
|
|
144
|
+
|
|
145
|
+
# ``Intl.NumberFormatOptions``, e.g. ``{"style": "percent"}``.
|
|
146
|
+
number_format: rx.Var[dict[str, Any]]
|
|
147
|
+
|
|
148
|
+
# Replaces the built-in readout: a JS function ``(item, readout) => ReactNode``.
|
|
149
|
+
# Build one from Python with :func:`tooltip_template`.
|
|
150
|
+
tooltip: rx.Var[Any]
|
|
151
|
+
|
|
152
|
+
# The active item changed (pointer or keyboard focus), or cleared (``None``).
|
|
153
|
+
on_active_change: rx.EventHandler[_active_item_spec]
|
|
154
|
+
|
|
155
|
+
# An item was chosen by click, Enter or Space.
|
|
156
|
+
on_select: rx.EventHandler[_selected_item_spec]
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class SilverpointProvider(_SilverpointBase):
|
|
160
|
+
"""Sets ground, substrate, mode and locale once for every chart below it.
|
|
161
|
+
|
|
162
|
+
A prop on a chart always wins over the provider.
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
tag = "SilverpointProvider"
|
|
166
|
+
|
|
167
|
+
# Style ground for every chart below.
|
|
168
|
+
ground: rx.Var[str | dict[str, Any]]
|
|
169
|
+
|
|
170
|
+
# Substrate for every chart below.
|
|
171
|
+
substrate: rx.Var[Substrate]
|
|
172
|
+
|
|
173
|
+
# Inking mode for every chart below.
|
|
174
|
+
mode: rx.Var[InkMode]
|
|
175
|
+
|
|
176
|
+
# Locale for every chart below.
|
|
177
|
+
locale: rx.Var[str]
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
silverpoint_provider = SilverpointProvider.create
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"""Stub file for custom_components/reflex_silverpoint_react/base.py"""
|
|
2
|
+
|
|
3
|
+
# ------------------- DO NOT EDIT ----------------------
|
|
4
|
+
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
|
+
# ------------------------------------------------------
|
|
6
|
+
from collections.abc import Mapping, Sequence
|
|
7
|
+
from typing import Any, Literal, Optional
|
|
8
|
+
from reflex_components_core.core.breakpoints import Breakpoints
|
|
9
|
+
from reflex_base.event import (
|
|
10
|
+
EventType,
|
|
11
|
+
PointerEventInfo,
|
|
12
|
+
)
|
|
13
|
+
from reflex_base.vars.base import Var
|
|
14
|
+
import reflex as rx
|
|
15
|
+
|
|
16
|
+
SILVERPOINT_VERSION = "0.1.1"
|
|
17
|
+
SILVERPOINT_LIBRARY = f"@silverpoint/react@{SILVERPOINT_VERSION}"
|
|
18
|
+
SILVERPOINT_STYLESHEETS = ("@silverpoint/fonts/fonts.css", "@silverpoint/grounds/styles.css")
|
|
19
|
+
Substrate = Literal["cream", "green", "blue", "ochre"]
|
|
20
|
+
InkMode = Literal["ink", "precision"]
|
|
21
|
+
Chrome = Literal["card", "bare"]
|
|
22
|
+
HatchFill = Literal["tile", "per-shape"]
|
|
23
|
+
DataTable = Literal["visible", "hidden", "none"]
|
|
24
|
+
|
|
25
|
+
class _SilverpointBase(rx.Component):
|
|
26
|
+
def add_imports(self) -> dict[str, list[str]]: ...
|
|
27
|
+
@classmethod
|
|
28
|
+
def create(
|
|
29
|
+
cls,
|
|
30
|
+
*children,
|
|
31
|
+
style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None,
|
|
32
|
+
key: Any | None = None,
|
|
33
|
+
id: Any | None = None,
|
|
34
|
+
ref: Var | None = None,
|
|
35
|
+
class_name: Any | None = None,
|
|
36
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
37
|
+
on_blur: Optional[EventType[()]] = None,
|
|
38
|
+
on_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
39
|
+
on_context_menu: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
40
|
+
on_double_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
41
|
+
on_focus: Optional[EventType[()]] = None,
|
|
42
|
+
on_mount: Optional[EventType[()]] = None,
|
|
43
|
+
on_mouse_down: Optional[EventType[()]] = None,
|
|
44
|
+
on_mouse_enter: Optional[EventType[()]] = None,
|
|
45
|
+
on_mouse_leave: Optional[EventType[()]] = None,
|
|
46
|
+
on_mouse_move: Optional[EventType[()]] = None,
|
|
47
|
+
on_mouse_out: Optional[EventType[()]] = None,
|
|
48
|
+
on_mouse_over: Optional[EventType[()]] = None,
|
|
49
|
+
on_mouse_up: Optional[EventType[()]] = None,
|
|
50
|
+
on_scroll: Optional[EventType[()]] = None,
|
|
51
|
+
on_scroll_end: Optional[EventType[()]] = None,
|
|
52
|
+
on_unmount: Optional[EventType[()]] = None,
|
|
53
|
+
**props,
|
|
54
|
+
) -> "_SilverpointBase":
|
|
55
|
+
"""Create the component.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
*children: The children of the component.
|
|
59
|
+
style: The style of the component.
|
|
60
|
+
key: A unique key for the component.
|
|
61
|
+
id: The id for the component.
|
|
62
|
+
ref: The Var to pass as the ref to the component.
|
|
63
|
+
class_name: The class name for the component.
|
|
64
|
+
custom_attrs: Attributes passed directly to the component.
|
|
65
|
+
on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input.
|
|
66
|
+
on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input.
|
|
67
|
+
on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button.
|
|
68
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
69
|
+
on_double_click: Fired when the user double-clicks on an element.
|
|
70
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
71
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
72
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
73
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
74
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
75
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
76
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
77
|
+
on_scroll: Fired when the user scrolls the element.
|
|
78
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
79
|
+
on_mount: Fired when the component is mounted to the page.
|
|
80
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
81
|
+
**props: The props of the component.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
The component.
|
|
85
|
+
"""
|
|
86
|
+
...
|
|
87
|
+
|
|
88
|
+
class SilverpointChart(_SilverpointBase):
|
|
89
|
+
@classmethod
|
|
90
|
+
def create(
|
|
91
|
+
cls,
|
|
92
|
+
*children,
|
|
93
|
+
data: Var[list[dict[str, Any]]] | list[dict[str, Any]] | None = None,
|
|
94
|
+
ground: Var[dict[str, Any] | str] | dict[str, Any] | str | None = None,
|
|
95
|
+
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
96
|
+
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
97
|
+
| None = None,
|
|
98
|
+
mode: Literal["ink", "precision"] | Var[Literal["ink", "precision"]] | None = None,
|
|
99
|
+
seed: Var[int | str] | int | str | None = None,
|
|
100
|
+
height: Var[float | int] | float | int | None = None,
|
|
101
|
+
width: Var[float | int] | float | int | None = None,
|
|
102
|
+
chrome: Literal["bare", "card"] | Var[Literal["bare", "card"]] | None = None,
|
|
103
|
+
hatch_fill: Literal["per-shape", "tile"] | Var[Literal["per-shape", "tile"]] | None = None,
|
|
104
|
+
title: Var[str] | str | None = None,
|
|
105
|
+
badge: Var[str] | str | None = None,
|
|
106
|
+
value: Var[float | int | str] | float | int | str | None = None,
|
|
107
|
+
unit: Var[str] | str | None = None,
|
|
108
|
+
footer_left: Var[str] | str | None = None,
|
|
109
|
+
footer_right: Var[str] | str | None = None,
|
|
110
|
+
label: Var[str] | str | None = None,
|
|
111
|
+
description: Var[str] | str | None = None,
|
|
112
|
+
data_table: Literal["hidden", "none", "visible"] | Var[Literal["hidden", "none", "visible"]] | None = None,
|
|
113
|
+
locale: Var[str] | str | None = None,
|
|
114
|
+
number_format: Var[dict[str, Any]] | dict[str, Any] | None = None,
|
|
115
|
+
tooltip: Any | Var[Any] | None = None,
|
|
116
|
+
style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None,
|
|
117
|
+
key: Any | None = None,
|
|
118
|
+
id: Any | None = None,
|
|
119
|
+
ref: Var | None = None,
|
|
120
|
+
class_name: Any | None = None,
|
|
121
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
122
|
+
on_active_change: Optional[EventType[Any]] = None,
|
|
123
|
+
on_blur: Optional[EventType[()]] = None,
|
|
124
|
+
on_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
125
|
+
on_context_menu: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
126
|
+
on_double_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
127
|
+
on_focus: Optional[EventType[()]] = None,
|
|
128
|
+
on_mount: Optional[EventType[()]] = None,
|
|
129
|
+
on_mouse_down: Optional[EventType[()]] = None,
|
|
130
|
+
on_mouse_enter: Optional[EventType[()]] = None,
|
|
131
|
+
on_mouse_leave: Optional[EventType[()]] = None,
|
|
132
|
+
on_mouse_move: Optional[EventType[()]] = None,
|
|
133
|
+
on_mouse_out: Optional[EventType[()]] = None,
|
|
134
|
+
on_mouse_over: Optional[EventType[()]] = None,
|
|
135
|
+
on_mouse_up: Optional[EventType[()]] = None,
|
|
136
|
+
on_scroll: Optional[EventType[()]] = None,
|
|
137
|
+
on_scroll_end: Optional[EventType[()]] = None,
|
|
138
|
+
on_select: Optional[EventType[Any]] = None,
|
|
139
|
+
on_unmount: Optional[EventType[()]] = None,
|
|
140
|
+
**props,
|
|
141
|
+
) -> "SilverpointChart":
|
|
142
|
+
"""Create the component.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
*children: The children of the component.
|
|
146
|
+
data: no description
|
|
147
|
+
ground: no description
|
|
148
|
+
substrate: no description
|
|
149
|
+
mode: no description
|
|
150
|
+
seed: no description
|
|
151
|
+
height: no description
|
|
152
|
+
width: no description
|
|
153
|
+
chrome: no description
|
|
154
|
+
hatch_fill: no description
|
|
155
|
+
title: no description
|
|
156
|
+
badge: no description
|
|
157
|
+
value: no description
|
|
158
|
+
unit: no description
|
|
159
|
+
footer_left: no description
|
|
160
|
+
footer_right: no description
|
|
161
|
+
label: no description
|
|
162
|
+
description: no description
|
|
163
|
+
data_table: no description
|
|
164
|
+
locale: no description
|
|
165
|
+
number_format: no description
|
|
166
|
+
tooltip: no description
|
|
167
|
+
style: The style of the component.
|
|
168
|
+
key: A unique key for the component.
|
|
169
|
+
id: The id for the component.
|
|
170
|
+
ref: The Var to pass as the ref to the component.
|
|
171
|
+
class_name: The class name for the component.
|
|
172
|
+
custom_attrs: Attributes passed directly to the component.
|
|
173
|
+
on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input.
|
|
174
|
+
on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input.
|
|
175
|
+
on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button.
|
|
176
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
177
|
+
on_double_click: Fired when the user double-clicks on an element.
|
|
178
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
179
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
180
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
181
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
182
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
183
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
184
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
185
|
+
on_scroll: Fired when the user scrolls the element.
|
|
186
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
187
|
+
on_mount: Fired when the component is mounted to the page.
|
|
188
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
189
|
+
on_active_change: no description
|
|
190
|
+
on_select: no description
|
|
191
|
+
**props: The props of the component.
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
The component.
|
|
195
|
+
"""
|
|
196
|
+
...
|
|
197
|
+
|
|
198
|
+
class SilverpointProvider(_SilverpointBase):
|
|
199
|
+
@classmethod
|
|
200
|
+
def create(
|
|
201
|
+
cls,
|
|
202
|
+
*children,
|
|
203
|
+
ground: Var[dict[str, Any] | str] | dict[str, Any] | str | None = None,
|
|
204
|
+
substrate: Literal["blue", "cream", "green", "ochre"]
|
|
205
|
+
| Var[Literal["blue", "cream", "green", "ochre"]]
|
|
206
|
+
| None = None,
|
|
207
|
+
mode: Literal["ink", "precision"] | Var[Literal["ink", "precision"]] | None = None,
|
|
208
|
+
locale: Var[str] | str | None = None,
|
|
209
|
+
style: Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None = None,
|
|
210
|
+
key: Any | None = None,
|
|
211
|
+
id: Any | None = None,
|
|
212
|
+
ref: Var | None = None,
|
|
213
|
+
class_name: Any | None = None,
|
|
214
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
215
|
+
on_blur: Optional[EventType[()]] = None,
|
|
216
|
+
on_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
217
|
+
on_context_menu: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
218
|
+
on_double_click: Optional[EventType[()] | EventType[PointerEventInfo]] = None,
|
|
219
|
+
on_focus: Optional[EventType[()]] = None,
|
|
220
|
+
on_mount: Optional[EventType[()]] = None,
|
|
221
|
+
on_mouse_down: Optional[EventType[()]] = None,
|
|
222
|
+
on_mouse_enter: Optional[EventType[()]] = None,
|
|
223
|
+
on_mouse_leave: Optional[EventType[()]] = None,
|
|
224
|
+
on_mouse_move: Optional[EventType[()]] = None,
|
|
225
|
+
on_mouse_out: Optional[EventType[()]] = None,
|
|
226
|
+
on_mouse_over: Optional[EventType[()]] = None,
|
|
227
|
+
on_mouse_up: Optional[EventType[()]] = None,
|
|
228
|
+
on_scroll: Optional[EventType[()]] = None,
|
|
229
|
+
on_scroll_end: Optional[EventType[()]] = None,
|
|
230
|
+
on_unmount: Optional[EventType[()]] = None,
|
|
231
|
+
**props,
|
|
232
|
+
) -> "SilverpointProvider":
|
|
233
|
+
"""Create the component.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
*children: The children of the component.
|
|
237
|
+
ground: Style ground for every chart below.
|
|
238
|
+
substrate: Substrate for every chart below.
|
|
239
|
+
mode: Inking mode for every chart below.
|
|
240
|
+
locale: Locale for every chart below.
|
|
241
|
+
style: The style of the component.
|
|
242
|
+
key: A unique key for the component.
|
|
243
|
+
id: The id for the component.
|
|
244
|
+
ref: The Var to pass as the ref to the component.
|
|
245
|
+
class_name: The class name for the component.
|
|
246
|
+
custom_attrs: Attributes passed directly to the component.
|
|
247
|
+
on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input.
|
|
248
|
+
on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input.
|
|
249
|
+
on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button.
|
|
250
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
251
|
+
on_double_click: Fired when the user double-clicks on an element.
|
|
252
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
253
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
254
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
255
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
256
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
257
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
258
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
259
|
+
on_scroll: Fired when the user scrolls the element.
|
|
260
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
261
|
+
on_mount: Fired when the component is mounted to the page.
|
|
262
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
263
|
+
**props: The props of the component.
|
|
264
|
+
|
|
265
|
+
Returns:
|
|
266
|
+
The component.
|
|
267
|
+
"""
|
|
268
|
+
...
|
|
269
|
+
|
|
270
|
+
silverpoint_provider = SilverpointProvider.create
|