question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get Storm react diagrams to work

See original GitHub issue

Hi there,

My link is not displayed and I don’t know why 😕

image

Here is my code :

    this.engine = new DiagramEngine();

    this.engine.registerNodeFactory(new DefaultNodeFactory());
    this.engine.registerLinkFactory(new DefaultLinkFactory());

    const model = new DiagramModel();

    const node1 = new DefaultNodeModel("Node 1", "rgb(0,192,255)");
    const port1 = node1.addPort(new DefaultPortModel(false, "out-1", "Out"));
    node1.x = 100;
    node1.y = 100;

    const node2 = new DefaultNodeModel("Node 2", "rgb(192,255,0)");
    const port2 = node2.addPort(new DefaultPortModel(true, "in-1", "IN"));
    node2.x = 400;
    node2.y = 100;

    const link1 = new LinkModel();
    link1.setSourcePort(port1);
    link1.setTargetPort(port2);

    model.addNode(node1);
    model.addNode(node2);
    model.addLink(link1);

    this.engine.setDiagramModel(model);


  render() {
    return ( <DiagramWidget
      css={css`
        background-color: #f5f5f5;
        height: 100vh;
      `}
      diagramEngine={engine}
    />)
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
top4ecommented, Feb 21, 2019

Reverting to react@16.7.0 react-dom@16.7.0 and react-scripts@2.1.3 fixed the issue for me

1reaction
top4ecommented, Feb 21, 2019

sd_links_issue

I have similar (possibly the same) issue. I see links displayed, but out of place (see screenshot). Although links are OK when created with mouse. Issue was not observed with previous installation I have from few weeks ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-diagrams - cannot get simple demo to work #519 - GitHub
If that doesnt work, press CTRL + SHIFT + C and move your mouse around your application until you find any DOM element...
Read more >
projectstorm/react-diagrams - Gitter
Hi everybody, My diagram project works perfectly with drag and drop zoom etc. But if I insert other react components outside the diagram...
Read more >
@projectstorm/react-diagrams-routing - npm
This package adds dagre integration for laying out nodes and links. Latest version: 6.7.4, last published: 6 months ago.
Read more >
projectstorm/react-diagrams examples - CodeSandbox
Learn how to use @projectstorm/react-diagrams by viewing and forking example apps that make use of @projectstorm/react-diagrams on CodeSandbox.
Read more >
Getting Started - React Diagrams - GitBook
When you run this in your project directory, this will install the library into ./node_modules/@projectstorm/react-diagrams . You will then find a dist ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found