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

graphviz diagram preview fails #267

Closed
Kinokin opened this issue Feb 13, 2020 · 4 comments
Closed

graphviz diagram preview fails #267

Kinokin opened this issue Feb 13, 2020 · 4 comments
Labels

Comments

@Kinokin
Copy link

Kinokin commented Feb 13, 2020

Since some time (2.7.8 or 2.7.9) simple graphviz diagram fail with 'TypeError: Cannot call a class as a function' notification by VSCode

== Live preview

[graphviz]
....
digraph G {

subgraph cluster_0 {
	style=filled;
	color=lightgrey;
	node [style=filled,color=white];
	a0 -> a1 -> a2 -> a3;
	label = "process #1";
}

subgraph cluster_1 {
	node [style=filled];
	b0 -> b1 -> b2 -> b3;
	label = "process #2";
	color=blue
}
start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> end;

start [shape=Mdiamond];
end [shape=Msquare];
}
....
@joaompinto
Copy link
Contributor

I am able to reproduce it, I will take at look at it when possible

Thanks for reporting.

danyill added a commit to danyill/asciidoctor-vscode that referenced this issue Feb 13, 2020
@danyill
Copy link
Contributor

danyill commented Feb 13, 2020

@joaompinto moving from viz.js 1.8.1 to 2.1.2 did this.

The API changes are described in mdaines/viz-js#113

viz.js appears to be archived on Github and likely no longer supported. The author calls it a "hack", it was last released in late 2018, and issues are no longer being resolved. It is being abandoned by other downstream projects e.g. see magjac/d3-graphviz#55 which also suggests an alternative (https://github.com/hpcc-systems/hpcc-js-wasm) which I don't think is suitable for our application...

I've tried using both the WebWorker and Module/Render options from https://github.com/mdaines/viz.js/wiki/Usage but without being able to successfully integrate either. I suspect they are not working "nicely" within either vs-code or the synchronous requirements of Asciidoctor.js. See the commit referenced above.

You may be able to make better sense of this than me (incidentally @joaompinto if you can increase my rights I'm happy to do some issue management on this project).

Otherwise two other options:

  1. Drop support of graphviz via Viz.js and require the end user to use e.g. asciidoctor-diagram, asciidoctor-kroki, asciidoctor-plantuml.

  2. Revert the dependency to 1.8.1 which is easy and will work (but I think we should make an effort to use only supported packages).

@joaompinto
Copy link
Contributor

@danyill added you as admin

@joaompinto
Copy link
Contributor

I vote for option 1, we just need to make asciidoctor-kroki more discoverable, probably adding some snippets

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

No branches or pull requests

3 participants