Skip to content

Commit

Permalink
Add graphviz dot.exe.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jan 7, 2019
1 parent 2f59e21 commit 11f81d4
Show file tree
Hide file tree
Showing 60 changed files with 964 additions and 5 deletions.
6 changes: 6 additions & 0 deletions BalsamiqFlowOverview.UnitTestProject/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,11 @@ public void Test_GraphVizToSvg()
}


[TestMethod]
public void Test_PathCombine()
{
Debug.Assert(Path.Combine(@"C:\Program Files") == "\"C:\\Program Files\"");
}

}
}
47 changes: 42 additions & 5 deletions BalsamiqFlowOverview/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static void Main(string[] args)
else
{
Console.WriteLine("No Argument specified. Using default path.");
path = "C:/Users/emill/Dropbox (Persoonlijk)/slimmerWorden/2018-2019-Semester1/CMDM/PROJECT/balsamiq_mockups.bmpr";
path = "C:/Users/emill/Dropbox (Persoonlijk)/slimmerWorden/2018-2019-Semester1/CMDM/PROJECT/DELIVERABLE_Emile_Maurin_Yassine/balsamiq_mockups.bmpr";
}
Console.WriteLine("Path: " + path);

Expand Down Expand Up @@ -68,7 +68,7 @@ static void Main(string[] args)
if (flowScreens.ContainsKey(href))
fl.screen = flowScreens[href];
else
fl.screen = new FlowScreen("Broken ref: "+href);
fl.screen = new FlowScreen("Broken ref: " + href);
lst.Add(fl);
}
}
Expand All @@ -87,7 +87,7 @@ static void Main(string[] args)
Console.WriteLine("Outputting flow.txt");
File.WriteAllText("flow.txt", graphViz);

