forked from emilhe/dash-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2950010
commit 1fe5322
Showing
25 changed files
with
1,536 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,6 @@ dmypy.json | |
node_modules | ||
/assets/ | ||
|
||
dash_extensions/* | ||
inst/* | ||
**/file_system_backend/* | ||
man/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Metadata-Version: 2.1 | ||
Name: dash-extensions | ||
Version: 1.0.12 | ||
Summary: Extensions for Plotly Dash. | ||
Home-page: https://dash-extensions.com | ||
License: MIT | ||
Author: emher | ||
Author-email: [email protected] | ||
Requires-Python: >=3.8,<4 | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 3.8 | ||
Classifier: Programming Language :: Python :: 3.9 | ||
Classifier: Programming Language :: Python :: 3.10 | ||
Classifier: Programming Language :: Python :: 3.11 | ||
Provides-Extra: mantine | ||
Requires-Dist: Flask-Caching (>=2.1.0,<3.0.0) | ||
Requires-Dist: dash (>=2.15.0) | ||
Requires-Dist: dash-mantine-components (>=0.11.1,<0.12.0) ; extra == "mantine" | ||
Requires-Dist: dataclass-wizard (>=0.22.2,<0.23.0) | ||
Requires-Dist: jsbeautifier (>=1.14.3,<2.0.0) | ||
Requires-Dist: more-itertools (>=9.0.0,<10.0.0) | ||
Project-URL: Repository, https://github.com/thedirtyfew/dash-extensions | ||
Description-Content-Type: text/markdown | ||
|
||
[![PyPI Latest Release](https://img.shields.io/pypi/v/dash-extensions.svg)](https://pypi.org/project/dash-extensions/) | ||
[![codecov](https://img.shields.io/codecov/c/github/thedirtyfew/dash-extensions?logo=codecov)](https://codecov.io/gh/thedirtyfew/dash-extensions) | ||
[![Testing](https://github.com/thedirtyfew/dash-extensions/actions/workflows/python-test.yml/badge.svg)](https://github.com/thedirtyfew/dash-extensions/actions/workflows/python-test.yml) | ||
[![CodeQL](https://github.com/thedirtyfew/dash-extensions/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/thedirtyfew/dash-extensions/actions/workflows/codeql-analysis.yml) | ||
|
||
The `dash-extensions` package is a collection of utility functions, syntax extensions, and Dash components that aim to improve the Dash development experience. It can be divided in four main pillars, | ||
|
||
* The `enrich` module, which contains various enriched versions of Dash components | ||
* A number of custom components, e.g. the `Websocket` component, which enables real-time communication and push notifications | ||
* The `javascript` module, which contains functionality to ease the interplay between Dash and JavaScript | ||
* The `snippets` module, which contains a collection of utility functions (documentation limited to source code comments) | ||
|
||
The `enrich` module enables a number of _transforms_ that add functionality and/or syntactic sugar to Dash. Examples include | ||
|
||
* Making it possible to avoid invoking a callback _if it is already running_ via the `BlockingCallbackTransform` | ||
* Enabling logging from within Dash callbacks via the `LogTransform` | ||
* Improving app performance via the `ServersideOutputTransform` | ||
|
||
to name a few. To enable interactivity, the documentation has been moved to a [separate page](http://dash-extensions.com). | ||
|
||
NB: The 1.0.0 version introduces a number of breaking changes, see documentation for details. | ||
|
||
## Donation | ||
|
||
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=Z9RXT5HVPK3B8¤cy_code=DKK&source=url) | ||
|
||
## Installing | ||
|
||
* Only `release/{VERSION}` branches and `v{VERSION}` tags should be used for direct pip / poetry based install(s), installation(s) from branches that were not created by the `release` action will not work as they will be missing all the `webpack` generated files. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class BeforeAfter(Component): | ||
"""A BeforeAfter component. | ||
Before After Image Slider based on https://github.com/sneas/img-comparison-slider | ||
Keyword arguments: | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- after (dict; optional): | ||
Props for the `after` Img component. eg {\"src\": | ||
\"/assets/lena_color.png\"}. | ||
- before (dict; optional): | ||
Props for the `before` Img component. eg {\"src\": | ||
\"/assets/lena_bw.png\"}. | ||
- direction (a value equal to: 'horizontal', 'vertical'; default 'horizontal'): | ||
Set slider direction. | ||
- height (string; default 'auto'): | ||
Image height - default \"auto\" for responsive images. | ||
- hover (boolean; default True): | ||
Automatic slide on mouse over. | ||
- keyboard (a value equal to: 'enabled', 'disabled'; default 'enabled'): | ||
Enable/disable slider position control with the keyboard. | ||
- value (number; default 50): | ||
The divider position can be specified as a percentage, i.e. 0 to | ||
100. | ||
- width (string; default '100%'): | ||
Image width - default \"100%\" for responsive images.""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'BeforeAfter' | ||
@_explicitize_args | ||
def __init__(self, id=Component.UNDEFINED, height=Component.UNDEFINED, width=Component.UNDEFINED, hover=Component.UNDEFINED, value=Component.UNDEFINED, direction=Component.UNDEFINED, keyboard=Component.UNDEFINED, before=Component.UNDEFINED, after=Component.UNDEFINED, **kwargs): | ||
self._prop_names = ['id', 'after', 'before', 'direction', 'height', 'hover', 'keyboard', 'value', 'width'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['id', 'after', 'before', 'direction', 'height', 'hover', 'keyboard', 'value', 'width'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args} | ||
|
||
super(BeforeAfter, self).__init__(**args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class CycleBreaker(Component): | ||
"""A CycleBreaker component. | ||
Simple data store that automatically copies the current value of the src property into dst property. Can be used to break circular dependencies. | ||
Keyword arguments: | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- dst (boolean | number | string | dict | list; optional): | ||
Read the forwarded value from this property. | ||
- src (boolean | number | string | dict | list; optional): | ||
Set this property to value to be forwarded from .""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'CycleBreaker' | ||
@_explicitize_args | ||
def __init__(self, id=Component.UNDEFINED, src=Component.UNDEFINED, dst=Component.UNDEFINED, **kwargs): | ||
self._prop_names = ['id', 'dst', 'src'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['id', 'dst', 'src'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args} | ||
|
||
super(CycleBreaker, self).__init__(**args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class DeferScript(Component): | ||
"""A DeferScript component. | ||
Used to delay import of js resources until after React had been loaded. Typically used to apply js to dynamic | ||
content. Based on https://github.com/Grasia/grasia-dash-components/blob/master/src/components/Import.react.js | ||
Keyword arguments: | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- src (string; optional): | ||
Local or external source of the javascript to import.""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'DeferScript' | ||
@_explicitize_args | ||
def __init__(self, id=Component.UNDEFINED, src=Component.UNDEFINED, **kwargs): | ||
self._prop_names = ['id', 'src'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['id', 'src'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args} | ||
|
||
super(DeferScript, self).__init__(**args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class EventListener(Component): | ||
"""An EventListener component. | ||
The EventListener component listens for events from the document object or children if provided. | ||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): | ||
The children of this component. If any children are provided, the | ||
component will listen for events from these components. If no | ||
children are specified, the component will listen for events from | ||
the document object. | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- className (string; optional): | ||
A custom class name. | ||
- event (dict; optional): | ||
The latest event fired. | ||
- events (list of dicts; default [{"event": "keydown", "props": ["key", "altKey", "ctrlKey", "shiftKey","metaKey", "repeat"]}]): | ||
The event entry specifies which event to listen to, e.g. \"click\" | ||
for click events. The \"props\" entry specifies what event | ||
properties to record, e.g. [\"x\", \"y\"] to get the cursor | ||
position. | ||
`events` is a list of dicts with keys: | ||
- event (string; optional) | ||
- props (list of strings; optional) | ||
- logging (boolean; default False): | ||
If True, event information is logged to the javascript console. | ||
Useful if you can't remember events props. | ||
- n_events (number; default 0): | ||
The number of events fired. | ||
- style (dict; optional): | ||
The CSS style of the component. | ||
- useCapture (boolean; default False): | ||
Value of useCapture used when registering event listeners.""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'EventListener' | ||
@_explicitize_args | ||
def __init__(self, children=None, id=Component.UNDEFINED, events=Component.UNDEFINED, logging=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, event=Component.UNDEFINED, n_events=Component.UNDEFINED, useCapture=Component.UNDEFINED, **kwargs): | ||
self._prop_names = ['children', 'id', 'className', 'event', 'events', 'logging', 'n_events', 'style', 'useCapture'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['children', 'id', 'className', 'event', 'events', 'logging', 'n_events', 'style', 'useCapture'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args if k != 'children'} | ||
|
||
super(EventListener, self).__init__(children=children, **args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class EventSource(Component): | ||
"""An EventSource component. | ||
An interface to server sent events in Dash | ||
Keyword arguments: | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- close (boolean; optional): | ||
Close event source. | ||
- error (string; optional): | ||
Error. | ||
- message (string; optional): | ||
Received message. | ||
- readyState (number; optional): | ||
A number representing the state of the connection. Possible values | ||
are CONNECTING (0), OPEN (1), or CLOSED (2). | ||
- url (string; required): | ||
A DOMString representing the URL of the source. | ||
- withCredentials (boolean; optional): | ||
A boolean value indicating whether the EventSource object was | ||
instantiated with cross-origin (CORS) credentials set (True), or | ||
not (False, the default).""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'EventSource' | ||
@_explicitize_args | ||
def __init__(self, id=Component.UNDEFINED, close=Component.UNDEFINED, error=Component.UNDEFINED, message=Component.UNDEFINED, readyState=Component.UNDEFINED, withCredentials=Component.UNDEFINED, url=Component.REQUIRED, **kwargs): | ||
self._prop_names = ['id', 'close', 'error', 'message', 'readyState', 'url', 'withCredentials'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['id', 'close', 'error', 'message', 'readyState', 'url', 'withCredentials'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args} | ||
|
||
for k in ['url']: | ||
if k not in args: | ||
raise TypeError( | ||
'Required argument `' + k + '` was not specified.') | ||
|
||
super(EventSource, self).__init__(**args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# AUTO GENERATED FILE - DO NOT EDIT | ||
|
||
from dash.development.base_component import Component, _explicitize_args | ||
|
||
|
||
class Keyboard(Component): | ||
"""A Keyboard component. | ||
The Keyboard component listens for keyboard events. | ||
Keyword arguments: | ||
- children (a list of or a singular dash component, string or number; optional): | ||
The children of this component. If any children are provided, the | ||
component will listen for events from these components. If no | ||
children are specified, the component will listen for events from | ||
the document object. | ||
- id (string; optional): | ||
The ID used to identify this component in Dash callbacks. | ||
- captureKeys (list of strings; optional): | ||
The keys to capture. Defaults to all keys. | ||
- className (string; optional): | ||
A custom class name. | ||
- eventProps (list of strings; default ["key", "altKey", "ctrlKey", "shiftKey","metaKey", "repeat"]): | ||
The event properties to forward to dash, see | ||
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent. | ||
- keydown (dict; optional): | ||
keydown (dict) the object that holds the result of the key down | ||
event. It is a dictionary with the following keys: \"key\", | ||
\"altKey\", \"ctrlKey\", \"shiftKey\",\"metaKey\", \"repeat\". | ||
Those keys have the following values: - key (str) which key is | ||
pressed - altKey (bool) whether the Alt key is pressed - | ||
ctrlKey (bool) Ctrl key is pressed - shiftKey (bool) Shift key | ||
is pressed - metaKey (bool) Meta key is pressed (Mac: Command | ||
key or PC: Windows key) - repeat (bool) whether the key is held | ||
down. | ||
- keys_pressed (dict; optional): | ||
keys_pressed (dict) is a dict of objects like keydown for all keys | ||
currently pressed. | ||
- keyup (dict; optional): | ||
keyup (dict) the object that holds the result of the key up event. | ||
Structure like keydown. | ||
- n_keydowns (number; default 0): | ||
A counter, which is incremented on each key down event, similar to | ||
n_clicks for buttons. | ||
- n_keyups (number; default 0): | ||
A counter, which is incremented on each key up event, similar to | ||
n_clicks for buttons. | ||
- style (dict; optional): | ||
The CSS style of the component. | ||
- useCapture (boolean; default False): | ||
Value of useCapture used when registering event listeners.""" | ||
_children_props = [] | ||
_base_nodes = ['children'] | ||
_namespace = 'dash_extensions' | ||
_type = 'Keyboard' | ||
@_explicitize_args | ||
def __init__(self, children=None, style=Component.UNDEFINED, className=Component.UNDEFINED, id=Component.UNDEFINED, eventProps=Component.UNDEFINED, captureKeys=Component.UNDEFINED, keydown=Component.UNDEFINED, keyup=Component.UNDEFINED, keys_pressed=Component.UNDEFINED, n_keydowns=Component.UNDEFINED, n_keyups=Component.UNDEFINED, useCapture=Component.UNDEFINED, **kwargs): | ||
self._prop_names = ['children', 'id', 'captureKeys', 'className', 'eventProps', 'keydown', 'keys_pressed', 'keyup', 'n_keydowns', 'n_keyups', 'style', 'useCapture'] | ||
self._valid_wildcard_attributes = [] | ||
self.available_properties = ['children', 'id', 'captureKeys', 'className', 'eventProps', 'keydown', 'keys_pressed', 'keyup', 'n_keydowns', 'n_keyups', 'style', 'useCapture'] | ||
self.available_wildcard_properties = [] | ||
_explicit_args = kwargs.pop('_explicit_args') | ||
_locals = locals() | ||
_locals.update(kwargs) # For wildcard attrs and excess named props | ||
args = {k: _locals[k] for k in _explicit_args if k != 'children'} | ||
|
||
super(Keyboard, self).__init__(children=children, **args) |
Oops, something went wrong.