cytoscape / cytoscape-explore

Network visualization webapp.
MIT License
12 stars 4 forks source link

Fix/support node label position in cx2 export #94

Closed d2fong closed 2 years ago

d2fong commented 2 years ago

General information

Associated issues: #57, #59

Checklist

Author:

Reviewers:

Notes This PR adds support for node label position properties when exporting networks to CX. The previous approach was not designed for nested CX properties so I had to redesign the exporter taking into account that a property could be nested.

I use a lookup table for all the CX properties we want to support. Most CX properties use the same conversion function but the table optionally contains an override conversion function for nested properties.

This approach iterates over a hardcoded table of supported CX properties instead of iterating through cytoscape.js style snapshots. This should prevent things from breaking less often when new changes are made to the style model.

d2fong commented 2 years ago

Thanks. There will probably be another PR from me to clean up the cx module in general. Some issues with the CX conversion code includes:

  1. Not fully using the node/js module conventions
  2. Unused files/code
  3. Possibly duplicated code in the importer/exporter