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

Loading component #352

Merged
merged 66 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
62ddd3b
Loading component with basic spinner
valentijnnieman Oct 17, 2018
9ad9c09
Get loading prop from loading object, bump version
valentijnnieman Nov 5, 2018
2d4834e
Prop docs for Loading component
valentijnnieman Nov 5, 2018
9c259b7
Use new loading API and show propsName and componentName for now
valentijnnieman Nov 6, 2018
1769ca3
Add custom CSS spinner
valentijnnieman Nov 7, 2018
a751cd2
Update webpack to parse .jsx, update extract-meta to not parse .jsx
valentijnnieman Nov 7, 2018
1906814
Refactor into loading/ folder and pull out spinners into separate files
valentijnnieman Nov 7, 2018
b7d6e4e
Update default spinner
valentijnnieman Nov 7, 2018
ea99b42
Add props.type and Cube spinner
valentijnnieman Nov 7, 2018
40baf19
Add default padding to cube spinner
valentijnnieman Nov 7, 2018
9e3ebe3
More spinners, fullscreen mode
valentijnnieman Nov 12, 2018
4084252
Fix Demo app and add Loading Demo
valentijnnieman Nov 12, 2018
5d72092
Add component gallery back to demo using tabs
valentijnnieman Nov 13, 2018
5ea63e2
Change prop names for Loading component to be more pythonic
valentijnnieman Nov 13, 2018
cc911ef
Color prop for Loading component - all spinners except GraphSpinner
valentijnnieman Nov 13, 2018
7de62a9
Add codemirror scripts back in index.html
valentijnnieman Nov 14, 2018
63f5f6f
Fix for Input that causes dash-renderer tests to fail
valentijnnieman Nov 15, 2018
3237905
Change props.status to props.loading_state to be more specific
valentijnnieman Nov 15, 2018
e115109
Add docstring to type prop
valentijnnieman Nov 29, 2018
26f986c
Revert Input changes back to master
valentijnnieman Nov 29, 2018
d8442f8
Fix formatting
valentijnnieman Nov 29, 2018
61c2130
Refactor spinner type parsing
valentijnnieman Nov 29, 2018
af9b430
Credit tobiasahlin for spinners in comments
valentijnnieman Nov 29, 2018
ae9f4d2
Append dash-circle-spinner to circle spinner html
valentijnnieman Nov 29, 2018
eda74c4
Change circlespinner to use prepended dash- classnames
valentijnnieman Nov 29, 2018
170ba07
Prepend default spinner classes with dash-default-spinner
valentijnnieman Nov 29, 2018
41f6153
Merge branch 'master' of https://github.com/plotly/dash-core-componen…
valentijnnieman Nov 30, 2018
d3194a2
Bump version for prerelease 0.41.0rc1
valentijnnieman Nov 30, 2018
4431bda
Release candidate 2, fixes indent bug in _imports_
valentijnnieman Dec 3, 2018
71ff6f8
Fixes bug with react-dom when renderering props.children
valentijnnieman Dec 3, 2018
ee7462d
Fix regression of default spinner animations caused by CSS changes
valentijnnieman Dec 3, 2018
62881b5
Release candidate 3
valentijnnieman Dec 3, 2018
a9bcde2
Add className and style props to loading component
valentijnnieman Dec 3, 2018
00a6a86
Update unit tests with Jest snapshots to test correct output
valentijnnieman Jan 8, 2019
a374597
Check if children have loading_state prop, and children's children if…
valentijnnieman Jan 30, 2019
a4b33b4
Update dev-requirements with loading states prerelease version of das…
valentijnnieman Jan 30, 2019
83b199a
Merge branch 'master' of https://github.com/plotly/dash-core-componen…
valentijnnieman Jan 30, 2019
1d9fb08
dash -> 0.31.0 dev-requirements
valentijnnieman Jan 30, 2019
511ab79
Rebuild package-lock.json
valentijnnieman Jan 30, 2019
5df49ff
Fix test by accept()ing confirmdialog twice, for now
valentijnnieman Jan 31, 2019
9b7b354
Update dash_renderer to 0.18.0rc2 for latest loading states api build
valentijnnieman Jan 31, 2019
ac2970c
Use new loading_states dash-renderer build to fix tests
valentijnnieman Feb 1, 2019
afbfb54
Remove tarball and get latest dash-renderer rc, fix scroll test
valentijnnieman Feb 1, 2019
73e3b2e
Merge branch 'master' of https://github.com/plotly/dash-core-componen…
valentijnnieman Feb 6, 2019
df4cbc4
Recurse children and get loading states
valentijnnieman Feb 7, 2019
a28537d
Use latest dash-renderer RC to fix tests
valentijnnieman Feb 7, 2019
692cc73
Fix formatting
valentijnnieman Feb 7, 2019
46658d7
Fix formatting in test
valentijnnieman Feb 7, 2019
1568458
Add unit test for checking loading_state in children
valentijnnieman Feb 8, 2019
6e5550c
Get loading_state from children
valentijnnieman Feb 8, 2019
29a9d6e
Small type fix
valentijnnieman Feb 8, 2019
4d19f5c
Expose data-dash-is-loading attribute to all components with loading_…
valentijnnieman Feb 8, 2019
35e8f19
Style wrapper of DatePicker components so they don't change appearance
valentijnnieman Feb 13, 2019
fbd39b6
Prerelease version 0.44.0rc2
valentijnnieman Feb 13, 2019
d5e11a6
Merge branch 'master' of https://github.com/plotly/dash-core-componen…
valentijnnieman Feb 13, 2019
4dab2d8
Changed to unreleased and added link
valentijnnieman Feb 13, 2019
0d35300
fragments/ folder for components used internally such as spinners
valentijnnieman Feb 13, 2019
f46c006
initial_loading_state -> isLoading
valentijnnieman Feb 14, 2019
f2baa17
Add style and className props to DatePicker components
valentijnnieman Feb 14, 2019
e80d7f6
Refactored getLoadingState function
valentijnnieman Feb 14, 2019
9d1a293
Restore plotly-1.44.3.min.js
valentijnnieman Feb 14, 2019
4ae07ce
Removed defaultProps.loading_state because it overrides loading_state…
valentijnnieman Feb 14, 2019
57ebaf4
Revert version and dev-requirements
valentijnnieman Feb 28, 2019
0137efe
Revert dev-requirements
valentijnnieman Feb 28, 2019
c98a6df
Try with dash 0.37.0rc1
valentijnnieman Feb 28, 2019
6279d0d
Use rc of loading states dash-renderer
valentijnnieman Feb 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"no-new": ["error"],
"no-new-func": ["error"],
"no-new-wrappers": ["error"],
"no-param-reassign": ["error"],
"no-param-reassign": ["off"],
"no-process-env": ["warn"],
"no-proto": ["error"],
"no-redeclare": ["error"],
Expand Down Expand Up @@ -105,7 +105,7 @@
"react/no-unknown-property": ["error"],
"react/prefer-es6-class": ["error", "always"],
"react/prop-types": "error",
"valid-jsdoc": ["error"],
"valid-jsdoc": ["off"],
"yoda": ["error"],
"spaced-comment": ["error", "always", {
"block": {
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## UNRELEASED
### Added
- Loading component [#267](https://github.com/plotly/dash/issues/267)

## [0.43.1] - 2019-02-11
### Updated
- Upgraded plotly.js to 1.44.3 [#458](https://github.com/plotly/dash-core-components/pull/458)
Expand Down
36 changes: 9 additions & 27 deletions dash_core_components/Checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ 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"""
and the option's label
- loading_state (optional): Object that holds the loading state object coming from dash-renderer. loading_state has the following type: dict containing keys 'is_loading', 'prop_name', 'component_name'.
Those keys have the following types:
- is_loading (boolean; optional): Determines if the component is loading or not
- prop_name (string; optional): Holds which property is loading
- component_name (string; optional): Holds the name of the component that is loading"""
@_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']
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, loading_state=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName', 'loading_state']
self._type = 'Checklist'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_properties = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName']
self.available_properties = ['id', 'options', 'values', 'className', 'style', 'inputStyle', 'inputClassName', 'labelStyle', 'labelClassName', 'loading_state']
self.available_wildcard_properties = []

_explicit_args = kwargs.pop('_explicit_args')
Expand All @@ -41,26 +46,3 @@ def __init__(self, id=Component.UNDEFINED, options=Component.UNDEFINED, values=C
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(Checklist, self).__init__(**args)

def __repr__(self):
if(any(getattr(self, c, None) is not None
for c in self._prop_names
if c is not self._prop_names[0])
or any(getattr(self, c, None) is not None
for c in self.__dict__.keys()
if any(c.startswith(wc_attr)
for wc_attr in self._valid_wildcard_attributes))):
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self._prop_names
if getattr(self, c, None) is not None])
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self.__dict__.keys()
if any([c.startswith(wc_attr)
for wc_attr in
self._valid_wildcard_attributes])])
return ('Checklist(' + props_string +
(', ' + wilds_string if wilds_string != '' else '') + ')')
else:
return (
'Checklist(' +
repr(getattr(self, self._prop_names[0], None)) + ')')
23 changes: 0 additions & 23 deletions dash_core_components/ConfirmDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,3 @@ def __init__(self, id=Component.UNDEFINED, message=Component.UNDEFINED, submit_n
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(ConfirmDialog, self).__init__(**args)

def __repr__(self):
if(any(getattr(self, c, None) is not None
for c in self._prop_names
if c is not self._prop_names[0])
or any(getattr(self, c, None) is not None
for c in self.__dict__.keys()
if any(c.startswith(wc_attr)
for wc_attr in self._valid_wildcard_attributes))):
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self._prop_names
if getattr(self, c, None) is not None])
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self.__dict__.keys()
if any([c.startswith(wc_attr)
for wc_attr in
self._valid_wildcard_attributes])])
return ('ConfirmDialog(' + props_string +
(', ' + wilds_string if wilds_string != '' else '') + ')')
else:
return (
'ConfirmDialog(' +
repr(getattr(self, self._prop_names[0], None)) + ')')
36 changes: 9 additions & 27 deletions dash_core_components/ConfirmDialogProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ 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."""
- displayed (boolean; optional): Is the modal currently displayed.
- loading_state (optional): Object that holds the loading state object coming from dash-renderer. loading_state has the following type: dict containing keys 'is_loading', 'prop_name', 'component_name'.
Those keys have the following types:
- is_loading (boolean; optional): Determines if the component is loading or not
- prop_name (string; optional): Holds which property is loading
- component_name (string; optional): Holds the name of the component that is loading"""
@_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']
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, loading_state=Component.UNDEFINED, **kwargs):
self._prop_names = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'loading_state']
self._type = 'ConfirmDialogProvider'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
self.available_properties = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed']
self.available_properties = ['children', 'id', 'message', 'submit_n_clicks', 'submit_n_clicks_timestamp', 'cancel_n_clicks', 'cancel_n_clicks_timestamp', 'displayed', 'loading_state']
self.available_wildcard_properties = []

