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

Commit 925c91c

Browse files
Issue 681 - Upgrade plotly.js to 1.50.1 (#682)
1 parent 607d708 commit 925c91c

File tree

5 files changed

+60
-5
lines changed

5 files changed

+60
-5
lines changed

CHANGELOG.md

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

5+
## [Unreleased]
6+
### Updated
7+
- Upgraded plotly.js to 1.50.1 [#681](https://github.com/plotly/dash-core-components/issues/681)
8+
- Patch release [1.50.1](https://github.com/plotly/plotly.js/releases/tag/v1.50.1) containing several bug fixes.
9+
10+
### Fixed
11+
- [#681](https://github.com/plotly/dash-core-components/issues/681) Fix a bug with the dcc.Graph component logging errors in certain circumstances when nested inside a dcc.Loading component
12+
513
## [1.3.0] - 2019-10-08
614
### Added
715
- Added `search_value` prop to `Dropdown`, for server-side options loading/filtering. [#660](https://github.com/plotly/dash-core-components/pull/660)

dash_core_components_base/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
_js_dist = [
4444
{
45-
'external_url': 'https://cdn.plot.ly/plotly-1.50.0.min.js',
46-
'relative_package_path': 'plotly-1.50.0.min.js',
45+
'external_url': 'https://cdn.plot.ly/plotly-1.50.1.min.js',
46+
'relative_package_path': 'plotly-1.50.1.min.js',
4747
'namespace': 'dash_core_components'
4848
},
4949
{

dash_core_components_base/plotly-1.50.0.min.js renamed to dash_core_components_base/plotly-1.50.1.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Graph.react.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ class PlotlyGraph extends Component {
220220
const gd = this.gd.current;
221221
if (gd && gd.removeAllListeners) {
222222
gd.removeAllListeners();
223-
Plotly.purge(gd);
223+
if (this._hasPlotted) {
224+
Plotly.purge(gd);
225+
}
224226
}
225227
window.removeEventListener('resize', this.graphResize);
226228
}

tests/integration/graph/test_graph_basics.py

+45
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,48 @@ def selected_df_figure(selection):
8888
# but that's what we had as of the 608 fix, PR 621, so let's lock that
8989
# in for now.
9090
assert call_count.value == 2
91+
92+
93+
@pytest.mark.DCC672
94+
def test_grbs002_graph_wrapped_in_loading_component_does_not_fail(dash_dcc):
95+
app = dash.Dash(__name__, suppress_callback_exceptions=True)
96+
app.layout = html.Div([
97+
html.H1('subplot issue'),
98+
dcc.Location(id='url', refresh=False),
99+
dcc.Loading(id="page-content")
100+
])
101+
102+
@app.callback(Output('page-content', 'children'), [Input('url', 'value')])
103+
def render_page(url):
104+
return [
105+
dcc.Dropdown(
106+
id='my-dropdown',
107+
options=[
108+
{'label': 'option 1', 'value': '1'},
109+
{'label': 'option 2', 'value': '2'}
110+
],
111+
value='1'
112+
),
113+
dcc.Graph(id='my-graph')
114+
]
115+
116+
@app.callback(Output('my-graph', 'figure'), [Input('my-dropdown', 'value')])
117+
def update_graph(value):
118+
values = [1, 2, 3]
119+
ranges = [1, 2, 3]
120+
121+
return {
122+
'data': [{
123+
'x': ranges,
124+
'y': values,
125+
'line': {
126+
'shape': 'spline'
127+
}
128+
}],
129+
}
130+
131+
dash_dcc.start_server(app)
132+
133+
dash_dcc.wait_for_element('#my-graph .main-svg')
134+
135+
assert not dash_dcc.get_logs()

0 commit comments

Comments
 (0)