Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing dagre.js after traspiling with Babel #450

Open
vakokako opened this issue Aug 30, 2024 · 1 comment
Open

Importing dagre.js after traspiling with Babel #450

vakokako opened this issue Aug 30, 2024 · 1 comment

Comments

@vakokako
Copy link

Hi, I want to preface this by saying that we are not knowledgeable with javascript importing, but would be grateful if you can help us with our problem :)

We want to use dagre in application that uses Qml for UI. Qml runtime allows to import javascript files to use in Qml, but only supports Ecmascript version 7. Our solution was to use Babel to transpile the dagre.js to ES7, then Qml engine seems to parse the dagre.js correctly without complaints. However, after importing dagre.js, we can't access the exported variables, like dagre.graphlib.

Are there any reasons that this should not work, if Qml engine implements ES7. Maybe dagre.js is only supposed to work in browsers? Or some other checks during import fail... Would be super helpful to hear some input on this.

I'm also attaching the transpiled dagre.js.
dagre.es7.zip

@emmenlau
Copy link

emmenlau commented Sep 2, 2024

I think it would be awesome if dagre could be used from Qt QML!

Qt does not provide any layouting of graphs. There is the nice Qt QML library QuickQanava that can be used to display and interact with complex graph layouts, but it also does not provide any layouting. dagre would be a perfect extension for this! And I think the QuickQanava developers would be interested to add dagre bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants