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.

Diagram doesn't seem

See original GitHub issue

Hi,

My codes are as follows but nothing doesn’t seem.

import React from 'react';
import {
	DiagramEngine,
	DiagramModel,
	DiagramProps,
	DefaultNodeModel,
	LinkModel,
	DiagramWidget
} from "storm-react-diagrams";

require("storm-react-diagrams/dist/style.min.css");


function App() {

	const engine = new DiagramEngine();
	engine.installDefaultFactories();
	const model = new DiagramModel();

	var node1 = new DefaultNodeModel("Node 1", "rgb(0,192,255)");
	let port1 = node1.addOutPort("Out");
	node1.setPosition(100, 100);
	var node2 = new DefaultNodeModel("Node 2", "rgb(192,255,0)");
	let port2 = node2.addInPort("In");
	node2.setPosition(400, 100);
	let link1 = port1.link(port2);
	link1.setColor('black');
	model.addAll(node1, node2, link1);
	var node3 = new DefaultNodeModel("Node 3", "rgb(192,255,0)");
	node3.addInPort("In");
	node3.addOutPort("out");
	model.addAll(node3);
  engine.setDiagramModel(model);
  
  return <DiagramWidget diagramEngine={engine}/>;

}

export default App;

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
dannyb648commented, Jun 6, 2019

So setting this in my app.css worked.

.srd-diagram { height: 80vh; background-color: aliceblue; width: 90%; }

2reactions
Arkanayancommented, Jun 6, 2019

You have to set height, width, backgroundColor of the parent dom element. see this https://stackoverflow.com/questions/49513323/react-diagrams-invisible

Verify if the elements are present or not in the react developer panel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chart options don't appear when clicking on chart (Excel 2016)
I have Excel 2016 and by clicking on a chart, the plus sign on the top right corner doesn't appear.
Read more >
TINA/Spice: Remember diagram settings does not seem to work
Under Analysis Options, I have enabled "Remember diagram settings". Even after running a plot, setting settings up, closing the plot, re-running ...
Read more >
networkD3 Sankey diagram doesn't appear in the viewer, no ...
The code runs without error and then I get a blank viewer. The Source and Target nodes are zero indexed, and they are...
Read more >
Need help with a circuit diagram where the motor does not ...
Need help with a circuit diagram where the motor does not seem to have any connection to ground. Error with diagram? Or am...
Read more >
PlantUML Plugin - doesn't seem to allow Diagrams s...
But now unable to save diagrams. Is this a known bug? ... PlantUML Plugin - doesn't seem to allow Diagrams saving as of...
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