freegroup / draw2d

Create Visio like drawings, diagrams or workflows with JavaScript and HTML5
https://freegroup.github.io/draw2d/#/examples
MIT License
738 stars 227 forks source link

Multiple problems with the Circuits #174

Closed pmorim closed 1 year ago

pmorim commented 3 years ago

Initial Questions

  1. Are there any plans to add more functionality to this library's 'circuit implementation'?
  2. Is there any plans to improve the documentation? I found that some of the code has seemingly impossible syntax.

Problems

I am trying to use this library, together with React, to make a Web App where you could create/edit circuits. Unfortunately, I am getting some problems:

JSON IO

I created a simple circuit and then exported it to JSON by following this example in the docs.

() => {
    let writer = new draw2d.io.json.Writer();
    writer.marshal(canvas.current, (json) => {
        // A simple console log of the JSON
        console.log(json);
    });
},

But when I tried to read the previously exported JSON to re-create the circuit, I got a lot of error and warning messages. Here is a screenshot of a small amount of them:

image

Nodes

There is a visual glitch that, when a connection of the circuit is deleted, it will not delete the node that is shared with other connections. I also noticed that this bug doesn't happen every time because it depends on the order that the connections are deleted.

image

Besides, the two leftmost nodes in the above screenshot should not even exist.

Undo

The Undo functionality doesn't work properly. For example, if I delete a figure, the undo will not bring it back. The same happens when I rotate a figure; it will not rotate back to its original orientation.

Grid

I also found that the grid works weirdly. The figures don't attach properly to it, even when the policy was installed on the canvas.

Touch

I also, for some strange reason, cannot get it to work with a touchscreen. The clicks do not register.

freegroup commented 1 year ago

circuit is now alive as its own product.. https://electra.academy/simulator/