Opened 7 months ago

Last modified 6 weeks ago

#30540 new enhancement

Provide graph editor that works with Jupyter

Reported by: slelievre Owned by:
Priority: major Milestone: sage-9.4
Component: user interface Keywords: graph_editor
Cc: boothby, jason, mpatel, nthiery, nvcleemp, rbeezer, rkirov, rlm, slelievre, was, zerline, gh-jcamp0x2a, gh-jfraymond Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

This ticket is about providing a graph editor that works in Jupyter (Jupyter Notebook or JupyterLab).

Possibly in the form of a Jupyter widget, using any existing one if possible.

This is part of

  • #29889: Metaticket: Jupyter improvements for things that were in sagenb

Related:

Change History (10)

comment:1 Changed 7 months ago by slelievre

I cc-ed a lot of people who have had historical involvement with this topic.

If you mind, email me to un-cc you (un-cc-ing yourself would have the opposite effect of subscribing you forever to updates on this ticket).

comment:2 Changed 7 months ago by slelievre

  • Description modified (diff)

And if I forgot someone who wanted to be cc-ed, it's easy: just cc yourself.

comment:3 Changed 7 months ago by nthiery

Candidates could be francy, bqplot, networkx+matplotlib. A promising one:

https://blog.jupyter.org/interactive-graph-visualization-in-jupyter-with-ipycytoscape-a8828a54ab63

comment:4 follow-up: Changed 7 months ago by nvcleemp

Some nice features would be:

  • ability to disable any automatic layouting: not as annoying as an editor that keeps moving vertices while you're trying to construct a complicated graph
  • ability to have a layout-only mode: if you have a graph, you might want to change the layout without accidentally changing the graph structure

Probably some more, but these are the first two I could think of.

comment:5 in reply to: ↑ 4 Changed 7 months ago by slelievre

Replying to nvcleemp:

Some nice features would be:

  • ability to disable any automatic layouting: not as annoying as an editor that keeps moving vertices while you're trying to construct a complicated graph
  • ability to have a layout-only mode: if you have a graph, you might want to change the layout without accidentally changing the graph structure

Probably some more, but these are the first two I could think of.

The "CS academy" graph editor (not sure about the license -- I'm asking them) has those features. There's a button "Force" to let some force reshape the graph, and buttons "Draw", "Edit", "Delete", "Config" that stop the movement to let the user edit the graph. There's also a text column on the left where one can manually edit the graph vertices and edges.

comment:6 Changed 7 months ago by gh-jcamp0x2a

  • Cc gh-jcamp0x2a added

comment:7 Changed 6 months ago by slelievre

  • Description modified (diff)

comment:8 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:9 Changed 2 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

comment:10 Changed 6 weeks ago by gh-jfraymond

  • Cc gh-jfraymond added

Hello,

I just see this ticket. Last year I started to (occasionally) develop a graph editor for sage using ipycanvas and ipywidgets, that can be found in the following repository: https://gitlab.limos.fr/jfraymon/phitigra

It is not completely finished (and the code could/will be improved) but it is functional: one can draw a graph and export it, zoom in/out, change vertex colors, use layout algorithms, etc.

I did not make a ticket here to include it in sage because it depends on external libraries (ipycanvas and ipywidgets) and I thought it would be annoying to review (also it is still work in progress).

Note: See TracTickets for help on using tickets.