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

Commit 080d66b

Browse files
Change prop names for Loading component to be more pythonic
1 parent 879610d commit 080d66b

10 files changed

+34
-47
lines changed

dash_core_components/Loading.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,24 @@ class Loading(Component):
1111
- children (list | a list of or a singular dash component, string or number; optional): Array that holds components to render
1212
- id (string; optional)
1313
- type (a value equal to: 'graph', 'cube', 'circle', 'dot', 'default'; optional)
14-
- loadingProp (string; optional): String that determines which prop to listen to when loading
1514
- fullscreen (boolean; optional): Boolean that determines if the loading spinner will be displayed full-screen or not
16-
- debug (boolean; optional): Boolean that determines if the loading spinner will display the status.propName and componentName
15+
- debug (boolean; optional): Boolean that determines if the loading spinner will display the status.prop_name and component_name
1716
- className (string; optional): Additional CSS class for the root DOM node
18-
- status (optional): Object that holds the status object coming from dash-renderer. status has the following type: dict containing keys 'isLoading', 'propName', 'componentName'.
17+
- status (optional): Object that holds the status object coming from dash-renderer. status has the following type: dict containing keys 'is_loading', 'prop_name', 'component_name'.
1918
Those keys have the following types:
20-
- isLoading (boolean; optional): Determines if the component is loading or not
21-
- propName (string; optional): Holds which property is loading
22-
- componentName (string; optional): Holds the name of the component that is loading
19+
- is_loading (boolean; optional): Determines if the component is loading or not
20+
- prop_name (string; optional): Holds which property is loading
21+
- component_name (string; optional): Holds the name of the component that is loading
2322
2423
Available events: """
2524
@_explicitize_args
26-
def __init__(self, children=None, id=Component.UNDEFINED, type=Component.UNDEFINED, loadingProp=Component.UNDEFINED, fullscreen=Component.UNDEFINED, debug=Component.UNDEFINED, className=Component.UNDEFINED, status=Component.UNDEFINED, **kwargs):
27-
self._prop_names = ['children', 'id', 'type', 'loadingProp', 'fullscreen', 'debug', 'className', 'status']
25+
def __init__(self, children=None, id=Component.UNDEFINED, type=Component.UNDEFINED, fullscreen=Component.UNDEFINED, debug=Component.UNDEFINED, className=Component.UNDEFINED, status=Component.UNDEFINED, **kwargs):
26+
self._prop_names = ['children', 'id', 'type', 'fullscreen', 'debug', 'className', 'status']
2827
self._type = 'Loading'
2928
self._namespace = 'dash_core_components'
3029
self._valid_wildcard_attributes = []
3130
self.available_events = []
32-
self.available_properties = ['children', 'id', 'type', 'loadingProp', 'fullscreen', 'debug', 'className', 'status']
31+
self.available_properties = ['children', 'id', 'type', 'fullscreen', 'debug', 'className', 'status']
3332
self.available_wildcard_properties = []
3433

3534
_explicit_args = kwargs.pop('_explicit_args')

dash_core_components/dash_core_components.dev.js

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

dash_core_components/dash_core_components.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_core_components/metadata.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,13 +2121,6 @@
21212121
"computed": false
21222122
}
21232123
},
2124-
"loadingProp": {
2125-
"type": {
2126-
"name": "string"
2127-
},
2128-
"required": false,
2129-
"description": "String that determines which prop to listen to when loading"
2130-
},
21312124
"fullscreen": {
21322125
"type": {
21332126
"name": "bool"
@@ -2140,7 +2133,7 @@
21402133
"name": "bool"
21412134
},
21422135
"required": false,
2143-
"description": "Boolean that determines if the loading spinner will display the status.propName and componentName"
2136+
"description": "Boolean that determines if the loading spinner will display the status.prop_name and component_name"
21442137
},
21452138
"className": {
21462139
"type": {
@@ -2153,17 +2146,17 @@
21532146
"type": {
21542147
"name": "shape",
21552148
"value": {
2156-
"isLoading": {
2149+
"is_loading": {
21572150
"name": "bool",
21582151
"description": "Determines if the component is loading or not",
21592152
"required": false
21602153
},
2161-
"propName": {
2154+
"prop_name": {
21622155
"name": "string",
21632156
"description": "Holds which property is loading",
21642157
"required": false
21652158
},
2166-
"componentName": {
2159+
"component_name": {
21672160
"name": "string",
21682161
"description": "Holds the name of the component that is loading",
21692162
"required": false

src/components/Loading/Loading.react.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import DotSpinner from './spinners/DotSpinner.jsx';
1212
export default class Loading extends Component {
1313
render() {
1414
const { status, fullscreen, debug } = this.props;
15-
if (status && status.isLoading) {
15+
if (status && status.is_loading) {
1616
switch (this.props.type) {
1717
case 'graph':
1818
return <GraphSpinner status={status} debug={debug} fullscreen={fullscreen}/>;
@@ -47,18 +47,13 @@ Loading.propTypes = {
4747

4848
type: PropTypes.oneOf(['graph', 'cube', 'circle', 'dot', 'default']),
4949

50-
/**
51-
* String that determines which prop to listen to when loading
52-
*/
53-
loadingProp: PropTypes.string,
54-
5550
/**
5651
* Boolean that determines if the loading spinner will be displayed full-screen or not
5752
*/
5853
fullscreen: PropTypes.bool,
5954

6055
/**
61-
* Boolean that determines if the loading spinner will display the status.propName and componentName
56+
* Boolean that determines if the loading spinner will display the status.prop_name and component_name
6257
*/
6358
debug: PropTypes.bool,
6459

@@ -74,14 +69,14 @@ Loading.propTypes = {
7469
/**
7570
* Determines if the component is loading or not
7671
*/
77-
isLoading: PropTypes.bool,
72+
is_loading: PropTypes.bool,
7873
/**
7974
* Holds which property is loading
8075
*/
81-
propName: PropTypes.string,
76+
prop_name: PropTypes.string,
8277
/**
8378
* Holds the name of the component that is loading
8479
*/
85-
componentName: PropTypes.string,
80+
component_name: PropTypes.string,
8681
}),
8782
};

src/components/Loading/spinners/CircleSpinner.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const CircleSpinner = ({status, fullscreen, debug}) => {
66
if (debug) {
77
debugTitle = (
88
<h3 className="dash-loading-title">
9-
Loading {status.componentName}
10-
's {status.propName}
9+
Loading {status.component_name}
10+
's {status.prop_name}
1111
</h3>
1212
);
1313
}

src/components/Loading/spinners/CubeSpinner.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const CubeSpinner = ({status, fullscreen, debug}) => {
66
if (debug) {
77
debugTitle = (
88
<h3 className="dash-loading-title">
9-
Loading {status.componentName}
10-
's {status.propName}
9+
Loading {status.component_name}
10+
's {status.prop_name}
1111
</h3>
1212
);
1313
}

src/components/Loading/spinners/DefaultSpinner.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const DefaultSpinner = ({status, fullscreen, debug}) => {
77
if (debug) {
88
debugTitle = (
99
<h3 className="dash-loading-title">
10-
Loading {status.componentName}
11-
's {status.propName}
10+
Loading {status.component_name}
11+
's {status.prop_name}
1212
</h3>
1313
);
1414
}

src/components/Loading/spinners/DotSpinner.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const DotSpinner = ({status, fullscreen, debug}) => {
66
if (debug) {
77
debugTitle = (
88
<h3 className="dash-loading-title">
9-
Loading {status.componentName}
10-
's {status.propName}
9+
Loading {status.component_name}
10+
's {status.prop_name}
1111
</h3>
1212
);
1313
}

src/components/Loading/spinners/GraphSpinner.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const GraphSpinner = ({status, fullscreen, debug}) => {
66
if (debug) {
77
debugTitle = (
88
<h3 className="dash-loading-title">
9-
Loading {status.componentName}
10-
's {status.propName}
9+
Loading {status.component_name}
10+
's {status.prop_name}
1111
</h3>
1212
);
1313
}

0 commit comments

Comments
 (0)