ipycytoscape icon indicating copy to clipboard operation
ipycytoscape copied to clipboard

Improving docs or examples

Open marimeireles opened this issue 3 years ago • 5 comments

Ian and I are always saying "Oh, it'd be great to have this example in our docs!" but because we can't always add them immediately we don't and we end up losing them. This issue is an effort to document these little good snippets that we wish we had to someday actually add them to our docs.

Please feel free to drop yours in the comments :) Just add a sentence (or more) explaining what the example is about.

  • [ ] Use ipycytoscape as an embeded widget https://github.com/QuantStack/ipycytoscape/issues/172#issuecomment-713823288
  • [ ] helper function to create nodes and edges from dicts https://github.com/QuantStack/ipycytoscape/issues/185#issuecomment-733593298
  • [ ] What are the valid events to listen to https://github.com/QuantStack/ipycytoscape/issues/182

marimeireles avatar Nov 27 '20 09:11 marimeireles

  • [ ] Changing the size of the graph using cyto.layout.width and cyto.layout.height https://github.com/QuantStack/ipycytoscape/issues/170#issuecomment-706248455

ianhi avatar Nov 27 '20 22:11 ianhi

talking about layouts.... what about a list of the different layouts somewhere? here: https://js.cytoscape.org/#cy.layout there is not such list neither.

joseberlines avatar Nov 27 '20 23:11 joseberlines

So there is an example which I would probably enjoy seeing in the docs as it took me a while to figure it out (btw the gif in README is outdated), this is changing layout on the fly and using the exact positions of nodes (no layout). I even wonder if it would make sense to make name=None to act like name='preset' (with default being whatever is being used by default at the moment).

kegg_example

Code in:

  • https://github.com/krassowski/computational-notebooks-for-biomedical-research/blob/master/cytoscape_widgets.py
  • https://github.com/krassowski/computational-notebooks-for-biomedical-research/blob/master/Examples_Jupyter_notebook.ipynb

of note, in current examples the redraw currently happens on every callback, but it could only happen on if event['name'] != 'value': (I think that @ianhi mentioned this earlier elsewhere).

Edit: for simplicity I herby license the code of my example as CC0 and allow re-licensing to the current ipycytoscape license if someone wants to pick up and send a PR with this as a (modified?) example.

krassowski avatar Dec 02 '20 13:12 krassowski

@krassowski this is sooooo cool

joseberlines avatar Dec 03 '20 18:12 joseberlines

Thank you for this adition @krassowski is super! :)

marimeireles avatar Dec 23 '20 20:12 marimeireles