openmsi / openmsimodel

OpenMSIModel uses the GEMD (Graphical Expression of Material Data) format to interact with generalized laboratory, analysis, and computational materials data.
1 stars 3 forks source link

Add widget for Cytoscape from GraphML #4

Open matthewturk opened 6 months ago

matthewturk commented 6 months ago

(I'm not yet familiar with the standard processes for contributions to this repository, but I very much would like to learn and conform to them!)

This adds a CytoscapeGraphWidget for graphml files. In one specific case, this is how I used it:

import openmsimodel.graph.helpers as helpers

helpers.CytoscapeGraphWidget.from_graphml("F086-R4C3.graphml")

The resultant display has a JSON viewer that is updated whenever a node is selected. It also includes some code that flattens GraphML nodes to better work with CytoscapeJS.