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

Callback graph robustness #1416

Merged
merged 7 commits into from
Sep 25, 2020
Merged

Callback graph robustness #1416

merged 7 commits into from
Sep 25, 2020

Conversation

alexcjohnson
Copy link
Collaborator

The callback graph barfs on some apps, for two reasons:

  • If there's a prop width the Dagre layout throws an error the way we constructed our graph elements. I just mangled the props in the graph element IDs to fix this.
  • Even after this is fixed, for some apps the Dagre layout algorithm gets stuck in an apparently infinite loop. Switching the ranker from the default network-simplex to tight-tree appears to be more robust and gives generally comparable results.

In addition, I switched the force layout to fcose, which is more powerful than the built-in cose, I gave it stronger coupling between props in a single component to group them closer together, and I added a mode force-loose that skips that stronger coupling in case that works better in some circumstances.

I didn't add any tests of the new behavior, as I couldn't find a simple and public app that has problems previously.

import PropTypes from 'prop-types';
import React, { Fragment } from 'react';

const WidthComponent = props => (<Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callback graph fails against components with width prop.. simple component with width

dash_duo.find_element(".dash-debug-menu__button--callbacks").click()
sleep(3) # wait for callback graph to draw

assert dash_duo.get_logs() == []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some test with a callback involving a width prop. Fails against dash-renderer==1.8.1

Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcjohnson If you're 💃 with the test, I'm 💃 with the code change 😁

Copy link
Collaborator Author

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! 💃

@alexcjohnson alexcjohnson merged commit d33db91 into dev Sep 25, 2020
@alexcjohnson alexcjohnson deleted the callback-graph-robustness branch September 25, 2020 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants