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

Expose CyLeaflet subcomponent IDs + Add additional documentation of CyLeaflet design #211

Merged
merged 4 commits into from
May 7, 2024

Conversation

emilykl
Copy link
Contributor

@emilykl emilykl commented Mar 15, 2024

Description of changes

Pre-Merge checklist

  • The project was correctly built with npm run build:all.
  • If there was any conflict, it was solved correctly.
  • All changes were documented in CHANGELOG.md.
  • All tests on CircleCI have passed.
  • All Percy visual changes have been approved.
  • Two people have 💃'd the pull request. You can be one of these people if you are a Dash Cytoscape core contributor.

@emilykl emilykl requested a review from alexcjohnson as a code owner March 15, 2024 20:53
@emilykl emilykl requested a review from Farkites March 15, 2024 21:06
Comment on lines +68 to +70
self.CYTOSCAPE_ID = self.ids["cy"]
self.LEAFLET_ID = self.ids["leaf"]
self.ELEMENTS_ID = self.ids["elements"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to make it easier than cyleaflet_instance.ids["leaf"]? I guess this way you get autocompletion?

Regardless, in order to use this you needed to pull cyleaflet_instance out of the layout... which might not always be possible, I wonder if it would also be worth making a cyto.CyLeaflet.get_leaflet_id(cyleaflet_id) etc that would construct the PMC ID for you - and then you could even call cyto.CyLeaflet.get_leaflet_id(ALL) or (MATCH) if you wanted to construct your own PMC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah exactly, this way you get autocomplete and it looks cleaner than accessing a dictionary.

I see your point -- I'm open to switching this to exposing static functions instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it needs to be one or the other - this pattern is very nice when it works, but we can add the functions as well to cover the cases when it doesn't work.

Copy link
Contributor

@Farkites Farkites left a comment

Choose a reason for hiding this comment

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

lgtm!

@Farkites Farkites merged commit 77817ed into main May 7, 2024
2 checks passed
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.

3 participants