Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 67cd5d7

Browse files
authored
Merge pull request #444 from plotly/no-events
No events
2 parents 46ba666 + 8b4936b commit 67cd5d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+35432
-33372
lines changed

.circleci/config.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ jobs:
3535
- 'venv'
3636
- 'node_modules'
3737

38-
- run:
39-
name: prettier --list-different
40-
command: npm run format:test
41-
42-
- run:
43-
name: npm run lint
44-
command: npm run lint
45-
46-
- run:
47-
name: python run lint
48-
command: |
49-
. venv/bin/activate
50-
flake8 --ignore=E501,F401,F841,F811 test
51-
5238
- run:
5339
name: Build
5440
command: |
@@ -61,9 +47,7 @@ jobs:
6147
command: |
6248
. venv/bin/activate
6349
python --version
64-
npm run test-unit
65-
python -m unittest test.test_integration
66-
python -m unittest test.test_dash_import
50+
npm run test
6751
6852
'python-3.6':
6953
<<: *test-template

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
6+
### Added
7+
- Added event props `n_blur` and `n_clicks` - along with `n_blur_timestamp` and `n_clicks_timestamp` - in `Textarea` components, to maintain the functionality lost by removing the `click` and `blur` events. All other events were already covered by existing props. [#444](https://github.com/plotly/dash-core-components/pull/444)
8+
69
### Fixed
710
- Fix dynamically disabling and enabling `Interval` components [#436](https://github.com/plotly/dash-core-components/pull/436)
811
- Clear date in DatePickerSingle and DatePickerRange [#434](https://github.com/plotly/dash-core-components/issues/434)
912

13+
### Removed
14+
- Removed `Event` system - see https://github.com/plotly/dash/issues/531 for details. [#444](https://github.com/plotly/dash-core-components/pull/444)
15+
1016
## [0.42.1] - 2019-01-07
1117
### Fixed
1218
- Fix `dcc.Store` type changes [#427](https://github.com/plotly/dash-core-components/pull/427)

dash_core_components/Checklist.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ class Checklist(Component):
2121
- labelStyle (dict; optional): The style of the <label> that wraps the checkbox input
2222
and the option's label
2323
- labelClassName (string; optional): The class of the <label> that wraps the checkbox input
24-
and the option's label
25-
26-
Available events: 'change'"""
24+
and the option's label"""
2725
@_explicitize_args
2826
def __init__(self, id=Component.UNDEFINED, options=Component.UNDEFINED, values=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, inputStyle=Component.UNDEFINED, inputClassName=Component.UNDEFINED, labelStyle=Component.UNDEFINED, labelClassName=Component.UNDEFINED, **kwargs):
2927
self._prop_names = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
3028
self._type = 'Checklist'
3129
self._namespace = 'dash_core_components'
3230
self._valid_wildcard_attributes = []
33-
self.available_events = ['change']
3431
self.available_properties = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
3532
self.available_wildcard_properties = []
3633

dash_core_components/ConfirmDialog.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@ class ConfirmDialog(Component):
1818
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
1919
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
2020
- displayed (boolean; optional): Set to true to send the ConfirmDialog.
21-
- key (string; optional)
22-
23-
Available events: """
21+
- key (string; optional)"""
2422
@_explicitize_args
2523
def __init__(self, id=Component.UNDEFINED, message=Component.UNDEFINED, submit_n_clicks=Component.UNDEFINED, submit_n_clicks_timestamp=Component.UNDEFINED, cancel_n_clicks=Component.UNDEFINED, cancel_n_clicks_timestamp=Component.UNDEFINED, displayed=Component.UNDEFINED, key=Component.UNDEFINED, **kwargs):
2624
self._prop_names = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'key']
2725
self._type = 'ConfirmDialog'
2826
self._namespace = 'dash_core_components'
2927
self._valid_wildcard_attributes = []
30-
self.available_events = []
3128
self.available_properties = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'key']
3229
self.available_wildcard_properties = []
3330

dash_core_components/ConfirmDialogProvider.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ class ConfirmDialogProvider(Component):
2424
- submit_n_clicks_timestamp (number; optional): Last time the submit button was clicked.
2525
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
2626
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
27-
- displayed (boolean; optional): Is the modal currently displayed.
28-
29-
Available events: """
27+
- displayed (boolean; optional): Is the modal currently displayed."""
3028
@_explicitize_args
3129
def __init__(self, children=None, id=Component.UNDEFINED, message=Component.UNDEFINED, submit_n_clicks=Component.UNDEFINED, submit_n_clicks_timestamp=Component.UNDEFINED, cancel_n_clicks=Component.UNDEFINED, cancel_n_clicks_timestamp=Component.UNDEFINED, displayed=Component.UNDEFINED, **kwargs):
3230
self._prop_names = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
3331
self._type = 'ConfirmDialogProvider'
3432
self._namespace = 'dash_core_components'
3533
self._valid_wildcard_attributes = []
36-
self.available_events = []
3734
self.available_properties = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
3835
self.available_wildcard_properties = []
3936

dash_core_components/DatePickerRange.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,13 @@ class DatePickerRange(Component):
7777
will only trigger its value when the user has
7878
finished picking both dates. If `singledate`, then
7979
the DatePicker will update its value
80-
as one date is picked.
81-
82-
Available events: 'change'"""
80+
as one date is picked."""
8381
@_explicitize_args
8482
def __init__(self, id=Component.UNDEFINED, start_date=Component.UNDEFINED, end_date=Component.UNDEFINED, min_date_allowed=Component.UNDEFINED, max_date_allowed=Component.UNDEFINED, initial_visible_month=Component.UNDEFINED, start_date_placeholder_text=Component.UNDEFINED, end_date_placeholder_text=Component.UNDEFINED, day_size=Component.UNDEFINED, calendar_orientation=Component.UNDEFINED, is_RTL=Component.UNDEFINED, reopen_calendar_on_clear=Component.UNDEFINED, number_of_months_shown=Component.UNDEFINED, with_portal=Component.UNDEFINED, with_full_screen_portal=Component.UNDEFINED, first_day_of_week=Component.UNDEFINED, minimum_nights=Component.UNDEFINED, stay_open_on_select=Component.UNDEFINED, show_outside_days=Component.UNDEFINED, month_format=Component.UNDEFINED, display_format=Component.UNDEFINED, disabled=Component.UNDEFINED, clearable=Component.UNDEFINED, updatemode=Component.UNDEFINED, **kwargs):
8583
self._prop_names = ['id', 'start_date', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'updatemode']
8684
self._type = 'DatePickerRange'
8785
self._namespace = 'dash_core_components'
8886
self._valid_wildcard_attributes = []
89-
self.available_events = ['change']
9087
self.available_properties = ['id', 'start_date', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'updatemode']
9188
self.available_wildcard_properties = []
9289

dash_core_components/DatePickerSingle.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,13 @@ class DatePickerSingle(Component):
6464
- disabled (boolean; optional): If True, no dates can be selected.
6565
- clearable (boolean; optional): Whether or not the dropdown is "clearable", that is, whether or
6666
not a small "x" appears on the right of the dropdown that removes
67-
the selected value.
68-
69-
Available events: 'change'"""
67+
the selected value."""
7068
@_explicitize_args
7169
def __init__(self, id=Component.UNDEFINED, date=Component.UNDEFINED, min_date_allowed=Component.UNDEFINED, max_date_allowed=Component.UNDEFINED, initial_visible_month=Component.UNDEFINED, day_size=Component.UNDEFINED, calendar_orientation=Component.UNDEFINED, is_RTL=Component.UNDEFINED, placeholder=Component.UNDEFINED, reopen_calendar_on_clear=Component.UNDEFINED, number_of_months_shown=Component.UNDEFINED, with_portal=Component.UNDEFINED, with_full_screen_portal=Component.UNDEFINED, first_day_of_week=Component.UNDEFINED, stay_open_on_select=Component.UNDEFINED, show_outside_days=Component.UNDEFINED, month_format=Component.UNDEFINED, display_format=Component.UNDEFINED, disabled=Component.UNDEFINED, clearable=Component.UNDEFINED, **kwargs):
7270
self._prop_names = ['id', 'date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'day_size', 'calendar_orientation', 'is_RTL', 'placeholder', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable']
7371
self._type = 'DatePickerSingle'
7472
self._namespace = 'dash_core_components'
7573
self._valid_wildcard_attributes = []
76-
self.available_events = ['change']
7774
self.available_properties = ['id', 'date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'day_size', 'calendar_orientation', 'is_RTL', 'placeholder', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable']
7875
self.available_wildcard_properties = []
7976

dash_core_components/Dropdown.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ class Dropdown(Component):
3131
- multi (boolean; optional): If true, the user can select multiple values
3232
- placeholder (string; optional): The grey, default text shown when no option is selected
3333
- searchable (boolean; optional): Whether to enable the searching feature or not
34-
- style (dict; optional)
35-
36-
Available events: 'change'"""
34+
- style (dict; optional)"""
3735
@_explicitize_args
3836
def __init__(self, id=Component.UNDEFINED, options=Component.UNDEFINED, value=Component.UNDEFINED, className=Component.UNDEFINED, clearable=Component.UNDEFINED, disabled=Component.UNDEFINED, multi=Component.UNDEFINED, placeholder=Component.UNDEFINED, searchable=Component.UNDEFINED, style=Component.UNDEFINED, **kwargs):
3937
self._prop_names = ['id', 'options', 'value', 'className', 'clearable', 'disabled', 'multi', 'placeholder', 'searchable', 'style']
4038
self._type = 'Dropdown'
4139
self._namespace = 'dash_core_components'
4240
self._valid_wildcard_attributes = []
43-
self.available_events = ['change']
4441
self.available_properties = ['id', 'options', 'value', 'className', 'clearable', 'disabled', 'multi', 'placeholder', 'searchable', 'style']
4542
self.available_wildcard_properties = []
4643

dash_core_components/Graph.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ class Graph(Component):
3232
- config (optional): Plotly.js config options.
3333
See https://plot.ly/javascript/configuration-options/
3434
for more info.. config has the following type: dict containing keys 'staticPlot', 'editable', 'edits', 'autosizable', 'queueLength', 'fillFrame', 'frameMargins', 'scrollZoom', 'doubleClick', 'showTips', 'showAxisDragHandles', 'showAxisRangeEntryBoxes', 'showLink', 'sendData', 'linkText', 'displayModeBar', 'modeBarButtonsToRemove', 'modeBarButtonsToAdd', 'modeBarButtons', 'displaylogo', 'plotGlPixelRatio', 'topojsonURL', 'mapboxAccessToken'.
35-
Those keys have the following types:
35+
Those keys have the following types:
3636
- staticPlot (boolean; optional): no interactivity, for export or image generation
3737
- editable (boolean; optional): we can edit titles, move annotations, etc - sets all pieces of `edits`
3838
unless a separate `edits` config item overrides individual parts
3939
- edits (optional): a set of editable properties. edits has the following type: dict containing keys 'annotationPosition', 'annotationTail', 'annotationText', 'axisTitleText', 'colorbarPosition', 'colorbarTitleText', 'legendPosition', 'legendText', 'shapePosition', 'titleText'.
40-
Those keys have the following types:
40+
Those keys have the following types:
4141
- annotationPosition (boolean; optional): annotationPosition: the main anchor of the annotation, which is the
4242
text (if no arrow) or the arrow (which drags the whole thing leaving
4343
the arrow length & direction unchanged)
@@ -83,16 +83,13 @@ class Graph(Component):
8383
- topojsonURL (string; optional): URL to topojson files used in geo charts
8484
- mapboxAccessToken (boolean | number | string | dict | list; optional): Mapbox access token (required to plot mapbox trace types)
8585
If using an Mapbox Atlas server, set this option to '',
86-
so that plotly.js won't attempt to authenticate to the public Mapbox server.
87-
88-
Available events: 'click', 'clickannotation', 'hover', 'selected', 'relayout', 'unhover'"""
86+
so that plotly.js won't attempt to authenticate to the public Mapbox server."""
8987
@_explicitize_args
9088
def __init__(self, id=Component.UNDEFINED, clickData=Component.UNDEFINED, clickAnnotationData=Component.UNDEFINED, hoverData=Component.UNDEFINED, clear_on_unhover=Component.UNDEFINED, selectedData=Component.UNDEFINED, relayoutData=Component.UNDEFINED, figure=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, animate=Component.UNDEFINED, animation_options=Component.UNDEFINED, config=Component.UNDEFINED, **kwargs):
9189
self._prop_names = ['id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config']
9290
self._type = 'Graph'
9391
self._namespace = 'dash_core_components'
9492
self._valid_wildcard_attributes = []
95-
self.available_events = ['click', 'clickannotation', 'hover', 'selected', 'relayout', 'unhover']
9693
self.available_properties = ['id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config']
9794
self.available_wildcard_properties = []
9895

dash_core_components/Input.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,13 @@ class Input(Component):
5050
- n_submit (number; optional): Number of times the `Enter` key was pressed while the input had focus.
5151
- n_submit_timestamp (number; optional): Last time that `Enter` was pressed.
5252
- n_blur (number; optional): Number of times the input lost focus.
53-
- n_blur_timestamp (number; optional): Last time the input lost focus.
54-
55-
Available events: 'blur', 'change'"""
53+
- n_blur_timestamp (number; optional): Last time the input lost focus."""
5654
@_explicitize_args
5755
def __init__(self, id=Component.UNDEFINED, value=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, debounce=Component.UNDEFINED, type=Component.UNDEFINED, autocomplete=Component.UNDEFINED, autofocus=Component.UNDEFINED, disabled=Component.UNDEFINED, inputmode=Component.UNDEFINED, list=Component.UNDEFINED, max=Component.UNDEFINED, maxlength=Component.UNDEFINED, min=Component.UNDEFINED, minlength=Component.UNDEFINED, multiple=Component.UNDEFINED, name=Component.UNDEFINED, pattern=Component.UNDEFINED, placeholder=Component.UNDEFINED, readOnly=Component.UNDEFINED, required=Component.UNDEFINED, selectionDirection=Component.UNDEFINED, selectionEnd=Component.UNDEFINED, selectionStart=Component.UNDEFINED, size=Component.UNDEFINED, spellCheck=Component.UNDEFINED, step=Component.UNDEFINED, n_submit=Component.UNDEFINED, n_submit_timestamp=Component.UNDEFINED, n_blur=Component.UNDEFINED, n_blur_timestamp=Component.UNDEFINED, **kwargs):
5856
self._prop_names = ['id', 'value', 'style', 'className', 'debounce', 'type', 'autocomplete', 'autofocus', 'disabled', 'inputmode', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'selectionDirection', 'selectionEnd', 'selectionStart', 'size', 'spellCheck', 'step', 'n_submit', 'n_submit_timestamp', 'n_blur', 'n_blur_timestamp']
5957
self._type = 'Input'
6058
self._namespace = 'dash_core_components'
6159
self._valid_wildcard_attributes = []
62-
self.available_events = ['blur', 'change']
6360
self.available_properties = ['id', 'value', 'style', 'className', 'debounce', 'type', 'autocomplete', 'autofocus', 'disabled', 'inputmode', 'list', 'max', 'maxlength', 'min', 'minlength', 'multiple', 'name', 'pattern', 'placeholder', 'readOnly', 'required', 'selectionDirection', 'selectionEnd', 'selectionStart', 'size', 'spellCheck', 'step', 'n_submit', 'n_submit_timestamp', 'n_blur', 'n_blur_timestamp']
6461
self.available_wildcard_properties = []
6562

dash_core_components/Interval.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,26 @@
55

66
class Interval(Component):
77
"""A Interval component.
8-
A component that repeatedly fires an event ("interval")
9-
with a fixed time delay between each event.
8+
A component that repeatedly increments a counter `n_intervals`
9+
with a fixed time delay between each increment.
1010
Interval is good for triggering a component on a recurring basis.
1111
The time delay is set with the property "interval" in milliseconds.
1212
1313
Keyword arguments:
1414
- id (string; optional)
15-
- interval (number; optional): This component will fire an event every `interval`
16-
milliseconds with the event name `setInterval`
17-
- disabled (boolean; optional): If True, the interval will no longer trigger
18-
an event.
15+
- interval (number; optional): This component will increment the counter `n_intervals` every
16+
`interval` milliseconds
17+
- disabled (boolean; optional): If True, the counter will no longer update
1918
- n_intervals (number; optional): Number of times the interval has passed
20-
- max_intervals (number; optional): Number of times the interval will be fired. If -1, then the interval has no limit (the default) and if 0 then the interval stops running.
21-
22-
Available events: 'interval'"""
19+
- max_intervals (number; optional): Number of times the interval will be fired.
20+
If -1, then the interval has no limit (the default)
21+
and if 0 then the interval stops running."""
2322
@_explicitize_args
2423
def __init__(self, id=Component.UNDEFINED, interval=Component.UNDEFINED, disabled=Component.UNDEFINED, n_intervals=Component.UNDEFINED, max_intervals=Component.UNDEFINED, **kwargs):
2524
self._prop_names = ['id', 'interval', 'disabled', 'n_intervals', 'max_intervals']
2625
self._type = 'Interval'
2726
self._namespace = 'dash_core_components'
2827
self._valid_wildcard_attributes = []
29-
self.available_events = ['interval']
3028
self.available_properties = ['id', 'interval', 'disabled', 'n_intervals', 'max_intervals']
3129
self.available_wildcard_properties = []
3230

0 commit comments

Comments
 (0)