Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
13a5c34
Add test case multi component in list of dict.
T4rk1n Jul 13, 2022
740b94e
Fix multiple components in list of dict.
T4rk1n Jul 13, 2022
1ff8652
Add one more item with multiple components.
T4rk1n Jul 21, 2022
7c09119
Merge branch 'dev' into fix-component-as-prop
T4rk1n Jul 21, 2022
96cab27
Update changelog.
T4rk1n Jul 21, 2022
755b037
Merge branch 'dev' into fix-component-as-prop
T4rk1n Jul 29, 2022
29511fe
Merge branch 'dev' into fix-component-as-prop
T4rk1n Aug 3, 2022
9dbc2ec
fixed validation_layout in pages
AnnMarieW Aug 4, 2022
2cd87cc
Improve error message when using fixtures but testing not installed.
T4rk1n Aug 9, 2022
db9f344
Fix grva004 test prepend trace.
T4rk1n Aug 9, 2022
cc7e30d
Fix grva005 extend graph trace.
T4rk1n Aug 9, 2022
90d76fc
Remove reruns
T4rk1n Aug 9, 2022
68dffbc
Fix test hot reload.
T4rk1n Aug 9, 2022
22e537d
Add MultiProcessRunner for hot reload test.
T4rk1n Aug 10, 2022
694f431
Kill process with psutil.
T4rk1n Aug 10, 2022
14b4ab1
Move import to top.
T4rk1n Aug 11, 2022
b569dfe
Merge pull request #2188 from plotly/fix-prepend-tests
T4rk1n Aug 11, 2022
5aaf159
Merge branch 'dev' into testing-import-error
T4rk1n Aug 12, 2022
f68acab
Merge branch 'dev' into fix-component-as-prop
T4rk1n Aug 12, 2022
20b6467
Merge pull request #2152 from plotly/fix-component-as-prop
T4rk1n Aug 12, 2022
81a398c
Merge branch 'dev' into testing-import-error
T4rk1n Aug 12, 2022
de5cd9d
Update changelog.
T4rk1n Aug 12, 2022
495f794
Merge pull request #2187 from plotly/testing-import-error
T4rk1n Aug 15, 2022
93ba642
Fix unordered background callback inputs & state.
T4rk1n Aug 15, 2022
c7e6078
remove deprecated before_first_request
AnnMarieW Aug 16, 2022
5282136
Merge pull request #2194 from plotly/fix-bg-args
T4rk1n Aug 19, 2022
233daa3
Fixed double quotes copy and paste bug
Aug 22, 2022
f38dfb2
Fixed lint error
Aug 22, 2022
12377d9
Retrying tests
Aug 22, 2022
6c938e2
Update Markdown.react.js
LiamConnors Aug 26, 2022
29a3892
Merge pull request #2206 from plotly/update-Markdown-doc-typo
alexcjohnson Aug 26, 2022
3831b97
Merge branch 'dev' of https://github.com/plotly/dash into fix-pages-v…
AnnMarieW Aug 30, 2022
01e42c3
Merge branch 'dev' into fixing-double-quote-copy-paste
amy-morrill Aug 31, 2022
711360c
Fix double quote bug while allowing multiline cells
amy-morrill Sep 1, 2022
2373e42
Small logical fix
amy-morrill Sep 1, 2022
7f26336
Fix selenium test error
amy-morrill Sep 1, 2022
8f875b8
react-cytoscapejs v2 and lint updates
alexcjohnson Sep 2, 2022
3c09015
reformat with black
siner308 Sep 5, 2022
127ee23
fix to required children prop
siner308 Sep 5, 2022
9b5af0a
separate args generator
siner308 Sep 6, 2022
ae9faa6
fix #1348
siner308 Sep 6, 2022
ce9b09d
Small fixes
amy-morrill Sep 6, 2022
efe8c7e
Lint fix
amy-morrill Sep 6, 2022
c897b2b
Merge pull request #2217 from plotly/react-cytoscape-v2
alexcjohnson Sep 6, 2022
6b00499
Merge branch 'dev' into fixing-double-quote-copy-paste
alexcjohnson Sep 7, 2022
5c73fab
changelog for #2202
alexcjohnson Sep 7, 2022
dd13278
Merge pull request #2202 from amy-morrill/fixing-double-quote-copy-paste
alexcjohnson Sep 7, 2022
e9e2c54
revert commit c7e6078
AnnMarieW Sep 8, 2022
1319b33
Merge branch 'dev' of https://github.com/plotly/dash into fix-pages-v…
AnnMarieW Sep 8, 2022
bf71a22
feat: improve to dynamically add required props validation
alstn2468 Sep 8, 2022
70360e3
Merge pull request #1 from alstn2468/required-children-prop
siner308 Sep 8, 2022
316e530
fix component generator
siner308 Sep 8, 2022
b802c5d
add test case gene004
siner308 Sep 8, 2022
4800dcb
add test case debc030
siner308 Sep 8, 2022
e139906
add parentheses
siner308 Sep 8, 2022
8862ba8
added test and changelog
AnnMarieW Sep 8, 2022
13ac4c6
feat: improve to use list comprehensions instead of list method
alstn2468 Sep 8, 2022
1c92af4
chore: remove useless dedent import
alstn2468 Sep 8, 2022
a0030bb
Merge pull request #2 from alstn2468/required-children-prop
siner308 Sep 8, 2022
45698b6
Merge branch 'dev' into required-children-prop
siner308 Sep 8, 2022
3322e8f
fixed changelog
AnnMarieW Sep 8, 2022
070ee15
rerun tests
AnnMarieW Sep 8, 2022
3fe9d0f
Merge pull request #2182 from AnnMarieW/fix-pages-validation_layout
alexcjohnson Sep 8, 2022
6527073
Merge branch 'dev' into required-children-prop
alexcjohnson Sep 8, 2022
e04a28b
fix test metadata & dedent unused indent
siner308 Sep 9, 2022
7eff7eb
add changelog
siner308 Sep 9, 2022
026d685
fix replace to dedent
siner308 Sep 9, 2022
b7585ef
exclude dirs in the pages folder that start with . or _
AnnMarieW Sep 9, 2022
03b68c5
changelog for #2223
AnnMarieW Sep 9, 2022
ef84089
improved tests
AnnMarieW Sep 9, 2022
5d2169b
rerun tests
AnnMarieW Sep 10, 2022
340c80a
rerun tests
AnnMarieW Sep 10, 2022
d02017d
Merge pull request #2223 from AnnMarieW/pages-exclude-hidden-folders
alexcjohnson Sep 12, 2022
d956adb
Merge branch 'dev' into required-children-prop
alexcjohnson Sep 12, 2022
9af721d
Replace bare exception with PageError
T4rk1n Sep 12, 2022
ed38d3b
Ignore page register from callback context value.
T4rk1n Sep 12, 2022
ba9876a
Add dash.testing.ignore_register_page contest manager.
T4rk1n Sep 12, 2022
6886670
Rename tests.unit.dash to tests.unit.library (messes with IDE imports)
T4rk1n Sep 12, 2022
6481306
Merge pull request #2218 from siner308/required-children-prop
alexcjohnson Sep 12, 2022
5827387
Remove ignore register page flag when calling background callbacks.
T4rk1n Sep 14, 2022
7e9b1ee
Merge branch 'dev' into background-register-page
T4rk1n Sep 16, 2022
e8467cd
Update changelog
T4rk1n Sep 16, 2022
0df861f
Merge pull request #2226 from plotly/background-register-page
T4rk1n Sep 16, 2022
c50e3d4
Ensure plotly.js calls are properly sequenced if graph is rerendered …
alexcjohnson Sep 19, 2022
6786539
leftover linting
alexcjohnson Sep 19, 2022
413106e
changelog for graph edit queue
alexcjohnson Sep 19, 2022
dc15b79
Update LICENSE
GeorgeKontsevik Sep 19, 2022
b698707
Update LICENSE
GeorgeKontsevik Sep 20, 2022
c4e861b
Update LICENSE
GeorgeKontsevik Sep 20, 2022
b392f4e
Update LICENSE
GeorgeKontsevik Sep 20, 2022
b46be78
Update LICENSE.md
GeorgeKontsevik Sep 20, 2022
1d7616d
Update LICENSE
GeorgeKontsevik Sep 20, 2022
699ce7e
Update LICENSE
GeorgeKontsevik Sep 20, 2022
64908fa
Update LICENSE
GeorgeKontsevik Sep 20, 2022
c682e0c
Update LICENSE
GeorgeKontsevik Sep 20, 2022
a5bb256
Merge pull request #2237 from plotly/graph-edit-queue
alexcjohnson Sep 23, 2022
91f20fe
Merge branch 'dev' into patch-1
alexcjohnson Sep 23, 2022
f79a276
Merge pull request #2238 from GKI98/patch-1
alexcjohnson Sep 23, 2022
32a4492
Version 2.6.2
T4rk1n Sep 23, 2022
5335ec5
Merge pull request #2243 from plotly/version-2.6.2
T4rk1n Sep 23, 2022
78825a3
Merge branch 'dev' into master-2.6.2
T4rk1n Sep 23, 2022
51779f4
Version 2.6.2 artifacts.
T4rk1n Sep 23, 2022
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ jobs:
. venv/bin/activate && rm -rf components/dash-core-components/dash_core_components
cd components/dash-core-components
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml --junitprefix="components.dash-core-components" ${TESTFILES} --reruns 3
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml --junitprefix="components.dash-core-components" ${TESTFILES}
- store_artifacts:
path: ~/dash/components/dash-core-components/test-reports
- store_test_results:
Expand Down
2 changes: 1 addition & 1 deletion @plotly/dash-component-plugins/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Plotly, Inc
Copyright (c) 2022 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { RequiredChildrenComponentProps } from "../props";


