Giter VIP home page Giter VIP logo

Comments (9)

mdaines avatar mdaines commented on July 3, 2024

Please try the latest release (0.0.3). It appears to work for me.

https://github.com/mdaines/viz.js/releases/tag/0.0.3

from viz-js.

MilWolf avatar MilWolf commented on July 3, 2024

It doesn't work anymore.
The only version usable is used by the website http://www.webgraphviz.com/

from viz-js.

vmarkovtsev avatar vmarkovtsev commented on July 3, 2024

Paste the following code at the bottom of example.html, right after 'document.body.innerHTML += example("cluster", "xdot");':

data = "digraph G {" +
       "16 -> 4;" +
       "16 -> 8;" +
       "16 -> 20;" +
       "16 -> 24;" +
       "16 -> 32; "+
       "20 -> 32;" +
       "}";

var svg = Viz(data, "svg");
document.body.innerHTML += svg;

It works for me, producing

g

Looks like you are using Viz function wrong, since the second parameter specifies the output format, and the third one ("dot" by default) is optional.

from viz-js.

MilWolf avatar MilWolf commented on July 3, 2024

I want to use "dot" in output format and it doesn't generate the positions.
When i use "svg" in output format, it generate the positions, i agree with that.
So what's wrong?

from viz-js.

MilWolf avatar MilWolf commented on July 3, 2024

Input:

"digraph G {
graph[layout=dot];
16 -> 4;
16 -> 8;
16 -> 20;
16 -> 24;
16 -> 32;
20 -> 32;
}"

Output (with latest release):

"digraph G {
graph [layout=dot];
node [label="\N"];
16 [height=𴓬
pos=𴓬
width=𴓝;
4 [height=𴓬
pos=𴓬
width=𴓝;
16 -> 4 [pos="𴓨��������;
8 [height=𴓬
pos=𴓬
width=𴓝;
16 -> 8 [pos="𴓨��������;
20 [height=𴓬
pos=𴓬
width=𴓝;
16 -> 20 [pos="𴓨��������;
24 [height=𴓬
pos=𴓬
width=𴓝;
16 -> 24 [pos="𴓨��������;
32 [height=𴓬
pos=𴓬
width=𴓝;
16 -> 32 [pos="𴓨��������������;
20 -> 32 [pos="𴓨��������;
}
"

Output (with webgraphviz website):

"digraph G {
graph [layout=dot];
node [label="\N"];
graph [bb="0,0,283.94,180"];
16 [pos="171,162", width="0.75", height="0.5"];
4 [pos="27,90", width="0.75", height="0.5"];
8 [pos="99,90", width="0.75", height="0.5"];
20 [pos="171,90", width="0.75", height="0.5"];
24 [pos="243,90", width="0.75", height="0.5"];
32 [pos="234,18", width="0.75", height="0.5"];
16 -> 4 [pos="e,48.335,101.37 149.75,150.67 125.4,138.83 85.281,119.33 57.572,105.86"];
16 -> 8 [pos="e,113.8,105.38 156.43,146.83 146.25,136.94 132.48,123.55 120.97,112.36"];
16 -> 20 [pos="e,171,108.1 171,143.7 171,135.98 171,126.71 171,118.11"];
16 -> 24 [pos="e,228.2,105.38 185.57,146.83 195.75,136.94 209.52,123.55 221.03,112.36"];
16 -> 32 [pos="e,249.8,32.675 196.75,156.43 222.61,150.31 261.1,136.72 279,108 292.94,85.628 274.38,58.387 257.05,39.982"];
20 -> 32 [pos="e,220.66,33.824 184.36,74.155 192.88,64.689 204.09,52.238 213.69,41.563"];
}
"

from viz-js.

mdaines avatar mdaines commented on July 3, 2024

I have updated the GitHub pages branch to 0.0.3, as it was behind, and added an form similar to the one you linked to:

http://mdaines.github.io/viz.js/form.html

Please try the graph you posted on that page.

from viz-js.

vmarkovtsev avatar vmarkovtsev commented on July 3, 2024

Works for me. @MilWolf what browser and version are you using? I have tested it with Chromium 33.0.1750.152 Ubuntu 13.10 (256984) and Firefox 28.0.

from viz-js.

MilWolf avatar MilWolf commented on July 3, 2024

It works for me too.
I generate the graph with this code:

//generate digraph
this.digraph="digraph G {\n";
this.digraph+="graph[layout=dot];\n";

for(edge in edges){

this.digraph+=edges[edge].startVertex.id;
this.digraph+=" -> ";
this.digraph+=edges[edge].endVertex.id;
this.digraph+=";\n";

}

this.digraph+="}";

//generate dot file
var dotFile = Viz(this.digraph, "dot");

who give me the outputs above, so i think the problem is my code, but it doesn't appear with the release on the website http://www.webgraphviz.com/ .
I use chrome 26.0.1410.63 with fedora 64 bit.

from viz-js.

MilWolf avatar MilWolf commented on July 3, 2024

I redownloaded the latest release again and now it works.
I don't understand what i did because i tried again and again.
So i can clause the issue.
Congratulations for your job and thank you for helped me.

from viz-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.