_explicit_args = kwargs.pop('_explicit_args')
Expand All @@ -44,26 +49,3 @@ def __init__(self, children=None, id=Component.UNDEFINED, message=Component.UNDE
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(ConfirmDialogProvider, self).__init__(children=children, **args)

def __repr__(self):
if(any(getattr(self, c, None) is not None
for c in self._prop_names
if c is not self._prop_names[0])
or any(getattr(self, c, None) is not None
for c in self.__dict__.keys()
if any(c.startswith(wc_attr)
for wc_attr in self._valid_wildcard_attributes))):
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self._prop_names
if getattr(self, c, None) is not None])
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self.__dict__.keys()
if any([c.startswith(wc_attr)
for wc_attr in
self._valid_wildcard_attributes])])
return ('ConfirmDialogProvider(' + props_string +
(', ' + wilds_string if wilds_string != '' else '') + ')')
else:
return (
'ConfirmDialogProvider(' +
repr(getattr(self, self._prop_names[0], None)) + ')')
38 changes: 11 additions & 27 deletions dash_core_components/DatePickerRange.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,26 @@ class DatePickerRange(Component):
- 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.
- style (dict; optional): CSS styles appended to wrapper div
- className (string; optional): Appends a CSS class to the wrapper div component.
- updatemode (a value equal to: 'singledate', 'bothdates'; optional): Determines when the component should update
its value. If `bothdates`, then the DatePicker
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."""
as one date is picked.
- loading_state (optional): Object that holds the loading state object coming from dash-renderer. loading_state has the following type: dict containing keys 'is_loading', 'prop_name', 'component_name'.
Those keys have the following types:
- is_loading (boolean; optional): Determines if the component is loading or not
- prop_name (string; optional): Holds which property is loading
- component_name (string; optional): Holds the name of the component that is loading"""
@_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']
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, style=Component.UNDEFINED, className=Component.UNDEFINED, updatemode=Component.UNDEFINED, loading_state=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', 'style', 'className', 'updatemode', 'loading_state']
self._type = 'DatePickerRange'
self._namespace = 'dash_core_components'
self._valid_wildcard_attributes = []
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_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', 'style', 'className', 'updatemode', 'loading_state']
self.available_wildcard_properties = []

_explicit_args = kwargs.pop('_explicit_args')
Expand All @@ -97,26 +104,3 @@ def __init__(self, id=Component.UNDEFINED, start_date=Component.UNDEFINED, end_d
raise TypeError(
'Required argument `' + k + '` was not specified.')
super(DatePickerRange, self).__init__(**args)

def __repr__(self):
if(any(getattr(self, c, None) is not None
for c in self._prop_names
if c is not self._prop_names[0])
or any(getattr(self, c, None) is not None
for c in self.__dict__.keys()
if any(c.startswith(wc_attr)
for wc_attr in self._valid_wildcard_attributes))):
props_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self._prop_names
if getattr(self, c, None) is not None])
wilds_string = ', '.join([c+'='+repr(getattr(self, c, None))
for c in self.__dict__.keys()
if any([c.startswith(wc_attr)
for wc_attr in
self._valid_wildcard_attributes])])
return ('DatePickerRange(' + props_string +
(', ' + wilds_string if wilds_string != '' else '') + ')')
else:
return (
'DatePickerRange(' +
repr(getattr(self, self._prop_names[0], None)) + ')')
Loading