4
$\begingroup$

I'm interested in constructing an interactive GUI graph generator, where I can add and delete vertices and edges.

I'm aware of this question, and this is but a quick follow-up to this answer. I would like to simply edit István Zachar's code to answer the following questions

  1. Is it possible to recover/paste the constructed graph? How does one do it (an undirected graph would be ok)?
  2. Could I easily toggle the graph between directed and undirected?
  3. Also, I wonder if it's possible to, given a graph, edit it with such a GUI construction.

I feel like it should be relatively easy to do it using this code, but I'm not yet very comfortable working DynamicModule. I wonder if there is a Manipulate version of this.

Any ideas?

$\endgroup$
5
  • $\begingroup$ I always wanted a good interactive graph drawing function for IGraph/M, but never had the time, and I am not deeply experienced with creating well-performing GUIs in Mathematica. $\endgroup$
    – Szabolcs
    Mar 18, 2020 at 8:29
  • 1
    $\begingroup$ I pledge a bounty of 500 for any answer that is sufficiently usable, robust and responsive that it can be a basis of an IGraph/M function. I will not post the bounty right now because I do not want to add time pressure, but rest assured that it will be granted. The offer stands in the long term. If there are additional answers that bring tangible improvements, those will receive the bounty too. $\endgroup$
    – Szabolcs
    Mar 18, 2020 at 8:30
  • 1
    $\begingroup$ Tip: Ideally, the function will output an object that is simply interpreted as a Graph when re-evaluated. Requirements: (1) Directed/undirected support (mixed graph not necessary). (2) Movable vertices (3) Possibility to add/remove edges/vertices (4) Keep usability in mind: try to build various small graphs with it. (5) Reasonably commented readable implementation (so others can build on it). $\endgroup$
    – Szabolcs
    Mar 18, 2020 at 8:40
  • $\begingroup$ Sam: I didn't want to hijack your question. I understand that your requirements are less stringent. So everyone: please do not hesitate to post simpler solutions that satisfy the OP's needs, if you have such a solution. The comment above just states the requirements for the bounty. $\endgroup$
    – Szabolcs
    Mar 18, 2020 at 8:44
  • $\begingroup$ No worries! I think your suggestions are great, and I am particularly interested in the directed/undirected support (I will edit my question). I think (2) and (3) are already doable with István's code, if you right-click on a vertex or edge, but this might not be exactly what you're looking for. $\endgroup$
    – sam wolfe
    Mar 18, 2020 at 9:57

1 Answer 1

4
$\begingroup$

IGraph/M 0.6 now provides the IGGraphEditor[] function for this. For more details, see https://mathematica.stackexchange.com/a/270829/12

This functionality is under active development, and all feedback is very welcome!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.