const RequiredChildrenComponent = (props: RequiredChildrenComponentProps) => {
const {children} = props;
return (
<div>
{children}
</div>
)
}

export default RequiredChildrenComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import WrappedHTML from './components/WrappedHTML';
import FCComponent from './components/FCComponent';
import EmptyComponent from './components/EmptyComponent';
import MixedComponent from './components/MixedComponent';
import RequiredChildrenComponent from './components/RequiredChildrenComponent';

export {
TypeScriptComponent,
Expand All @@ -16,4 +17,5 @@ export {
FCComponent,
EmptyComponent,
MixedComponent,
RequiredChildrenComponent,
};
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ export type WrappedHTMLProps = {
children?: React.ReactNode;
id?: string;
} & Pick<React.ButtonHTMLAttributes<any>, 'autoFocus'>

export type RequiredChildrenComponentProps = {
children: React.ReactNode;
}
11 changes: 10 additions & 1 deletion @plotly/dash-test-components/src/components/ComponentAsProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import PropTypes from 'prop-types';


const ComponentAsProp = (props) => {
const { element, id, shapeEl, list_of_shapes } = props;
const { element, id, shapeEl, list_of_shapes, multi_components } = props;
return (
<div id={id}>
{shapeEl && shapeEl.header}
{element}
{shapeEl && shapeEl.footer}
{list_of_shapes && <ul>{list_of_shapes.map(e => <li key={e.value}>{e.label}</li>)}</ul> }
{multi_components && <div>{multi_components.map(m => <div id={m.id} key={m.id}>{m.first} - {m.second}</div>)}</div>}
</div>
)
}
Expand All @@ -28,6 +29,14 @@ ComponentAsProp.propTypes = {
label: PropTypes.node,
value: PropTypes.number,
})
),

