plotly / dash-cytoscape

Interactive network visualization in Python and Dash, powered by Cytoscape.js
https://dash.plot.ly/cytoscape
MIT License
602 stars 119 forks source link

Object Oriented Approach for Elements, Styling and Layouts #20

Closed xhluca closed 4 years ago

xhluca commented 5 years ago

Description

At the moment, the elements, styles and layouts are specified using dictionaries. In fact, the syntax is closer to CSS and JS than Pythonic (although dictionaries are inherently pythonic, an object-oriented approach would be intuitive for long-time python users). I still believe dictionary declaration should stay for those who come from Cytoscape.js background, or those who are familiar with CSS selectors.

In fact, the learning curve for dictionary declaration is higher, but it is faster to write and less verbose, as well as being JSON-compatible (in other words, it's easier to import/export graphs from cytoscape.js).

Recommendations

Add object declaration for:

Links

xhluca commented 4 years ago

Closing this since https://github.com/plotly/dash-cytoscape/issues/23 would resolve this suggestion.