Skip to content

Commit 551d149

Browse files
authored
Merge pull request #3275 from plotly/master-3.0.3
Master 3.0.3
2 parents 2525a3d + 572e3a6 commit 551d149

File tree

207 files changed

+3976
-1185
lines changed

Some content is hidden

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

207 files changed

+3976
-1185
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [3.0.3] - 2025-04-14
6+
7+
## Fixed
8+
- [#3264](https://github.com/plotly/dash/pull/3264) Fixed an issue where moving components inside of children would not update the `setProps` path, leading to hashes being incorrect
9+
- [#3265](https://github.com/plotly/dash/pull/3265) Fixed issue where the resize of graphs was cancelling others
10+
- [#3273](https://github.com/plotly/dash/pull/3273) Fix hooks entry point, renamed from invalid hyphen `dash-hooks` to underscored `dash_hooks`. Fix [#3272](https://github.com/plotly/dash/issues/3272)
11+
- [#3271](https://github.com/plotly/dash/pull/3271) fix issue with tooltip styling. Fix [#3269](https://github.com/plotly/dash/issues/3269)
12+
13+
## Added
14+
- [#3268](https://github.com/plotly/dash/pull/3268) Added the ability for component devs to subscribe to descendent updates by setting `dashChildrenUpdate = true` on the component, eg: `Tabs.dashChildrenUpdate = true`
15+
516
## [3.0.2] - 2025-04-01
617

718
## Changed
@@ -17,6 +28,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1728
## Added
1829
- [#3248](https://github.com/plotly/dash/pull/3248) added new `dashRenderType` to determine why the component layout was changed (`internal`, `callback`, `parent`, `clientsideApi`):
1930
- this can be utilized to keep from rendering components by the component having `dashRenderType` defined as a prop, and the `dashRenderType = true` must be set on the component, eg (`Div.dashRenderType = true`)
31+
- [#3241](https://github.com/plotly/dash/pull/3241) Added a collapse / expand button to Dash Dev Tools.
2032

2133
## [3.0.1] - 2025-03-24
2234

components/dash-core-components/dash_core_components_base/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
send_string,
1414
)
1515

16-
__all__ = _components + [
16+
__all__ = _components + [ # type: ignore[reportUnsupportedDunderAll]
1717
"send_bytes",
1818
"send_data_frame",
1919
"send_file",

components/dash-core-components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-core-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

components/dash-core-components/src/components/Tabs.react.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,6 @@ const EnhancedTab = ({
121121
);
122122
};
123123

124-
EnhancedTab.defaultProps = {
125-
loading_state: {
126-
is_loading: false,
127-
component_name: '',
128-
prop_name: '',
129-
},
130-
};
131-
132124
/**
133125
* A Dash component that lets you render pages with tabs - the Tabs component's children
134126
* can be dcc.Tab components, which can hold a label that will be displayed as a tab, and can in turn hold
@@ -439,3 +431,5 @@ Tabs.propTypes = {
439431
*/
440432
persistence_type: PropTypes.oneOf(['local', 'session', 'memory']),
441433
};
434+
435+
Tabs.dashChildrenUpdate = true;

components/dash-core-components/src/components/Tooltip.react.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33

44
import _JSXStyle from 'styled-jsx/style'; // eslint-disable-line no-unused-vars
5-
import LoadingElement from '../utils/LoadingElement';
65

76
/**
87
* A tooltip with an absolute position.
@@ -27,9 +26,9 @@ const Tooltip = ({
2726
return (
2827
<>
2928
<div className="dcc-tooltip-bounding-box">
30-
<LoadingElement
31-
elementType="span"
29+
<div
3230
className={`hover hover-${direction}`}
31+
data-dash-is-loading={is_loading}
3332
>
3433
<span
3534
id={id}
@@ -42,7 +41,7 @@ const Tooltip = ({
4241
props.children
4342
)}
4443
</span>
45-
</LoadingElement>
44+
</div>
4645
</div>
4746
<style jsx>{`
4847
.dcc-tooltip-bounding-box {

components/dash-core-components/src/utils/ResizeDetector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import PropTypes from 'prop-types';
44
// Debounce 50 ms
55
const DELAY = 50;
66

7-
let resizeTimeout;
8-
97
const ResizeDetector = props => {
108
const {onResize, children, targets} = props;
119
const ref = createRef();
10+
let resizeTimeout;
1211

1312
const debouncedResizeHandler = useCallback(() => {
1413
if (resizeTimeout) {

components/dash-core-components/tests/integration/graph/test_graph_responsive.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
from dash import Dash, Input, Output, State, dcc, html
4+
import plotly.graph_objects as go
45

56
from dash.exceptions import PreventUpdate
67
from dash.testing import wait
@@ -134,3 +135,77 @@ def resize(n_clicks, style):
134135
)
135136

136137
assert dash_dcc.get_logs() == []
138+
139+
140+
def test_grrs002_graph(dash_dcc):
141+
app = Dash(__name__)
142+
143+
app.layout = html.Div(
144+
[
145+
html.Button("Generate Figures", id="generate-btn", n_clicks=0),
146+
html.Button("Get Bounding Box", id="bounding-btn"),
147+
html.Div(
148+
id="graph-container",
149+
children=[
150+
html.Div(id="bounding-output"),
151+
dcc.Graph(
152+
id="prec-climate-daily",
153+
style={"height": "45vh"},
154+
config={"responsive": True},
155+
),
156+
dcc.Graph(
157+
id="temp-climate-daily",
158+
style={"height": "45vh"},
159+
config={"responsive": True},
160+
),
161+
],
162+
style={"display": "none"},
163+
),
164+
]
165+
)
166+
167+
app.clientside_callback(
168+
"""() => {
169+
pcd_container = document.querySelector("#prec-climate-daily")
170+
pcd_container_bbox = pcd_container.getBoundingClientRect()
171+
pcd_graph = pcd_container.querySelector('.main-svg')
172+
pcd_graph_bbox = pcd_graph.getBoundingClientRect()
173+
tcd_container = document.querySelector("#temp-climate-daily")
174+
tcd_container_bbox = tcd_container.getBoundingClientRect()
175+
tcd_graph = tcd_container.querySelector('.main-svg')
176+
tcd_graph_bbox = tcd_graph.getBoundingClientRect()
177+
return JSON.stringify(
178+
pcd_container_bbox.height == pcd_graph_bbox.height &&
179+
pcd_container_bbox.width == pcd_graph_bbox.width &&
180+
tcd_container_bbox.height == tcd_graph_bbox.height &&
181+
tcd_container_bbox.width == tcd_graph_bbox.width
182+
)
183+
}""",
184+
Output("bounding-output", "children"),
185+
Input("bounding-btn", "n_clicks"),
186+
prevent_initial_call=True,
187+
)
188+
189+
@app.callback(
190+
[
191+
Output("prec-climate-daily", "figure"),
192+
Output("temp-climate-daily", "figure"),
193+
Output("graph-container", "style"),
194+
Output("bounding-output", "children", allow_duplicate=True),
195+
],
196+
[Input("generate-btn", "n_clicks")],
197+
prevent_initial_call=True,
198+
)
199+
def update_figures(n_clicks):
200+
fig_acc = go.Figure(data=[go.Scatter(x=[0, 1, 2], y=[0, 1, 0], mode="lines")])
201+
fig_daily = go.Figure(data=[go.Scatter(x=[0, 1, 2], y=[1, 0, 1], mode="lines")])
202+
return fig_acc, fig_daily, {"display": "block"}, "loaded"
203+
204+
dash_dcc.start_server(app)
205+
dash_dcc.wait_for_text_to_equal("#generate-btn", "Generate Figures")
206+
dash_dcc.find_element("#generate-btn").click()
207+
dash_dcc.wait_for_text_to_equal("#bounding-output", "loaded")
208+
dash_dcc.wait_for_element(".dash-graph .js-plotly-plot.dash-graph--pending")
209+
dash_dcc.wait_for_element(".dash-graph .js-plotly-plot:not(.dash-graph--pending)")
210+
dash_dcc.find_element("#bounding-btn").click()
211+
dash_dcc.wait_for_text_to_equal("#bounding-output", "true")

components/dash-table/dash_table_base/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# type: ignore
2+
13
import os as _os
24
import sys as _sys
35
import json

components/dash-table/src/dash-table/dash/DataTable.js

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -472,25 +472,14 @@ export const propTypes = {
472472
* View the documentation examples to learn more.
473473
*
474474
*/
475-
fixed_columns: PropTypes.oneOfType([
476-
PropTypes.exact({
477-
/**
478-
* Example `{'headers':False, 'data':0}` No columns are fixed (the default)
479-
*/
480-
481-
data: PropTypes.oneOf([0]),
482-
headers: PropTypes.oneOf([false])
483-
}),
484-
485-
PropTypes.exact({
486-
/**
487-
* Example `{'headers':True, 'data':1}` one column is fixed.
488-
*/
475+
fixed_columns: PropTypes.exact({
476+
/**
477+
* Example `{'headers':False, 'data':0}` No columns are fixed (the default)
478+
*/
489479

490-
data: PropTypes.number,
491-
headers: PropTypes.oneOf([true]).isRequired
492-
})
493-
]),
480+
data: PropTypes.number,
481+
headers: PropTypes.bool
482+
}),
494483

495484
/**
496485
* `fixed_rows` will "fix" the set of rows so that
@@ -505,24 +494,14 @@ export const propTypes = {
505494
* way that your columns are rendered or sized.
506495
* View the documentation examples to learn more.
507496
*/
508-
fixed_rows: PropTypes.oneOfType([
509-
PropTypes.exact({
510-
/**
511-
* Example `{'headers':False, 'data':0}` No rows are fixed (the default)
512-
*/
513-
514-
data: PropTypes.oneOf([0]),
515-
headers: PropTypes.oneOf([false])
516-
}),
517-
PropTypes.exact({
518-
/**
519-
* Example `{'headers':True, 'data':1}` one row is fixed.
520-
*/
497+
fixed_rows: PropTypes.exact({
498+
/**
499+
* Example `{'headers':False, 'data':0}` No rows are fixed (the default)
500+
*/
521501

522-
data: PropTypes.number,
523-
headers: PropTypes.oneOf([true]).isRequired
524-
})
525-
]),
502+
data: PropTypes.number,
503+
headers: PropTypes.bool
504+
}),
526505

527506
/**
528507
* If `single`, then the user can select a single column or group

0 commit comments

Comments
 (0)