Class TikzExporter<L extends Label>
java.lang.Object
org.variantsync.diffdetective.variation.diff.serialize.TikzExporter<L>
- All Implemented Interfaces:
Exporter<L>
Exporter for TikZ pictures which can be embedded into a LaTeX document.
The resulting graph is styled using TikZ styles which have to be set using
\tikzset
. An
example for all required styles can be found in the file tikz_header.tex
in the resource
directory. This particular style is used by <La>exportFullLatexExample(org.variantsync.diffdetective.variation.diff.VariationDiff<La>,java.nio.file.Path)
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<La extends L>
voidexportFullLatexExample
(VariationDiff<La> variationDiff, Path destination) Exports a ready to compile LaTeX document containing a TikZ graph exported by<La>exportVariationDiff(org.variantsync.diffdetective.variation.diff.VariationDiff<La>,java.io.OutputStream)
.<La extends L>
voidexportVariationDiff
(VariationDiff<La> variationDiff, OutputStream destination) ExportvariationDiff
as TikZ graph intodestination
.<La extends L>
voidexportVariationDiff
(VariationDiff<La> variationDiff, Function<DiffNode<La>, Vec2> nodeLayout, OutputStream destination, boolean escape) <La extends L>
voidexportVariationDiff
(VariationDiff<La> variationDiff, GraphvizExporter.LayoutAlgorithm algorithm, OutputStream destination) ExportvariationDiff
as TikZ graph intodestination
.
-
Field Details
-
format
-
-
Constructor Details
-
TikzExporter
-
-
Method Details
-
exportVariationDiff
public <La extends L> void exportVariationDiff(VariationDiff<La> variationDiff, OutputStream destination) throws IOException ExportvariationDiff
as TikZ graph intodestination
. The exported graph starts and ends with thetikzpicture
environment and does not include surrounding LaTeX code like the preamble. For a quick way to set up a working LaTeX document see<La>exportFullLatexExample(org.variantsync.diffdetective.variation.diff.VariationDiff<La>,java.nio.file.Path)
.- Specified by:
exportVariationDiff
in interfaceExporter<L extends Label>
- Parameters:
variationDiff
- to be exporteddestination
- where the result should be written- Throws:
IOException
-
exportVariationDiff
public <La extends L> void exportVariationDiff(VariationDiff<La> variationDiff, GraphvizExporter.LayoutAlgorithm algorithm, OutputStream destination) throws IOException ExportvariationDiff
as TikZ graph intodestination
. Same as<La>exportVariationDiff(org.variantsync.diffdetective.variation.diff.VariationDiff<La>,java.io.OutputStream)
, but allows the selection of a different Graphviz layout algorithm.- Throws:
IOException
-
exportVariationDiff
public <La extends L> void exportVariationDiff(VariationDiff<La> variationDiff, Function<DiffNode<La>, Vec2> nodeLayout, OutputStream destination, boolean escape) -
exportFullLatexExample
public <La extends L> void exportFullLatexExample(VariationDiff<La> variationDiff, Path destination) throws IOException Exports a ready to compile LaTeX document containing a TikZ graph exported by<La>exportVariationDiff(org.variantsync.diffdetective.variation.diff.VariationDiff<La>,java.io.OutputStream)
. The resulting document should be used as prototype not as ready to be published visualisation. To discourage further processing the API differs fromexportVariationDiff
by exporting directly into a file.- Parameters:
variationDiff
- to be exporteddestination
- path of the generated file- Throws:
IOException
-