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

Miscellaneous fixes re. label mappings & CX routes #93

Merged
merged 1 commit into from
Nov 10, 2021
Merged

Conversation

d2fong
Copy link
Member

@d2fong d2fong commented Nov 4, 2021

  • create a default name attribute for every node created in the network editor
  • re add export/import cx server endpoints

General information

Add a name attribute to every created

NODE_STYLE_DEFAULTS have a passthrough mapping for node labels, using the name attribute, accessed by node.data('name'). See here
The network editor does not instantiate any nodes with a name field. When the network is exported to CX, there will be a default label mapping to the name attribute but no node will have a name field.

This edit changes the controller logic to instantiate every node created in the network editor with a name attribute and a default value of empty string.

Re-add deleted cx import/export API endpoints

I also re-added the endpoints that I deleted before that allow import/export via the node API.

Checklist

Author:

  • One or more reviewers have been assigned.
  • Automated tests have been included in this pull request, if possible, for the new feature(s) or bug fix.
  • The associated GitHub issues are included (above).
  • Notes have been included (below).

Reviewers:

  • All automated checks are passing (green check next to latest commit).
  • At least one reviewer has signed off on the pull request. Reviewers have two business days to review the pull request, after which the author may merge in the pull request unilaterally.

@maxkfranz
Copy link
Member

NODE_STYLE_DEFAULTS have a passthrough mapping for node labels, using the name attribute, accessed by node.data('name').

I think Mike set that in anticipation for smart label presets (e.g. if you have a 'name' or 'protein name' attribute, then that should probably be used by default for the label). I don't think the expectation should be that the 'name' field is always used.

One alternative that would be simple and less error-prone for now would be for the label to fall back on the empty string if 'name' doesn't exist. Implicitly editing the user's data may cause unexpected consequences down the road.

@mikekucera, @d2fong, what do you think?

@maxkfranz maxkfranz changed the title miscellaneous fixes Miscellaneous fixes re. label mappings & CX routes Nov 5, 2021
@mikekucera
Copy link
Collaborator

mikekucera commented Nov 5, 2021 via email

@d2fong
Copy link
Member Author

d2fong commented Nov 5, 2021

Ok if that style default will eventually build into smart defaults, then we should not include that name attribute change. There are other ways that I can handle the default node label mapping when I export the network to CX.

- uploading cx into a CE network
- exporting a ce network to CX
@d2fong d2fong merged commit 3b01bf9 into master Nov 10, 2021
@d2fong d2fong deleted the fix/variety branch November 10, 2021 20:15
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.

4 participants