Does GraphVIz for Mac has sfdp laying? - macos

I installed GraphViz 2.36 from MacPorts. I have to process hundreds of nodes and don't need hierarchy, just a readable graph. But GUI does not allow to choose laying. I tried to run this:
sfdp -Goverlap=prism -Tpng test.gv > test.png
But I get:
Warning: Overlap value "prism" unsupported - ignored
Error: remove_overlap: Graphviz not built with triangulation library
and a lot of exceptions of invalid context 0x0. What can be done here?..

I have solved it. Firstly, I updated to 2.38 from MacPorts. Secondly, I found a simple way to make a beautiful graph without additional console attributes:
digraph MyGraph {
graph [layout="sfdp", overlap="prism"];
...
}

Related

"failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems" PATH on mac in sage math

I want to use graphviz for graph vizualisation. I would like to use source from graphviz:
def display(self, verbose=False):
'''
Prints the QMDD as a dot graph.
'''
filename = '.tmp.dot'
self.save_as_dot(filename, verbose)
s = Source.from_file(filename)
s.view()
os.remove(filename)
# Can't manage to properly remove file .tmp.dot.pdf
I always experience this error message :
""failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH.""
I'm using a mac and a sage math in a jupyter notebook.
I've already tried to do pip3 install graphviz and brew install graphviz. Furthermore I had the path : "/Library/SageMath/local/lib/python3.9/site-packages/graphviz" to the system path but each solutions didn't work.
Try this:
conda install python-graphviz
It worked for me!

Graphviz does not display SVG images

I am trying to create a Graphviz chart with an SVG image embedded in a node, but the SVG image does not display whereas using a PNG image works fine. For example, I download this test image, and then use the following code
digraph G {
a [label=<<TABLE><TR><TD><IMG SRC="/full/path/Test.svg"/></TD></TR></TABLE>>];
a -> b;
}
Executing
dot graph.gv -Tpdf -o graph.pdf
Produces a PDF with a empty spot where Test.svg should be. Graphviz does not report any error message. I am doing this on macOS with Graphviz 2.40.1 installed via Homebrew. I have had no better luck on Windows 7, although on Windows Graphviz reports an error, Warning: No loadimage plugin for "svg:cairo,
I spent hours banging away on this problem on OS X High Sierra. Finally got it working. I had to install graphviz using option --with-librsvg:
$ brew install graphviz --with-librsvg --with-app --with-pango

OpenCV and dlib Face detection

I am using the code mentioned in the link :
OpenCV detect face landmarks (ear-chin-ear line)
I executed it on Anaconda Python3.5 using opencv3 and dlib but I get the following error :
rect=dlib.rectangle(x,y,x+w,y+h) which is Boost.Python.ArgumentError: Python argument types in rectangle.__init__(rectangle, numpy.int32, numpy.int32, numpy.int32, numpy.int32) did not match C++ signature: __init__(_object*, long left, long top, long right, long bottom) __init__(_object*)
I changed the type of the parameters using :
x,y,w,h =rects[0].astype('long')
But the same error persists. Kindly help.
Dlib comes with complete example programs that show how to do this. You should refer to that code since it's correct: http://dlib.net/face_recognition.py.html
Also, here are other python example programs. They all run correctly: https://github.com/davisking/dlib/tree/master/python_examples

phpDocumentor crashing when using graphviz

I just managed to get "dot" installed correctly, per a warning in phpDocumentor. Now when I try to build my docs, however, I am getting the exception:
[phpDocumentor\GraphViz\Exception]
An error occurred while creating the graph; GraphViz returned: Format: "svg" not recognized. Use one of:
Does anyone know how to get past this? The command I am running is:
php phpdoc.php -c mypath/phpdoc.dist.xml -p
I had this same issue, running sudo dot -c fixed it for me.

Error in Installing the Cairo R Package

I am attempting to install the Cairo package in the development version of R on Mac OS X 10.7.4, but I'm running into an issue that I cannot resolve.
I have installed Cairo with homebrew (i.e., brew install cairo) and received the following message:
==> Caveats This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this program and installing another version
in parallel can cause all kinds of trouble.
The Cairo provided by Leopard is too old for newer software to link
against.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add its lib
& include paths to your build variables:
LDFLAGS -L/usr/local/Cellar/cairo/1.12.2/lib
CPPFLAGS -I/usr/local/Cellar/cairo/1.12.2/include
With the above message in mind, I attempted to install the Cairo package from R-Forge with the following R command:
install.packages("Cairo", repos="http://www.rforge.net/", configure.args = c("CAIRO_LIBS=/usr/local/Cellar/cairo/1.12.2/lib", "CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include/cairo"))
I receive the following error:
checking cairo.h usability... no
checking cairo.h presence... no
checking for cairo.h... no
configure: error: Cannot find cairo.h!
Please install cairo (http://www.cairographics.org/) and/or set
CAIRO_CFLAGS/LIBS correspondingly. ERROR: configuration failed for package ‘Cairo’
I repeated the same command without the repos argument (by default, I use the FHCRC mirror) with the same result.
At this point, the problem seems obvious: the file cairo.h is not present. But then I listed the files in the include/cairo directory. Here's the response:
ls /usr/local/Cellar/cairo/1.12.2/include/cairo
cairo-deprecated.h cairo-ft.h
cairo-ps.h
cairo-script-interpreter.h
cairo-svg.h
cairo-xcb.h
cairo-xlib.h
cairo-features.h
cairo-pdf.h
cairo-quartz.h
cairo-script.h
cairo-version.h
cairo-xlib-xrender.h
cairo.h
So, I'm pointing the installation of the Cairo package to the appropriate place, but the error persists. I have tried variations, such as CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include, with no luck.
Thoughts? Any help you can provide is greatly appreciated.
In case it's necessary, here is my sessionInfo:
R Under development (unstable) (2012-08-08 r60208) Platform: x86_64-apple-darwin11.4.0 (64-bit)
locale: [1]
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] BiocInstaller_1.5.12
loaded via a namespace (and not attached): [1] tools_2.16.0
I had similar issue with cairo config error, and I already installed cairo with homebrew. Try below
brew install pkg-config
This solved mine problem.
A coworker and I just fixed the problem by ignoring all of what I typed above. Rather, we installed Cairo and all of its dependencies from source manually, thereby bypassing the usage of brew or variants like port. This worked like a charm, so I am not entirely sure what was wrong above.
After trying everything listed here, I found this blog post about installing the "full R package" using brew: https://luispuerto.net/blog/2018/05/11/installing-r-with-homebrew-with-all-the-capabilities/
What finally worked for me was building R explicitly with cairo (brew's default R tap uses --without-cairo and simply editing the tap did not solve the issue for me).
Works like a charm for me with R 4.0.2, cairo 1.16.0_3 under macOS Catalina 10.15.6.

Resources