Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Callback Graph #1179

Merged
merged 62 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6d9cdfd
Move callback graph to cytoscape and add clientside coloring
Apr 4, 2020
18539a2
Update styling and add live component and callback introspection
Apr 4, 2020
45c3b98
Add State to the callback graph with dashed lines
Apr 4, 2020
5d99381
Remove redundant value fields in introspection data
Apr 4, 2020
42c7664
Change to BFS layout for better State support
Apr 4, 2020
d4652ca
Add store and reducers for callback profiling and change notifications
Apr 5, 2020
5a4b996
Connect CallbackGraph to profiling and change notifications
Apr 5, 2020
221d4ba
Add basic profiling and execution highlighting
Apr 5, 2020
a89994b
Cleanup effects and highlight the sub-callback graph on select.
Apr 10, 2020
1fbd48c
Add support for Server-Timing headers and resource timing API
Apr 11, 2020
147d3be
Fix error when callback selected before first run.
Apr 11, 2020
2e2215c
Switch to react-json-tree because of bugs
Apr 11, 2020
6390f01
Update JSON styling
Apr 20, 2020
8553fb6
Merge remote-tracking branch 'upstream/dev' into callback_graph. Brea…
Apr 20, 2020
0b24da2
Partial implementation of wildcards. Introspection is broken.
May 15, 2020
5fa1850
Merge branch 'dev' into callback_graph
alexcjohnson Jul 24, 2020
2ad16f3
Merge branch 'dev' into callback_graph
alexcjohnson Jul 24, 2020
06f051b
callback graph merge fixes, and restrict profiling to debug mode
alexcjohnson Jul 27, 2020
c480342
incorporate callback status in profiling
alexcjohnson Jul 28, 2020
2026f10
error boundary for callback graph
alexcjohnson Jul 28, 2020
c67bd64
basic callback graph + pattern-matching fix
alexcjohnson Jul 28, 2020
c24a8e1
callback graph compatibility with hot reloading
alexcjohnson Jul 28, 2020
c89bd92
avoid errors on callback graph info for pattern-matching callbacks
alexcjohnson Jul 28, 2020
0f4924e
Merge branch 'dev' into callback_graph
alexcjohnson Jul 28, 2020
39ee385
lint js
alexcjohnson Jul 29, 2020
19de6ec
prettier + tslint via tslint-config-prettier
alexcjohnson Jul 29, 2020
8be31bf
fix profiler with unresponsive server
alexcjohnson Jul 29, 2020
d6325a6
lint profile reducer again??
alexcjohnson Jul 29, 2020
a2c6db4
black for callback profiling
alexcjohnson Jul 29, 2020
5ba3378
callback graph - respect effect cleanup
alexcjohnson Jul 29, 2020
97f4bee
pylint callback profiling
alexcjohnson Jul 29, 2020
244c6a4
only add callback profiling in debug mode with ui
alexcjohnson Aug 3, 2020
712b8df
Merge branch 'dev' into callback_graph
alexcjohnson Aug 3, 2020
cd54525
js/py->client/server & fix displayed count/time
alexcjohnson Aug 3, 2020
fd749c8
clean up callback graph styles & profile report
alexcjohnson Aug 4, 2020
5c927f0
fix callback graph info for missing IDs
alexcjohnson Aug 4, 2020
fc967a4
use dagre, cache layout, and save it when users pan/zoom/move nodes
alexcjohnson Aug 4, 2020
21d1e70
prettier
alexcjohnson Aug 4, 2020
3cbd990
get callback inputs/outputs from request/response, not layout
alexcjohnson Aug 6, 2020
bd8a752
fix history -> undo/redo
alexcjohnson Aug 6, 2020
0cec93f
display average times and bytes, not totals, in callback profiles
alexcjohnson Aug 6, 2020
5bda9d8
Merge branch 'dev' into callback_graph
alexcjohnson Aug 6, 2020
fdde1f1
changelog for callback graph improvements
alexcjohnson Aug 6, 2020
e9977d6
lint setting tweaks - and include tsx
alexcjohnson Aug 14, 2020
da76ae0
map w/ no return -> forEach
alexcjohnson Aug 14, 2020
df041e1
don't move the graph when selecting a node
alexcjohnson Aug 14, 2020
fe759e8
Merge branch 'dev' into callback_graph
alexcjohnson Aug 14, 2020
f6ac62b
black
alexcjohnson Aug 17, 2020
ef7b60c
fiddling with cb graph layout
alexcjohnson Aug 19, 2020
75160ce
Merge branch 'dev' into callback_graph
alexcjohnson Aug 20, 2020
65e14c5
user-selectable callback graph layout algos
alexcjohnson Aug 20, 2020
6ee83d5
callback graph tests
alexcjohnson Aug 30, 2020
18035a7
Merge branch 'dev' into callback_graph
alexcjohnson Aug 30, 2020
4b10e65
py2 test fix?
alexcjohnson Aug 30, 2020
02bbe5f
Merge branch 'dev' into callback_graph
alexcjohnson Sep 3, 2020
fd28d05
fix changelog
alexcjohnson Sep 3, 2020
ec345d3
Update CHANGELOG.md
Marc-Andre-Rivet Sep 3, 2020
8af36d5
fix bad merge on requestedCallbacks.ts
Sep 3, 2020
fdc662e
trigger build
Sep 3, 2020
a710e5f
update dash-test-components lock file
Sep 3, 2020
607773d
trigger build
Sep 3, 2020
c065fd2
trigger build
Sep 3, 2020
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
- [#1384](https://github.com/plotly/dash/pull/1384) Fixed a bug introduced by [#1180](https://github.com/plotly/dash/pull/1180) breaking use of `prevent_initial_call` as a positional arg in callback definitions

### Changed
- [#1179](https://github.com/plotly/dash/pull/1179) New and improved callback graph in the debug menu. Now based on Cytoscape for much more interactivity, plus callback profiling including number of calls, fine-grained time information, bytes sent and received, and more. You can even add custom timing information on the server with `callback_context.record_timing(name, seconds)`

## [1.15.0] - 2020-08-25
### Added
- [#1355](https://github.com/plotly/dash/pull/1355) Removed redundant log message and consolidated logger initialization. You can now control the log level - for example suppress informational messages from Dash with `app.logger.setLevel(logging.WARNING)`.
Expand Down
5 changes: 3 additions & 2 deletions dash-renderer/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tabWidth": 4,
"singleQuote": true,
"jsxSingleQuote": true,
"bracketSpacing": false,
"trailingComma": "es5"
}
"trailingComma": "none"
}
131 changes: 124 additions & 7 deletions dash-renderer/package-lock.json

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

12 changes: 8 additions & 4 deletions dash-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"scripts": {
"prepublishOnly": "rm -rf lib && babel src --extensions=\".ts,.tsx,.js,.jsx\" --out-dir lib --copy-files",
"private::format.js-eslint": "eslint --quiet --fix .",
"private::format.js-prettier": "prettier --config .prettierrc --write \"src/**/*.js\"",
"private::format.js-prettier": "prettier --config .prettierrc --write \"src/**/*.{js,jsx,ts,tsx}\"",
"private::format.ts": "tslint --fix --project tsconfig.json --config tslint.json",
"private::lint.js-eslint": "eslint .",
"private::lint.js-prettier": "prettier --config .prettierrc \"src/**/*.js\" --list-different",
"private::lint.js-prettier": "prettier --config .prettierrc \"src/**/*.{js,jsx,ts,tsx}\" --list-different",
"private::lint.ts": "tslint --project tsconfig.json --config tslint.json",
"build:js": "webpack --build release",
"build:dev": "webpack --build local",
Expand All @@ -27,18 +27,21 @@
"@babel/polyfill": "7.8.7",
"@plotly/dash-component-plugins": "^1.2.0",
"cookie": "^0.4.0",
"cytoscape": "^3.14.1",
"cytoscape-dagre": "^2.2.2",
"dependency-graph": "^0.9.0",
"fast-isnumeric": "^1.1.3",
"prop-types": "15.7.2",
"radium": "^0.26.0",
"ramda": "^0.27.0",
"react": "16.13.0",
"react-cytoscapejs": "^1.2.1",
"react-dom": "16.13.0",
"react-json-tree": "^0.11.2",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-thunk": "^2.3.0",
"viz.js": "2.1.2"
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
Expand Down Expand Up @@ -75,6 +78,7 @@
"ts-jest": "^26.0.0",
"ts-loader": "^7.0.2",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.8.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
Expand Down
22 changes: 11 additions & 11 deletions dash-renderer/src/APIController.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
onError,
setGraphs,
setPaths,
setLayout,
setLayout
} from './actions';
import {computePaths} from './actions/paths';
import {computeGraphs} from './actions/dependencies';
Expand All @@ -36,7 +36,7 @@ const UnconnectedContainer = props => {
error,
layoutRequest,
layout,
loadingMap,
loadingMap
} = props;

const [errorLoading, setErrorLoading] = useState(false);
Expand All @@ -55,8 +55,8 @@ const UnconnectedContainer = props => {
_dashprivate_config: propsRef.current.config,
_dashprivate_dispatch: propsRef.current.dispatch,
_dashprivate_graphs: propsRef.current.graphs,
_dashprivate_loadingMap: propsRef.current.loadingMap,
}),
_dashprivate_loadingMap: propsRef.current.loadingMap
})
});

