reflex-components-plotly 0.10.0a1__tar.gz → 0.11.0a1__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_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/.gitignore +4 -0
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/CHANGELOG.md +25 -1
- reflex_components_plotly-0.11.0a1/PKG-INFO +21 -0
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/pyproject.toml +11 -3
- reflex_components_plotly-0.11.0a1/src/reflex_components_plotly/__init__.py +32 -0
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/src/reflex_components_plotly/plotly.py +117 -39
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/src/reflex_components_plotly/plotly.pyi +346 -2
- reflex_components_plotly-0.11.0a1/src/reflex_components_plotly/py.typed +0 -0
- reflex_components_plotly-0.10.0a1/PKG-INFO +0 -15
- reflex_components_plotly-0.10.0a1/src/reflex_components_plotly/__init__.py +0 -32
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/README.md +0 -0
- {reflex_components_plotly-0.10.0a1 → reflex_components_plotly-0.11.0a1}/news/.gitkeep +0 -0
|
@@ -32,6 +32,8 @@ reflex.db
|
|
|
32
32
|
.env.*
|
|
33
33
|
node_modules
|
|
34
34
|
package-lock.json
|
|
35
|
+
# ...except the frontend package, which CI installs with `npm ci`.
|
|
36
|
+
!packages/reflex-frontend/package-lock.json
|
|
35
37
|
*.pyi
|
|
36
38
|
.pre-commit-config.yaml
|
|
37
39
|
.claude/.worktrees
|
|
@@ -40,3 +42,5 @@ CLAUDE.local.md
|
|
|
40
42
|
|
|
41
43
|
# Backups written by scripts/delete_automated_releases.sh
|
|
42
44
|
automated-releases-backup-*.json
|
|
45
|
+
# The tarball `npm run build` packs the frontend package into.
|
|
46
|
+
packages/reflex-frontend/*.tgz
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
## v0.
|
|
1
|
+
## v0.11.0a1 (2026-12-04)
|
|
2
|
+
|
|
3
|
+
### Breaking Changes
|
|
4
|
+
|
|
5
|
+
- Upgrade Plotly.js and locales to 4.3. MathJax 2, Chart Studio options and source-reference attributes are removed. Mapbox figures keep rendering until Reflex 1.0, but Mapbox paths in buttons, sliders and templates no longer act, `on_relayout` data uses `map.*` keys, and Mapbox-hosted styles no longer load. See the [migration guide](https://reflex.dev/docs/library/graphing/other-charts/plotly/) for the changes to make. ([#7408](https://github.com/reflex-dev/reflex/issues/7408))
|
|
6
|
+
|
|
7
|
+
### Deprecations
|
|
8
|
+
|
|
9
|
+
- Deprecate `rx.plotly.mapbox` and Mapbox figures in Reflex 0.12.0 in favor of `rx.plotly.map` with MapLibre traces and `layout.map`. Until removal in Reflex 1.0, `rx.plotly`, `rx.plotly.map` and `rx.plotly.mapbox` render existing Mapbox figures on Plotly.js 4 by renaming their trace types, subplot references and `layout.mapbox` keys, and log a browser warning. ([#7408](https://github.com/reflex-dev/reflex/issues/7408))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Add `rx.plotly.map` for MapLibre maps using `scattermap`, `choroplethmap` and `densitymap` traces without a Mapbox access token. ([#7408](https://github.com/reflex-dev/reflex/issues/7408))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- Fix a page crash when `rx.plotly` receives a `None` figure from state while `layout` or the default template is set. ([#7408](https://github.com/reflex-dev/reflex/issues/7408))
|
|
18
|
+
- Ship a `py.typed` marker so type checkers such as mypy read the package's bundled `.pyi` stubs instead of treating it as untyped, and mark the names the package root imports as re-exported. ([#7710](https://github.com/reflex-dev/reflex/issues/7710))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## v0.10.0 (2026-10-08)
|
|
22
|
+
|
|
23
|
+
### Breaking Changes
|
|
24
|
+
|
|
25
|
+
- Require Python 3.11 or newer; Python 3.10 is no longer supported. ([#7449](https://github.com/reflex-dev/reflex/issues/7449))
|
|
2
26
|
|
|
3
27
|
### Bug Fixes
|
|
4
28
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: reflex-components-plotly
|
|
3
|
+
Version: 0.11.0a1
|
|
4
|
+
Summary: Reflex plotly components.
|
|
5
|
+
Author-email: Khaleel Al-Adhami <khaleel@reflex.dev>
|
|
6
|
+
Maintainer-email: Khaleel Al-Adhami <khaleel@reflex.dev>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Requires-Dist: reflex-base>=0.10.0
|
|
16
|
+
Requires-Dist: reflex-components-core>=0.10.0
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# reflex-components-plotly
|
|
20
|
+
|
|
21
|
+
Reflex plotly components.
|
|
@@ -6,12 +6,20 @@ license.text = "Apache-2.0"
|
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
authors = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
|
|
8
8
|
maintainers = [{ name = "Khaleel Al-Adhami", email = "khaleel@reflex.dev" }]
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"Programming Language :: Python :: 3.11",
|
|
13
|
+
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Programming Language :: Python :: 3.14",
|
|
16
|
+
"Programming Language :: Python :: 3.15",
|
|
17
|
+
]
|
|
10
18
|
dependencies = [
|
|
11
19
|
# The unversioned "mergician" import resolves against the pin in
|
|
12
20
|
# reflex-base's PackageJson.DEPENDENCIES.
|
|
13
|
-
"reflex-base >= 0.
|
|
14
|
-
"reflex-components-core >= 0.
|
|
21
|
+
"reflex-base >= 0.10.0",
|
|
22
|
+
"reflex-components-core >= 0.10.0",
|
|
15
23
|
]
|
|
16
24
|
|
|
17
25
|
[tool.hatch.version]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Plotly components."""
|
|
2
|
+
|
|
3
|
+
from reflex_base.components.component import ComponentNamespace
|
|
4
|
+
|
|
5
|
+
from .plotly import Plotly as Plotly
|
|
6
|
+
from .plotly import PlotlyBasic as PlotlyBasic
|
|
7
|
+
from .plotly import PlotlyCartesian as PlotlyCartesian
|
|
8
|
+
from .plotly import PlotlyFinance as PlotlyFinance
|
|
9
|
+
from .plotly import PlotlyGeo as PlotlyGeo
|
|
10
|
+
from .plotly import PlotlyGl2d as PlotlyGl2d
|
|
11
|
+
from .plotly import PlotlyGl3d as PlotlyGl3d
|
|
12
|
+
from .plotly import PlotlyMap as PlotlyMap
|
|
13
|
+
from .plotly import PlotlyMapbox as PlotlyMapbox
|
|
14
|
+
from .plotly import PlotlyStrict as PlotlyStrict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class PlotlyNamespace(ComponentNamespace):
|
|
18
|
+
"""Plotly namespace."""
|
|
19
|
+
|
|
20
|
+
__call__ = Plotly.create
|
|
21
|
+
basic = PlotlyBasic.create
|
|
22
|
+
cartesian = PlotlyCartesian.create
|
|
23
|
+
geo = PlotlyGeo.create
|
|
24
|
+
gl2d = PlotlyGl2d.create
|
|
25
|
+
gl3d = PlotlyGl3d.create
|
|
26
|
+
finance = PlotlyFinance.create
|
|
27
|
+
map = PlotlyMap.create
|
|
28
|
+
mapbox = PlotlyMapbox.create
|
|
29
|
+
strict = PlotlyStrict.create
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
plotly = PlotlyNamespace()
|
|
@@ -8,10 +8,14 @@ from typing import TYPE_CHECKING, Any, TypedDict, TypeVar
|
|
|
8
8
|
|
|
9
9
|
from reflex_base.components.component import Component, NoSSRComponent, field
|
|
10
10
|
from reflex_base.event import EventHandler, no_args_event_spec
|
|
11
|
+
from reflex_base.utils import console
|
|
11
12
|
from reflex_base.utils.imports import ImportDict, ImportVar
|
|
12
13
|
from reflex_base.vars.base import LiteralVar, Var
|
|
13
14
|
from reflex_components_core.core.cond import color_mode_cond
|
|
14
15
|
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from typing_extensions import deprecated
|
|
18
|
+
|
|
15
19
|
logger = logging.getLogger(__name__)
|
|
16
20
|
|
|
17
21
|
try:
|
|
@@ -74,12 +78,57 @@ _ID_PROP = "id"
|
|
|
74
78
|
_DIV_ID_PROP = "divId"
|
|
75
79
|
|
|
76
80
|
|
|
81
|
+
# Plotly.js 4 removed Mapbox. A figure with Mapbox traces or layout.mapbox keys
|
|
82
|
+
# gets a one-time warning, then a copy for Plotly with MapLibre trace types,
|
|
83
|
+
# subplot references and layout keys, in the figure and its animation frames.
|
|
84
|
+
# The user's figure is not changed. Remove with rx.plotly.mapbox in 1.0.
|
|
85
|
+
_MAPBOX_TO_MAP_JS = """
|
|
86
|
+
const _rxMapboxToMapName = (name) =>
|
|
87
|
+
name.replace(/^((?:scatter|choropleth|density)?map)box(\\d*)$/, "$1$2");
|
|
88
|
+
const _rxRenamePlotlyMapbox = ({ data, layout, ...rest }) => ({
|
|
89
|
+
...rest,
|
|
90
|
+
...(data && {
|
|
91
|
+
data: data.map((trace) => ({
|
|
92
|
+
...trace,
|
|
93
|
+
...(trace?.type && { type: _rxMapboxToMapName(trace.type) }),
|
|
94
|
+
...(trace?.subplot && { subplot: _rxMapboxToMapName(trace.subplot) }),
|
|
95
|
+
})),
|
|
96
|
+
}),
|
|
97
|
+
...(layout && {
|
|
98
|
+
layout: Object.fromEntries(
|
|
99
|
+
Object.entries(layout).map(([key, value]) => [_rxMapboxToMapName(key), value])
|
|
100
|
+
),
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
let _rxDidWarnPlotlyMapbox = false;
|
|
104
|
+
const _rxPlotlyMapboxToMap = (figure) => {
|
|
105
|
+
if (!(
|
|
106
|
+
figure?.data?.some((trace) => trace?.type?.endsWith("mapbox")) ||
|
|
107
|
+
Object.keys(figure?.layout ?? {}).some((key) => /^mapbox\\d*$/.test(key))
|
|
108
|
+
)) {
|
|
109
|
+
return figure;
|
|
110
|
+
}
|
|
111
|
+
if (!_rxDidWarnPlotlyMapbox) {
|
|
112
|
+
_rxDidWarnPlotlyMapbox = true;
|
|
113
|
+
console.warn(
|
|
114
|
+
"Plotly.js 4 removed Mapbox traces and layout.mapbox. Reflex renames them to " +
|
|
115
|
+
"scattermap, choroplethmap, densitymap and layout.map until Reflex 1.0. " +
|
|
116
|
+
"Use the MapLibre names in the figure instead."
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const renamed = _rxRenamePlotlyMapbox(figure);
|
|
120
|
+
if (figure.frames) renamed.frames = figure.frames.map(_rxRenamePlotlyMapbox);
|
|
121
|
+
return renamed;
|
|
122
|
+
};
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
|
|
77
126
|
class Plotly(NoSSRComponent):
|
|
78
127
|
"""Display a plotly graph."""
|
|
79
128
|
|
|
80
129
|
library = "react-plotly.js@4.1.0"
|
|
81
130
|
|
|
82
|
-
lib_dependencies: list[str] = ["plotly.js@3.
|
|
131
|
+
lib_dependencies: list[str] = ["plotly.js@4.3.0"]
|
|
83
132
|
|
|
84
133
|
tag = "Plot"
|
|
85
134
|
|
|
@@ -200,7 +249,7 @@ class Plotly(NoSSRComponent):
|
|
|
200
249
|
}
|
|
201
250
|
if self.locale is not None:
|
|
202
251
|
# For locale dictionaries injected into plot config.locales.
|
|
203
|
-
imports["plotly.js-locales@3.
|
|
252
|
+
imports["plotly.js-locales@4.3.0"] = ImportVar(
|
|
204
253
|
tag="plotlyLocales",
|
|
205
254
|
is_default=True,
|
|
206
255
|
)
|
|
@@ -252,6 +301,7 @@ const extractPoints = (points) => {
|
|
|
252
301
|
})
|
|
253
302
|
}
|
|
254
303
|
""",
|
|
304
|
+
_MAPBOX_TO_MAP_JS,
|
|
255
305
|
]
|
|
256
306
|
if self.locale is not None:
|
|
257
307
|
codes.append("""
|
|
@@ -340,26 +390,15 @@ const _rxGetPlotlyLocaleConfig = (config, locale, plotlyLocales) => {
|
|
|
340
390
|
template_dict = LiteralVar.create({"layout": {"template": self.template}})
|
|
341
391
|
merge_dicts.append(template_dict._without_data())
|
|
342
392
|
if merge_dicts:
|
|
343
|
-
|
|
344
|
-
special_props=[
|
|
345
|
-
*tag.special_props,
|
|
346
|
-
# Merge all dictionaries and spread the result over props.
|
|
347
|
-
Var(
|
|
348
|
-
_js_expr=(
|
|
349
|
-
f"{{ ...mergician({figure!s}, "
|
|
350
|
-
f"...{Var.create(merge_dicts)!s}) }}"
|
|
351
|
-
),
|
|
352
|
-
),
|
|
353
|
-
]
|
|
354
|
-
)
|
|
393
|
+
figure_expr = f"{{ ...mergician({figure!s} ?? {{}}, ...{Var.create(merge_dicts)!s}) }}"
|
|
355
394
|
else:
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
395
|
+
figure_expr = str(figure)
|
|
396
|
+
tag = tag.set(
|
|
397
|
+
special_props=[
|
|
398
|
+
*tag.special_props,
|
|
399
|
+
Var(_js_expr=f"_rxPlotlyMapboxToMap({figure_expr})"),
|
|
400
|
+
]
|
|
401
|
+
)
|
|
363
402
|
if self.locale is not None:
|
|
364
403
|
config = self.config if self.config is not None else LiteralVar.create({})
|
|
365
404
|
tag = tag.set(
|
|
@@ -410,7 +449,7 @@ class PlotlyBasic(Plotly):
|
|
|
410
449
|
|
|
411
450
|
library = "react-plotly.js@4.1.0"
|
|
412
451
|
|
|
413
|
-
lib_dependencies: list[str] = ["plotly.js-basic-dist-min@3.
|
|
452
|
+
lib_dependencies: list[str] = ["plotly.js-basic-dist-min@4.3.0"]
|
|
414
453
|
|
|
415
454
|
def add_imports(self) -> ImportDict:
|
|
416
455
|
"""Add imports for the plotly basic component.
|
|
@@ -436,7 +475,7 @@ class PlotlyCartesian(Plotly):
|
|
|
436
475
|
|
|
437
476
|
library = "react-plotly.js@4.1.0"
|
|
438
477
|
|
|
439
|
-
lib_dependencies: list[str] = ["plotly.js-cartesian-dist-min@3.
|
|
478
|
+
lib_dependencies: list[str] = ["plotly.js-cartesian-dist-min@4.3.0"]
|
|
440
479
|
|
|
441
480
|
def add_imports(self) -> ImportDict:
|
|
442
481
|
"""Add imports for the plotly cartesian component.
|
|
@@ -462,7 +501,7 @@ class PlotlyGeo(Plotly):
|
|
|
462
501
|
|
|
463
502
|
library = "react-plotly.js@4.1.0"
|
|
464
503
|
|
|
465
|
-
lib_dependencies: list[str] = ["plotly.js-geo-dist-min@3.
|
|
504
|
+
lib_dependencies: list[str] = ["plotly.js-geo-dist-min@4.3.0"]
|
|
466
505
|
|
|
467
506
|
def add_imports(self) -> ImportDict:
|
|
468
507
|
"""Add imports for the plotly geo component.
|
|
@@ -488,7 +527,7 @@ class PlotlyGl3d(Plotly):
|
|
|
488
527
|
|
|
489
528
|
library = "react-plotly.js@4.1.0"
|
|
490
529
|
|
|
491
|
-
lib_dependencies: list[str] = ["plotly.js-gl3d-dist-min@3.
|
|
530
|
+
lib_dependencies: list[str] = ["plotly.js-gl3d-dist-min@4.3.0"]
|
|
492
531
|
|
|
493
532
|
def add_imports(self) -> ImportDict:
|
|
494
533
|
"""Add imports for the plotly 3d component.
|
|
@@ -514,7 +553,7 @@ class PlotlyGl2d(Plotly):
|
|
|
514
553
|
|
|
515
554
|
library = "react-plotly.js@4.1.0"
|
|
516
555
|
|
|
517
|
-
lib_dependencies: list[str] = ["plotly.js-gl2d-dist-min@3.
|
|
556
|
+
lib_dependencies: list[str] = ["plotly.js-gl2d-dist-min@4.3.0"]
|
|
518
557
|
|
|
519
558
|
def add_imports(self) -> ImportDict:
|
|
520
559
|
"""Add imports for the plotly 2d component.
|
|
@@ -533,30 +572,69 @@ class PlotlyGl2d(Plotly):
|
|
|
533
572
|
return dynamic_plotly_import(self.tag, "plotly.js-gl2d-dist-min")
|
|
534
573
|
|
|
535
574
|
|
|
536
|
-
class
|
|
537
|
-
"""Display a
|
|
538
|
-
|
|
539
|
-
tag: str = "MapboxPlotlyPlot"
|
|
575
|
+
class PlotlyMap(Plotly):
|
|
576
|
+
"""Display a Plotly MapLibre graph without a Mapbox access token."""
|
|
540
577
|
|
|
541
|
-
|
|
578
|
+
tag: str = "MapPlotlyPlot"
|
|
542
579
|
|
|
543
|
-
lib_dependencies: list[str] = ["plotly.js-
|
|
580
|
+
lib_dependencies: list[str] = ["plotly.js-map-dist-min@4.3.0"]
|
|
544
581
|
|
|
545
582
|
def add_imports(self) -> ImportDict:
|
|
546
|
-
"""Add
|
|
583
|
+
"""Add the factory import for the Plotly map component.
|
|
547
584
|
|
|
548
585
|
Returns:
|
|
549
|
-
The
|
|
586
|
+
The Plotly component factory import.
|
|
550
587
|
"""
|
|
551
588
|
return CREATE_PLOTLY_COMPONENT
|
|
552
589
|
|
|
553
590
|
def _get_dynamic_imports(self) -> str:
|
|
554
|
-
"""
|
|
591
|
+
"""Load the MapLibre bundle on the client.
|
|
555
592
|
|
|
556
593
|
Returns:
|
|
557
|
-
The dynamic
|
|
594
|
+
The dynamic import for the Plotly map component.
|
|
558
595
|
"""
|
|
559
|
-
return dynamic_plotly_import(self.tag, "plotly.js-
|
|
596
|
+
return dynamic_plotly_import(self.tag, "plotly.js-map-dist-min")
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class PlotlyMapbox(PlotlyMap):
|
|
600
|
+
"""Display a legacy Mapbox figure on the MapLibre bundle."""
|
|
601
|
+
|
|
602
|
+
if TYPE_CHECKING:
|
|
603
|
+
|
|
604
|
+
@classmethod
|
|
605
|
+
@deprecated("Use rx.plotly.map with MapLibre traces and layout.map instead.")
|
|
606
|
+
def create(cls, *children, **props) -> Component:
|
|
607
|
+
"""Create a deprecated Plotly Mapbox component.
|
|
608
|
+
|
|
609
|
+
Args:
|
|
610
|
+
*children: The children of the component.
|
|
611
|
+
**props: The properties of the component.
|
|
612
|
+
|
|
613
|
+
Returns:
|
|
614
|
+
The Plotly Mapbox component.
|
|
615
|
+
"""
|
|
616
|
+
...
|
|
617
|
+
|
|
618
|
+
else:
|
|
619
|
+
|
|
620
|
+
@classmethod
|
|
621
|
+
def create(cls, *children, **props) -> Component:
|
|
622
|
+
"""Create a legacy Mapbox map with a migration warning.
|
|
623
|
+
|
|
624
|
+
Args:
|
|
625
|
+
*children: The children of the component.
|
|
626
|
+
**props: The properties of the component.
|
|
627
|
+
|
|
628
|
+
Returns:
|
|
629
|
+
The Plotly Mapbox component.
|
|
630
|
+
"""
|
|
631
|
+
console.deprecate(
|
|
632
|
+
feature_name="rx.plotly.mapbox",
|
|
633
|
+
reason="Use rx.plotly.map with MapLibre traces and layout.map instead",
|
|
634
|
+
deprecation_version="0.12.0",
|
|
635
|
+
removal_version="1.0",
|
|
636
|
+
)
|
|
637
|
+
return super().create(*children, **props)
|
|
560
638
|
|
|
561
639
|
|
|
562
640
|
class PlotlyFinance(Plotly):
|
|
@@ -566,7 +644,7 @@ class PlotlyFinance(Plotly):
|
|
|
566
644
|
|
|
567
645
|
library = "react-plotly.js@4.1.0"
|
|
568
646
|
|
|
569
|
-
lib_dependencies: list[str] = ["plotly.js-finance-dist-min@3.
|
|
647
|
+
lib_dependencies: list[str] = ["plotly.js-finance-dist-min@4.3.0"]
|
|
570
648
|
|
|
571
649
|
def add_imports(self) -> ImportDict:
|
|
572
650
|
"""Add imports for the plotly finance component.
|
|
@@ -592,7 +670,7 @@ class PlotlyStrict(Plotly):
|
|
|
592
670
|
|
|
593
671
|
library = "react-plotly.js@4.1.0"
|
|
594
672
|
|
|
595
|
-
lib_dependencies: list[str] = ["plotly.js-strict-dist-min@3.
|
|
673
|
+
lib_dependencies: list[str] = ["plotly.js-strict-dist-min@4.3.0"]
|
|
596
674
|
|
|
597
675
|
def add_imports(self) -> ImportDict:
|
|
598
676
|
"""Add imports for the plotly strict component.
|
|
@@ -13,6 +13,8 @@ from reflex_base.utils.imports import ImportDict
|
|
|
13
13
|
from reflex_base.vars.base import Var
|
|
14
14
|
from reflex_components_core.core.breakpoints import Breakpoints
|
|
15
15
|
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from typing_extensions import deprecated
|
|
16
18
|
logger = logging.getLogger(__name__)
|
|
17
19
|
try:
|
|
18
20
|
from plotly.graph_objs import Figure
|
|
@@ -49,6 +51,7 @@ class Point(TypedDict):
|
|
|
49
51
|
|
|
50
52
|
_ID_PROP = "id"
|
|
51
53
|
_DIV_ID_PROP = "divId"
|
|
54
|
+
_MAPBOX_TO_MAP_JS = '\nconst _rxMapboxToMapName = (name) =>\n name.replace(/^((?:scatter|choropleth|density)?map)box(\\d*)$/, "$1$2");\nconst _rxRenamePlotlyMapbox = ({ data, layout, ...rest }) => ({\n ...rest,\n ...(data && {\n data: data.map((trace) => ({\n ...trace,\n ...(trace?.type && { type: _rxMapboxToMapName(trace.type) }),\n ...(trace?.subplot && { subplot: _rxMapboxToMapName(trace.subplot) }),\n })),\n }),\n ...(layout && {\n layout: Object.fromEntries(\n Object.entries(layout).map(([key, value]) => [_rxMapboxToMapName(key), value])\n ),\n }),\n});\nlet _rxDidWarnPlotlyMapbox = false;\nconst _rxPlotlyMapboxToMap = (figure) => {\n if (!(\n figure?.data?.some((trace) => trace?.type?.endsWith("mapbox")) ||\n Object.keys(figure?.layout ?? {}).some((key) => /^mapbox\\d*$/.test(key))\n )) {\n return figure;\n }\n if (!_rxDidWarnPlotlyMapbox) {\n _rxDidWarnPlotlyMapbox = true;\n console.warn(\n "Plotly.js 4 removed Mapbox traces and layout.mapbox. Reflex renames them to " +\n "scattermap, choroplethmap, densitymap and layout.map until Reflex 1.0. " +\n "Use the MapLibre names in the figure instead."\n );\n }\n const renamed = _rxRenamePlotlyMapbox(figure);\n if (figure.frames) renamed.frames = figure.frames.map(_rxRenamePlotlyMapbox);\n return renamed;\n};\n'
|
|
52
55
|
|
|
53
56
|
class Plotly(NoSSRComponent):
|
|
54
57
|
def add_imports(self) -> ImportDict: ...
|
|
@@ -739,7 +742,7 @@ class PlotlyGl2d(Plotly):
|
|
|
739
742
|
The Plotly component.
|
|
740
743
|
"""
|
|
741
744
|
|
|
742
|
-
class
|
|
745
|
+
class PlotlyMap(Plotly):
|
|
743
746
|
def add_imports(self) -> ImportDict: ...
|
|
744
747
|
@classmethod
|
|
745
748
|
def create(
|
|
@@ -796,7 +799,7 @@ class PlotlyMapbox(Plotly):
|
|
|
796
799
|
on_unhover: EventType[()] | EventType[list[Point]] | None = None,
|
|
797
800
|
on_unmount: EventType[()] | None = None,
|
|
798
801
|
**props,
|
|
799
|
-
) ->
|
|
802
|
+
) -> PlotlyMap:
|
|
800
803
|
"""Create the Plotly component.
|
|
801
804
|
|
|
802
805
|
Args:
|
|
@@ -853,6 +856,347 @@ class PlotlyMapbox(Plotly):
|
|
|
853
856
|
The Plotly component.
|
|
854
857
|
"""
|
|
855
858
|
|
|
859
|
+
class PlotlyMapbox(PlotlyMap):
|
|
860
|
+
if TYPE_CHECKING:
|
|
861
|
+
@classmethod
|
|
862
|
+
@deprecated("Use rx.plotly.map with MapLibre traces and layout.map instead.")
|
|
863
|
+
def create(
|
|
864
|
+
cls,
|
|
865
|
+
*children,
|
|
866
|
+
data: Any | Var[Any] | None = None,
|
|
867
|
+
layout: Var[dict] | dict | None = None,
|
|
868
|
+
template: Any | Var[Any] | None = None,
|
|
869
|
+
config: Var[dict] | dict | None = None,
|
|
870
|
+
locale: Var[str] | str | None = None,
|
|
871
|
+
use_resize_handler: Var[bool] | bool | None = None,
|
|
872
|
+
style: Sequence[Mapping[str, Any]]
|
|
873
|
+
| Mapping[str, Any]
|
|
874
|
+
| Var[Mapping[str, Any]]
|
|
875
|
+
| Breakpoints
|
|
876
|
+
| None = None,
|
|
877
|
+
key: Any | None = None,
|
|
878
|
+
id: Any | None = None,
|
|
879
|
+
ref: Var | None = None,
|
|
880
|
+
class_name: Any | None = None,
|
|
881
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
882
|
+
on_after_plot: EventType[()] | None = None,
|
|
883
|
+
on_animated: EventType[()] | None = None,
|
|
884
|
+
on_animating_frame: EventType[()] | None = None,
|
|
885
|
+
on_animation_interrupted: EventType[()] | None = None,
|
|
886
|
+
on_autosize: EventType[()] | None = None,
|
|
887
|
+
on_before_hover: EventType[()] | None = None,
|
|
888
|
+
on_blur: EventType[()] | None = None,
|
|
889
|
+
on_button_clicked: EventType[()] | None = None,
|
|
890
|
+
on_click: EventType[()] | EventType[list[Point]] | None = None,
|
|
891
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
892
|
+
on_deselect: EventType[()] | None = None,
|
|
893
|
+
on_double_click: EventType[()] | None = None,
|
|
894
|
+
on_focus: EventType[()] | None = None,
|
|
895
|
+
on_hover: EventType[()] | EventType[list[Point]] | None = None,
|
|
896
|
+
on_mount: EventType[()] | None = None,
|
|
897
|
+
on_mouse_down: EventType[()] | None = None,
|
|
898
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
899
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
900
|
+
on_mouse_move: EventType[()] | None = None,
|
|
901
|
+
on_mouse_out: EventType[()] | None = None,
|
|
902
|
+
on_mouse_over: EventType[()] | None = None,
|
|
903
|
+
on_mouse_up: EventType[()] | None = None,
|
|
904
|
+
on_redraw: EventType[()] | None = None,
|
|
905
|
+
on_relayout: EventType[()] | None = None,
|
|
906
|
+
on_relayouting: EventType[()] | None = None,
|
|
907
|
+
on_restyle: EventType[()] | None = None,
|
|
908
|
+
on_scroll: EventType[()] | None = None,
|
|
909
|
+
on_scroll_end: EventType[()] | None = None,
|
|
910
|
+
on_selected: EventType[()] | EventType[list[Point]] | None = None,
|
|
911
|
+
on_selecting: EventType[()] | EventType[list[Point]] | None = None,
|
|
912
|
+
on_transition_interrupted: EventType[()] | None = None,
|
|
913
|
+
on_transitioning: EventType[()] | None = None,
|
|
914
|
+
on_unhover: EventType[()] | EventType[list[Point]] | None = None,
|
|
915
|
+
on_unmount: EventType[()] | None = None,
|
|
916
|
+
**props,
|
|
917
|
+
) -> PlotlyMapbox:
|
|
918
|
+
"""Create a legacy Mapbox map with a migration warning.
|
|
919
|
+
|
|
920
|
+
Args:
|
|
921
|
+
*children: The children of the component.
|
|
922
|
+
data: The figure to display. This can be a plotly figure or a plotly data json.
|
|
923
|
+
layout: The layout of the graph.
|
|
924
|
+
template: The template for visual appearance of the graph.
|
|
925
|
+
config: The config of the graph.
|
|
926
|
+
locale: The locale code used for Plotly formatting and modebar labels.
|
|
927
|
+
use_resize_handler: If true, the graph will resize when the window is resized.
|
|
928
|
+
style: The style of the component.
|
|
929
|
+
key: A unique key for the component.
|
|
930
|
+
id: The id for the component.
|
|
931
|
+
ref: The Var to pass as the ref to the component.
|
|
932
|
+
class_name: The class name for the component.
|
|
933
|
+
custom_attrs: Attributes passed directly to the component.
|
|
934
|
+
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.
|
|
935
|
+
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.
|
|
936
|
+
on_click: Fired when the plot is clicked.
|
|
937
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
938
|
+
on_double_click: Fired when the plot is double clicked.
|
|
939
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
940
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
941
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
942
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
943
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
944
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
945
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
946
|
+
on_scroll: Fired when the user scrolls the element.
|
|
947
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
948
|
+
on_mount: Fired when the component is mounted to the page.
|
|
949
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
950
|
+
on_after_plot: Fired after the plot is redrawn.
|
|
951
|
+
on_animated: Fired after the plot was animated.
|
|
952
|
+
on_animating_frame: Fired while animating a single frame (does not currently pass data through).
|
|
953
|
+
on_animation_interrupted: Fired when an animation is interrupted (to start a new animation for example).
|
|
954
|
+
on_autosize: Fired when the plot is responsively sized.
|
|
955
|
+
on_before_hover: Fired whenever mouse moves over a plot.
|
|
956
|
+
on_button_clicked: Fired when a plotly UI button is clicked.
|
|
957
|
+
on_deselect: Fired when a selection is cleared (via double click).
|
|
958
|
+
on_hover: Fired when a plot element is hovered over.
|
|
959
|
+
on_relayout: Fired after the plot is laid out (zoom, pan, etc).
|
|
960
|
+
on_relayouting: Fired while the plot is being laid out.
|
|
961
|
+
on_restyle: Fired after the plot style is changed.
|
|
962
|
+
on_redraw: Fired after the plot is redrawn.
|
|
963
|
+
on_selected: Fired after selecting plot elements.
|
|
964
|
+
on_selecting: Fired while dragging a selection.
|
|
965
|
+
on_transitioning: Fired while an animation is occurring.
|
|
966
|
+
on_transition_interrupted: Fired when a transition is stopped early.
|
|
967
|
+
on_unhover: Fired when a hovered element is no longer hovered.
|
|
968
|
+
**props: The properties of the component.
|
|
969
|
+
|
|
970
|
+
Returns:
|
|
971
|
+
The Plotly Mapbox component.
|
|
972
|
+
"""
|
|
973
|
+
...
|
|
974
|
+
|
|
975
|
+
else:
|
|
976
|
+
@classmethod
|
|
977
|
+
def create(
|
|
978
|
+
cls,
|
|
979
|
+
*children,
|
|
980
|
+
data: Any | Var[Any] | None = None,
|
|
981
|
+
layout: Var[dict] | dict | None = None,
|
|
982
|
+
template: Any | Var[Any] | None = None,
|
|
983
|
+
config: Var[dict] | dict | None = None,
|
|
984
|
+
locale: Var[str] | str | None = None,
|
|
985
|
+
use_resize_handler: Var[bool] | bool | None = None,
|
|
986
|
+
style: Sequence[Mapping[str, Any]]
|
|
987
|
+
| Mapping[str, Any]
|
|
988
|
+
| Var[Mapping[str, Any]]
|
|
989
|
+
| Breakpoints
|
|
990
|
+
| None = None,
|
|
991
|
+
key: Any | None = None,
|
|
992
|
+
id: Any | None = None,
|
|
993
|
+
ref: Var | None = None,
|
|
994
|
+
class_name: Any | None = None,
|
|
995
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
996
|
+
on_after_plot: EventType[()] | None = None,
|
|
997
|
+
on_animated: EventType[()] | None = None,
|
|
998
|
+
on_animating_frame: EventType[()] | None = None,
|
|
999
|
+
on_animation_interrupted: EventType[()] | None = None,
|
|
1000
|
+
on_autosize: EventType[()] | None = None,
|
|
1001
|
+
on_before_hover: EventType[()] | None = None,
|
|
1002
|
+
on_blur: EventType[()] | None = None,
|
|
1003
|
+
on_button_clicked: EventType[()] | None = None,
|
|
1004
|
+
on_click: EventType[()] | EventType[list[Point]] | None = None,
|
|
1005
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
1006
|
+
on_deselect: EventType[()] | None = None,
|
|
1007
|
+
on_double_click: EventType[()] | None = None,
|
|
1008
|
+
on_focus: EventType[()] | None = None,
|
|
1009
|
+
on_hover: EventType[()] | EventType[list[Point]] | None = None,
|
|
1010
|
+
on_mount: EventType[()] | None = None,
|
|
1011
|
+
on_mouse_down: EventType[()] | None = None,
|
|
1012
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
1013
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
1014
|
+
on_mouse_move: EventType[()] | None = None,
|
|
1015
|
+
on_mouse_out: EventType[()] | None = None,
|
|
1016
|
+
on_mouse_over: EventType[()] | None = None,
|
|
1017
|
+
on_mouse_up: EventType[()] | None = None,
|
|
1018
|
+
on_redraw: EventType[()] | None = None,
|
|
1019
|
+
on_relayout: EventType[()] | None = None,
|
|
1020
|
+
on_relayouting: EventType[()] | None = None,
|
|
1021
|
+
on_restyle: EventType[()] | None = None,
|
|
1022
|
+
on_scroll: EventType[()] | None = None,
|
|
1023
|
+
on_scroll_end: EventType[()] | None = None,
|
|
1024
|
+
on_selected: EventType[()] | EventType[list[Point]] | None = None,
|
|
1025
|
+
on_selecting: EventType[()] | EventType[list[Point]] | None = None,
|
|
1026
|
+
on_transition_interrupted: EventType[()] | None = None,
|
|
1027
|
+
on_transitioning: EventType[()] | None = None,
|
|
1028
|
+
on_unhover: EventType[()] | EventType[list[Point]] | None = None,
|
|
1029
|
+
on_unmount: EventType[()] | None = None,
|
|
1030
|
+
**props,
|
|
1031
|
+
) -> PlotlyMapbox:
|
|
1032
|
+
"""Create a legacy Mapbox map with a migration warning.
|
|
1033
|
+
|
|
1034
|
+
Args:
|
|
1035
|
+
*children: The children of the component.
|
|
1036
|
+
data: The figure to display. This can be a plotly figure or a plotly data json.
|
|
1037
|
+
layout: The layout of the graph.
|
|
1038
|
+
template: The template for visual appearance of the graph.
|
|
1039
|
+
config: The config of the graph.
|
|
1040
|
+
locale: The locale code used for Plotly formatting and modebar labels.
|
|
1041
|
+
use_resize_handler: If true, the graph will resize when the window is resized.
|
|
1042
|
+
style: The style of the component.
|
|
1043
|
+
key: A unique key for the component.
|
|
1044
|
+
id: The id for the component.
|
|
1045
|
+
ref: The Var to pass as the ref to the component.
|
|
1046
|
+
class_name: The class name for the component.
|
|
1047
|
+
custom_attrs: Attributes passed directly to the component.
|
|
1048
|
+
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.
|
|
1049
|
+
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.
|
|
1050
|
+
on_click: Fired when the plot is clicked.
|
|
1051
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
1052
|
+
on_double_click: Fired when the plot is double clicked.
|
|
1053
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
1054
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
1055
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
1056
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
1057
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
1058
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
1059
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
1060
|
+
on_scroll: Fired when the user scrolls the element.
|
|
1061
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
1062
|
+
on_mount: Fired when the component is mounted to the page.
|
|
1063
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
1064
|
+
on_after_plot: Fired after the plot is redrawn.
|
|
1065
|
+
on_animated: Fired after the plot was animated.
|
|
1066
|
+
on_animating_frame: Fired while animating a single frame (does not currently pass data through).
|
|
1067
|
+
on_animation_interrupted: Fired when an animation is interrupted (to start a new animation for example).
|
|
1068
|
+
on_autosize: Fired when the plot is responsively sized.
|
|
1069
|
+
on_before_hover: Fired whenever mouse moves over a plot.
|
|
1070
|
+
on_button_clicked: Fired when a plotly UI button is clicked.
|
|
1071
|
+
on_deselect: Fired when a selection is cleared (via double click).
|
|
1072
|
+
on_hover: Fired when a plot element is hovered over.
|
|
1073
|
+
on_relayout: Fired after the plot is laid out (zoom, pan, etc).
|
|
1074
|
+
on_relayouting: Fired while the plot is being laid out.
|
|
1075
|
+
on_restyle: Fired after the plot style is changed.
|
|
1076
|
+
on_redraw: Fired after the plot is redrawn.
|
|
1077
|
+
on_selected: Fired after selecting plot elements.
|
|
1078
|
+
on_selecting: Fired while dragging a selection.
|
|
1079
|
+
on_transitioning: Fired while an animation is occurring.
|
|
1080
|
+
on_transition_interrupted: Fired when a transition is stopped early.
|
|
1081
|
+
on_unhover: Fired when a hovered element is no longer hovered.
|
|
1082
|
+
**props: The properties of the component.
|
|
1083
|
+
|
|
1084
|
+
Returns:
|
|
1085
|
+
The Plotly Mapbox component.
|
|
1086
|
+
"""
|
|
1087
|
+
|
|
1088
|
+
@classmethod
|
|
1089
|
+
def create(
|
|
1090
|
+
cls,
|
|
1091
|
+
*children,
|
|
1092
|
+
data: Any | Var[Any] | None = None,
|
|
1093
|
+
layout: Var[dict] | dict | None = None,
|
|
1094
|
+
template: Any | Var[Any] | None = None,
|
|
1095
|
+
config: Var[dict] | dict | None = None,
|
|
1096
|
+
locale: Var[str] | str | None = None,
|
|
1097
|
+
use_resize_handler: Var[bool] | bool | None = None,
|
|
1098
|
+
style: Sequence[Mapping[str, Any]]
|
|
1099
|
+
| Mapping[str, Any]
|
|
1100
|
+
| Var[Mapping[str, Any]]
|
|
1101
|
+
| Breakpoints
|
|
1102
|
+
| None = None,
|
|
1103
|
+
key: Any | None = None,
|
|
1104
|
+
id: Any | None = None,
|
|
1105
|
+
ref: Var | None = None,
|
|
1106
|
+
class_name: Any | None = None,
|
|
1107
|
+
custom_attrs: dict[str, Any | Var] | None = None,
|
|
1108
|
+
on_after_plot: EventType[()] | None = None,
|
|
1109
|
+
on_animated: EventType[()] | None = None,
|
|
1110
|
+
on_animating_frame: EventType[()] | None = None,
|
|
1111
|
+
on_animation_interrupted: EventType[()] | None = None,
|
|
1112
|
+
on_autosize: EventType[()] | None = None,
|
|
1113
|
+
on_before_hover: EventType[()] | None = None,
|
|
1114
|
+
on_blur: EventType[()] | None = None,
|
|
1115
|
+
on_button_clicked: EventType[()] | None = None,
|
|
1116
|
+
on_click: EventType[()] | EventType[list[Point]] | None = None,
|
|
1117
|
+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
1118
|
+
on_deselect: EventType[()] | None = None,
|
|
1119
|
+
on_double_click: EventType[()] | None = None,
|
|
1120
|
+
on_focus: EventType[()] | None = None,
|
|
1121
|
+
on_hover: EventType[()] | EventType[list[Point]] | None = None,
|
|
1122
|
+
on_mount: EventType[()] | None = None,
|
|
1123
|
+
on_mouse_down: EventType[()] | None = None,
|
|
1124
|
+
on_mouse_enter: EventType[()] | None = None,
|
|
1125
|
+
on_mouse_leave: EventType[()] | None = None,
|
|
1126
|
+
on_mouse_move: EventType[()] | None = None,
|
|
1127
|
+
on_mouse_out: EventType[()] | None = None,
|
|
1128
|
+
on_mouse_over: EventType[()] | None = None,
|
|
1129
|
+
on_mouse_up: EventType[()] | None = None,
|
|
1130
|
+
on_redraw: EventType[()] | None = None,
|
|
1131
|
+
on_relayout: EventType[()] | None = None,
|
|
1132
|
+
on_relayouting: EventType[()] | None = None,
|
|
1133
|
+
on_restyle: EventType[()] | None = None,
|
|
1134
|
+
on_scroll: EventType[()] | None = None,
|
|
1135
|
+
on_scroll_end: EventType[()] | None = None,
|
|
1136
|
+
on_selected: EventType[()] | EventType[list[Point]] | None = None,
|
|
1137
|
+
on_selecting: EventType[()] | EventType[list[Point]] | None = None,
|
|
1138
|
+
on_transition_interrupted: EventType[()] | None = None,
|
|
1139
|
+
on_transitioning: EventType[()] | None = None,
|
|
1140
|
+
on_unhover: EventType[()] | EventType[list[Point]] | None = None,
|
|
1141
|
+
on_unmount: EventType[()] | None = None,
|
|
1142
|
+
**props,
|
|
1143
|
+
) -> PlotlyMapbox:
|
|
1144
|
+
"""Create a legacy Mapbox map with a migration warning.
|
|
1145
|
+
|
|
1146
|
+
Args:
|
|
1147
|
+
*children: The children of the component.
|
|
1148
|
+
data: The figure to display. This can be a plotly figure or a plotly data json.
|
|
1149
|
+
layout: The layout of the graph.
|
|
1150
|
+
template: The template for visual appearance of the graph.
|
|
1151
|
+
config: The config of the graph.
|
|
1152
|
+
locale: The locale code used for Plotly formatting and modebar labels.
|
|
1153
|
+
use_resize_handler: If true, the graph will resize when the window is resized.
|
|
1154
|
+
style: The style of the component.
|
|
1155
|
+
key: A unique key for the component.
|
|
1156
|
+
id: The id for the component.
|
|
1157
|
+
ref: The Var to pass as the ref to the component.
|
|
1158
|
+
class_name: The class name for the component.
|
|
1159
|
+
custom_attrs: Attributes passed directly to the component.
|
|
1160
|
+
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.
|
|
1161
|
+
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.
|
|
1162
|
+
on_click: Fired when the plot is clicked.
|
|
1163
|
+
on_context_menu: Fired when the user right-clicks on an element.
|
|
1164
|
+
on_double_click: Fired when the plot is double clicked.
|
|
1165
|
+
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
1166
|
+
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
1167
|
+
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
1168
|
+
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
1169
|
+
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
1170
|
+
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
1171
|
+
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
1172
|
+
on_scroll: Fired when the user scrolls the element.
|
|
1173
|
+
on_scroll_end: Fired when scrolling ends on the element.
|
|
1174
|
+
on_mount: Fired when the component is mounted to the page.
|
|
1175
|
+
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
1176
|
+
on_after_plot: Fired after the plot is redrawn.
|
|
1177
|
+
on_animated: Fired after the plot was animated.
|
|
1178
|
+
on_animating_frame: Fired while animating a single frame (does not currently pass data through).
|
|
1179
|
+
on_animation_interrupted: Fired when an animation is interrupted (to start a new animation for example).
|
|
1180
|
+
on_autosize: Fired when the plot is responsively sized.
|
|
1181
|
+
on_before_hover: Fired whenever mouse moves over a plot.
|
|
1182
|
+
on_button_clicked: Fired when a plotly UI button is clicked.
|
|
1183
|
+
on_deselect: Fired when a selection is cleared (via double click).
|
|
1184
|
+
on_hover: Fired when a plot element is hovered over.
|
|
1185
|
+
on_relayout: Fired after the plot is laid out (zoom, pan, etc).
|
|
1186
|
+
on_relayouting: Fired while the plot is being laid out.
|
|
1187
|
+
on_restyle: Fired after the plot style is changed.
|
|
1188
|
+
on_redraw: Fired after the plot is redrawn.
|
|
1189
|
+
on_selected: Fired after selecting plot elements.
|
|
1190
|
+
on_selecting: Fired while dragging a selection.
|
|
1191
|
+
on_transitioning: Fired while an animation is occurring.
|
|
1192
|
+
on_transition_interrupted: Fired when a transition is stopped early.
|
|
1193
|
+
on_unhover: Fired when a hovered element is no longer hovered.
|
|
1194
|
+
**props: The properties of the component.
|
|
1195
|
+
|
|
1196
|
+
Returns:
|
|
1197
|
+
The Plotly Mapbox component.
|
|
1198
|
+
"""
|
|
1199
|
+
|
|
856
1200
|
class PlotlyFinance(Plotly):
|
|
857
1201
|
def add_imports(self) -> ImportDict: ...
|
|
858
1202
|
@classmethod
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: reflex-components-plotly
|
|
3
|
-
Version: 0.10.0a1
|
|
4
|
-
Summary: Reflex plotly components.
|
|
5
|
-
Author-email: Khaleel Al-Adhami <khaleel@reflex.dev>
|
|
6
|
-
Maintainer-email: Khaleel Al-Adhami <khaleel@reflex.dev>
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Requires-Dist: reflex-base>=0.9.12
|
|
10
|
-
Requires-Dist: reflex-components-core>=0.9.0
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
|
|
13
|
-
# reflex-components-plotly
|
|
14
|
-
|
|
15
|
-
Reflex plotly components.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"""Plotly components."""
|
|
2
|
-
|
|
3
|
-
from reflex_base.components.component import ComponentNamespace
|
|
4
|
-
|
|
5
|
-
from .plotly import (
|
|
6
|
-
Plotly,
|
|
7
|
-
PlotlyBasic,
|
|
8
|
-
PlotlyCartesian,
|
|
9
|
-
PlotlyFinance,
|
|
10
|
-
PlotlyGeo,
|
|
11
|
-
PlotlyGl2d,
|
|
12
|
-
PlotlyGl3d,
|
|
13
|
-
PlotlyMapbox,
|
|
14
|
-
PlotlyStrict,
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class PlotlyNamespace(ComponentNamespace):
|
|
19
|
-
"""Plotly namespace."""
|
|
20
|
-
|
|
21
|
-
__call__ = Plotly.create
|
|
22
|
-
basic = PlotlyBasic.create
|
|
23
|
-
cartesian = PlotlyCartesian.create
|
|
24
|
-
geo = PlotlyGeo.create
|
|
25
|
-
gl2d = PlotlyGl2d.create
|
|
26
|
-
gl3d = PlotlyGl3d.create
|
|
27
|
-
finance = PlotlyFinance.create
|
|
28
|
-
mapbox = PlotlyMapbox.create
|
|
29
|
-
strict = PlotlyStrict.create
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
plotly = PlotlyNamespace()
|
|
File without changes
|
|
File without changes
|