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
cy.mount()
: Attach to a DOM element for rendering, after init
#1937
Comments
@maxkfranz I can work on this feature. I was able to implement mount for the basic case. I tested it with the pathways search app and I could pass cy instances as props to child components without errors. |
@d2fong Great; I'll add this to the 3.3 milestone then. Not sure if it's worth it to support multiple mounts per core instance. Maybe it's worth trying destroying/replacing the renderer on each mount to support that usecase? If cleanly destroying the renderer without also destroying the core instance is not straight forward, then we could just support the mount-once per core instance usecase. There's |
Merged #1949 into unstable. It looks good, but let's keep this issue open for now as a reminder to keep an eye out for mount issues while working on other features on the unstable branch. |
@d2fong I added buttons to test mounting on the debug page. I played around with it for a while and I wasn't able to break anything. It looks like it's working well. Closing |
Thanks. Good to know it is working well. |
cy.mount() doesn't work well with the cose layout. |
You're welcome to post reproducible issues as new issues in the issue tracker. Include all of the information in the issue template, such as the reproducible demo. |
Description of new feature
cy.mount( container )
: Attaches the instance to the specified container, just like specifyingcontainer
at init.cy.unmount()
: Detaches the instance from its container, making it a headless instance.Motivation for new feature
Sometimes, you want to create an instance before you have the DOM element you want to render in. For example, you might pass a Cytoscape instance into a React component's props, but you can't attach to the DOM element until
componentDidMount()
.Feature Breakdown
The text was updated successfully, but these errors were encountered: