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

Commit

Permalink
Merge pull request #444 from plotly/no-events
Browse files Browse the repository at this point in the history
No events
  • Loading branch information
alexcjohnson authored Jan 24, 2019
2 parents 46ba666 + 8b4936b commit 67cd5d7
Show file tree
Hide file tree
Showing 47 changed files with 35,432 additions and 33,372 deletions.
18 changes: 1 addition & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ jobs:
- 'venv'
- 'node_modules'

- run:
name: prettier --list-different
command: npm run format:test

- run:
name: npm run lint
command: npm run lint

- run:
name: python run lint
command: |
. venv/bin/activate
flake8 --ignore=E501,F401,F841,F811 test
- run:
name: Build
command: |
Expand All @@ -61,9 +47,7 @@ jobs:
command: |
. venv/bin/activate
python --version
npm run test-unit
python -m unittest test.test_integration
python -m unittest test.test_dash_import
npm run test
'python-3.6':
<<: *test-template
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
### Added
- 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)

### Fixed
- Fix dynamically disabling and enabling `Interval` components [#436](https://github.com/plotly/dash-core-components/pull/436)
- Clear date in DatePickerSingle and DatePickerRange [#434](https://github.com/plotly/dash-core-components/issues/434)

### Removed
- Removed `Event` system - see https://github.com/plotly/dash/issues/531 for details. [#444](https://github.com/plotly/dash-core-components/pull/444)

## [0.42.1] - 2019-01-07
### Fixed
- Fix `dcc.Store` type changes [#427](https://github.com/plotly/dash-core-components/pull/427)
Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/Checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ class Checklist(Component):
- labelStyle (dict; optional): The style of the <label> that wraps the checkbox input
and the option's label
- labelClassName (string; optional): The class of the <label> that wraps the checkbox input
and the option's label
Available events: 'change'"""
and the option's label"""
@_explicitize_args
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):
self._prop_names = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
self._type = 'Checklist'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['change']
self.available_properties = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/ConfirmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ class ConfirmDialog(Component):
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
- displayed (boolean; optional): Set to true to send the ConfirmDialog.
- key (string; optional)
Available events: """
- key (string; optional)"""
@_explicitize_args
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):
self._prop_names = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'key']
self._type = 'ConfirmDialog'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = []
self.available_properties = ['id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'key']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/ConfirmDialogProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ class ConfirmDialogProvider(Component):
- submit_n_clicks_timestamp (number; optional): Last time the submit button was clicked.
- cancel_n_clicks (number; optional): Number of times the popup was canceled.
- cancel_n_clicks_timestamp (number; optional): Last time the cancel button was clicked.
- displayed (boolean; optional): Is the modal currently displayed.
Available events: """
- displayed (boolean; optional): Is the modal currently displayed."""
@_explicitize_args
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):
self._prop_names = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
self._type = 'ConfirmDialogProvider'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = []
self.available_properties = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/DatePickerRange.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,13 @@ class DatePickerRange(Component):
will only trigger its value when the user has
finished picking both dates. If `singledate`, then
the DatePicker will update its value
as one date is picked.
Available events: 'change'"""
as one date is picked."""
@_explicitize_args
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):
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']
self._type = 'DatePickerRange'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['change']
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']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/DatePickerSingle.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,13 @@ class DatePickerSingle(Component):
- disabled (boolean; optional): If True, no dates can be selected.
- clearable (boolean; optional): Whether or not the dropdown is "clearable", that is, whether or
not a small "x" appears on the right of the dropdown that removes
the selected value.
Available events: 'change'"""
the selected value."""
@_explicitize_args
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):
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']
self._type = 'DatePickerSingle'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['change']
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']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/Dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ class Dropdown(Component):
- multi (boolean; optional): If true, the user can select multiple values
- placeholder (string; optional): The grey, default text shown when no option is selected
- searchable (boolean; optional): Whether to enable the searching feature or not
- style (dict; optional)
Available events: 'change'"""
- style (dict; optional)"""
@_explicitize_args
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):
self._prop_names = ['id', 'options', 'value', 'className', 'clearable', 'disabled', 'multi', 'placeholder', 'searchable', 'style']
self._type = 'Dropdown'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['change']
self.available_properties = ['id', 'options', 'value', 'className', 'clearable', 'disabled', 'multi', 'placeholder', 'searchable', 'style']
self.available_wildcard_properties = []

