Giter Site home page Giter Site logo

magjac / graphviz-visual-editor Goto Github PK

View Code? Open in Web Editor NEW
675.0 15.0 73.0 8.54 MB

A web application for interactive visual editing of Graphviz graphs described in the DOT language.

Home Page: http://magjac.com/graphviz-visual-editor

License: MIT License

Makefile 0.46% JavaScript 95.48% HTML 0.15% PEG.js 3.79% Python 0.12%
graphviz dot visual-editor javascript graphviz-dot-language interactive-visualization web-application text-editor graph-drawing graph-visualization

graphviz-visual-editor's People

Contributors

dependabot[bot] avatar magjac avatar prizz avatar ygra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphviz-visual-editor's Issues

Make it easier to interact with nodes without fill

Currently, unfilled nodes must be interacted with through the perimeter or through the node text which makes it a little harder to select them or to draw edges from and to them. This is analogous to how the URL attribute works:

For svg [...] output, the active area for a node is its visible image. For example, an unfilled node with no drawn boundary will only be active on its label.

Filled nodes can be interacted with anywhere on or inside its perimeter, including its background.

Ideas

  • When displaying the graph, set fill="transparent" on the SVG basic shape.

Error indication in text editor is cleared even though the error is still present

If neither the error message nor the line number changes when the DOT source is edited, the error indication is removed, although the error is still present.

A workaround is to add or delete a line in the beginning of the DOT source, which forces the line number to change.

The reason for this bug seems to be that the Ace editor clears the annotations internally and the React Ace Component does not update them if they are not changed, see the source code.

Provide visual feedback when the graph pane has focus

The only indication today is loss of focus in the text editor pane, indicated by a change of background color on the current line.
Ideas in the order currently preferred:

  • Colored frame on graph pane
  • Different backgrounds in both panes depending on focus
  • Gray-out panes depending on focus

Undo/redo history is lost when a node or edge format drawer is opened

The node and edge format drawers are displayed instead of the text editor. This is intentional.

However, the editor is terminated when a format drawer is opened and a new editor instance is started when the drawer is closed which causes the editor state to be lost. The editor should be running all the time and it's visibility toggled instead.

The graph pane is not focused after inserting a node shape from node shape insert panel

This is just a minor flaw, maybe not even a bug, but it means that graph keyboard shortcuts are not operational directly after the insertion. In particular, pressing Ctrl-Z for undo has no effect. The user needs to focus the graph pane by clicking it in order to use a keyboard shortcut.

This bug is valid both for drag-and-drop insert and for click insert from the node shape insertion panel.

Allow selecting and deleting all the edges in the graph that are the result of one edge to or from a subgraph in the DOT source

Currently, such edges can be selected individually, but not deleted because it would involve quite drastic changes to the DOT source, possibly involving cloning nodes and edges, which the user probably does not want.

Ideas

  • When selecting an edge in the graph that is the result of one edge to or from a subgraph in the DOT source, select also all other edges that are the result of the same edge in the DOT source.
  • When deleting such edges, delete the edge to or from the subgraph in the DOT source.
  • The edges could be highlighted with a different color to distinguish them from non-subgraph edges.

Specification of the DOT source code through a URL parameter

After starting the editor, the text editor contents should be initialized from a URL parameter.

Ideas

  • Name name of the URL parameter could for example be: dotSrc, src or graph.
  • If the editor is first initialized with the contents from local storage and then from the URL parameter, it will be possible to undo the change if an update was not what the user intended.
  • Should a warning be issued when this happens? (Always after the first time).
  • If #70 is implemented:
    • The graph specified with the URL parameter can be saved as a separate entry in local storage.
    • If the same graph already exists in local storage, load the saved version.
    • The name of the graph can optionally be specified with a separate URL parameter.

Nodes with quoted node id cannot be deleted

Node "a" in this graph cannot be deleted:

digraph {
    "a" -> c
}

The reason is that the current implementation uses a simple pattern matcher that does not take quoted id's into account.

More restrictions are mentioned in enhancement request #15.

Allow node text to be edited directly in the graph

Ideas:

  • Edit the text directly in the node shape and let the shape size adapt while editing.
  • Open a dialog where the text is edited and then inserted into the node shape.
  • The node text is either the node label or if it does not exist, the node_id.
  • The graph shall not be re-rendered until editing is completed, since nodes may move around.

Scroll line with error indication into view in the text editor

If there is an error in the DOT source code, but the error indication is not in the visible area of the text editor, it can be hard to find where the error is if the DOT source code is large. A function that scrolls the line with the error into view would simplify this.

Ideas:

  • Scroll automatically when an error occurs.
    • Probably requires some kind of filtering to avoid interfering with user scrolling.
      • No scroll if the error message and line number does not change.
      • No scroll if the error message and line number as counted from the end of the file does not change.
  • Scroll on user command.
    • Through a keyboard shortcut?
    • Through a button somewhere (not shown when error free)?

Allow selection of arrow type for arrow heads and tails for use when drawing edges

Graphviz allows the arrowhead and arrowtail attributes to specify an arrowType.

Ideas:

  • It should be possible to select which type to use when drawing edges in the graph.
  • At least the primitive shapes should be possible to select.
  • Possibly all the "commonly used arrow shapes" listed in the arrowType should be possible to select.
  • It should be possible to specify an arbitrary arrow type as a string through a text field.

Out of scope:

  • Support for composing complex arrow shapes according to the arrow shapes grammar through the GUI is out of scope for the enhancement request.

Make it easier to interact with edges

Currently, edges must be interacted with through the arrow head or tail or through the sometimes very thin edge path itself which makes it a little hard to select them. This is analogous to how the URL attribute works:

For svg [...] output, [...]. For edges, the active areas are small circles where the edge contacts its head and tail nodes. In addition [...] the active area includes a thin polygon approximating the edge [...]. If the edge has a label, this will also be active. Finally, if the edge has a head or tail label, this will also be active.

Ideas

  • When displaying the graph, add an invisible overlay path that can be used to select the edge and has the same attributes as the real edge path, but with a stroke-width attribute with a larger value and stroke="transparent". An algorithm for calculating the width can be based on:
    let dashWidth = Math.max(4 / scale, 2);
    .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.