useEffect(storeEffect.bind(null, props, events, setErrorLoading));
Expand All @@ -73,13 +73,13 @@ const UnconnectedContainer = props => {
layoutRequest.status &&
!includes(layoutRequest.status, [STATUS.OK, 'loading'])
) {
content = <div className="_dash-error">Error loading layout</div>;
content = <div className='_dash-error'>Error loading layout</div>;
} else if (
errorLoading ||
(dependenciesRequest.status &&
!includes(dependenciesRequest.status, [STATUS.OK, 'loading']))
) {
content = <div className="_dash-error">Error loading dependencies</div>;
content = <div className='_dash-error'>Error loading dependencies</div>;
} else if (appLifecycle === getAppState('HYDRATED')) {
renderedTree.current = true;

Expand All @@ -102,7 +102,7 @@ const UnconnectedContainer = props => {
</DashContext.Provider>
);
} else {
content = <div className="_dash-loading">Loading...</div>;
content = <div className='_dash-loading'>Loading...</div>;
}

return config && config.ui === true ? (
Expand All @@ -120,7 +120,7 @@ function storeEffect(props, events, setErrorLoading) {
error,
graphs,
layout,
layoutRequest,
layoutRequest
} = props;

if (isEmpty(layoutRequest)) {
Expand Down Expand Up @@ -180,7 +180,7 @@ function storeEffect(props, events, setErrorLoading) {
UnconnectedContainer.propTypes = {
appLifecycle: PropTypes.oneOf([
getAppState('STARTED'),
getAppState('HYDRATED'),
getAppState('HYDRATED')
]),
dispatch: PropTypes.func,
dependenciesRequest: PropTypes.object,
Expand All @@ -190,7 +190,7 @@ UnconnectedContainer.propTypes = {
loadingMap: PropTypes.any,
history: PropTypes.any,
error: PropTypes.object,
config: PropTypes.object,
config: PropTypes.object
};

const Container = connect(
Expand All @@ -204,7 +204,7 @@ const Container = connect(
graphs: state.graphs,
history: state.history,
error: state.error,
config: state.config,
config: state.config
}),
dispatch => ({dispatch})
)(UnconnectedContainer);
Expand Down
2 changes: 1 addition & 1 deletion dash-renderer/src/AccessDenied.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ function AccessDenied(props) {
);
}
AccessDenied.propTypes = {
config: PropTypes.object,
config: PropTypes.object
};
export default AccessDenied;
Loading