Expand Down
9 changes: 3 additions & 6 deletions dash_core_components/Graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class Graph(Component):
- config (optional): Plotly.js config options.
See https://plot.ly/javascript/configuration-options/
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'.
Those keys have the following types:
Those keys have the following types:
- staticPlot (boolean; optional): no interactivity, for export or image generation
- editable (boolean; optional): we can edit titles, move annotations, etc - sets all pieces of `edits`
unless a separate `edits` config item overrides individual parts
- 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'.
Those keys have the following types:
Those keys have the following types:
- annotationPosition (boolean; optional): annotationPosition: the main anchor of the annotation, which is the
text (if no arrow) or the arrow (which drags the whole thing leaving
the arrow length & direction unchanged)
Expand Down Expand Up @@ -83,16 +83,13 @@ class Graph(Component):
- topojsonURL (string; optional): URL to topojson files used in geo charts
- mapboxAccessToken (boolean | number | string | dict | list; optional): Mapbox access token (required to plot mapbox trace types)
If using an Mapbox Atlas server, set this option to '',
so that plotly.js won't attempt to authenticate to the public Mapbox server.
Available events: 'click', 'clickannotation', 'hover', 'selected', 'relayout', 'unhover'"""
so that plotly.js won't attempt to authenticate to the public Mapbox server."""
@_explicitize_args
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):
self._prop_names = ['id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config']
self._type = 'Graph'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['click', 'clickannotation', 'hover', 'selected', 'relayout', 'unhover']
self.available_properties = ['id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config']
self.available_wildcard_properties = []

Expand Down
5 changes: 1 addition & 4 deletions dash_core_components/Input.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ class Input(Component):
- n_submit (number; optional): Number of times the `Enter` key was pressed while the input had focus.
- n_submit_timestamp (number; optional): Last time that `Enter` was pressed.
- n_blur (number; optional): Number of times the input lost focus.
- n_blur_timestamp (number; optional): Last time the input lost focus.
Available events: 'blur', 'change'"""
- n_blur_timestamp (number; optional): Last time the input lost focus."""
@_explicitize_args
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):
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']
self._type = 'Input'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['blur', 'change']
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']
self.available_wildcard_properties = []

Expand Down
18 changes: 8 additions & 10 deletions dash_core_components/Interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@

class Interval(Component):
"""A Interval component.
A component that repeatedly fires an event ("interval")
with a fixed time delay between each event.
A component that repeatedly increments a counter `n_intervals`
with a fixed time delay between each increment.
Interval is good for triggering a component on a recurring basis.
The time delay is set with the property "interval" in milliseconds.
Keyword arguments:
- id (string; optional)
- interval (number; optional): This component will fire an event every `interval`
milliseconds with the event name `setInterval`
- disabled (boolean; optional): If True, the interval will no longer trigger
an event.
- interval (number; optional): This component will increment the counter `n_intervals` every
`interval` milliseconds
- disabled (boolean; optional): If True, the counter will no longer update
- n_intervals (number; optional): Number of times the interval has passed
- 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.
Available events: 'interval'"""
- 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."""
@_explicitize_args
def __init__(self, id=Component.UNDEFINED, interval=Component.UNDEFINED, disabled=Component.UNDEFINED, n_intervals=Component.UNDEFINED, max_intervals=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'interval', 'disabled', 'n_intervals', 'max_intervals']
self._type = 'Interval'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_events = ['interval']
self.available_properties = ['id', 'interval', 'disabled', 'n_intervals', 'max_intervals']
self.available_wildcard_properties = []

Expand Down
Loading

0 comments on commit 67cd5d7

Please sign in to comment.