var svg2 = GraphVizToSvg(graphViz);
var svg2 = GraphVizToSvgUsingNode(graphViz);
Console.WriteLine("Outputting flow_graph.svg");
File.WriteAllText("flow_graph.svg", svg2);
//Console.ReadLine();
Expand Down Expand Up @@ -132,7 +132,7 @@ public static string SearchProgramWhileBubelingUpPath(string relPathFromParentLi
absPath += relPathFromParentList;

if (File.Exists(absPath)) return absPath;
if (File.Exists(absPath + ".exe")) return absPath + ".exe";
if (File.Exists(absPath + ".exe")) return absPath; // + ".exe";
//if (File.Exists(absPath + ".bat")) return absPath + ".bat";

di = di.Parent;
Expand Down Expand Up @@ -170,7 +170,44 @@ public static string GraphVizToSvg(string graphCode)
{
try
{
var vizCode = File.ReadAllText("../../../BalsamiqFlowOverview/viz.js");
string fileName = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".svg";
fileName = Path.Combine(fileName);
string tmpInputPath = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".txt";
tmpInputPath = Path.Combine(tmpInputPath);
File.WriteAllText(tmpInputPath, graphCode);

var dot_path = SearchProgramWhileBubelingUpPath("graphviz-2.38-minimal/dot");
var arguments = tmpInputPath + " -Tsvg -v -o " + fileName;

// Start the child process.
Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = dot_path;
p.StartInfo.Arguments = arguments;
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected stream.
// p.WaitForExit();
// Read the output stream first and then wait.
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
//return output;
return File.ReadAllText(fileName);
}
catch (Exception e)
{
Console.WriteLine(e.Message + "\n\n");
return e.Message;
}
}
public static string GraphVizToSvgUsingNode(string graphCode)
{
try
{
var viz_path = SearchProgramWhileBubelingUpPath("/viz.js");
var vizCode = File.ReadAllText(viz_path);
vizCode += @"
var data = `" + graphCode + @"`;
var svg = this.Viz(data, 'svg');
Expand Down
2 changes: 2 additions & 0 deletions graphviz-2.38-minimal/Graphviz.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Graphviz]
Version=XXX
Empty file.
Binary file added graphviz-2.38-minimal/Pathplan.dll
Binary file not shown.
8 changes: 8 additions & 0 deletions graphviz-2.38-minimal/Settings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Settings]
Layout=0
Output=9
Preview=1
InitialDir1=
InitialDir2=
InitialDir3=
binPath=C:\Program Files\Graphviz2.24\bin\
Binary file added graphviz-2.38-minimal/ann.dll
Binary file not shown.
Binary file added graphviz-2.38-minimal/cdt.dll
Binary file not shown.
Binary file added graphviz-2.38-minimal/cgraph.dll
Binary file not shown.
273 changes: 273 additions & 0 deletions graphviz-2.38-minimal/config6
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
# This file was generated by "dot -c" at time of install.

# You may temporarily disable a plugin by removing or commenting out
# a line in this file, or you can modify its "quality" value to affect
# default plugin selection.

# Manual edits to this file **will be lost** on upgrade.

gvplugin_core.dll core {
device {
dot:dot 1
gv:dot 1
canon:dot 1
plain:dot 1
plain-ext:dot 1
xdot:xdot 1
xdot1.2:xdot 1
xdot1.4:xdot 1
}
device {
fig:fig 1
}
device {
ismap:map 1
cmap:map 1
imap:map 1
cmapx:map 1
imap_np:map 1
cmapx_np:map 1
}
device {
ps:ps 1
ps2:ps 1
eps:ps 1
}
device {
svg:svg 1
svgz:svg 1
}
device {
tk:tk 1
}
device {
vml:vml 1
vmlz:vml 1
}
device {
pic:pic -1
}
device {
pov:pov 1
}
render {
dot 1
xdot 1
}
render {
fig 1
}
render {
map 1
}
render {
ps 1
}
render {
svg 1
}
render {
tk 1
}
render {
vml 1
}
render {
pic -1
}
render {
pov 1
}
loadimage {
png:svg 1
gif:svg 1
jpeg:svg 1
jpe:svg 1
jpg:svg 1
png:fig 1
gif:fig 1
jpeg:fig 1
jpe:fig 1
jpg:fig 1
png:vrml 1
gif:vrml 1
jpeg:vrml 1
jpe:vrml 1
jpg:vrml 1
eps:ps 1
ps:ps 1
(lib):ps 1
png:map 1
gif:map 1
jpeg:map 1
jpe:map 1
jpg:map 1
ps:map 1
eps:map 1
svg:map 1
png:dot 1
gif:dot 1
jpeg:dot 1
jpe:dot 1
jpg:dot 1
ps:dot 1
eps:dot 1
svg:dot 1
png:xdot 1
gif:xdot 1
jpeg:xdot 1
jpe:xdot 1
jpg:xdot 1
ps:xdot 1
eps:xdot 1
svg:xdot 1
svg:svg 1
png:vml 1
gif:vml 1
jpeg:vml 1
jpe:vml 1
jpg:vml 1
gif:tk 1
}
}
gvplugin_dot_layout.dll dot_layout {
layout {
dot 0
}
}
gvplugin_gd.dll gd {
render {
gd 1
}
render {
vrml 1
}
textlayout {
textlayout 2
}
loadimage {
gd:gd 1
gd2:gd 1
gif:gd 1
jpeg:gd 1
jpe:gd 1
jpg:gd 1
png:gd 1
gd:ps 1
#FAILS gd:lasi 1
gd2:ps 1
#FAILS gd2:lasi 1
gif:ps 1
#FAILS gif:lasi 1
jpeg:ps 1
jpg:ps 1
jpe:ps 1
#FAILS jpeg:lasi 1
#FAILS jpg:lasi 1
#FAILS jpe:lasi 1
png:ps 1
#FAILS png:lasi 1
gd:cairo 1
gd2:cairo 1
gif:cairo 1
jpeg:cairo 1
jpg:cairo 1
jpe:cairo 1
png:cairo -1
}
device {
gif:cairo 10
wbmp:cairo 5
jpe:cairo 5
jpeg:cairo 5
jpg:cairo 5
png:cairo 5
gd:cairo 5
gd2:cairo 5
}
device {
gif:gd 1
wbmp:gd 1
jpe:gd 1
jpeg:gd 1
jpg:gd 1
png:gd 1
gd:gd 1
gd2:gd 1
}
device {
vrml:vrml 1
}
}
gvplugin_gdiplus.dll gdiplus {
render {
gdiplus 1
}
textlayout {
textlayout 8
}
loadimage {
bmp:gdiplus 8
gif:gdiplus 8
jpe:gdiplus 8
jpeg:gdiplus 8
jpg:gdiplus 8
png:gdiplus 8
}
device {
metafile:gdiplus 8
bmp:gdiplus 8
emf:gdiplus 8
emfplus:gdiplus 8
gif:gdiplus 8
jpe:gdiplus 8
jpeg:gdiplus 8
jpg:gdiplus 8
png:gdiplus 8
tif:gdiplus 8
tiff:gdiplus 8
}
device {
bmp:cairo 8
gif:cairo 8
jpe:cairo 8
jpeg:cairo 8
jpg:cairo 8
png:cairo 8
tif:cairo 8
tiff:cairo 8
}
}
gvplugin_neato_layout.dll neato_layout {
layout {
neato 0
fdp 0
sfdp 0
twopi 0
circo 0
patchwork 0
osage 0
nop 0
nop1 0
nop2 0
}
}
gvplugin_pango.dll cairo {
render {
cairo 10
}
textlayout {
textlayout 10
}
loadimage {
png:cairo 1
#FAILS png:lasi 2
png:ps 2
}
device {
png:cairo 10
ps:cairo -10
pdf:cairo 10
svg:cairo -10
}
}
Binary file added graphviz-2.38-minimal/dot.exe
Binary file not shown.
Binary file added graphviz-2.38-minimal/dotty.exe
Binary file not shown.
Loading

0 comments on commit 11f81d4

Please sign in to comment.