Skip to content

Commit 50d9121

Browse files
authored
Merge pull request #1076 from facultyai/dash-3.0
2 parents 98aabba + 40076d0 commit 50d9121

File tree

198 files changed

+25450
-13714
lines changed

Some content is hidden

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

198 files changed

+25450
-13714
lines changed

.babelrc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
22
"presets": ["@babel/preset-env", "@babel/preset-react"],
3-
"plugins": [
4-
"@babel/plugin-transform-object-rest-spread",
5-
"@babel/plugin-transform-runtime"
6-
],
7-
"env": {
8-
"test": {
9-
"plugins": ["@babel/plugin-transform-class-properties"]
10-
}
11-
}
3+
"plugins": ["@babel/plugin-transform-runtime"]
124
}

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ restrictions:
1919

2020
- Please **do not** use the issue tracker for personal support requests. Stack
2121
Overflow ([`plotly-dash`](https://stackoverflow.com/questions/tagged/plotly-dash) tag),
22-
or the [Plotly Community Forum](https://community.plot.ly) are better places to get help.
22+
or the [Plotly Community Forum](https://community.plotly.com) are better places to get help.
2323

2424
- Please **do not** derail or troll issues. Keep the discussion on topic and
2525
respect the opinions of others.

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"singleQuote": true,
44
"bracketSpacing": false,
55
"arrowParens": "avoid",
6-
"trailingComma": "none"
6+
"trailingComma": "none",
7+
"importOrder": ["^react$", "<THIRD_PARTY_MODULES>", "^@/.*$", "^[./]"],
8+
"importOrderSeparation": true,
9+
"plugins": ["@trivago/prettier-plugin-sort-imports"]
710
}

dash_bootstrap_components/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Bootstrap themed components for use in Plotly Dash"""
22

3-
import os
4-
53
from dash_bootstrap_components import _components, icons, themes
64
from dash_bootstrap_components._components import * # noqa
75
from dash_bootstrap_components._components import Table
@@ -10,9 +8,6 @@
108

119
__all__ = _components.__all__ + ["icons", "themes"]
1210

13-
_current_path = os.path.dirname(os.path.abspath(__file__))
14-
_METADATA_PATH = os.path.join(_current_path, "_components", "metadata.json")
15-
1611
_js_dist = [
1712
{
1813
"relative_package_path": ("_components/dash_bootstrap_components.min.js"),

demo/Demo.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
/* eslint-disable react/prop-types */
12
import React, {useState} from 'react';
3+
24
import {
35
Alert,
46
Badge,
@@ -37,29 +39,29 @@ import {
3739
Tooltip
3840
} from '../src';
3941

40-
const StateWrapper = ({tag: Tag, ...otherProps}) => {
42+
function StateWrapper({tag: Tag, ...otherProps}) {
4143
// helper to mimic setProps functionality
4244
const [state, setState] = useState(otherProps);
4345
return <Tag setProps={props => setState({...state, ...props})} {...state} />;
44-
};
46+
}
4547

46-
const CollapseComponent = ({children}) => {
48+
function CollapseComponent({children}) {
4749
const [isOpen, setIsOpen] = useState(false);
4850

4951
return (
5052
<div>
51-
<Button onClick={() => setIsOpen(!isOpen)}>Toggle collapse</Button>
53+
<Button setProps={() => setIsOpen(!isOpen)}>Toggle collapse</Button>
5254
<Collapse is_open={isOpen}>{children}</Collapse>
5355
</div>
5456
);
55-
};
57+
}
5658

5759
const FadeComponent = ({children}) => {
5860
const [isIn, setIsIn] = useState(false);
5961

6062
return (
6163
<div>
62-
<Button onClick={() => setIsOpen(!isIn)}>Toggle fade</Button>
64+
<Button setProps={() => setIsIn(!isIn)}>Toggle fade</Button>
6365
<Fade is_in={isIn}>{children}</Fade>
6466
</div>
6567
);
@@ -212,7 +214,7 @@ const Demo = () => (
212214
<Col md={3}>
213215
<Card>
214216
<CardBody>
215-
<h5 className="card-title">Here's another card</h5>
217+
<h5 className="card-title">Here&apos;s another card</h5>
216218
<p className="card-text">With some text, and a button</p>
217219
<Button color="success">Click here</Button>
218220
</CardBody>
@@ -221,7 +223,7 @@ const Demo = () => (
221223
<Col md={3}>
222224
<Card>
223225
<CardBody>
224-
<h5 className="card-title">Here's yet another card</h5>
226+
<h5 className="card-title">Here&apos;s yet another card</h5>
225227
<p className="card-text">With some text, and some links</p>
226228
<CardLink href="https://www.asidatascience.com">
227229
External

demo/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
3+
import {createRoot} from 'react-dom/client';
34

45
import Demo from './Demo';
56

6-
const rootInstance = ReactDOM.render(
7-
<Demo />,
8-
document.getElementById('react-demo-entry-point')
9-
);
7+
const root = createRoot(document.getElementById('react-demo-entry-point'));
8+
9+
root.render(<Demo />);

docs/components_page/components/carousel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is a carousel with slides only. The default cycle time is 5000ms, but here
1212

1313
## With controls
1414

15-
Here we add the previous and next controls. The default is for the slideshow to autoplay after the user manually cycles the first item. Set `ride="carousel"` to start the slideshow on page load.
15+
Here we add the previous and next controls.
1616

1717
{{example:components/carousel/controls.py:carousel}}
1818

docs/components_page/components/carousel/simple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
controls=False,
1010
indicators=False,
1111
interval=2000,
12-
ride="carousel",
1312
)

docs/components_page/components/index/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121

2222
# 5. Start the Dash server
2323
if __name__ == "__main__":
24-
app.run_server()
24+
app.run()

docs/components_page/components/navbar/navbar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import dash_bootstrap_components as dbc
22
from dash import Input, Output, State, html
33

4-
PLOTLY_LOGO = "https://images.plot.ly/logo/new-branding/plotly-logomark.png"
4+
LOGO = "https://placehold.co/100x100"
55

66
search_bar = dbc.Row(
77
[
@@ -22,13 +22,13 @@
2222
# Use row and col to control vertical alignment of logo / brand
2323
dbc.Row(
2424
[
25-
dbc.Col(html.Img(src=PLOTLY_LOGO, height="30px")),
25+
dbc.Col(html.Img(src=LOGO, height="30px")),
2626
dbc.Col(dbc.NavbarBrand("Navbar", className="ms-2")),
2727
],
2828
align="center",
2929
className="g-0",
3030
),
31-
href="https://plotly.com",
31+
href="https://placehold.co/",
3232
style={"textDecoration": "none"},
3333
),
3434
dbc.NavbarToggler(id="navbar-toggler", n_clicks=0),

0 commit comments

Comments
 (0)