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.

Full source code of getting started example

See original GitHub issue

Hi,

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
marcelotrevisanicommented, Jul 20, 2020

@MikHulk thanks a lot for sharing your solution! That really helped me! 😃 I didn’t realize that the problem was the canvas height

1reaction
MikHulkcommented, Jul 20, 2020

glad to help you. It also took me a while to find where the problem comes from.

Read more comments on GitHub >

github_iconTop 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 >

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