multi_components: PropTypes.arrayOf(
PropTypes.exact({
id: PropTypes.string,
first: PropTypes.node,
second: PropTypes.node,
})
)
}

Expand Down
2 changes: 1 addition & 1 deletion @plotly/webpack-dash-dynamic-import/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Plotly, Inc
Copyright (c) 2022 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [2.6.2] - 2022-09-23

### Fixed

- [#2237](https://github.com/plotly/dash/pull/2237) Ensure calls to `plotly.js` from `dcc.Graph` are properly sequenced even if React initiates multiple render cycles in quick succession.
- [#2218](https://github.com/plotly/dash/pull/2218) Fix bug [#1348](https://github.com/plotly/dash/issues/1348) Validate children prop (required or not).
- [#2223](https://github.com/plotly/dash/pull/2223) Exclude hidden folders when building `dash.page_registry`.
- [#2182](https://github.com/plotly/dash/pull/2182) Fix [#2172](https://github.com/plotly/dash/issues/2172) Make it so that when using pages, if `suppress_callback_exceptions=True` the `validation_layout` is not set.
- [#2152](https://github.com/plotly/dash/pull/2152) Fix bug [#2128](https://github.com/plotly/dash/issues/2128) preventing rendering of multiple components inside a dictionary.
- [#2187](https://github.com/plotly/dash/pull/2187) Fix confusing error message when trying to use pytest fixtures but `dash[testing]` is not installed.
- [#2202](https://github.com/plotly/dash/pull/2202) Fix bug [#2185](https://github.com/plotly/dash/issues/2185) when you copy text with multiple quotes into a table
- [#2226](https://github.com/plotly/dash/pull/2226) Fix [#2219](https://github.com/plotly/dash/issues/2219) pages register & background callbacks.

## [2.6.1] - 2022-08-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Plotly, Inc
Copyright (c) 2022 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion components/dash-core-components/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Plotly Technologies
Copyright (c) 2022 Plotly Technologies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions components/dash-core-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions components/dash-core-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "2.6.1",
"version": "2.6.2",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand All @@ -21,7 +21,7 @@
"private::lint.prettier": "prettier --config .prettierrc src/**/*.js --list-different",
"prepublishOnly": "rm -rf lib && babel src --out-dir lib --copy-files --config-file ./.lib.babelrc && rm -rf lib/jl/ lib/*.jl",
"test": "run-s -c lint test:intg test:pyimport",
"test:intg": "pytest --nopercyfinalize --headless tests/integration --reruns 3",
"test:intg": "pytest --nopercyfinalize --headless tests/integration ",
"test:pyimport": "python -m unittest tests/test_dash_import.py",
"prebuild:js": "cp node_modules/plotly.js-dist-min/plotly.min.js dash_core_components_base/plotly.min.js",
"build:js": "webpack --mode production",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DashMarkdown.propTypes = {
link_target: PropTypes.string,

/**
* A markdown string (or array of strings) that adhreres to the CommonMark spec
* A markdown string (or array of strings) that adheres to the CommonMark spec
*/
children: PropTypes.oneOfType([
PropTypes.string,
Expand Down
135 changes: 72 additions & 63 deletions components/dash-core-components/src/fragments/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class PlotlyGraph extends Component {
this.gd = React.createRef();
this._hasPlotted = false;
this._prevGd = null;
this._queue = Promise.resolve();

this.bindEvents = this.bindEvents.bind(this);
this.getConfig = this.getConfig.bind(this);
Expand All @@ -144,6 +145,7 @@ class PlotlyGraph extends Component {
this.getLayoutOverride = this.getLayoutOverride.bind(this);
this.graphResize = this.graphResize.bind(this);
this.isResponsive = this.isResponsive.bind(this);
this.amendTraces = this.amendTraces.bind(this);

this.state = {override: {}, originals: {}};
}
Expand Down Expand Up @@ -219,41 +221,78 @@ class PlotlyGraph extends Component {
});
}

mergeTraces(props, dataKey, plotlyFnKey) {
const clearState = props.clearState;
const dataArray = props[dataKey];
amendTraces(p, oldProps, newProps) {
const {prependData: oldPrepend, extendData: oldExtend} = oldProps;
const {prependData: newPrepend, extendData: newExtend} = newProps;
const _this = this;

let p = Promise.resolve();
function mergeTraces(props, dataKey, plotlyFnKey) {
const clearState = props.clearState;
const dataArray = props[dataKey];

dataArray.forEach(data => {
let updateData, traceIndices, maxPoints;
if (Array.isArray(data) && typeof data[0] === 'object') {
[updateData, traceIndices, maxPoints] = data;
} else {
updateData = data;
}
let _p = Promise.resolve();

if (!traceIndices) {
function getFirstProp(data) {
return data[Object.keys(data)[0]];
dataArray.forEach(data => {
let updateData, traceIndices, maxPoints;
if (Array.isArray(data) && typeof data[0] === 'object') {
[updateData, traceIndices, maxPoints] = data;
} else {
updateData = data;
}

function generateIndices(data) {
return Array.from(Array(getFirstProp(data).length).keys());
if (!traceIndices) {
function getFirstProp(data) {
return data[Object.keys(data)[0]];
}

function generateIndices(data) {
return Array.from(
Array(getFirstProp(data).length).keys()
);
}
traceIndices = generateIndices(updateData);
}
traceIndices = generateIndices(updateData);
}

p = p.then(() => {
const gd = this.gd.current;
return (
gd &&
Plotly[plotlyFnKey](gd, updateData, traceIndices, maxPoints)
);
_p = _p.then(() => {
const gd = _this.gd.current;
return (
gd &&
Plotly[plotlyFnKey](
gd,
updateData,
traceIndices,
maxPoints
)
);
});
});
});

p.then(() => clearState(dataKey));
return _p.then(() => clearState(dataKey));
}

let modified = false;

if (newPrepend?.length && oldPrepend !== newPrepend) {
modified = true;
p = p.then(() =>
mergeTraces(newProps, 'prependData', 'prependTraces')
);
}

if (newExtend?.length && oldExtend !== newExtend) {
modified = true;
p = p.then(() =>
mergeTraces(newProps, 'extendData', 'extendTraces')
);
}

if (modified) {
p = p.then(() =>
newProps._dashprivate_onFigureModified(newProps.figure)
);
}

return p;
}

getConfig(config, responsive) {
Expand Down Expand Up @@ -405,23 +444,8 @@ class PlotlyGraph extends Component {
}

componentDidMount() {
let p = this.plot(this.props);
if (this.props.prependData) {
p = p.then(() =>
this.mergeTraces(this.props, 'prependData', 'prependTraces')
);
}
if (this.props.extendData) {
p = p.then(() =>
this.mergeTraces(this.props, 'extendData', 'extendTraces')
);
}

if (this.props.prependData?.length || this.props.extendData?.length) {
p.then(() =>
this.props._dashprivate_onFigureModified(this.props.figure)
);
}
const p = this.plot(this.props);
this._queue = this.amendTraces(p, {}, this.props);
}

componentWillUnmount() {
Expand Down Expand Up @@ -454,7 +478,8 @@ class PlotlyGraph extends Component {
return;
}

let p = Promise.resolve();
let p = this._queue;

if (
this.props.mathjax !== nextProps.mathjax ||
this.props.figure !== nextProps.figure ||
Expand All @@ -463,34 +488,18 @@ class PlotlyGraph extends Component {
this.props._dashprivate_transformFigure !==
nextProps._dashprivate_transformFigure
) {
p = this.plot(nextProps);
p = p.then(() => this.plot(nextProps));
}

if (this.props.prependData !== nextProps.prependData) {
p = p.then(() =>
this.mergeTraces(nextProps, 'prependData', 'prependTraces')
);
}

if (this.props.extendData !== nextProps.extendData) {
p = p.then(() =>
this.mergeTraces(nextProps, 'extendData', 'extendTraces')
);
}

if (this.props.prependData?.length || this.props.extendData?.length) {
p.then(() =>
this.props._dashprivate_onFigureModified(this.props.figure)
);
}
this._queue = this.amendTraces(p, this.props, nextProps);
}

componentDidUpdate(prevProps) {
if (
prevProps.id !== this.props.id ||
prevProps.mathjax !== this.props.mathjax
) {
this.plot(this.props);
this._queue = this._queue.then(() => this.plot(this.props));
}
}

Expand Down
Loading