Full source code of getting started example
See original GitHub issueHi,
I have just discovered your libray. It is exactly what I need. Iwant first thank you for that.
However I have trouble to get working the first example. At now that’s whhat I have done
import React from 'react';
import './App.css';
import createEngine, {
DefaultNodeModel,
DiagramModel
} from '@projectstorm/react-diagrams';
import {
CanvasWidget
} from '@projectstorm/react-canvas-core';
// create an instance of the engine with all the defaults
const engine = createEngine();
// node 1
const node1 = new DefaultNodeModel({
name: 'Node 1',
color: 'rgb(0,192,255)',
});
node1.setPosition(100, 100);
let port1 = node1.addOutPort('Out');
// node 2
const node2 = new DefaultNodeModel({
name: 'Node 1',
color: 'rgb(0,192,255)',
});
node2.setPosition(100, 100);
let port2 = node2.addOutPort('Out');
// link them and add a label to the link
const link = port1.link(port2);
link.addLabel('Hello World!');
const model = new DiagramModel();
model.addAll(node1, node2, link);
engine.setModel(model);
console.log(engine);
function App() {
return <CanvasWidget engine={engine} />;
}
export default App;
I don’t use Typescript, so I remove thing which were related.
The build run without warning, but I get a white page. In dev tools / inspect I can see the canvas but not in the real page. All is white.
I hope you could help me with this. A full working example will be cool.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
How to get the full source code of an online form - YouTube
Sign up for your free Jotform account at:https://link.jotform.com/2dW5CG8nlP Whether you'd like to add HTML codes to your online form or ...
Read more >How To Get Started With Open Source - YouTube
Getting started in open source is intimidating. It seems daunting jumping into an unfamiliar world so in this video I will guide you...
Read more >Hello World - GitHub Docs
You'll create your own Hello World repository and learn GitHub's pull request workflow, a popular way to create and review code. In this...
Read more >Lesson: A Closer Look at the "Hello World!" Application
The "Hello World!" application consists of three primary components: source code comments, the HelloWorldApp class definition, and the main method. The ...
Read more >Getting started with HTML - Learn web development | MDN
To get you started, this article defines elements, attributes, ... A sample code snippet demonstrating the structure of an html element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MikHulk thanks a lot for sharing your solution! That really helped me! 😃 I didn’t realize that the problem was the canvas height
glad to help you. It also took me a while to find where the problem comes from.