ipycytoscape
ipycytoscape copied to clipboard
Improving docs or examples
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
- [ ] Changing the size of the graph using
cyto.layout.width
andcyto.layout.height
https://github.com/QuantStack/ipycytoscape/issues/170#issuecomment-706248455
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.
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).
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 this is sooooo cool
Thank you for this adition @krassowski is super! :)