Overlapping nodes and cut off graph, even though overlap is set to false

GTS would be a pain to build for WASM (as all of its dependencies would also need to be built for WASM - and it depends on glib…)

For native builds on windows it should be relatively easy with vcpkg…

Then maybe we should just adjust the Windows builds (and WASM on your side, Gordon) to copy triangle.[ch] into the source dir at build time? If that solves the problem, it seems simpler than compiling all of GTS.

FWIW I am using vcpkg for the WASM builds already (and Triangle is available and WASM compatible), so its easy enough to add (and I was contemplating adding it for the next release).
I did enable it in a test build but didn’t see any noticeable differences on the few dot files I generally test with…

Hello!
Currently having an issue with rendering a graph using sfdp and fdp. As far as i can understand, it comes down to not having a GTS/Triangle in my windows installation, which you are discussing above.

I’m using graphviz for Windows (5.0.1), python, and graphviz library for python (0.20.1).
Can provide more info.

FIRST PROBLEM
Here is a test example (small graph for simplisity purpose, target graph is ~4000 nodes)

Code:

import graphviz
w = graphviz.Digraph('tst', engine='sfdp')

w.edges(('0', str(i)) for i in range(1, 5))
w.render(directory='doctest-output')

Result is:
Error: remove_overlap: Graphviz not built with triangulation library

Log:

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\backend\execute.py:91, in run_check(cmd, input_lines, encoding, quiet, **kwargs)
     90 try:
---> 91     proc.check_returncode()
     92 except subprocess.CalledProcessError as e:

File ~\AppData\Local\Programs\Python\Python39\lib\subprocess.py:460, in CompletedProcess.check_returncode(self)
    459 if self.returncode:
--> 460     raise CalledProcessError(self.returncode, self.args, self.stdout,
    461                              self.stderr)

CalledProcessError: Command '[WindowsPath('dot'), '-Ksfdp', '-Tpdf', '-O', 'tst.gv']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

CalledProcessError                        Traceback (most recent call last)
Input In [14], in <cell line: 5>()
      2 w = graphviz.Digraph('tst', engine='sfdp')
      4 w.edges(('0', str(i)) for i in range(1, 5))
----> 5 w.render(directory='doctest-output')

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\_tools.py:171, in deprecate_positional_args.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    162     wanted = ', '.join(f'{name}={value!r}'
    163                        for name, value in deprecated.items())
    164     warnings.warn(f'The signature of {func.__name__} will be reduced'
    165                   f' to {supported_number} positional args'
    166                   f' {list(supported)}: pass {wanted}'
    167                   ' as keyword arg(s)',
    168                   stacklevel=stacklevel,
    169                   category=category)
--> 171 return func(*args, **kwargs)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\rendering.py:122, in Render.render(self, filename, directory, view, cleanup, format, renderer, formatter, neato_no_op, quiet, quiet_view, outfile, engine, raise_if_result_exists, overwrite_source)
    118 filepath = self.save(filename, directory=directory, skip_existing=None)
    120 args.append(filepath)
--> 122 rendered = self._render(*args, **kwargs)
    124 if cleanup:
    125     log.debug('delete %r', filepath)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\_tools.py:171, in deprecate_positional_args.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    162     wanted = ', '.join(f'{name}={value!r}'
    163                        for name, value in deprecated.items())
    164     warnings.warn(f'The signature of {func.__name__} will be reduced'
    165                   f' to {supported_number} positional args'
    166                   f' {list(supported)}: pass {wanted}'
    167                   ' as keyword arg(s)',
    168                   stacklevel=stacklevel,
    169                   category=category)
--> 171 return func(*args, **kwargs)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\backend\rendering.py:324, in render(engine, format, filepath, renderer, formatter, neato_no_op, quiet, outfile, raise_if_result_exists, overwrite_filepath)
    320     raise exceptions.FileExistsError(f'output file exists: {os.fspath(outfile)!r}')
    322 cmd += args
--> 324 execute.run_check(cmd,
    325                   cwd=filepath.parent if filepath.parent.parts else None,
    326                   quiet=quiet,
    327                   capture_output=True)
    329 return os.fspath(outfile)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\graphviz\backend\execute.py:93, in run_check(cmd, input_lines, encoding, quiet, **kwargs)
     91     proc.check_returncode()
     92 except subprocess.CalledProcessError as e:
---> 93     raise CalledProcessError(*e.args)
     95 return proc

CalledProcessError: Command '[WindowsPath('dot'), '-Ksfdp', '-Tpdf', '-O', 'tst.gv']' returned non-zero exit status 1. [stderr: b'Error: remove_overlap: Graphviz not built with triangulation library\r\n']

SECOND PROBLEM
A bigger grapf and a fdp engine

Code:

# ~200 node / 200 egde graph
rawDotSource = 'digraph tree { blahblahblah}'

src = graphviz.Source(source = rawDotSource, filename = "tst2", engine='fdp')
src.render(directory='doctest-output')

Result:
Warning: Overlap value "prism" unsupported - ignored
And a result file with overlaping edges.