summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-05 22:40:38 +0000
committerKarl Berry <karl@freefriends.org>2019-01-05 22:40:38 +0000
commit22536bb2b5257046d271b1eaa11b4a275d5ec041 (patch)
tree2500eaf5c26b11e00ebd33a64fccfa332cd5a66c /Master/texmf-dist/tex/generic/pgf/graphdrawing
parentcf794f0e2db6857972a9d48d4466a4f03a7057a0 (diff)
pgf (5jan19)
git-svn-id: svn://tug.org/texlive/trunk@49607 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua102
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua638
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua177
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua875
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua570
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua196
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua60
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua116
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua107
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua33
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua28
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua41
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua9
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua28
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua35
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua37
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua678
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua787
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua88
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua49
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua576
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua159
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua128
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua144
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex499
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex101
197 files changed, 6177 insertions, 525 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
index 0ffbaf53c13..da0aba39121 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf.lua,v 1.3 2013/04/04 20:43:44 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
index b813ccab603..cf94454a494 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
index 8f72092e4e9..410da3af455 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
index f062c7a54c5..5b60d90ccd6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua,v 1.6 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
index 0ad475fbf3e..90519e23d55 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua,v 1.11 2015/06/08 21:58:24 tantau Exp $
+-- @release $Header$
@@ -63,10 +63,16 @@ require("pgf.gd.bindings").BindingToPGF = BindingToPGF
-- Imports
local lib = require "pgf.gd.lib"
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Path = require "pgf.gd.model.Path"
+
-- The implementation
-- Forward
local table_in_pgf_syntax
+local animations_in_pgf_syntax
+local path_in_pgf_syntax
+local coordinate_in_pgf_syntax
@@ -140,7 +146,7 @@ function BindingToPGF:renderVertex(v)
local info = assert(self.storage[v], "thou shalt not modify the syntactic digraph")
tex.print(
string.format(
- "\\pgfgdcallbackrendernode{%s}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%s}",
+ "\\pgfgdcallbackrendernode{%s}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%s}{%s}",
'not yet positionedPGFINTERNAL' .. v.name,
info.x_min,
info.x_max,
@@ -148,7 +154,8 @@ function BindingToPGF:renderVertex(v)
info.y_max,
v.pos.x,
v.pos.y,
- info.box_count))
+ info.box_count,
+ animations_in_pgf_syntax(v.animations)))
end
function BindingToPGF:retrieveBox(index, box_num)
@@ -230,6 +237,7 @@ function BindingToPGF:renderEdge(e)
end
callback [#callback + 1] = '}'
+ callback [#callback + 1] = '{' .. animations_in_pgf_syntax(e.animations) .. '}'
-- hand TikZ code over to TeX
tex.print(table.concat(callback))
@@ -276,5 +284,91 @@ function table_in_pgf_syntax (t)
end
+function animations_in_pgf_syntax (a)
+ return
+ table.concat(
+ lib.imap(
+ a,
+ function(animation)
+ return "\\pgfanimateattribute{" .. animation.attribute .. "}{whom=pgf@gd," ..
+ table.concat(
+ lib.imap (
+ animation.entries,
+ function (entry)
+ return "entry={" .. entry.t .. "s}{" .. to_pgf(entry.value) .. "}"
+ end
+ ), ",") ..
+ "," ..
+ table.concat(
+ lib.imap(
+ animation.options or {},
+ function(table)
+ if table.value then
+ return table.key .. "={" .. to_pgf(table.value) .. "}"
+ else
+ return table.key
+ end
+ end), ",")
+ .. "}"
+ end)
+ )
+end
+
+
+function to_pgf(x)
+ if type (x) == "table" then
+ if getmetatable(x) == Coordinate then
+ return coordinate_in_pgf_syntax(x)
+ elseif getmetatable(x) == Path then
+ return path_in_pgf_syntax(x)
+ else
+ error("illegal table in value of a key to be passed back to pgf")
+ end
+ else
+ return tostring(x)
+ end
+end
+
+function path_in_pgf_syntax (p)
+
+ local s = {}
+
+ local i = 1
+ while i <= #p do
+ local c = p[i]
+ assert (type(c) == "string", "illegal path operand")
+
+ if c == "lineto" then
+ i = i + 1
+ local d = rigid(p[i])
+ s [#s + 1] = '\\pgfpathlineto{\\pgfqpoint{' .. to_pt(d.x) .. '}{' .. to_pt(d.y) .. '}}'
+ i = i + 1
+ elseif c == "moveto" then
+ i = i + 1
+ local d = rigid(p[i])
+ s [#s + 1] = '\\pgfpathmoveto{\\pgfqpoint{' .. to_pt(d.x) .. '}{' .. to_pt(d.y) .. '}}'
+ i = i + 1
+ elseif c == "closepath" then
+ s [#s + 1] = '\\pgfpathclose'
+ i = i + 1
+ elseif c == "curveto" then
+ local d1, d2, d3 = rigid(p[i+1]), rigid(p[i+2]), rigid(p[i+3])
+ i = i + 3
+ s [#s + 1] = '\\pgfpathcurveto{\\pgfqpoint{' .. to_pt(d1.x) .. '}{' .. to_pt(d1.y) .. '}}{\\pgfqpoint{'
+ .. to_pt(d2.x) .. '}{' .. to_pt(d2.y) .. '}}{\\pgfqpoint{'
+ .. to_pt(d3.x) .. '}{' .. to_pt(d3.y) .. '}}'
+ i = i + 1
+ else
+ error("illegal operation in edge path")
+ end
+ end
+
+ return table.concat(s)
+end
+
+function coordinate_in_pgf_syntax(c)
+ return '\\pgfqpoint{'..to_pt(c.x) .. '}{'.. to_pt(c.y) .. '}'
+end
+
-return BindingToPGF \ No newline at end of file
+return BindingToPGF
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
index 0249c9130af..cddfd96dfd4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
index 1966a3066c5..8e0d7d5bc66 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua,v 1.9 2014/03/19 09:20:57 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
index d3c267394c4..e532e783e11 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua,v 1.1 2014/03/19 09:20:57 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
local documentation = require 'pgf.gd.doc'.documentation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
index ac229a8e0d0..016cfe483f7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
index 3492510d242..a3bec1fef38 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
index a3f5de83194..ccbb097583c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua,v 1.7 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
index f5475227245..dec07caaccd 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua,v 1.4 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
index 39df30ab248..a84800d94cf 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua,v 1.2 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
index 30f5630ce52..5bf473e9c6a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua,v 1.2 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
index 63a8896e8a4..0cad5d7d9b5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
index 0d1d2b1bf48..9d9621e6da4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
index 046940d84f3..c1b64729fab 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua,v 1.5 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
index bb2fd065b24..be1666b255b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
index 7a6a910dfa0..c998ca490aa 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua,v 1.13 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
index b159f21eef2..e7d44d7d10e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua,v 1.3 2013/10/08 09:21:17 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
index a3205a06dbe..10f5ecdf471 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua,v 1.2 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
index c10df7a0696..c28d12db563 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua,v 1.4 2013/09/23 20:04:26 tantau Exp $
+-- @release $Header$
local function full_print(g, pref)
local s = ""
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
index ac2b186f5d5..2d8317bd72d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua,v 1.1 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
local documentation = require 'pgf.gd.doc'.documentation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
index fbb3a33857d..e25e0cd628e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua,v 1.9 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
-- Load declarations from:
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
index 748eee9429a..0b8d9e324fb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
index 22ba62e04af..7d6369d2bc9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
index 43b886787c4..23712278990 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
index 8e29d78667a..9e41e1124ee 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
index 89e8a2e68fa..84d3d3ee11f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
index ab94ebe9686..ef8500b5aeb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- Vector class
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
index 5d02603943c..428091a9ae4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
index 7dfd9179648..37878cd20f4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
index 3f2b9bc2e30..0d987f7c5b6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua,v 1.2 2013/10/09 19:46:59 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
index 8fe64399c91..4b676aff121 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
index d564af44dfa..674bc996f14 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua,v 1.2 2013/10/07 18:43:25 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
index 783ab8b4bff..4dc8d3b3fc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
index 2c5ae1bc293..b71d6629c13 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
index 8d4462d0815..a79d94f7e2a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
index a2882845c98..0d130b19235 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
index 20ca3ce3d12..55ac157e302 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
index 0cda25ca466..1ef3e4914cb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
index 9623b70d89e..82af7b56366 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
index 15e11ff91c7..e65a9f41fe6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
index 352a1f5400a..7e5e261f55f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
index eb52badcc55..e7f8144e3bb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
index 50be16489c2..10a8ba58994 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
index 4d8bfd179de..aafb8afd2ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
index 779e992bb83..a0c9738fa17 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
index 081067143da..99ff4c621d3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
index 21eb1f122ee..eb186a56157 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
index f4dcfc632cc..e7722fd669a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
index 6dfa6a46575..77a679d2be2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua,v 1.2 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
index f0e20321e86..5e4138eecef 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
index b5fd3ba6669..e2c09f21242 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
index 4a4935e4aea..eced60b2ed6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
index af593f6d972..4d45270a01f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua,v 1.2 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
index 1798cb7e0df..719e6035699 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
index c0b407bb050..788baece4ff 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
index f6c59ac2125..a8cd94ef197 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
index 65dd5176f8b..e81bb2e1c30 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
index 5ad07881fe1..b37480ac78c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
index e694de6e790..64eb7eadd80 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
index 6231ab49249..f54f0c33462 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
index fc897d71c51..1579c7153d9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
index d887b6c6bad..ef68a1db0db 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua,v 1.4 2013/10/09 19:47:00 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
index e9c2c427774..bdf85e9905e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
index 9a8dd45a641..bca8edd9ebc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
index 4cada7886b4..5c8a926384e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
index 97d3a7f0191..b2bb7e1d24c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
index 9ee6a534eb4..a0292530cdb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
index 7fc5c535f2d..328a2806db8 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
index d79f1c41fc7..9604c986409 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
index 672a3375358..8dce27a3355 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
index edc96e7b49f..877cba47f60 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
index 66835b6f012..c653bdc6b60 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua,v 1.1 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
index bceba167894..516d119f553 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua,v 1.1 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
index bf6907bddb1..de33c0ed371 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
index cff5d95253a..da850ff0dea 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua,v 1.6 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
index 2becd305cf1..8eb9d7d7019 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua,v 1.3 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
index 1e3bd381e79..270ecce2c90 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua,v 1.5 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
index 0c8038d3148..85e74970095 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua
new file mode 100644
index 00000000000..2dd23937fe1
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua
@@ -0,0 +1,638 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+--
+--
+-- @field.visible_objects An array which stores for each supernode a mapping
+-- of snapshots to the related visible snapshot nodes.
+-- Note that these mappings may differ from the supergraph
+-- because if there are two snapshot nodes in consecutive snapshots
+-- then the first can be shown for a longer time period to
+-- put aside some fade animations.
+-- @field is_first A table storing for each snapshot node or snapshot arc if it
+-- appears in its snapshot. This means that in the previous snapshot
+-- there is no corresponding arc or node.
+-- @field is_last A table storing for each snapshot node or arc if there
+-- is no representative in the next snapshot.
+-- @field move_on_enter A table which stores for each snapshot object if it is in
+-- motion while it appears in its snapshot.
+-- @field move_on_leave A table which stores for each snapshot object if it is in
+-- motion while switching to the next snapshot
+-- @field last_rep
+-- A table which stores for every snapshot node if the representing (visible) node
+-- disappears with the next snapshot.
+--
+-- @field previous_node The same as |next_node| just for the previous node
+-- @field next_node A Storage to map each snapshot node to the next node in the
+-- following snapshot related to the same supernode.
+-- If in the next snapshot there is node following snapshot node
+-- then the value is nil.
+--
+local GraphAnimationCoordination = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local Storage = require "pgf.gd.lib.Storage"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+
+declare {
+ key = "modified",
+ type = "boolean",
+ Initial = false,
+ documentation = [["
+ This key specifies, if a supernode changed its
+ visual properties since the last snapshot.
+ The default value is |false| and prevent the algorithm
+ to produce a lot of unnecessary animations.
+ "]]
+}
+
+declare {
+ key = "unmodified",
+ use = {
+ { key = "modified", boolean = false},
+ },
+}
+
+
+---
+declare {
+ key = "minimum rest time",
+ type = "number",
+ initial = 0.5,
+ documentation = [["
+ This key specifies a minimum time in which a single node
+ has to be prohibited to be animated.
+ For a node with minimum rest time of 1s that exists in a snapshot
+ at time $t$ this means that all animations including movements and fadings
+ are only allowed before $t$-0.5s and after $t$+0.5s.
+ "]],
+}
+
+declare {
+ key = "maximum motion time",
+ type = "number",
+ initial = math.huge,
+ documentation = [["
+ Use this key if you want to limit the time during nodes are allowed to move
+ when they changing their positions.
+ "]],
+}
+
+declare {
+ key = "overlapping transition",
+ type = "boolean",
+ initial = true,
+ documentation = [["
+ Use this key if you want to allow that the fade animations for or dissappearing nodes may occurs while the mid time between two snapshots. If false then the appearing ends on the midtime and the disappering starts in this moment.
+ "]]
+}
+
+---
+declare {
+ key = "default evolving graph animation",
+ algorithm = GraphAnimationCoordination,
+ phase = "evolving graph animation",
+ phase_default = true,
+ summary = [["
+ This phase animates all vertices including movements and
+ fade in or fade out animations given an evolving graph as sequence
+ of single snapshot graphs.
+ "]],
+ documentation = [["
+ This phase animates all vertices including movements and
+ fade in or fade out animations given an evolving graph as sequence
+ of single snapshot graphs.
+
+ Your algorithm needs to work on evolving graphs and has to use
+ the |evolving graph animation| phase. You do not need to use
+ this key by yourself then because this key starts the default
+ algorithm algorithm of the phase.
+
+ \begin{codeexample}[]
+ local ga_class = self.digraph.options.algorithm_phases['evolving graph animation']
+ -- animate graph
+ ga_class.new {
+ main_algorithm = self,
+ supergraph = supergraph,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+ \end{codeexample}
+
+ This algorithm and phase require a supergraph instance and the original digraph and ugraph.
+ Note that you have to set the layout of the snapshot nodes before running algorithms of this
+ is useful.
+
+ "]],
+}
+
+-- Helpfunctions
+
+--
+-- Appends a move animation to a given snapshot object such that the
+-- object moves from one point to another on a straight line. Note
+-- that the coordinates of the two points are given as relative
+-- coordinates to the current origin of the object.
+--
+-- This means if we want to move a node 1cm to the right the value of
+-- |c_from| has to be (0,0) while |c_to| must be (1,0). The argument
+-- |c_from| is usefull for a node which has a position but its
+-- previous node related to the same supervertex is at a different
+-- position. Then we can use this argument to move the new node to
+-- its origin position for smooth transitions.
+--
+-- @field object The snapshot object which should be moved
+--
+-- @field c_from The coordinate where the animation starts
+--
+-- @field c_to The coordinate where the animation should end
+--
+-- @field t_start The time when the movement starts.
+--
+-- @field t_end The time when the animation stops.
+local function append_move_animation(object, c_from, c_to, t_start, t_end)
+ if not object then return end
+ assert(object, "no object to animate")
+ if ((c_from.x~=c_to.x) or (c_from.y~=c_to.y))then
+ local animations = object.animations or {}
+ local c1 = Coordinate.new((2*c_from.x+c_to.x)/3,(2*c_from.y+c_to.y)/3)
+ local c2 = Coordinate.new((c_from.x+2*c_to.x)/3,(c_from.y+2*c_to.y)/3)
+ local t1 = (7*t_start + 5*t_end)/12
+ local t2 = (5*t_start + 7*t_end)/12
+ table.insert(animations, {
+ attribute = "translate",
+ entries = {
+ { t = t_start, value = c_from},
+-- { t = t1, value = c1 },
+-- { t = t2, value = c2 },
+ { t = t_end, value = c_to }
+ },
+ options = { { key = "freeze at end", },
+-- {key = "entry control", value="0}{1",}
+ }
+ })
+ object.animations = animations
+ end
+end
+
+local function append_fade_animation(object, v_start, v_end, t_start, t_end)
+ local animations = object.animations or {}
+
+ if v_start == 0 then
+ table.insert(animations, {
+ attribute = "stage",
+ entries = { { t = t_start, value = "true"}, },
+ options = { { key = "freeze at end" } }
+ })
+ elseif v_end == 0 and nil then
+ table.insert(animations, {
+ attribute = "stage",
+ entries = { { t = t_end, value = "false"}, },
+ options = { --{ key = "freeze at end" }
+ }
+ })
+ end
+
+ table.insert(animations, {
+ attribute = "opacity",
+ entries = {
+ { t = t_start, value = v_start },
+ { t = t_end, value = v_end } },
+ options = { { key = "freeze at end" } }
+ })
+ object.animations = animations
+end
+
+--
+-- check if the difference/vector between two pairs (a1,a2),(b1,b2) of points
+-- is the same.
+local function eq_offset(a1, a2, b1, b2)
+ local dx = ((a1.x-a2.x) - (b1.x-b2.x))
+ local dy = ((a1.y-a2.y) - (b1.y-b2.y))
+ if dx<0 then dx = -dx end
+ if dy<0 then dy = -dy end
+ return dx<0.001 and dy<0.001
+end
+
+--
+-- Check if two arcs connect a pair of nodes at the same position.
+-- This can be used as an indicator that two consecutive arcs
+-- can be representet by the same arc object.
+--
+local function eq_arc(arc1, arc2)
+ if not arc1 or not arc2 then
+ return false
+ end
+ return eq_offset(arc1.tail.pos, arc1.head.pos, arc2.tail.pos, arc2.head.pos)
+end
+
+
+-- Implementation
+
+function GraphAnimationCoordination:run()
+ assert(self.supergraph, "no supergraph defined")
+
+ self.is_first = Storage.new()
+ self.is_last = Storage.new()
+ self.last_rep = Storage.new()
+ self.move_on_enter = Storage.new()
+ self.move_on_leave = Storage.new()
+ self.previous_node = Storage.new()
+ self.next_node = Storage.new()
+ self.visible_objects = Storage.new()
+
+
+ self:precomputeNodes()
+ self:precomputeEdges()
+ self:animateNodeAppearing()
+ self:animateEdgeAppearing()
+ self:generateNodeMotions()
+ self:generateEdgeMotions()
+end
+
+function GraphAnimationCoordination:generateNodeMotions(node_types)
+ local supergraph = self.supergraph
+ local graph = self.digraph
+
+ for _, supervertex in ipairs(self.supergraph.vertices) do
+ local lj = -1
+ local last_v = nil
+ local last_time = nil
+ for j, s in ipairs(supergraph.snapshots) do
+ local vertex = supergraph:getSnapshotVertex(supervertex, s)
+
+ if lj == j-1 and vertex and last_v then
+ local mrt1 = last_v.options["minimum rest time"]/2
+ local mrt2 = vertex.options["minimum rest time"]/2
+
+ local s1 = Coordinate.new(0,0)
+ local e1 = Coordinate.new(vertex.pos.x-last_v.pos.x,-vertex.pos.y+last_v.pos.y)
+
+ local s2 = Coordinate.new(-vertex.pos.x+last_v.pos.x,vertex.pos.y-last_v.pos.y)
+ local e2 = Coordinate.new(0,0)
+
+ local t_end = s.timestamp - math.max(0, mrt2)
+ local t_start = last_time + math.max(0,mrt1)
+
+ local representative = self.visible_objects[supervertex][s]
+ if representative == vertex then
+ append_move_animation(vertex, s2, e2, t_start, t_end)
+ append_move_animation(last_v, s1, e1, t_start, t_end)
+ else
+ append_move_animation(representative,s1,e1,t_start,t_end)
+ end
+ end
+ last_time = s.timestamp
+ lj = j
+ last_v = vertex
+ end
+ end
+end
+
+
+
+
+
+function GraphAnimationCoordination:generateEdgeMotions()
+ local supergraph = self.supergraph
+ local graph = self.digraph
+
+ for i, arc in ipairs(supergraph.arcs) do
+ local head = arc.head
+ local tail = arc.tail
+
+ local last_arc = nil
+ local last_time = nil
+ local last_v = nil
+ local last_w = nil
+
+ for j, s in ipairs(supergraph.snapshots) do
+ local v = supergraph:getSnapshotVertex(tail,s)
+ local w = supergraph:getSnapshotVertex(head,s)
+
+ if v and w then
+ local this_arc = graph:arc(v,w) --or graph:arc(w,v)
+ if this_arc then
+ if this_arc and last_arc then
+ local mrt1 = last_v.options["minimum rest time"]/2
+ local mrt2 = v.options["minimum rest time"]/2
+
+ local s1 = Coordinate.new(0,0)--lv.pos
+ local e1 = Coordinate.new(v.pos.x-last_v.pos.x,-v.pos.y+last_v.pos.y)
+
+ local s2 = Coordinate.new(-v.pos.x+last_v.pos.x,v.pos.y-last_v.pos.y)
+ local e2 = Coordinate.new(0,0)
+
+ local t_end = s.timestamp - math.max(0,mrt2)
+ local t_start = last_time + math.max(0,mrt1)
+
+ local representative = self.visible_objects[arc][s]
+ if representative == this_arc then
+ append_move_animation(last_arc, s1, e1, t_start,t_end)
+ append_move_animation(this_arc, s2, e2, t_start,t_end)
+ else
+ append_move_animation(representative,s1,e1,t_start,t_end)
+ end
+ this_arc = representative
+ end
+ last_arc = this_arc
+ last_v = v
+ last_time = s.timestamp
+ else
+ last_arc = nil
+ end
+ else
+ last_arc = nil
+ end
+ end
+ end
+end
+
+--
+--
+-- @field t_transition The mid time between two snapshot times.
+-- @field fade_duration The duration of the fade animation
+-- @field overlapping A boolean defining if the animation occurs
+-- beofre and after the mid time (true) or if it
+-- starts/end only in one interval (false)
+-- @field closing A boolean specifieng if this is a outfading time
+local function compute_fade_times(t_transition, fade_duration, overlapping, closing)
+
+ if overlapping then
+ t_start = t_transition - fade_duration / 2
+ t_end = t_transition + fade_duration / 2
+ else
+ if closing then
+ t_start = t_transition - fade_duration
+ t_end = t_transition
+ else
+ t_start = t_transition
+ t_end = t_transition + fade_duration
+ end
+ end
+ return {t_start = t_start, t_end = t_end}
+end
+
+function GraphAnimationCoordination:animateNodeAppearing()
+ local supergraph = self.supergraph
+ for i,vertex in ipairs(self.ugraph.vertices) do
+ local snapshot = supergraph:getSnapshot(vertex)
+ local interval = snapshot.interval
+ local supernode = supergraph:getSupervertex(vertex)
+ local representative = self.visible_objects[supernode][snapshot]
+ local overlapping_in = true -- init true for crossfading
+ local overlapping_out= true
+ local minimum_rest_time = math.max(0,vertex.options["minimum rest time"])
+ local allow_overlapping = vertex.options["overlapping transition"]
+ local fadein_duration = 0.01
+ local fadeout_duration = 0.01
+
+ if self.is_first[vertex] then
+ fadein_duration = self.ugraph.options["fadein time"]
+ overlapping_in = false or allow_overlapping
+ end
+ if self.is_last[vertex] then
+ fadeout_duration = self.ugraph.options["fadeout time"]
+ overlapping_out = false or allow_overlapping
+ end
+
+ if fadein_duration == math.huge or fadein_duration<0 then
+ fadein_duration = (interval.to-interval.from-minimum_rest_time)/2
+ if overlapping then fadein_duration = fadein_duration * 2 end
+ end
+ if fadeout_duration == math.huge or fadeout_duration<0 then
+ fadeout_duration = (interval.to-interval.from-minimum_rest_time)/2
+ if overlapping then fadeout_duration = fadeout_duration*2 end
+ end
+
+ local fin = compute_fade_times(interval.from, fadein_duration, overlapping_in, false)
+ local fout = compute_fade_times(interval.to, fadeout_duration, overlapping_out, true)
+
+ vertex.animations = vertex.animations or {}
+
+ if representative~= vertex then
+ table.insert(vertex.animations,{
+ attribute = "stage",
+ entries = { { t = 0, value = "false"}, },
+ options = {}
+ })
+ end
+
+ if interval.from > -math.huge and (vertex == representative or self.is_first[vertex]) then
+ -- only appears if the snapshot node is its own repr. or if in the prev snapshot is
+ -- no representative.
+ append_fade_animation(representative, 0, 1, fin.t_start, fin.t_end)
+ end
+ if interval.to < math.huge and (self.is_last[vertex] or self.last_rep[vertex]) then
+ -- The snapshot node only disappears when the node is not visible
+ -- in the next or (this=)last snapshot:
+ append_fade_animation(representative, 1, 0, fout.t_start, fout.t_end)
+ end
+ end
+end
+
+
+
+function GraphAnimationCoordination:animateEdgeAppearing()
+ local supergraph = self.supergraph
+ local graph = self.digraph
+ for _,edge in ipairs(graph.arcs) do
+ local snapshot = supergraph:getSnapshot(edge.head)
+ local int = snapshot.interval
+ local superarc = supergraph:getSuperarc(edge)
+ local representative = self.visible_objects[superarc][snapshot] or edge
+
+ local minimum_rest_time = math.max(0,edge.head.options["minimum rest time"]/2,
+ edge.tail.options["minimum rest time"]/2)
+
+ local appears = math.max(int.from, int.from)
+ local disappears = math.min(int.to, int.to)
+
+ local overlapping_in = true -- init true for crossfading
+ local overlapping_out= true
+ local fadein_duration = 0.01
+ local fadeout_duration = 0.01
+ local allow_overlapping = (edge.tail.options["overlapping transition"] and edge.head.options["overlapping transition"])
+
+ if self.is_first[edge] and not self.move_on_enter[edge] and not self.move_on_enter[edge.head] then
+ fadein_duration = self.ugraph.options["fadein time"]
+ overlapping_in = false or allow_overlapping
+ end
+
+ if self.is_last[edge] and not self.move_on_leave[edge] then
+ fadeout_duration = self.ugraph.options["fadeout time"]
+ overlapping_out = false or allow_overlapping
+ end
+
+
+ if self.is_first[edge]
+ and (self.move_on_enter[edge.head]
+ or self.move_on_enter[edge.tail] )
+ then
+ appears = snapshot.timestamp - minimum_rest_time
+ end
+ if self.is_last[edge] and
+ (self.move_on_leave[edge.head]
+ or self.move_on_leave[edge.tail]
+ ) then
+ disappears = snapshot.timestamp + minimum_rest_time
+ end
+
+ local fin = compute_fade_times(appears, fadein_duration, overlapping_in,false)
+ local fout = compute_fade_times(disappears,fadeout_duration,overlapping_out,true)
+
+ edge.animations = edge.animations or {}
+
+ if representative~=edge then
+ table.insert(edge.animations,{
+ attribute = "stage",
+ entries = { { t = 0, value = "false"}, },
+ options = {}})
+ end
+
+ -- Fade in:
+ if appears > -math.huge and (edge == representative or self.is_first[edge]) then
+ append_fade_animation(representative, 0, 1, fin.t_start, fin.t_end )
+ end
+
+ -- Fade out:
+ if disappears < math.huge and (self.is_last[edge] or self.last_rep[edge])then
+ append_fade_animation(representative, 1, 0, fout.t_start,fout.t_end )
+ end
+
+ end
+
+end
+
+function GraphAnimationCoordination:precomputeNodes()
+ local supergraph = self.supergraph
+
+ for _, supernode in ipairs(supergraph.vertices) do
+
+ local vis_nodes = {}
+ self.visible_objects[supernode] = vis_nodes
+
+ local any_previous_node = nil
+ local previous_representant = nil
+ local node_before = nil
+
+ for i, s in ipairs(supergraph.snapshots) do
+ local node = supergraph:getSnapshotVertex(supernode, s)
+
+ if node then
+ -- assume the node is the last node
+ self.is_last[node] = true
+
+ if node.options["modified"] then
+ -- modified
+ vis_nodes[s] = node
+ previous_representant = node
+ if any_previous_node then
+ self.last_rep[any_previous_node] = true
+ end
+ else
+ -- unmodified
+ previous_representant = previous_representant or node
+ vis_nodes[s] = previous_representant
+ end
+ any_previous_node = node
+
+ if node_before then
+ self.is_last[node_before] = false
+ self.previous_node[node] = node_before
+ self.next_node[node_before] = node
+
+ local do_move = (( node.pos.x ~= node_before.pos.x )
+ or (node.pos.y ~= node_before.pos.y))
+ self.move_on_enter[node] = do_move
+ self.move_on_leave[node_before] = do_move
+ else
+ self.is_first[node] = true
+ end
+ node_before = node
+ else
+ node_before = nil
+ end
+ end
+ end
+end
+
+function GraphAnimationCoordination:precomputeEdges()
+ -- 1. classify arcs (appearing, disappearing)
+ for _, arc in ipairs(self.digraph.arcs) do
+ local head = arc.head
+ local tail = arc.tail
+ if not ( self.is_first[head] or self.is_first[tail]) then
+ if not self.digraph:arc(self.previous_node[tail], self.previous_node[head]) then
+ -- new arc connects existing nodes
+ self.is_first[arc] = true
+ end
+ else
+ -- arc and at least one node is new.
+ self.is_first[arc] = true
+ end
+ if not ( self.is_last[head] or self.is_last[tail]) then
+ if not self.digraph:arc(self.next_node[tail],self.next_node[head]) then
+ -- arc disappears while nodes are still in the next snapshot
+ self.is_last[arc] = true
+ end
+ else
+ -- arc and at least one node disappears in the next snapshot
+ self.is_last[arc] = true
+ end
+ self.move_on_enter[arc] = self.move_on_enter[head] or self.move_on_enter[tail]
+ self.move_on_leave[arc] = self.move_on_leave[head] or self.move_on_leave[tail]
+ end
+
+ -- 2. precompute the unmodified edges
+ local supergraph = self.supergraph
+
+ for _, superarc in ipairs(supergraph.arcs) do
+ local vis_objects = {}
+ self.visible_objects[superarc] = vis_objects
+
+ local previous_arc
+ local previous_representant
+
+ for _, s in ipairs(supergraph.arc_snapshots[superarc]) do
+ local head = supergraph:getSnapshotVertex(superarc.head, s)
+ local tail = supergraph:getSnapshotVertex(superarc.tail, s)
+ -- use the digraph because the snapshot arc is not syncted
+ local arc = self.digraph:arc(tail, head)
+
+ local modified = false
+ local opt_array = arc:optionsArray('modified')
+ for i = 1,#opt_array.aligned do
+ modified = modified or opt_array[i]
+ end
+
+ if modified or
+ not eq_arc(arc, previous_arc) or self.is_first[arc] then
+ --modified
+ previous_representant = arc
+ vis_objects[s] = arc
+ if previous_arc then
+ self.last_rep[previous_arc] = true
+ end
+ else
+ -- unmodified
+ previous_representant = previous_representant or arc
+ vis_objects[s] = previous_representant
+ end
+ previous_arc = arc
+ end
+ end
+end
+-- Done
+
+return GraphAnimationCoordination
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua
new file mode 100644
index 00000000000..17c46aa352c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua
@@ -0,0 +1,177 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+local GreedyTemporalCycleRemoval = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+local PriorityQueue = require "pgf.gd.lib.PriorityQueue"
+
+-- Keys
+
+---
+
+declare {
+ key = "split critical arc head",
+ type = "boolean",
+ initial = true,
+ summary = "Specifies, that for a critical the tail node is separated"
+}
+
+---
+
+declare {
+ key = "split critical arc tail",
+ type = "boolean",
+ initial = true,
+ summary = "Specifies, that for a critical the tail node is separated"
+}
+
+---
+
+declare {
+ key = "greedy temporal cycle removal",
+ algorithm = GreedyTemporalCycleRemoval,
+ phase = "temporal cycle removal",
+ phase_default = true,
+ summary = [["
+ A temporal dependency cycle is a cyclic path in the supergraph of
+ an evolving graph. Use this key if you want remove all temporal
+ dependency cycles by a greedy strategy which incrementally inserts
+ edge checks if this edge creates a cycle and splits at least one node
+ into two supernode at a given time.
+ "]],
+ documentation = [["
+ See ToDo
+ "]]
+}
+
+-- Helpfunctions
+local function reachable(graph, v, w)
+ local visited = {}
+ local queue = PriorityQueue.new()
+ queue:enqueue(v,1)
+ while not queue:isEmpty() do
+ local vertex = queue:dequeue()
+ if vertex==w then
+ return true
+ end
+ local outgoings = graph:outgoing(vertex)
+ for _, e in ipairs(outgoings) do
+ local head = e.head
+ if not visited[head] then
+ visited[head] = true
+ if head == w then
+ return true
+ else
+ queue:enqueue(head,1)
+ end
+ end
+ end
+ end
+ return false
+end
+
+-- Implementation
+
+function GreedyTemporalCycleRemoval:run()
+ local supergraph = assert(self.supergraph, "no supergraph passed")
+ local digraph = assert(self.digraph, "no digraph passed to the phase")
+ local split_tail = digraph.options["split critical arc tail"]
+ local split_head = digraph.options["split critical arc head"]
+ assert(split_tail or split_head, "without splitting nodes dependency cycles cannot be removed.")
+
+ self:iterativeCycleRemoval(supergraph, split_tail, split_head)
+end
+
+--
+-- Resolves all dependencies by splitting supernodes into multiple supernodes.
+-- To resolve a cycle each edge will be inserted into a dependency graph
+-- successively. Each time such edge closes a cycle the head and tail will
+-- be splitet at the related snapshot.
+--
+-- @param supergraph
+--
+function GreedyTemporalCycleRemoval:iterativeCycleRemoval(supergraph, split_tail, split_head)
+ -- Build up the global dependency graph
+ -- A supernode v directly depends on another supernode w iff
+ -- there is a snapshot in which w is a child of w
+ local dependency_graph = Digraph.new(supergraph)
+ local stable_arcs = {}
+ for i, snapshot in ipairs(supergraph.snapshots) do
+ --local tree = snapshot.spanning_tree
+ for _,tree in ipairs(snapshot.spanning_trees) do
+ local new_arcs = {}
+
+ for _, e in ipairs(tree.arcs) do
+ if e.head.kind ~= "dummy" and e.tail.kind~="dummy" then
+ table.insert(new_arcs, e)
+
+ local sv = supergraph:getSupervertex(e.tail)
+ local sw = supergraph:getSupervertex(e.head)
+ local dep_arc = dependency_graph:arc(sv, sw)
+
+
+ if (not dep_arc) then
+ -- check if the edge v->w closes a cycle in the dependencygraph
+ --pgf.debug{dependency_graph}
+ local cycle_arc = reachable(dependency_graph, sw, sv)
+ dep_arc = dependency_graph:connect(sv,sw)
+-- texio.write("\ncheck ".. sv.name.."->" .. sw.name)
+ if cycle_arc then
+ if split_tail then
+ supergraph:splitSupervertex(sv, { [1]=snapshot })
+ end
+ if split_head then
+ supergraph:splitSupervertex(sw, { [1]=snapshot })
+ end
+
+ -- rebuild dependency graph
+ dependency_graph = Digraph.new(supergraph)
+
+ for _, arc in ipairs(stable_arcs) do
+ dependency_graph:connect(arc.tail, arc.head)
+ end
+
+ for _, arc in ipairs(new_arcs) do
+ local sv = supergraph:getSupervertex(arc.tail)
+ local sw = supergraph:getSupervertex(arc.head)
+ dependency_graph:connect(sv, sw)
+ end
+ end -- end of resovle cycle_arc
+ end
+ end
+ end
+ -- Stable Arcs:
+ for _, arc in ipairs(new_arcs) do
+
+ local sv = supergraph:getSupervertex(arc.tail)
+ local sw = supergraph:getSupervertex(arc.head)
+ local deparc = dependency_graph:arc(sv, sw)
+-- if not deparc or not stable_arcs[deparc] then
+-- stable_arcs[deparc] = true
+ table.insert(stable_arcs, deparc)
+-- end
+
+ end
+ end -- end for spanning_tree
+ end -- end for snapshot
+end
+
+
+-- Done
+
+return GreedyTemporalCycleRemoval
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua
new file mode 100644
index 00000000000..23bbdf36a8c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua
@@ -0,0 +1,875 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+--
+
+-- Imports
+require "pgf.gd.trees.ChildSpec"
+
+local Digraph = require "pgf.gd.model.Digraph"
+local Vertex = require "pgf.gd.model.Vertex"
+
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local layered = require "pgf.gd.layered"
+local tlayered = require "pgf.gd.experimental.evolving.layered"
+local SpanningTreeComputation = require "pgf.gd.trees.SpanningTreeComputation"
+local lib = require "pgf.gd.lib"
+
+local Storage = require "pgf.gd.lib.Storage"
+local PriorityQueue = require "pgf.gd.lib.PriorityQueue"
+
+local Supergraph = require "pgf.gd.experimental.evolving.Supergraph"
+
+local LayoutPipeline = require "pgf.gd.control.LayoutPipeline"
+local Direct = require "pgf.gd.lib.Direct"
+
+--
+--
+local Skambath2016 = {}
+
+
+---
+declare {
+ key = "animated tree layout",
+ algorithm = Skambath2016,
+ postconditions = {
+ upward_oriented = true
+ },
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+---
+declare {
+ key = "animated binary tree layout",
+ use = {
+ { key = "animated tree layout" },
+ { key = "minimum number of children", value = 2 },
+ { key = "significant sep", value = 0 },
+ },
+
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+---
+declare {
+ key = "extended animated binary tree layout",
+ use = {
+ { key = "animated tree layout" },
+ { key = "minimum number of children", value=2 },
+ { key = "missing nodes get space" },
+ { key = "significant sep", value = 0 }
+ },
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+
+
+
+
+-- Helpfunctions
+
+---
+-- Borders models the borderlines / the line of border vertices
+-- of a tree or subtree structure which can change over time.
+-- Each ordered and rooted tree or subtree has vertices per layer for which they
+-- are on the outer places. On the left or respectivly on the right.
+-- The field |left| and |right| stores the both borderlines.
+-- A \emph{borderline} is an array. This array contains for each layer of the tree
+-- a table mapping a given snapshot to the related border-vertex of the layer
+-- in the snapshot.
+--
+-- @field left
+-- @field right
+--
+local Borders = {}
+Borders.__index = Borders
+
+
+-- Namespace
+
+--require("pgf.gd.experimental.evolving").Borders = Borders
+
+
+--- Create a new tree border description.
+--
+--
+function Borders.new()
+ return setmetatable( {left = {}, right = {}}, Borders )
+end
+
+function Borders:addBoth(layer, snapshot, vertex)
+ local lleft = self.left[layer] or {}
+ local lright = self.right[layer] or {}
+ assert(not lleft[snapshot] and not lright[snapshot], "borders already defined for given layer and snapshot")
+ lleft[snapshot] = vertex
+ lright[snapshot] = vertex
+ self.left[layer] = lleft
+ self.right[layer] = lright
+end
+
+function Borders:appendBelow(level, borders)
+ assert(borders, "invalid argument for borders. Value must not be 'nil'.")
+ assert((#self.left == #self.right) and (#self.left == level), "cannot be appended")
+ local new_level = borders:getLevel()
+ for i = 1, new_level do
+ self.left[i + level] = borders.left[i]
+ self.right[i + level] = borders.right[i]
+ end
+end
+
+---
+--
+-- @return the number of levels in which bordervertices exists.
+function Borders:getLevel()
+ assert(#self.left == #self.right, "different levels")
+ return #self.left
+end
+
+function Borders.copyBordersAtSnapshot(source, target, snapshot)
+ local source_level = source:getLevel()
+ for i = 1, source_level do
+ level_border_left = target.left[i] or {}
+ level_border_right = target.right[i] or {}
+ assert(not level_border_left[snapshot] and not level_border_right[snapshot],
+ "border for a given snapshat already defined")
+ level_border_left[snapshot] = source.left[i][snapshot]
+ level_border_right[snapshot] = source.right[i][snapshot]
+ target.left[i] = level_border_left
+ target.right[i] = level_border_right
+ end
+end
+
+--
+-- Adapt existing borders with the borders of a group which will be
+-- placed on the right next to the existing borders. For each level
+-- and time in which the group has a border the borders on the right
+-- will be replaced with this border. If it is not existing in the old
+-- borders then also the left border will be adapted
+--
+-- @param borders The existing borders. These will be modified with
+-- the borders of
+--
+-- @param group_borders The borders of the group
+--
+-- @param snapshots All snapshots in which checking for distances is necessary.
+--
+local function adapt_borders(borders, group_borders, snapshots, ignore_dummies)
+ for level = 1, group_borders:getLevel() do
+ local l = borders.left[level] or {}
+ local r = borders.right[level] or {}
+ for _, s in pairs(snapshots) do
+ if ignore_dummies then
+ local gls,grs = group_borders.left[level][s], group_borders.right[level][s]
+ if gls~=nil then
+ if gls.kind~="dummy" then
+ l[s] = l[s] or gls
+ end
+ end
+ if grs~=nil then
+ if grs.kind~="dummy" then
+ r[s] = grs or r[s]
+ end
+ end
+ else
+ l[s] = l[s] or group_borders.left[level][s]
+ r[s] = group_borders.right[level][s] or r[s]
+ end
+
+ end
+ borders.left[level] = l
+ borders.right[level] = r
+ end
+
+end
+
+--
+-- Shift all vertices of a group and their descendants
+-- for a certain length into horizontal direction.
+--
+-- @param shift the length all involved vertices
+-- should be shifted in horizontal direction
+--
+--
+-- @param group A group of the spanning trees that should be shifted.
+-- A group entry has to map snapshots to root nodes
+--
+-- @param snapshots An array of at least all snapshots in which the group
+-- has a vertex
+--
+-- @param descendants A table or Storage storing the list of descendants
+-- for each vertex
+--
+-- @return the highest x-coordinate of vertices in the group after the shift.
+-- If there is no vertex which was shifted then -math.huge
+-- will be returned
+--
+local function shift_group(shift, group, snapshots, descendants)
+ assert(group,"no group passed")
+ assert(shift~=math.huge and shift ~=-math.huge,
+ "shift must be a valid finit length")
+ local shifted = {} -- remember which vertex was shifted during this run
+ local anchor = -math.huge
+ for _, s in ipairs(snapshots) do
+ local v = group[s]
+ if not shifted[v] and v then
+ v.pos.x = v.pos.x + shift
+ shifted[v] = true
+
+ -- also shift all descendants of the group vertex
+ for _, d in ipairs(descendants[v]) do
+ if not shifted[d] then
+ d.pos.x = d.pos.x + shift
+ shifted[d] = true
+ end
+ end
+ anchor = math.max(anchor, v.pos.x )
+ end
+ end
+ return anchor
+end
+
+--
+-- Traverse through the spanneng tree |tree| of a snapshot and sort
+-- the child nodes into groups. A group summarises for a given parent
+-- node all children node over time that are at the same child
+-- position. The k-th child group groups[i] maps each snapshot to the
+-- k-th node in the related snapshot.
+--
+--
+-- @field supergraph the supergraph
+--
+-- @field tree the tree or spanning tree to decide the indices of the
+-- child nodes
+--
+-- @field childgroups a Storage which contains the list of childgroups
+-- for each supernode
+--
+-- @field snapshot
+--
+local function precompute_childgroups(supergraph, tree, node, childgroups, snapshot)
+ local outgoings = tree:outgoing(node)
+ if #outgoings > 0 then
+ local supervertex = supergraph:getSupervertex(node)
+ local groups = childgroups[supervertex] or {}
+ for i, e in ipairs(outgoings) do
+
+ group = groups[i] or {}
+ assert(e.head, "no edge")
+ group[snapshot] = e.head
+ groups[i] = group
+ precompute_childgroups(supergraph, tree, e.head, childgroups, snapshot)
+ end
+ assert(supervertex, "no mv")
+ childgroups[supervertex] = groups
+ end
+end
+
+--
+-- Use this function to compute the horizontal positions of all
+-- vertices in a tree by accumulation of the relative shifts on the
+-- path from the root to the vertex recursively.
+--
+-- @param tree the tree in which the vertice's position should be
+-- computed.
+--
+-- @param vertex the next vertex that gets its absolute coordinate.
+--
+-- @param shifts a Storage, which stores for each node the relative
+-- shift between the vertex and its parent.
+--
+-- @param abs_shift the sum of all relative shifts on the path from
+-- the root to the vertex.
+--
+local function accumulate_hpos(tree, vertex, shifts, abs_shift)
+ local new_shift = abs_shift + shifts[vertex]
+ local test = vertex.pos.x
+ vertex.pos.x = new_shift
+-- if vertex.pos.x - test > 0.0001 then texio.write("X")end
+ local outgoings = tree:outgoing(vertex)
+ for _, e in ipairs(outgoings) do
+ accumulate_hpos(tree, e.head, shifts, new_shift)
+ end
+end
+
+
+local function get_next(border_pair, next)
+ local nl = next.left[border_pair.left]
+ local nr = next.right[border_pair.right]
+ assert ((nl and nr) or (not nl and not nr))
+ return {left = nl, right = nr,
+ }
+end
+
+local function add_shift(abs_shift, border_pair, next)
+ abs_shift.left = abs_shift.left + next.left_shift[border_pair.left]
+ abs_shift.right = abs_shift.right + next.right_shift[border_pair.right]
+end
+
+--
+-- Given a tree, computes the required distance between the i-th and the (i+1)-th subtree
+-- of the vertex |snapshot_vertex|.
+--
+-- @param shifts a Storage, which contains for each vertex the relative horizontal shift
+-- to its parent vertex.
+--
+function Skambath2016:computeRequiredDistance(tree, vertex, i, shifts, next)
+ local outgoings = tree:outgoing(vertex)
+-- texio.write("\n::"..vertex.name.. " "..i.."|"..(i+1))
+ if #outgoings > 0 then
+ local clumb = {left = outgoings[1].head,right = outgoings[i].head}
+ if clumb.right.kind=="dummy" then shifts[clumb.right] = 0 end
+ local v0 = outgoings[i].head
+ local v1 = outgoings[i+1].head
+ local shift = layered.ideal_sibling_distance(self.adjusted_bb, self.ugraph, v0, v1) + shifts[clumb.right]
+ local last0 = {left = clumb.left, right = clumb.right}
+ local last1 = {left = v1, right = v1}
+ local next0 = get_next(last0, next)
+ local next1 = get_next(last1, next)
+ local abs_shift0 = {left = shifts[clumb.left], right = shifts[clumb.right]}
+ local abs_shift1 = {left = 0, right = 0}
+
+ while (next0.left and next1.left) do
+ add_shift(abs_shift0, last0, next)
+ add_shift(abs_shift1, last1, next)
+
+ shift = math.max(shift,
+ layered.ideal_sibling_distance(self.adjusted_bb,
+ self.ugraph,
+ next0.right,
+ next1.left)
+ + abs_shift0.right - abs_shift1.left)
+-- texio.write("\n | "..(next0.right.name or "dummy").."<->"..(next1.left.name or "dummy").." :\t"..shift)
+ last0, last1 = next0, next1
+ next0 = get_next(next0, next)
+ next1 = get_next(next1, next)
+ end
+ return shift, {l0 = last0, l1 = last1, n0 = next0, n1 = next1,abs_shift1 = abs_shift1,abs_shift0=abs_shift0}
+ -- end
+ else
+ return 0
+ end
+end
+
+local function apply_shift(tree, vertex, i, shifts, next, border_ptr, shift)
+ local outgoings = tree:outgoing(vertex)
+-- texio.write("\n" .. (vertex.name or "dummy")..": ".. shift )
+ if #outgoings >= (i+1) then
+ assert(border_ptr, "unexpected error")
+ local last0 = border_ptr.l0
+ local last1 = border_ptr.l1
+ local next0 = border_ptr.n0
+ local next1 = border_ptr.n1
+ local abs0 = border_ptr.abs_shift0
+ local abs1 = border_ptr.abs_shift1
+ local vbase = outgoings[1].head -- before centering the 1st vertex is at x=0
+ local v0 = outgoings[i].head
+ local v1 = outgoings[i+1].head
+ if v0.kind=="dummy" then shifts[v0] = 0 end
+ shifts[v1] = shifts[vbase] + shift
+ if next0.left then
+ assert(next0.right and next0.left, "failA")
+ -- pointer from T_i to T_{i+0}
+ next.right[last1.right] = next0.right
+ next.right_shift[last1.right] = - shift - abs1.right + (abs0.right + next.right_shift[last0.right])
+ elseif next1.right then
+ assert(next1.right and next1.left, "")
+ -- pointer from T_{i+0} to T_i
+ -- texio.write(last0.left .." -> " ..next1.left)
+ next.left[last0.left] = next1.left
+-- pgf.debug{last0,abs0,abs1,last1}
+ next.left_shift[last0.left] = shift - abs0.left + (abs1.left + next.left_shift[last1.left] )
+
+ else
+ -- both trees have the same height
+ end
+ end
+end
+
+-- Implementation
+
+function Skambath2016:run()
+ local layers = Storage.new()
+ local descendants = Storage.new()
+ local childgroups = Storage.new()
+
+ local phases = self.digraph.options.algorithm_phases
+
+ local so_class = phases['supergraph optimization']
+ local ga_class = phases['evolving graph animation']
+ local cr_class = phases['temporal cycle removal']
+
+ self.extended_version = self.digraph.options['missing nodes get space']
+ self.supergraph = Supergraph.generateSupergraph(self.digraph)
+ local supergraph_original = Supergraph.generateSupergraph(self.digraph)
+
+ -- optimize graph by splitting nodes by trivial criteria
+ so_class.new {
+ main_algorithm = self,
+ supergraph = self.supergraph,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+
+
+ self:precomputeSpanningTrees()
+
+ -- Resolve cyclic dependencies if exists.
+ cr_class.new {
+ main_algorithm = self,
+ supergraph = self.supergraph,
+ digraph = self.digraph,
+ }:run()
+
+
+
+ self:precomputeDescendants(layers, descendants)
+ self:precomputeChildgroups(childgroups)
+
+ self:computeHorizontalLayout(childgroups, descendants)
+-- self:computeHorizontalLayoutFast()
+
+ -- vertical positions
+ tlayered.arrange_layers_by_baselines(layers,
+ self.adjusted_bb,
+ self.ugraph,
+ self.supergraph.snapshots,
+ self.supergraph.vertex_snapshots)
+
+ -- animate graph
+ ga_class.new {
+ main_algorithm = self,
+ supergraph = supergraph_original,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+end
+
+--
+-- Compute the required shift value for a second tree to garuantee
+-- a required node distance.
+-- @field right_borders The Border data structure for the right border of
+-- the left tree
+-- @field left_borders The Border data structure for the left border of
+-- the right tree
+-- @field selected_snapshots if you set this value with an array of snapshots
+-- only the predefined snapshots are used in the border
+-- computation.
+--
+function Skambath2016:computeMinShift(right_borders, left_borders, selected_snapshots)
+ local shift = -math.huge
+ local max_level = math.min(#right_borders, #left_borders)
+ local first_shift = 0
+ local snapshots = selected_snapshots or self.supergraph.snapshots
+
+ for layer = 1, max_level do
+ local rb, lb = right_borders[layer], left_borders[layer]
+ for _,s in ipairs(snapshots) do
+
+ local v1,v2 = rb[s],lb[s]
+ if v1 and v2 then
+ local local_shift = layered.ideal_sibling_distance(self.adjusted_bb, self.ugraph, v1, v2) + v1.pos.x - v2.pos.x
+ shift = math.max(shift, local_shift)
+ end
+ end
+ if layer == 1 then
+ first_shift = shift
+ end
+ end
+
+ local is_significant = false
+
+ if max_level > 1 and shift<=first_shift then
+ -- if the necessary shift of the subtrees
+ -- is the minimum required shift between two
+ -- nodes than a node is significant
+ is_significant = true
+ end
+
+ if shift <= -math.huge then
+ shift = 0
+ end
+
+ if is_significant then
+ shift = shift + self.ugraph.options['significant sep']
+ end
+
+ return shift
+end
+
+
+--
+-- The main algorithm: This method computes the layout for each vertex.
+-- For this all supervertices are visited in a topological order to their dependency.
+-- If a . This requires the supergraph to be acyclic. If this is not the case
+-- the calling process has to remove all cycles otherwise the x-coordinate will
+-- not be computed for every vertex.
+--
+function Skambath2016:computeHorizontalLayout(groups, descendants)
+ local subtree_borders = Storage.new()
+ local dep_counter = {}
+ local visited = {}
+ local queue = PriorityQueue.new()
+ local dependency_graph = Digraph.new()
+ for _, vertex in ipairs(self.supergraph.vertices) do
+ dep_counter[vertex] = 0
+ dependency_graph:add {vertex}
+ end
+
+ -- 1. Initialize Dependencies
+
+ for _, snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ for _, arc in ipairs(spanning_tree.arcs) do
+
+ local head = self.supergraph:getSupervertex(arc.head)
+ local tail = self.supergraph:getSupervertex(arc.tail)
+
+ if(head and tail) then
+ if not dependency_graph:arc(tail, head) then
+ dependency_graph:connect(tail, head)
+ dep_counter[tail] = dep_counter[tail] + 1
+ end
+ end
+ end
+ end
+ end
+
+ -- 2. Find independent vertices
+ for _, vertex in ipairs(dependency_graph.vertices) do
+ local outgoings = dependency_graph:outgoing(vertex)
+ if #outgoings == 0 then
+ queue:enqueue(vertex, 1)
+ end
+ end
+
+ -- 2.
+ while not queue:isEmpty() do
+ local vertex = queue:dequeue()
+ local vertex_snapshots = self.supergraph:getSnapshots(vertex)
+
+ -- a. Resolve dependencies on this vertex:
+ local incomings = dependency_graph:incoming(vertex)
+ for _, e in ipairs(incomings) do
+ dep_counter[e.tail] = dep_counter[e.tail] - 1
+ if dep_counter[e.tail] == 0 then
+ queue:enqueue(e.tail, 1)
+ end
+ end
+
+ -- b. Compute borders of this supervertex:
+ local vertex_borders = Borders.new()
+ for _, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ vertex_borders:addBoth(1, s, snapshot_vertex)
+ snapshot_vertex.pos.x = 0
+ snapshot_vertex.pos.y = 0
+ end
+
+ local vertex_groups = groups[vertex]
+ local last_pos_x = 0
+ if vertex_groups then
+ -- c. Compute borders of groups:
+ local all_group_borders = {}
+ for i, group in ipairs(vertex_groups) do
+ local group_boders = Borders.new()
+ for _,s in ipairs(vertex_snapshots) do
+ local child = group[s]
+ if child then
+ local child_borders
+ if not (child.kind == "dummy") then
+ local superchild = self.supergraph:getSupervertex(child)
+ child_borders = subtree_borders[superchild] or Borders.new()
+ else
+ child_borders = Borders.new()
+ child_borders:addBoth(1, s, child)
+ end
+ assert(child.pos~=math.huge, "invalid child pos")
+ shift_group(-child.pos.x,{[s]=child},{[1]=s}, descendants)
+ Borders.copyBordersAtSnapshot(child_borders, group_boders, s)
+ end
+ end
+ all_group_borders[i] = group_boders
+ end
+
+ -- d. Place groups and merge borders of groups:
+ local last_group = nil
+ last_pos_x = 0
+ local merged_borders = Borders.new()
+ local final_borders = Borders.new()
+ for i, group in ipairs(vertex_groups) do
+ local group_borders = all_group_borders[i]
+ if last_group_borders then
+ -- i. compute minimal shift
+
+ local shift
+ shift = self:computeMinShift(merged_borders.right, group_borders.left)
+
+
+ assert(shift ~= math.huge and shift~=-math.huge, "invalid shift")
+
+ -- ii. shift group
+ local anchor = shift_group(shift, group,vertex_snapshots, descendants)
+ last_pos_x = anchor
+ end
+ last_group_borders = group_borders
+
+ -- iii. adapt borders
+ adapt_borders(merged_borders,
+ group_borders,
+ self.supergraph.snapshots)
+ adapt_borders(final_borders,
+ group_borders,
+ self.supergraph.snapshots,
+ not self.extended_version)
+ end -- for (group)
+ vertex_borders:appendBelow(1, final_borders)
+ end
+ -- e. store borders:
+ assert(last_pos_x~=math.huge and last_pos_x~=-math.huge, "invalid position")
+ local x = ((last_pos_x) - 0)/2 + 0
+ assert(x~=math.huge and x~=-math.huge, "invalid position")
+ for _,s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ snapshot_vertex.pos.x = x
+ end
+
+ subtree_borders[vertex] = vertex_borders
+ end
+
+ -- align roots
+ for _, s in ipairs(self.supergraph.snapshots) do
+ local lastroot
+ local rborder
+ for i, spanning_tree in ipairs(s.spanning_trees) do
+ local root = spanning_tree.root
+ local rootborders = subtree_borders[self.supergraph:getSupervertex(root)]
+ shift_group(-root.pos.x,{[s]=root},{[1]=s}, descendants)
+ if i>1 then
+ local l = subtree_borders[self.supergraph:getSupervertex(lastroot)]
+ local r = rootborders
+ shift = math.max(self:computeMinShift(l.right, r.left, {[1]=s}),
+ self:computeMinShift(rborder.right,r.left, {[1]=s}))
+ shift_group(shift,{[s]=root},{[1]=s}, descendants)
+ else
+ rborder = Borders.new()
+ end
+ adapt_borders(rborder,rootborders,self.supergraph.snapshots,false)
+ lastroot = root
+ end
+ end
+end
+
+--
+-- The main algorithm: This method computes the layout for each vertex.
+-- For this all supervertices are visited in a topological order to their dependency.
+-- If a . This requires the supergraph to be acyclic. If this is not the case
+-- the calling process has to remove all cycles otherwise the x-coordinate will
+-- not be computed for every vertex.
+--
+function Skambath2016:computeHorizontalLayoutFast()
+ local all_trees = Storage.new()
+ local dep_counter = {}
+ local visited = {}
+ local queue = PriorityQueue.new()
+ local dependency_graph = Digraph.new()
+ local shifts = Storage.new()
+ local next = Storage.new()
+ for _, vertex in ipairs(self.supergraph.vertices) do
+ dep_counter[vertex] = 0
+ dependency_graph:add {vertex}
+ end
+
+
+ -- I. Initialize Dependencies (Build Dependency Graph)
+ for _, snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ table.insert(all_trees, spanning_tree)
+ shifts[spanning_tree] = Storage.new()
+ next[spanning_tree] = {left= Storage.new(),
+ right= Storage.new(),
+ left_shift = Storage.new(),
+ right_shift = Storage.new()
+ }
+
+ for _, arc in ipairs(spanning_tree.arcs) do
+ local head = self.supergraph:getSupervertex(arc.head)
+ local tail = self.supergraph:getSupervertex(arc.tail)
+
+ if(head and tail) then
+ if not dependency_graph:arc(tail, head) then
+ dependency_graph:connect(tail, head)
+ dep_counter[tail] = dep_counter[tail] + 1
+ end
+ end
+ end
+ end
+ end
+
+ -- II. Visit vertices in topological ordering
+ -- Find independent vertices
+ for _, vertex in ipairs(dependency_graph.vertices) do
+ local outgoings = dependency_graph:outgoing(vertex)
+ if #outgoings == 0 then
+ queue:enqueue(vertex, 1)
+ end
+ end
+
+ while not queue:isEmpty() do
+ -- Next node in topological order
+ local vertex = queue:dequeue()
+-- texio.write("\n\n --- "..vertex.name .. " ---")
+ --pgf.debug{next}
+ local vertex_snapshots = self.supergraph:getSnapshots(vertex)
+
+ -- a. Resolve dependencies on this vertex:
+ local incomings = dependency_graph:incoming(vertex)
+ for _, e in ipairs(incomings) do
+ dep_counter[e.tail] = dep_counter[e.tail] - 1
+ if dep_counter[e.tail] == 0 then
+ queue:enqueue(e.tail, 1)
+ end
+ end
+
+ -- b. Compute maximum number of children over time:
+ local num_children = 0
+ for _, s in ipairs(vertex_snapshots) do
+ local v = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ num_children = math.max(num_children, #(tree:outgoing(v)))
+ shifts[tree][v] = 0
+ end
+
+ -- c. Shift all subtrees in all snapshots:
+ local hlp_ptr = Storage.new()
+ local max_shift = 0
+ for i = 1, (num_children - 1) do
+ -- i) Compute the necessary shift between the i-th and (i+1)-th subtrees (per snapshot):
+ local min_shift = 0
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ local req_shift, hptr
+ req_shift, hptr = self:computeRequiredDistance(tree,
+ snapshot_vertex,
+ i,
+ shifts[tree],
+ next[tree]
+ )
+ hlp_ptr[t] = hptr
+-- texio.write(" -> \t"..req_shift)
+ min_shift = math.max(min_shift, req_shift)
+ end
+
+-- texio.write("\n \t\t".. min_shift )
+
+ -- ii) Synchronize distance between neigbored subtrees and apply shifts
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ apply_shift(tree, snapshot_vertex, i, shifts[tree], next[tree], hlp_ptr[t], min_shift)
+ end
+
+ max_shift = min_shift
+ end
+
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ local outgoings = tree:outgoing(snapshot_vertex)
+
+-- next[tree].left[snapshot_vertex] = outgoings[1].head
+
+
+ for i = 1,#outgoings do
+ if i==1 then
+ next[tree].left_shift[snapshot_vertex] = - max_shift / 2
+ next[tree].left[snapshot_vertex]= outgoings[i].head
+ end
+ shifts[tree][outgoings[i].head] = shifts[tree][outgoings[i].head] - max_shift / 2
+ next[tree].right[snapshot_vertex] = outgoings[i].head
+ next[tree].right_shift[snapshot_vertex] = shifts[tree][outgoings[i].head]
+ end
+
+ end
+
+ end -- end while (all vertices have been processed)
+
+ -- III. Accumulate absolute horizontal coordinates
+ for _, tree in ipairs(all_trees) do
+ accumulate_hpos(tree, tree.root, shifts[tree], 0)
+ end
+end
+
+
+
+
+function Skambath2016:precomputeTreeDescendants(tree, node, depth, layers, descendants)
+ local my_descendants = { node }
+
+ for _,arc in ipairs(tree:outgoing(node)) do
+ local head = arc.head
+ self:precomputeTreeDescendants(tree, head, depth+1, layers, descendants)
+ for _,d in ipairs(descendants[head]) do
+ my_descendants[#my_descendants + 1] = d
+ end
+ end
+ layers[node] = depth
+ descendants[node] = my_descendants
+end
+
+function Skambath2016:precomputeDescendants(layers, descendants)
+ for _,snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ self:precomputeTreeDescendants(spanning_tree, spanning_tree.root, 1, layers, descendants)
+ end
+ end
+end
+
+
+--
+--
+--
+function Skambath2016:precomputeChildgroups(childgroups)
+ for _,s in ipairs(self.supergraph.snapshots) do
+ for _,spanning_tree in ipairs(s.spanning_trees) do
+ precompute_childgroups(self.supergraph, spanning_tree, spanning_tree.root, childgroups, s)
+ end
+ end
+end
+
+--
+-- Compute a for each connected component of each
+-- snapshot and appends the result for a snapshot s to
+-- the array s.spanning_trees.
+--
+function Skambath2016:precomputeSpanningTrees()
+ local events = assert(self.scope.events,
+ "no events found for the spanning tree computation")
+
+ for i, s in ipairs(self.supergraph.snapshots) do
+ -- The involved snapshot graph:
+ local s_copy = Digraph.new(s)
+ for _,a in ipairs(s.arcs) do
+ local new_a = s_copy:connect(a.tail,a.head)
+ new_a.syntactic_edges = a.syntactic_edges
+ end
+ s.spanning_trees = s.spanning_trees or {}
+ -- Step 1: Decompose the snapshot into its connected components
+ local syntactic_components = LayoutPipeline.decompose(s_copy)
+ for i, syntactic_component in ipairs (syntactic_components) do
+ local tree = SpanningTreeComputation.computeSpanningTree(syntactic_component, true, events)
+ s.spanning_trees[i] = tree
+ end
+ end
+end
+
+return Skambath2016
+
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua
new file mode 100644
index 00000000000..490b8b3191d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua
@@ -0,0 +1,570 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+
+-- Imports
+local lib = require "pgf.gd.lib"
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Storage = require "pgf.gd.lib.Storage"
+
+
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+---
+-- Each |Supergraph| instance is a |Digraph| instance which represents
+-- the graph by union operation on all graphs G_i of an evolving graph
+-- $G=(G_1, G_2, \dots, G_n)$. Additional to that all references to
+-- the snapshot-graphs are shared such that is possible to get access
+-- to all vertices for each snapshot graph in a sequence. A vertex of
+-- an evolving graph may exists at different times, thus in in
+-- different snapshots. Each vertex will be a vertex in the supergraph
+-- and if there is a single snapshot in which two vertices are
+-- connected by an edge they are connected in the supergraph.
+--
+-- Note that in TikZ a \emph{node} is more than a single dot. A node
+-- has a content and different properties like background-color or a
+-- shape. Formally this can be modelled by function mapping vertices
+-- to their properties. For evolving graphs this could be done in the
+-- same way. As this is difficult to be realised in PGF because there
+-- is no basic support for time dependend properties on nodes, each
+-- vertex will be displayed over time by different single
+-- (snapshot-)nodes which can have different visual properties. This
+-- means for a vertex which we call |supervertex| in the following we
+-- will have a (snapshot-)node for each time stamp.
+--
+-- \medskip
+-- \noindent\emph{Snapshots.}
+-- Since an evolving graph is a sequence of different snapshot-graphs
+-- $G_i$ each snapshot is assigned to a time
+--
+--
+-- @field vertex_snapshots This storage maps each pgf-node to the snapshots
+-- in which they are visible.
+--
+-- @field supervertices This storage maps each pgf-node to its supervertex
+-- which represents all pgf-vertices assigned to the same node
+--
+-- @field supervertices_by_id This storage maps a node identifier to the
+-- related supervertex such that PGF-nodes which belonging to
+-- the same superverticex can be identified
+--
+-- @field snapshots An array of all snapshots. Sorted in ascending order
+-- over the timestamps of the snapshots.
+--
+-- @field arc_snapshots A table storing all snapshots of a supervertex in which
+-- the related nodes are connected. Using a snapshot as key you can check
+-- if a given snapshot is in the array.
+--
+-- Assume we want to iterate over all snapshots
+-- for a certain pair of supernodes in which they are connected
+-- by an arc. The arc_snapshots storage helps in this case:
+-- \begin{codeexample}[code only, tikz syntax=false]
+-- local supergraph = Supergraph.generateSupergraph(self.digraph)
+-- local u = supergraph.vertices[1]
+-- local v = supergraph.vertices[2]
+--
+-- local snapshots = supergraph.arc_snapshots[supergraph:arc(u, v)]
+-- for _, snapshot in ipairs(snapshots) do
+-- do_something(snapshot)
+-- end
+-- \end{codeexample}
+--
+local Supergraph = lib.class { base_class = Digraph }
+
+-- Namespace
+--require("pgf.gd.experimental.evolving").Supergraph = Supergraph
+
+Supergraph.__index =
+ function (t, k)
+ if k == "arcs" then
+ return Digraph.__index(t,k)
+ else
+ return rawget(Supergraph, k) or rawget(Digraph, k)
+ end
+ end
+
+function Supergraph.new(initial)
+ local supergraph = Digraph.new(initial)
+ setmetatable(supergraph, Supergraph)
+
+ supergraph.vertex_snapshots = Storage.new()
+ supergraph.supervertices = Storage.new()
+ supergraph.supervertices_by_id = {}
+ supergraph.arc_snapshots = Storage.newTableStorage()
+
+ return supergraph
+
+end
+
+
+local get_snapshot
+
+---
+-- Generate or extract a snapshot instance for a given snapshot time.
+--
+-- @param snapshots An array of all existing snapshots
+-- @param timestamps A table which maps known timestamps to their
+-- related snapshots
+-- @param ugraph The ugraph of the underlying graph structure
+-- @param snapshot_time
+--
+-- @return The snapshot instance found in the snapshots array for the
+-- wanted timestamp snapshot_time if it does'nt exists a new snapshot
+-- will be generated and added to the arrays
+--
+function get_snapshot(snapshots, timestamps, ugraph, snapshot_time)
+ local snapshot
+ local snapshot_idx = timestamps[snapshot_time]
+
+ if not snapshot_idx then
+ -- store snapshot if it doesn't exists
+ snapshot_idx = timestamps.n + 1
+ timestamps[snapshot_time] = snapshot_idx
+ timestamps.n = timestamps.n + 1
+ snapshot = Digraph.new {
+ syntactic_digraph = ugraph.syntactic_digraph,
+ options = ugraph.options
+ }
+ snapshot.timestamp = snapshot_time
+ snapshots[snapshot_idx] = snapshot
+ else
+ snapshot = snapshots[snapshot_idx]
+ end
+ assert(snapshot~=nil, "an unexpected error occured")
+ return snapshot
+end
+
+
+---
+-- Generate a new supergraph to describe the whole evolving graph by
+-- collecting all temporal information from the digraph and the node
+-- options. All nodes in the |digraph| require a |snapshot| and
+-- a |supernode| option. To identify a (snapshot-)node with its
+-- supernode and snapshot.
+--
+-- @param digraph
+--
+-- @return The supergraph which is a |Digraph| that has a supervertex
+-- for each set of snapshot-vertices with the same |supernode|
+-- attribute.
+--
+function Supergraph.generateSupergraph(digraph)
+ local new_supergraph
+ new_supergraph = Supergraph.new {
+ syntactic_digraph = digraph.syntactic_digraph,
+ options = digraph.options,
+ digraph = digraph,
+ }
+
+ -- array to store the supervertices for a given vertex name
+ local local_snapshots = {} -- array to store each snapshot graphs
+
+ local timestamps = { n = 0 } -- set of snapshot times
+
+ -- separate and assign vertices to their snapshots and supervertives
+ for i,vertex in ipairs(digraph.vertices) do
+ local snapshot_time = assert(vertex.options["snapshot"], "Missing option 'snapshot' for vertex ".. vertex.name ..". ")
+ local supernode_name = assert(vertex.options["supernode"], "Missing option 'supernode' for vertex"..vertex.name..". ")
+
+ local snapshot = get_snapshot(local_snapshots, timestamps, digraph, snapshot_time)
+ local supervertex = new_supergraph.supervertices_by_id[supernode_name]
+
+ if not supervertex then
+ -- first appeareance of the supernode id
+ supervertex = Vertex.new {
+ kind = "super",
+ name = supernode_name
+ }
+ supervertex.snapshots = {}
+ supervertex.subvertex = {}
+ new_supergraph.supervertices_by_id[supernode_name] = supervertex
+ new_supergraph:add{supervertex}
+
+ supervertex.options = {}
+ supervertex.options = vertex.options
+ end
+
+ snapshot:add{vertex}
+
+ new_supergraph.supervertices[vertex] = supervertex
+ new_supergraph.vertex_snapshots[vertex] = snapshot
+ new_supergraph:addSnapshotVertex(supervertex, snapshot, vertex)
+ end
+
+ -- Create edges
+ for i, e in ipairs(digraph.arcs) do
+ local u,v = e.tail, e.head
+ local snapshot_tail = new_supergraph.vertex_snapshots[e.tail]
+ local snapshot_head = new_supergraph.vertex_snapshots[e.head]
+
+ assert(snapshot_head == snapshot_tail, "Arcs must connect nodes that exist at the same time.")
+
+ -- connect in the snapshot graph
+ local arc = snapshot_tail:connect(u,v)
+
+ -- connect in the supergraph:
+ local super_tail = new_supergraph.supervertices[u]
+ local super_head = new_supergraph.supervertices[v]
+
+ new_supergraph:assignToSuperarc(super_tail, super_head, snapshot_tail)
+ end
+
+ -- snapshots in temporal order
+ table.sort(local_snapshots,
+ function(s1,s2)
+ return s1.timestamp < s2.timestamp
+ end )
+
+ local previous_snapshot
+
+ for i,s in ipairs(local_snapshots) do
+ local start = -math.huge
+ if previous_snapshot then
+ start = (s.timestamp - previous_snapshot.timestamp) / 2 + previous_snapshot.timestamp
+ previous_snapshot.interval.to = start
+ end
+ s.interval = { from = start , to = math.huge }
+ previous_snapshot = s
+ end
+
+ new_supergraph.snapshots = local_snapshots
+ new_supergraph.snapshots_indices = Storage.new()
+
+ for i, s in ipairs(new_supergraph.snapshots) do
+ new_supergraph.snapshots_indices[s] = i
+ end
+
+ return new_supergraph
+end
+
+
+function Supergraph:getSnapshotStaticDuration(snapshot)
+ assert(snapshot, "a snapshot as parameter expected, but got nil")
+ local idur = snapshot.interval.to - snapshot.interval.from
+ assert(idur, "unexpected nil-value")
+ local d1 = snapshot.interval.to - snapshot.timestamp
+ local d2 = snapshot.timestamp - snapshot.interval.from
+ local dm = math.min(d1,d2)
+ if (idur >= math.huge and dm < math.huge) then
+ return dm -- [-\infty,t] or [t,\infty]
+ elseif idur >= math.huge then
+ return 0 -- only one snapshot [-\infty,\infty]
+ else
+ return d1 + d2 -- [t_1, t_2]
+ end
+end
+
+---
+-- Get the durations of the graph in which snapshots are given which is exactly
+-- the time between the first and the last defined snapshot
+--
+-- @return The time between the last and first snapshot in seconds
+function Supergraph:getDuration()
+ local first_snapshot = self.snapshots[1]
+ local last_snapshot = self.snapshots[#self.snapshots]
+ return last_snapshot.timestamp - first_snapshot.timestamp
+end
+
+---
+--
+-- @return The ratio of the time of a snapshot related to the global duration of the whole
+-- evlolving trees. (The time between the last and first snapshot)
+function Supergraph:getSnapshotRelativeDuration(snapshot)
+ if self:getDuration() == 0 then
+ return 1
+ else
+ return self:getSnapshotStaticDuration(snapshot) / self:getDuration()
+ end
+end
+
+---
+-- Give the supervertex for a certain pgf-vertex (vertex of a snapshot)
+--
+-- @param vertex A vertex of a snapshot.
+--
+-- @return A supervertex in the supergraph for the given vertex, nil if no
+-- supervertex was assigned before.
+--
+function Supergraph:getSupervertex(vertex)
+ assert(vertex, "vertex required")
+ assert(self.supervertices, "supervertex table is not defined")
+ return self.supervertices[vertex]
+end
+
+function Supergraph:getSuperarc(arc)
+ local superhead = self:getSupervertex(arc.head)
+ local supertail = self:getSupervertex(arc.tail)
+ local arc = assert(self:arc(supertail, superhead),"unexpected problem")
+ return arc
+end
+
+function Supergraph:getSnapshots(supervertex)
+ return supervertex.snapshots
+end
+
+---
+-- Find the snapshot-instance for a given pgf-vertex
+-- (which is a vertex for one certain snapshot)
+--
+-- @param vertex A vertex for which you want to get the related snapshot
+--
+-- @return The snapshot which contains the given vertex as vertex.
+function Supergraph:getSnapshot(vertex)
+ return self.vertex_snapshots[vertex]
+end
+
+---
+-- For a given supervertex get the related vertex for a snapshot
+--
+-- @param supervertex
+--
+-- @param snapshot
+--
+-- @return The vertex of the supervertex at the specified snapshot
+--
+function Supergraph:getSnapshotVertex(supervertex, snapshot)
+ assert(supervertex, "supervertex must not be nil")
+ assert(snapshot, "snapshot must not be nil")
+ return supervertex.subvertex[snapshot]
+end
+
+
+function Supergraph:consecutiveSnapshots(snapshot1, snapshot2, n)
+ assert(snapshot1 and snapshot2, "no snapshot passed")
+ local idx1 = self.snapshots_indices[snapshot1] --or -1
+ local idx2 = self.snapshots_indices[snapshot2] --or -1
+ local d = n or 1
+
+ return (idx2-idx1 <= d) or (idx1-idx2 <= d)
+end
+
+function Supergraph:consecutive(vertex1, vertex2, n)
+ local s1 = self:getSnapshot(vertex1)
+ local s2 = self:getSnapshot(vertex2)
+ return self:consecutiveSnapshots(s1, s2, n)
+end
+
+---
+-- Write pack all position information to the nodes of each snapshot
+-- such that all nodes with the same supervertex have the same position
+--
+-- @param ugraph An undirected graph for which the vertices should get
+-- their positions from the supergraph.
+--
+function Supergraph:sharePositions(ugraph, ignore)
+
+ for _,vertex in ipairs(ugraph.vertices) do
+ if not ignore then
+ vertex.pos.x = self.supervertices[vertex].pos.x
+ vertex.pos.y = self.supervertices[vertex].pos.y
+ else
+ if not ignore.x then
+ vertex.pos.x = self.supervertices[vertex].pos.x
+ end
+ if not ignore.y then
+ vertex.pos.y = self.supervertices[vertex].pos.y
+ end
+ end
+
+
+ end
+end
+
+function Supergraph:onAllSnapshotvertices(f, ugraph)
+ for _,vertex in ipairs(ugraph.vertices) do
+ local snapshot_vertex = self.supertvertices[vertex]
+ if snapshot_vertex then
+ f(vertex, snapshot_vertex)
+ end
+ end
+end
+
+---
+-- Split a supervertex into new supervertices such that
+-- for a given snapshot there is a new pseudo-supervertex.
+-- This pseudo-supervertex will be assigned to all snapshots
+-- after the given snapshot.
+-- All snapshots of a new pseudo-supervertex are removed from
+-- the original vertex.
+-- If a supervertex has no subvertices then it will not be added to the graph.
+--
+-- @param supervertex The supervertex which should be splitted.
+--
+-- @param snapshots An array of snapshots at which the supervertex
+-- should be splitted into a new one with the corresponding pgf-vertices.
+-- If there are more than one snapshots passed to the function
+-- for each snapshot there will be a new pseudo-vertex
+--
+function Supergraph:splitSupervertex(supervertex, snapshots)
+ assert(supervertex, "no supervertex defined")
+ -- snapshots in temporal order
+ table.sort(snapshots,
+ function(s1,s2)
+ return s1.timestamp < s2.timestamp
+ end )
+
+ assert(#snapshots~=0)
+
+ local edit_snapshots = supervertex.snapshots
+ local first_removed = math.huge
+ local rem_arcs = {}
+ for i = 1, #snapshots do
+ local s_first = self.snapshots_indices[snapshots[i]]
+ first_removed = math.min(s_first,first_removed)
+ local s_last
+ if i==#snapshots then
+ s_last = #self.snapshots
+ else
+ s_last = self.snapshots_indices[snapshots[i+1]]-1
+ end
+
+ local pseudovertex = Vertex.new {
+ kind = "super",
+ name = supervertex.name.."*"..i,
+ subvertex = {},
+ snapshots = {}
+ }
+
+ local has_subvertices = false
+
+ for j = s_first, s_last do
+ local s = self.snapshots[j]
+ local vertex = self:getSnapshotVertex(supervertex, s)
+ if vertex then
+ self.supervertices[vertex] = pseudovertex
+ self:addSnapshotVertex(pseudovertex, s, vertex)
+ self:removeSnapshotVertex(supervertex, s)
+
+ if not has_subvertices then
+ has_subvertices = true
+ self:add{pseudovertex}
+ end
+
+ -- update edges:
+ local incoming = self.digraph:incoming(vertex)
+ local outgoing = self.digraph:outgoing(vertex)
+
+ for _, arc in ipairs(incoming) do
+ local tail = self.supervertices[arc.tail]
+ local head = self.supervertices[arc.head]
+ self:assignToSuperarc(tail, pseudovertex, s)
+
+ local super_arc = self:arc(tail, supervertex)
+ if not rem_arcs[super_arc] then
+ table.insert(rem_arcs, {arc = super_arc, snapshot = s})
+ rem_arcs[super_arc] = true
+ end
+ end
+
+ for _, arc in ipairs(outgoing) do
+ local tail = self.supervertices[arc.tail]
+ local head = self.supervertices[arc.head]
+ self:assignToSuperarc(pseudovertex, head, s)
+
+ local super_arc = self:arc(supervertex, head)
+ if not rem_arcs[super_arc] then
+ table.insert(rem_arcs, {arc = super_arc, snapshot = s})
+ rem_arcs[super_arc] = true
+ end
+ end
+ end
+ end
+ end
+
+ if first_removed ~= math.huge then
+ for _, removed_arc in ipairs(rem_arcs) do
+ local snapshots = self.arc_snapshots[removed_arc.arc]
+ for i=#snapshots,1,-1 do
+ local s = snapshots[i]
+ if s.timestamp >= removed_arc.snapshot.timestamp then
+ table.remove(snapshots, i)
+ end
+ end
+
+ if #snapshots==0 then
+ self:disconnect(removed_arc.arc.tail, removed_arc.arc.head)
+ end
+ end
+ end
+end
+
+-- function Supergraph:reloadArcSnapshots()
+-- for _, arc in ipairs(self.digraph.arcs) do
+-- local snapshot = self:getSnapshot(arc.head)
+-- local superarc = self:getSuperarc(arc)
+-- texio.write("\n"..arc.tail.name..">"..arc.head.name)
+-- self.arc_snapshots[superarc] = snapshot
+-- end
+-- end
+
+---
+-- Remove the binding of a vertex at a certain snapshot from its assigned
+-- supervertex.
+-- This requires time $O(n)$ where $n$ is the number of nodes actually
+-- assigned to the supervertex.
+function Supergraph:removeSnapshotVertex(supervertex, snapshot)
+ assert(supervertex and snapshot,"missing argument: the supervertex and snapshot must not be nil")
+
+ -- remove reference to snapshot
+ for i = #supervertex.snapshots,1,-1 do
+ if supervertex.snapshots[i] == snapshot then
+ table.remove(supervertex.snapshots, i)
+ end
+ end
+ -- remove vertex at snapshot
+ supervertex.subvertex[snapshot] = nil
+end
+
+---
+-- Assign a vertex to a snapshot vertex of this supergraph.
+-- This requires time $O(1)$
+-- @param supervertex
+--
+-- @param snapshot
+--
+-- @param vertex The vertex which should be assigned to the supervertex
+-- for the given snapshot.
+--
+function Supergraph:addSnapshotVertex(supervertex, snapshot, vertex)
+ supervertex.subvertex[snapshot] = vertex
+ table.insert(supervertex.snapshots, snapshot)
+end
+
+---
+-- Assign a given snapshot to the superarc between two supernodes.
+-- If still no arc between those nodes exists a new edges will
+-- be created.
+-- This requires time $O(n)$ where $n$ is the number of snapshots already
+-- assigned to the given arc.
+--
+-- @param super_tail The tail of the directed arc in the supergraph.
+--
+-- @param super_head The head of the directed arc in the supergraph.
+--
+-- @param snapshot A snapshot in which both nodes are connected.
+--
+-- @return The arc which was created or updated.
+--
+function Supergraph:assignToSuperarc(super_tail, super_head, snapshot)
+ assert(self:contains(super_tail) and self:contains(super_head),
+ "tried to connect supernodes not in the supergraph")
+
+ local super_arc = self:arc(super_tail, super_head)
+ if not super_arc then
+ super_arc = self:connect(super_tail, super_head)
+ end
+
+ table.insert(self.arc_snapshots[super_arc], snapshot)
+ self.arc_snapshots[super_arc][snapshot] = true
+
+ return super_arc
+end
+
+return Supergraph
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua
new file mode 100644
index 00000000000..2295e60513b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua
@@ -0,0 +1,196 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+local SupergraphVertexSplitOptimization = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+declare {
+ key = "split me",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disappearing",
+ type = "boolean",
+ initial = true
+}
+
+declare {
+ key = "split on disjoint neighbors",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disjoint children",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disjoint parents",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split all supervertices",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "unbound vertex splitting",
+ algorithm = SupergraphVertexSplitOptimization,
+ phase = "supergraph optimization",
+ phase_default = true,
+ summary = [["
+ Use this key if you want to disable animations.
+ Instead of producing animations the evolving graph animation phasephase animates all vertices including movements and
+ fade in or fade out animations.
+ "]],
+ documentation = [["
+ See ToDo
+ "]]
+}
+
+
+
+-- Helpfunctions
+
+
+-- Implementation
+
+function SupergraphVertexSplitOptimization:run()
+ local supergraph = assert(self.supergraph, "no supergraph passed")
+
+ local split_on_dissapearing = self.digraph.options["split on disappearing"]
+ local split_on_no_common_neighbor = self.digraph.options["split on disjoint neighbors"]
+ local split_on_no_common_child = self.digraph.options["split on disjoint children"]
+ local split_on_no_common_parent = self.digraph.options["split on disjoint parents"]
+ local split_all = self.digraph.options["split all supervertices"]
+
+ for _, supernode in ipairs(supergraph.vertices) do
+ -- follow trace of the supernode
+ local snapshots = supergraph:getSnapshots(supernode)
+ local splitsnapshots = {}
+
+ for i=2, #snapshots do
+ local s = snapshots[i]
+ local s_prev = snapshots[i - 1]
+ local can_split = false
+
+ if supergraph:consecutiveSnapshots(s_prev, s) then
+ local v1 = supergraph:getSnapshotVertex(supernode, s_prev)
+ local v2 = supergraph:getSnapshotVertex(supernode, s)
+ local is_child1 = {}
+ local is_parent1 = {}
+ local is_neighbor1 = {}
+
+ local incoming1 = s_prev:incoming(v1)
+ local outgoing1 = s_prev:outgoing(v1)
+
+ for _,e in ipairs(incoming1) do
+ local p = supergraph:getSupervertex(e.tail)
+ if p then
+ is_parent1[p] = true
+ is_neighbor1[p] = true
+ end
+ end
+
+ for _,e in ipairs(outgoing1) do
+ local p = supergraph:getSupervertex(e.head)
+ if p then
+ is_child1[p] = true
+ is_neighbor1[p] = true
+ end
+ end
+
+ local incoming2 = s:incoming(v2)
+ local outgoing2 = s:outgoing(v2)
+
+ no_common_parent = true
+ no_common_child = true
+ no_common_neighbor = true
+ for _,e in ipairs(incoming2) do
+ local p = supergraph:getSupervertex(e.tail)
+ if p then
+ if is_neighbor1[p] then
+ no_common_neighbor = false
+ end
+ if is_parent1[p] then
+ no_common_parent = false
+ end
+ if (not no_common_neighbor) and (not no_common_parent) then
+ break
+ end
+ end
+ end
+
+ for _,e in ipairs(outgoing2) do
+ local p = supergraph:getSupervertex(e.head)
+ if p then
+ if is_neighbor1[p] then
+ no_common_neighbor = false
+ end
+ if is_child1[p] then
+ no_common_child = false
+ end
+ if (not no_common_neighbor) and (not no_common_child) then
+ break
+ end
+ end
+ end
+
+
+
+ if no_common_neighbor and split_on_no_common_neighbor then
+ can_split = true
+ --texio.write("[N@".. s.timestamp .."]")
+ end
+ if no_common_parent and split_on_no_common_parent then
+ can_split = true
+ --texio.write("[P@".. s.timestamp .."]")
+ end
+ if no_common_child and split_on_no_common_child then
+ can_split = true
+ --texio.write("[N@".. s.timestamp .."]")
+ end
+ if v2.options["split me"] then
+ can_split = true
+ end
+ else
+ can_split = true
+ --texio.write("[R@".. s.timestamp .."]")
+ end
+ if can_split or split_all then
+ table.insert(splitsnapshots, s)
+ end
+ end
+ if #splitsnapshots>0 then
+ supergraph:splitSupervertex(supernode, splitsnapshots)
+ end
+ end
+end
+
+
+
+
+-- Done
+
+return SupergraphVertexSplitOptimization
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua
new file mode 100644
index 00000000000..13d453f1fd6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua
@@ -0,0 +1,60 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed and/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+---
+
+declare {
+ key = "snapshot",
+ type = "time",
+ initial = "0s",
+ summary = "The time of the snapshot in which a PGF node should be visible.",
+ documentation = [["
+ This option defines the time in seconds when respectively in which
+ state or snapshot of the graph the PGF represents a graph node.
+"]]
+}
+
+---
+
+declare {
+ key = "supernode",
+ type = "string",
+ initial = "null",
+ summary = "A unique name for a node a given PGF node should be assigned to.",
+ documentation = [["
+ Because it should be possible that nodes can change their
+ appearance, they are represented by separate PGF nodes in each
+ snapshot. To identify PGF nodes of the same supernode we have to
+ specify this key.
+"]]
+}
+
+---
+
+declare {
+ key = "fadein time",
+ type = "time",
+ initial = "0.5s",
+ summary = [["The time in seconds it should take that a nodes will be fade in
+ when it disappears in the graph"]],
+}
+
+---
+
+declare {
+ key = "fadeout time",
+ type = "time",
+ initial = "0.5s",
+ summary = "",
+ documentation = "The same as |fadein time| but for disappearing nodes."
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua
new file mode 100644
index 00000000000..801e3808bb4
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua
@@ -0,0 +1,116 @@
+-- Copyright 2012 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+--
+
+
+local key = require 'pgf.gd.doc'.key
+local documentation = require 'pgf.gd.doc'.documentation
+local summary = require 'pgf.gd.doc'.summary
+local example = require 'pgf.gd.doc'.example
+
+
+--------------------------------------------------------------------
+key "animated tree layout"
+
+summary "This layout uses the Reingold--Tilform method for drawing trees."
+
+documentation
+[[
+A method to create layouts for evolving graphs as an SVG animation.The Reingold--Tilford method is a standard method for drawing
+trees. It is described in:
+
+The algorithm, which is based on the Reingold--Tilford algorithm and
+its implementation in |graphdrawing.trees|, is introduced in my Masthesis:
+\begin{itemize}
+\item
+ M.\ Skambath,
+ \newblock Algorithmic Drawing of Evolving Trees, Masterthesis, 2016
+\end{itemize}
+
+You can use the same known graph macros as for other graph drawing
+algorithms in Ti\emph{k}Z. In addition all keys and features that
+are available for the static tree algorithm can be used:
+
+\begin{codeexample}[animation list={1,1.5,2,2.5,3,3.5,4}]
+ \tikz \graph[animated binary tree layout,
+ nodes={draw,circle}, auto supernode,
+ ] {
+ {[when=1] 15 -> {10 -> { ,11}, 20 }},
+ {[when=2] 15 -> {10 -> {3,11}, 20 }},
+ {[when=3] 15 -> {10 -> {3, }, 20 }},
+ {[when=4] 15 -> {10 -> {3, }, 20 -> 18 }},
+ };
+\end{codeexample}
+]]
+
+
+example
+[[
+\tikz[animated binary tree layout]
+ \graph[nodes={draw,circle}, auto supernode] {
+ {[when=1] 15 -> {10 -> { ,11}, 20 }},
+ {[when=2] 15 -> {10 -> {3,11}, 20 }},
+ {[when=3] 15 -> {10 -> {3, }, 20 }},
+ {[when=4] 15 -> {10 -> {3, }, 20 -> 18 }},
+ };
+]]
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+key "animated binary tree layout"
+
+summary
+[[ A layout based on the Reingold--Tilford method for drawing
+binary trees. ]]
+
+documentation
+[[
+This key executes:
+\begin{enumerate}
+\item |animated tree layout|, thereby selecting the Reingold--Tilford method,
+\item |minimum number of children=2|, thereby ensuring the all nodes
+ have (at least) two children or none at all, and
+\end{enumerate}
+]]
+
+
+example
+[[
+]]
+
+example
+[[
+]]
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+key "extended animated binary tree layout"
+
+summary
+[[ This algorithm is similar to |animated binary tree layout|, only the
+option \texttt{missing nodes get space} is executed and the
+\texttt{significant sep} is zero. ]]
+
+example
+[[
+]]
+--------------------------------------------------------------------
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
new file mode 100644
index 00000000000..dc1e8ab571c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
@@ -0,0 +1,107 @@
+-- Copyright 2012 by Till Tantau
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+
+
+local temporallayered = {}
+
+-- Namespace
+
+--require("pgf.gd").layered = layered
+--require("pgf.gd.experimental.evolving").layered = layered
+
+-- Import
+local lib = require "pgf.gd.lib"
+local Storage = require "pgf.gd.lib.Storage"
+local layered = require "pgf.gd.layered"
+
+--
+-- This file defines some basic functions to compute and/or set the
+-- ideal distances between nodes of any kind of layered drawing of a
+-- graph.
+
+
+
+---
+-- Position nodes in layers using baselines
+--
+-- @param layers A |Storage| object assigning layers to vertices.
+-- @param paddings A |Storage| object storing the computed distances
+-- (paddings).
+-- @param graph The graph in which the nodes reside
+-- @param snapshots The list of snapshots over which the overlaying evolving
+-- graph exists
+function temporallayered.arrange_layers_by_baselines (layers, paddings, graph, snapshots, vertex_snapshots)
+ assert(vertex_snapshots, "vertex_snapshots must not be nil")
+ --local layer_vertices = Storage.newTableStorage()
+ local snapshots_layers = Storage.newTableStorage()
+ local count_layers = 0
+ -- Decompose into layers:
+ for _,v in ipairs(graph.vertices) do
+ local layer_vertices = snapshots_layers[vertex_snapshots[v]] or {}
+ if layer_vertices[layers[v]] == nil then
+ assert( layers[v], "layer of node " .. v.name .. " has not been computed.")
+ layer_vertices[layers[v]] = {}
+ end
+ table.insert(layer_vertices[layers[v]], v)
+ count_layers = math.max(count_layers, layers[v])
+ end
+
+ if count_layers > 0 then
+
+
+ -- Now compute ideal distances and store
+ local height = 0
+
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices > 0 then -- sanity check
+ for _,v in ipairs(layer_vertices[1]) do
+ v.pos.y = 0
+ end
+ end
+ end
+
+ for i=2, count_layers do
+ local distance = 0
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ distance = math.max(
+ distance,
+ layered.baseline_distance(
+ paddings,
+ s,
+ layer_vertices[i-1],
+ layer_vertices[i]))
+ end
+ end
+
+ height = height + distance
+
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ for _,v in ipairs(layer_vertices[i]) do
+ v.pos.y = height
+ end
+ end
+ end
+ end
+ end
+end
+
+
+
+
+-- Done
+
+return temporallayered
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua
new file mode 100644
index 00000000000..bb50eaf2cb5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua
@@ -0,0 +1,33 @@
+-- Copyright 2016 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+
+
+-- @library
+
+local evolving -- Library name
+
+-- Load dependencies:
+require "pgf.gd.trees.ChildSpec"
+require "pgf.gd.trees.ReingoldTilford1981"
+require "pgf.gd.layered"
+
+-- Load declarations from:
+require "pgf.gd.experimental.evolving.TimeSpec"
+require "pgf.gd.experimental.evolving.Supergraph"
+
+-- Load preprocessing/optimization phases from:
+require "pgf.gd.experimental.evolving.SupergraphVertexSplitOptimization"
+require "pgf.gd.experimental.evolving.GreedyTemporalCycleRemoval"
+
+-- Load postprocessing/graph animation phases from:
+require "pgf.gd.experimental.evolving.GraphAnimationCoordination"
+
+-- Load algorithms from:
+require "pgf.gd.experimental.evolving.Skambath2016"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
index cb30ec17914..71efda1b35d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
index c9739dcaf63..6cd46c60eb2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- A class for handling "coarse" versions of a graph. Such versions contain
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua
deleted file mode 100644
index 113f54b7ace..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua
+++ /dev/null
@@ -1,28 +0,0 @@
--- Copyright 2012 by Till Tantau
---
--- This file may be distributed an/or modified
---
--- 1. under the LaTeX Project Public License and/or
--- 2. under the GNU Public License
---
--- See the file doc/generic/pgf/licenses/LICENSE for more information
-
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
-
-
--- Imports
-local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
-
-
----
--- @section subsection {Controlling and Configuring Force-Based Algorithms}
---
--- All force-based algorithms are based on
--- a general pattern which we detail in the following. Numerous options
--- can be used to influence the behaviour of this general pattern; more
--- specific options that apply only to individual algorithms are
--- explained along with these algorithms.
---
--- @end
-
-
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
index 330f401d5b5..17cd121b85e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua
new file mode 100644
index 00000000000..6d80fff6aa6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua
@@ -0,0 +1,41 @@
+-- Copyright 2012 by Till Tantau
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+-- See the file doc/generic/pgf/licenses/LICENSE for more information
+
+-- @release $Header$
+
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+
+---
+-- @section subsection {Controlling and Configuring Force-Based Algorithms}
+--
+-- All force-based algorithms are based on
+-- a general pattern which we detail in the following. Numerous options
+-- can be used to influence the behaviour of this general pattern; more
+-- specific options that apply only to individual algorithms are
+-- explained along with these algorithms.
+--
+-- The vertices are initially laid out in a random configuration.
+-- Then the configuration is annealed to find a configuration of
+-- minimal energy. To avoid getting stuck in a local minimum or at a
+-- saddle point, random forces are added. All of this makes the final
+-- layout extremely susceptible to changes in the random numbers. To
+-- achieve a certain stability of the results, you should fix the
+-- random seed. However, in the recent past Lua has switched its
+-- random number generator, which means that you won't get the same
+-- sequence of random numbers as in a previous version, even for
+-- identical seed. If you rely on the long-term stability of vertex
+-- placement, you should consider using a different layout. With the
+-- spring layout you have to assume that the layout will be random.
+--
+-- @end
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
index d708bd6d7b7..7bd118d7b85 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
index f07f23aeac3..b845d9d1f89 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
index 2ef55169bca..9252f7b1cb8 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
index 6b93f311290..b62be10c0a5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
index 1a7d0abf25a..4e511746bb2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- An implementation of a quad trees.
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
index 54ceddcc25a..9fa709a8053 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
local SpringElectricalHu2006 = {}
@@ -97,7 +97,11 @@ function SpringElectricalHu2006:run()
-- initialize node weights
for _,node in ipairs(self.graph.nodes) do
- node.weight = node:getOption('electric charge')
+ if node:getOption('electric charge') ~= nil then
+ node.weight = node:getOption('electric charge')
+ else
+ node.weight = 1
+ end
end
-- initialize edge weights
@@ -171,7 +175,7 @@ function SpringElectricalHu2006:run()
-- set the spring length to the average edge length of the initial layout
spring_length = 0
- for _,e in ipairs(coarse_graph.graph.edges) do
+ for _,edge in ipairs(coarse_graph.graph.edges) do
spring_length = spring_length + edge.nodes[1].pos:minus(edge.nodes[2].pos):norm()
end
spring_length = spring_length / #coarse_graph.graph.edges
@@ -205,7 +209,7 @@ function SpringElectricalHu2006:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, spring_length), y = math.random(1, spring_length)}
+ local direction = Vector.new{x = lib.random(1, spring_length), y = lib.random(1, spring_length)}
local distance = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -218,7 +222,7 @@ function SpringElectricalHu2006:computeInitialLayout(graph, spring_length)
-- use a random positioning technique
local function positioning_func(n)
local radius = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -518,4 +522,4 @@ end
-- done
-return SpringElectricalHu2006 \ No newline at end of file
+return SpringElectricalHu2006
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
index f8854e71618..df7dc70a745 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
index 25782bc9c3c..02fd09a72d9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
@@ -127,7 +127,11 @@ function SpringElectricalWalshaw2000:run()
-- initialize node weights
for _,node in ipairs(self.graph.nodes) do
- node.weight = node:getOption('electric charge')
+ if node:getOption('electric charge') ~= nil then
+ node.weight = node:getOption('electric charge')
+ else
+ node.weight = 1
+ end
-- a node is charged if its weight derives from the default setting
-- of 1 (where it has no influence on the forces)
@@ -212,7 +216,7 @@ function SpringElectricalWalshaw2000:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, 2), y = math.random(1, 2)}
+ local direction = Vector.new{x = lib.random(1, 2), y = lib.random(1, 2)}
local distance = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -227,7 +231,7 @@ function SpringElectricalWalshaw2000:computeInitialLayout(graph, spring_length)
-- use the random positioning technique
local function positioning_func(n)
local radius = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -513,4 +517,4 @@ end
-- done
-return SpringElectricalWalshaw2000 \ No newline at end of file
+return SpringElectricalWalshaw2000
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
index 35dc21008fb..b53bc9bff98 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
@@ -64,7 +64,6 @@ local lib = require("pgf.gd.lib")
-
function SpringHu2006:run()
-- Setup some parameters
@@ -214,7 +213,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, spring_length), y = math.random(1, spring_length)}
+ local direction = Vector.new{x = lib.random(1, spring_length), y = lib.random(1, spring_length)}
local distance = 1.8 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -226,7 +225,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length)
-- use a random positioning technique
local function positioning_func(n)
local radius = 2 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -384,4 +383,4 @@ end
-- done
-return SpringHu2006 \ No newline at end of file
+return SpringHu2006
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
index ab0126d7fcd..5554410816e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
index af3a1a62c27..be0faf465c1 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
@@ -109,7 +109,7 @@
local force -- Library name
-- Load declarations from:
-require "pgf.gd.force.Control"
+require "pgf.gd.force.ControlDeclare"
require "pgf.gd.force.ControlStart"
require "pgf.gd.force.ControlIteration"
require "pgf.gd.force.ControlSprings"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
index bd53ae4376b..df2649521b2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
index 8de6d96d48d..8dfbae44850 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua,v 1.6 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -117,6 +117,13 @@ local factors = {
[""]=1,
}
+local time_factors = {
+ s=1,
+ ms=0.001,
+ min=60,
+ h=3600
+}
+
local directions = {
down = -90,
up = 90,
@@ -157,6 +164,9 @@ function InterfaceCore.convert(s,t)
elseif t == "length" then
local num, dim = string.match(s, "([%d.]+)(.*)")
return tonumber(num) * assert(factors[dim], "unknown unit")
+ elseif t == "time" then
+ local num, dim = string.match(s, "([%d.]+)(.*)")
+ return tonumber(num) * assert(time_factors[dim], "unknown time unit")
elseif t == "string" then
return s
elseif t == "canvas coordinate" or t == "coordinate" then
@@ -178,4 +188,4 @@ end
-- Done
-return InterfaceCore \ No newline at end of file
+return InterfaceCore
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
index 0ea7bacf96a..f1b203e550c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua,v 1.18 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -283,6 +283,8 @@ end
-- a dimension like |cm| attached to it). It is the job of the display
-- layer to map this to a number in ``\TeX\ points,'' that is, to a
-- multiple of $1/72.27$th of an inch.
+-- \item |time| A ``time'' in the sense of |\pgfparsetime|. Examples
+-- are |6s| or |0.1min| or |6000ms|, all of which will map to |6|.
-- \item |string| Some text. Will be mapped to a Lua |string|.
-- \item |canvas coordinate| A position on the canvas. Will be mapped
-- to a |model.Coordinate|.
@@ -957,4 +959,4 @@ end
-- Done
-return InterfaceToAlgorithms \ No newline at end of file
+return InterfaceToAlgorithms
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
index 37db0b3d91e..2aeb2e6a7aa 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua,v 1.7 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
index a636e79b8ea..c0ddf0dc8ce 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua,v 1.14 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
index 7826e77e6ae..438925a2213 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua,v 1.2 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
index e5b4b5f1747..dd897fbe8ac 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua,v 1.2 2013/02/08 17:14:04 tantau Exp $
+--- @release $Header$
local layered = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
index 86baaf14c33..3fe3eac2552 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
index 8e5111cfb72..55207b845d3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
index deaae695246..218ecbd2099 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local CycleRemovalBergerS1990b = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
index 6ff83ceae39..ffb919b2092 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
index a2ee9c01863..b480b7c4e70 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local CycleRemovalGansnerKNV1993 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
index 649db1e54b6..c451f74116e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
index abc17477bac..40078405f90 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua,v 1.2 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
index ce0fab4efe7..3af15ad1593 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
index e941029b3d3..4a53acf8646 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local NodeRankingGansnerKNV1993 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
index 38f52f6ba7f..8aa98bd03ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local NodeRankingMinimumHeight = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
index 8b2527edd5f..228039b536f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
index 4d1e0ae47ed..3ab9596322d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
index 16e3b1653de..6bede7eb015 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
index e201de6da4a..63c43f5b14f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
index e2cb40f68b3..b790d527e3d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
index a3c03b7283e..9f681929ecb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua,v 1.3 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
index d53b0873a3f..8fa55f9cbb9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
index 3a1098d6c03..7aef0bde5fc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
index aaa7f648a51..bcd4f6cfc1e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua,v 1.6 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -209,7 +209,7 @@ function lib.random_permutation(n)
p[i] = i
end
for i=1,n-1 do
- local j = math.random(i,n)
+ local j = lib.random(i,n)
p[i], p[j] = p[i], p[j]
end
return p
@@ -394,6 +394,28 @@ function lib.ondemand(filename, table, name)
end
+
+---
+-- This implements the legacy random number generator of Lua 5.2 in
+-- pure Lua. This is needed for Lua 5.3 compatibility to obtain
+-- consitent results.
+--
+-- @param l Lower bound
+-- @param u Upper bound
+-- @return A random number
+function lib.random(l,u)
+ local r = math.random()
+ if l and u then
+ assert(l <= u)
+ return math.floor(r*(u-l+1)) + l
+ elseif l then
+ assert(1.0 <= l)
+ return math.floor(r*l) + 1.0
+ else
+ return r
+ end
+end
+
-- Done
-return lib \ No newline at end of file
+return lib
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
index aa149c3e4f9..292f9e56bf2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua,v 1.1 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
index 768a5da0ffe..564b8f6839a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
index dd5dde22e1c..aaad047c702 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
index 918c118f4b2..952f37796eb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
index a3c04ca54df..0014c94a375 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
index c617cf80d8b..05b480713b0 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
index 7b93c755c56..378800fbf5b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
index b935305893a..abb428b8725 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
index 11466c04961..dfab15697de 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
--- A Stack is a very simple wrapper around an array
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
index 525fcb4f8fc..eb520e77452 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua,v 1.4 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
@@ -107,4 +107,4 @@ end
-- Done
-return Storage \ No newline at end of file
+return Storage
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
index d477c682f60..1f81b269202 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua,v 1.2 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
index badde1bbd58..4a0130488bc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
index 5c2f10cd383..997a452399f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua,v 1.7 2015/04/21 14:10:00 tantau Exp $
+-- @release $Header$
---
@@ -31,13 +31,17 @@
-- synactic edges that ``belong'' to an edge.
--
-- In order to \emph{set} options of the edges, you can set the
--- |generate_options| field of an arc (which is |nil| by default), see
+-- |generated_options| field of an arc (which is |nil| by default), see
-- the |declare_parameter_sequence| function for the syntax. Similar
-- to the |path| field below, the options set in this table are
-- written back to the syntactic edges during a sync.
--
--- In detail, the following happens: Even though an arc has a |path|
--- field and a |generated_options| field, setting these fields does
+-- Finally, there is also an |animations| field, which, similarly to
+-- the |generated_options|, gets written back during a sync when it is
+-- not |nil|.
+--
+-- In detail, the following happens: Even though an arc has a |path|,
+-- |generated_options|, and |animations| fields, setting these fields does
-- not immediately set the paths of the syntactic edges nor does it
-- generate options. Indeed, you will normally want to setup and
-- modify the |path| field of an arc during your algorithm and only at
@@ -65,6 +69,9 @@
-- above.
-- @field generated_options If non-nil, some options to be passed back
-- to the original syntactic edges, see the description above.
+-- @field animations If non-nil, some animations to be passed back
+-- to the original syntactic edges. See the description of the
+-- |animations| field for |Vertex| for details on the syntax.
-- @field syntactic_edges In case this arc is an arc in the syntatic
-- digraph (and only then), this field contains an array containing
-- syntactic edges (``real'' edges in the syntactic digraph) that
@@ -528,6 +535,26 @@ function Arc:sync()
end
end
end
+ if self.animations then
+ local head = self.head
+ local tail = self.tail
+ local a = self.syntactic_digraph:arc(tail,head)
+ if a and #a.syntactic_edges>0 then
+ for _,e in ipairs(a.syntactic_edges) do
+ for _,o in ipairs(self.animations) do
+ e.animations[#e.animations+1] = o
+ end
+ end
+ end
+ local a = head ~= tail and self.syntactic_digraph:arc(head,tail)
+ if a and #a.syntactic_edges>0 then
+ for _,e in ipairs(a.syntactic_edges) do
+ for _,o in ipairs(self.animations) do
+ e.animations[#e.animations+1] = o
+ end
+ end
+ end
+ end
end
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
index a460e83505d..8ebb6f144cf 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua,v 1.2 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
index 8d11fe89d8f..815544ee705 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua,v 1.4 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
index f0568d13ad9..5c48059a605 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua,v 1.7 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
index a91979d0ad5..87b06661e54 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua,v 1.6 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
---
@@ -60,7 +60,10 @@
-- by the algorithm. When the edge is rendered later on, this array
-- will be passed back to the display layer. The syntax is the same as
-- for the |declare_parameter_sequence| function, see
--- |InterfaceToAlgorithms|.
+-- |InterfaceToAlgorithms|.
+--
+-- @field animations An array of animations, see the |animations|
+-- field of the |Vertex| class for the syntax.
local Edge = {}
Edge.__index = Edge
@@ -94,6 +97,7 @@ function Edge.new(values)
new[k] = v
end
new.generated_options = new.generated_options or {}
+ new.animations = new.animations or {}
if not new.path then
local p = Path.new ()
p:appendMoveto(Edge.tailAnchorForEdgePath(new))
@@ -202,4 +206,4 @@ end
-- Done
-return Edge \ No newline at end of file
+return Edge
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
index 54a373bf83f..3819e193689 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua,v 1.2 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
index 07cd78d34e1..93cd44cc218 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua,v 1.3 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
@@ -543,6 +543,10 @@ function Path:intersectionsWith(path)
local function intersect (i1, j1, i2, j2)
+ if i1 > j1 or i2 > j2 then
+ return
+ end
+
local bb1 = bb(i1, j1, memo1)
local bb2 = bb(i2, j2, memo2)
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
index ace3825e350..92dd8ad87ac 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua,v 1.2 2015/05/08 10:23:50 tantau Exp $
+-- @release $Header$
local Path = require 'pgf.gd.model.Path'
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
index f18aa43f450..c287181992f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua,v 1.6 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
---
@@ -22,7 +22,7 @@
-- be modified directly.
--
-- Note that a |Vertex| is an abstraction of \tikzname\ nodes; indeed
--- that objective is to ensure that, in principle, we can use them
+-- the objective is to ensure that, in principle, we can use them
-- independently of \TeX. For this reason, you will not find any
-- references to |tex| inside a |Vertex|; this information is only
-- available in the syntactic digraph.
@@ -91,6 +91,22 @@
--
-- @field options A table of options that contains user-defined options.
--
+-- @field animations An array of attribute animations for the
+-- node. When an algorithm adds entries to this array, the display
+-- layer should try to render these. The syntax is as follows: Each
+-- element in the array is a table with a field |attribute|, which must
+-- be a string like |"opacity"| or |"translate"|, a field |entries|,
+-- which must be an array to be explained in a moment, and field
+-- |options|, which must be a table of the same syntax as the
+-- |options| field. For the |entries| array, each element must be
+-- table with two field: |t| must be set to a number, representing a
+-- time in secondds, and |value|, which must be set to a value that
+-- the |attribute| should have at the given time. The entries and the
+-- options will then be interpreted as described in \pgfname's basic
+-- layer animation system, except that where a |\pgfpoint| is expected
+-- you provide a |Coordinate| and a where a path is expected you
+-- provide a |Path|.
+--
-- @field shape A string describing the shape of the node (like |rectangle|
-- or |circle|). Note, however, that this is more ``informative''; the
-- actual information that is used by the graph drawing system for
@@ -104,6 +120,13 @@
-- @field event The |Event| when this vertex was created (may be |nil|
-- if the vertex is not part of the syntactic digraph).
--
+-- @field incomings A table indexed by |Digraph| objects. For each
+-- digraph, the table entry is an array of all vertices from which
+-- there is an |Arc| to this vertex. This field is internal and may
+-- not only be accessed by the |Digraph| class.
+--
+-- @field outgoings Like |incomings|, but for outgoing arcs.
+--
local Vertex = {}
Vertex.__index = Vertex
@@ -137,16 +160,11 @@ local Storage = require "pgf.gd.lib.Storage"
-- \item[|path|] A |Path| object representing the vertex's hull.
-- \item[|anchors|] A table of anchors.
-- \item[|options|] An options table for the vertex.
+-- \item[|animations|] An array of generated animation attributes.
-- \item[|shape|] A string describing the shape. If not given, |"none"| is used.
-- \item[|kind|] A kind like |"node"| or |"dummy"|. If not given, |"dummy"| is used.
-- \end{description}
--
--- @field incomings A table indexed by |Digraph| objects. For each
--- digraph, the table entry is an array of all vertices from which
--- there is an |Arc| to this vertex. This field is internal and may
--- not only be accessed by the |Digraph| class.
--- @field outgoings Like |incomings|, but for outgoing arcs.
---
-- @return A newly allocated node.
--
function Vertex.new(values)
@@ -162,6 +180,7 @@ function Vertex.new(values)
new.kind = new.kind or "dummy"
new.pos = new.pos or Coordinate.new(0,0)
new.anchors = new.anchors or { center = Coordinate.new(0,0) }
+ new.animations = new.animations or {}
return setmetatable (new, Vertex)
end
@@ -274,4 +293,4 @@ end
-- Done
-return Vertex \ No newline at end of file
+return Vertex
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
index 3bc491ec093..ad62faa0f3d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
index aad6eb0a440..f7905f2418a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua,v 1.1 2012/12/17 23:53:11 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
index a06c732ed1d..f91c75a4d64 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua,v 1.12 2013/10/09 19:47:00 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
index 72bb3e904ee..95689e6379b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua,v 1.1 2015/03/12 15:58:20 tantau Exp $
+--- @release $Header$
local pedigrees = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
index 460aaaed905..df366a31687 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua,v 1.1 2015/03/12 15:58:23 tantau Exp $
+-- @release $Header$
local Koerner2015 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
index 4e6000d038f..db3d4f9cf72 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua,v 1.1 2015/03/12 15:58:23 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
index 75a78f4f478..77c66de5b2d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua,v 1.1 2013/02/08 17:14:04 tantau Exp $
+--- @release $Header$
local phylogenetics = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
index dc5dea45b0f..f1acbd71281 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
index fd0fb62b3ad..d2b64270796 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua,v 1.1 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
index a4fbc0cc3b9..8077790224a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
index 0bca7773212..d44f098161f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua,v 1.2 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
index ef0909a6d00..528110b57ea 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua,v 1.4 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
index 16356aa7cfa..f66f2553306 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua,v 1.2 2013/02/08 17:14:06 tantau Exp $
+-- @release $Header$
local PhylogeneticTree = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
index c55a7a7467c..8be5c1d51e9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua,v 1.1 2013/02/08 17:14:06 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
index 194e809ef2e..29183a57739 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua
new file mode 100644
index 00000000000..5d80de77cdd
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua
@@ -0,0 +1,6 @@
+require "pgf"
+require "pgf.gd"
+
+pgf.gd.planar = {}
+
+return pgf.gd.planar
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua
new file mode 100644
index 00000000000..f30c940a921
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua
@@ -0,0 +1,678 @@
+
+--[[
+---Data structures---
+
+Vertices from the original ugraph are referred to as input vertices.
+The tables that contain vertex data relevant to the algorithm
+are referred to as vertices.
+A vertex table may have the following keys:
+
+-sign
+1 or -1, indicates whether this and all in the depth-first search
+following vertices must be considered flipped
+(i. e. adjacency lists reversed) in respect to the dfs parent
+
+-childlist
+A linked list containing all dfs children of the vertex whose virtual roots
+have not yet been merged into the vertex, sorted by lowpoint
+
+-adjlistlinks
+A table with two fields with keys 0 and 1, containing the two half edges
+of the vertex which lie on the external face of the graph
+(if the vertex lies on the external face).
+The half edge with key 0 lies in the 0-direction of the other half edge
+and vice-versa
+The two fields may hold the same half edge, if the vertex has degree one
+
+-pertinentroots
+A linked list containing all virtual roots of this vertex that are
+pertinent during the current step
+
+-inputvertex
+The input vertex that corresponds to the vertex
+
+-dfi
+The depth-first search index (number of the step in the dfs at which
+the vertex was discovered)
+
+-dfsparent
+The depth-first search parent (vertex from which the vertex was discovered
+first in the dfs)
+
+-leastancestor
+Dfi of the vertex with lowest dfi that can be reached using one back edge
+(non-tree edge)
+
+-lowpoint
+Dfi of the vertex with lowest dfi that can be reached using any number of
+tree edges plus one back edge
+
+
+A root vertex is a virtual vertex not contained in the original ugraph.
+The root vertex represents another vertex in a biconnected component (block)
+which is a child of the biconnected component the represented vertex is in.
+The only field that it has in common with other vertices is the
+adjacency list links array:
+
+-isroot
+always true, indicates that this vertex is a virtual root
+
+-rootparent
+The vertex which this root represents
+
+-rootchild
+The only dfs child of the original vertex which is contained in the
+root verticis biconnected component
+
+-adjlistlinks
+See adjlistlinks of a normal vertex
+
+
+A half edge is a table with the following fields:
+
+-links
+A table with two fields with keys 0 and 1, containing the neighboring
+half edges in the adjacency list of the vertex these edges originate from.
+
+-target
+The vertex the half edge leads to
+
+-twin
+The twin half edge which connects the two vertices in the opposite direction
+
+-shortcircuit
+True if the half edge was inserted in order to make a short circuit for the
+algorithm. The edge will be removed at the end.
+
+The BoyerMyrvold2004 class has the following fields:
+
+-inputgraph
+The original ugraph given to the algorithm
+
+-numvertices
+The number of vertices of the graph
+
+-vertices
+The vertex table with depth-first search indices as keys
+
+-verticesbyinputvertex
+The vertex table with input vertices as keys
+
+-verticesbylowpoint
+The vertex table with low points as keys
+
+-shortcircuitedges
+An array of all short circuit half edges
+(which may not be in the original graph and will be removed at the end)
+
+--]]
+
+local BM = {}
+require("pgf.gd.planar").BoyerMyrvold2004 = BM
+
+-- imports
+local Storage = require "pgf.gd.lib.Storage"
+local LinkedList = require "pgf.gd.planar.LinkedList"
+local Embedding = require "pgf.gd.planar.Embedding"
+
+-- create class properties
+BM.__index = BM
+
+function BM.new()
+ local t = {}
+ setmetatable(t, BM)
+ return t
+end
+
+-- initializes some data structures at the beginning
+-- takes the ugraph of the layout algorithm as input
+function BM:init(g)
+ self.inputgraph = g
+ self.numvertices = #g.vertices
+ self.vertices = {}
+ self.verticesbyinputvertex = Storage.new()
+ self.verticesbylowpoint = Storage.newTableStorage()
+ self.shortcircuitedges = {}
+ for _, inputvertex in ipairs(self.inputgraph.vertices) do
+ local vertex = {
+ sign = 1,
+ childlist = LinkedList.new(),
+ adjlistlinks = {},
+ pertinentroots = LinkedList.new(),
+ inputvertex = inputvertex,
+ }
+ setmetatable(vertex, Embedding.vertexmetatable)
+ self.verticesbyinputvertex[inputvertex] = vertex
+ end
+end
+
+--[[
+local function nilmax(a, b)
+ if a == nil then return b end
+ if b == nil then return a end
+ return math.max(a, b)
+end
+
+local function nilmin(a, b)
+ if a == nil then return b end
+ if b == nil then return a end
+ return math.min(a, b)
+end
+--]]
+
+-- the depth-first search of the preprocessing
+function BM:predfs(inputvertex, parent)
+ local dfi = #self.vertices + 1
+ local vertex = self.verticesbyinputvertex[inputvertex]
+ self.vertices[dfi] = vertex
+ -- set the dfs infos in the vertex
+ vertex.dfi = dfi
+ vertex.dfsparent = parent
+ vertex.leastancestor = dfi
+ vertex.lowpoint = dfi
+ -- find neighbors
+ for _, arc in ipairs(self.inputgraph:outgoing(inputvertex)) do
+ local ninputvertex = arc.head
+ assert(ninputvertex ~= inputvertex, "Self-loop detected!")
+ local nvertex = self.verticesbyinputvertex[ninputvertex]
+ if nvertex.dfi == nil then
+ -- new vertex discovered
+ self:predfs(ninputvertex, vertex) -- recursive call
+ vertex.lowpoint = math.min(vertex.lowpoint, nvertex.lowpoint)
+ elseif parent and ninputvertex ~= parent.inputvertex then
+ -- back edge found
+ vertex.leastancestor = math.min(vertex.leastancestor, nvertex.dfi)
+ vertex.lowpoint = math.min(vertex.lowpoint, nvertex.dfi)
+ end
+ end
+ -- put vertex into lowpoint sort bucket
+ table.insert(self.verticesbylowpoint[vertex.lowpoint], vertex)
+end
+
+-- the preprocessing at the beginning of the algorithm
+-- does the depth-first search and the bucket sort for the child lists
+function BM:preprocess()
+ -- make dfs starting at an arbitrary vertex
+ self:predfs(self.inputgraph.vertices[1])
+ -- create separated child lists with bucket sort
+ for i = 1, self.numvertices do
+ for _, vertex in ipairs(self.verticesbylowpoint[i]) do
+ if vertex.dfsparent then
+ vertex.childlistelement
+ = vertex.dfsparent.childlist:addback(vertex)
+ end
+ end
+ end
+end
+
+-- adds tree edges and the corresponding virtual root vertices
+-- of the currentvertex
+function BM:add_trivial_edges(vertex)
+ -- find all dfs children
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfsparent == vertex then
+ -- create root vertex
+ local rootvertex = {
+ isroot = true,
+ rootparent = vertex,
+ rootchild = nvertex,
+ adjlistlinks = {},
+ name = tostring(vertex) .. "^" .. tostring(nvertex)
+ }
+ setmetatable(rootvertex, Embedding.vertexmetatable)
+ nvertex.parentroot = rootvertex
+ -- create half edges
+ local halfedge1 = {target = nvertex, links = {}}
+ local halfedge2 = {target = rootvertex, links = {}}
+ halfedge1.twin = halfedge2
+ halfedge2.twin = halfedge1
+ -- create circular adjacency lists
+ halfedge1.links[0] = halfedge1
+ halfedge1.links[1] = halfedge1
+ halfedge2.links[0] = halfedge2
+ halfedge2.links[1] = halfedge2
+ -- create links to adjacency lists
+ rootvertex.adjlistlinks[0] = halfedge1
+ rootvertex.adjlistlinks[1] = halfedge1
+ nvertex.adjlistlinks[0] = halfedge2
+ nvertex.adjlistlinks[1] = halfedge2
+ end
+ end
+end
+
+-- for the external face vertex which was entered through link vin
+-- returns the successor on the external face and the link through
+-- which it was entered
+local function get_successor_on_external_face(vertex, vin)
+ local halfedge = vertex.adjlistlinks[1 - vin]
+ local svertex = halfedge.target
+ local sin
+ if vertex.adjlistlinks[0] == vertex.adjlistlinks[1] then
+ sin = vin
+ elseif svertex.adjlistlinks[0].twin == halfedge then
+ sin = 0
+ else
+ sin = 1
+ end
+ return svertex, sin
+end
+
+-- the "walkup", used to identify the pertinent subgraph,
+-- i. e. the subgraph that contains end points of backedges
+-- for one backedge this function will mark all virtual roots
+-- as pertinent that lie on the path between the backedge and the current vertex
+-- backvertex: a vertex that is an endpoint of a backedge to the current vertex
+-- currentvertex: the vertex of the current step
+-- returns a root vertex of the current step, if one was found
+local function walkup(backvertex, currentvertex)
+ local currentindex = currentvertex.dfi
+ -- set the backedgeflag
+ backvertex.backedgeindex = currentindex
+ -- initialize traversal variables for both directions
+ local x, xin, y, yin = backvertex, 1, backvertex, 0
+ while x ~= currentvertex do
+ if x.visited == currentindex or y.visited == currentindex then
+ -- we found a path that already has the pertinent roots marked
+ return nil
+ end
+ -- mark vertices as visited for later calls
+ x.visited = currentindex
+ y.visited = currentindex
+
+ -- check for rootvertex
+ local rootvertex
+ if x.isroot then
+ rootvertex = x
+ elseif y.isroot then
+ rootvertex = y
+ end
+ if rootvertex then
+ local rootchild = rootvertex.rootchild
+ local rootparent = rootvertex.rootparent
+ if rootvertex.rootparent == currentvertex then
+ -- we found the other end of the back edge
+ return rootvertex
+ elseif rootchild.lowpoint < currentindex then
+ -- the block we just traversed is externally active
+ rootvertex.pertinentrootselement
+ = rootparent.pertinentroots:addback(rootvertex)
+ else
+ -- the block we just traversed is internally active
+ rootvertex.pertinentrootselement
+ = rootparent.pertinentroots:addfront(rootvertex)
+ end
+ -- jump to parent block
+ x, xin, y, yin = rootvertex.rootparent, 1, rootvertex.rootparent, 0
+ else
+ -- just continue on the external face
+ x, xin = get_successor_on_external_face(x, xin)
+ y, yin = get_successor_on_external_face(y, yin)
+ end
+ end
+end
+
+-- inverts the adjacency of a vertex
+-- i. e. reverses the order of the adjacency list and flips the links
+local function invert_adjacency(vertex)
+ -- reverse the list
+ for halfedge in Embedding.adjacency_iterator(vertex.adjlistlinks[0]) do
+ halfedge.links[0], halfedge.links[1]
+ = halfedge.links[1], halfedge.links[0]
+ end
+ -- flip links
+ vertex.adjlistlinks[0], vertex.adjlistlinks[1]
+ = vertex.adjlistlinks[1], vertex.adjlistlinks[0]
+end
+
+-- merges two blocks by merging the virtual root of the child block
+-- into it's parent, while making sure the external face stays consistent
+-- by flipping the root block if needed
+-- mergeinfo contains four fields:
+-- root - the virtual root vertex
+-- parent - it's parent
+-- rout - the link of the root through which we have exited it
+-- during the walkdown
+-- pin - the link of the parent through which we have entered it
+-- during the walkdown
+local function mergeblocks(mergeinfo)
+ local root = mergeinfo.root
+ local parent = mergeinfo.parent
+ local rout = mergeinfo.rootout
+ local pin = mergeinfo.parentin
+ if pin == rout then
+ -- flip required
+ invert_adjacency(root)
+ root.rootchild.sign = -1
+ --rout = 1 - rout -- not needed
+ end
+
+ -- redirect edges of the root vertex
+ for halfedge in Embedding.adjacency_iterator(root.adjlistlinks[0]) do
+ halfedge.twin.target = parent
+ end
+
+ -- remove block from data structures
+ root.rootchild.parentroot = nil
+ parent.pertinentroots:remove(root.pertinentrootselement)
+ parent.childlist:remove(root.rootchild.childlistelement)
+
+ -- merge adjacency lists
+ parent.adjlistlinks[0].links[1] = root.adjlistlinks[1]
+ parent.adjlistlinks[1].links[0] = root.adjlistlinks[0]
+ root.adjlistlinks[0].links[1] = parent.adjlistlinks[1]
+ root.adjlistlinks[1].links[0] = parent.adjlistlinks[0]
+ parent.adjlistlinks[pin] = root.adjlistlinks[pin]
+end
+
+-- inserts a half edge pointing to "to" into the adjacency list of "from",
+-- replacing the link "linkindex"
+local function insert_half_edge(from, linkindex, to)
+ local halfedge = {target = to, links = {}}
+ halfedge.links[ linkindex] = from.adjlistlinks[ linkindex]
+ halfedge.links[1 - linkindex] = from.adjlistlinks[1 - linkindex]
+ from.adjlistlinks[ linkindex].links[1 - linkindex] = halfedge
+ from.adjlistlinks[1 - linkindex].links[ linkindex] = halfedge
+ from.adjlistlinks[linkindex] = halfedge
+ return halfedge
+end
+
+-- connect the vertices x and y through the links xout and yin
+-- if shortcircuit is true, the edge will be marked as a short circuit edge
+-- and removed at the end of the algorithm
+function BM:embed_edge(x, xout, y, yin, shortcircuit)
+ -- create half edges
+ local halfedgex = insert_half_edge(x, xout, y)
+ local halfedgey = insert_half_edge(y, yin, x)
+ halfedgex.twin = halfedgey
+ halfedgey.twin = halfedgex
+ -- short circuit handling
+ if shortcircuit then
+ halfedgex.shortcircuit = true
+ halfedgey.shortcircuit = true
+ table.insert(self.shortcircuitedges, halfedgex)
+ table.insert(self.shortcircuitedges, halfedgey)
+ end
+end
+
+-- returns true if the given vertex is pertinent at the current step
+local function pertinent(vertex, currentindex)
+ return vertex.backedgeindex == currentindex
+ or not vertex.pertinentroots:empty()
+end
+
+-- returns ttue if the given vertex is externally active at the current step
+local function externally_active(vertex, currentindex)
+ return vertex.leastancestor < currentindex
+ or (not vertex.childlist:empty()
+ and vertex.childlist:first().lowpoint < currentindex)
+end
+
+-- the "walkdown", which merges the pertinent subgraph and embeds
+-- back and short circuit edges
+-- childrootvertex - a root vertex of the current vertex
+-- which the walkdown will start at
+-- currentvertex - the vertex of the current step
+function BM:walkdown(childrootvertex, currentvertex)
+ local currentindex = currentvertex.dfi
+ local mergestack = {}
+ local numinsertededges = 0 -- to return the number for count check
+ -- two walkdowns into both directions
+ for vout = 0,1 do
+ -- initialize the traversal variables
+ local w, win = get_successor_on_external_face(childrootvertex, 1 - vout)
+ while w ~= childrootvertex do
+ if w.backedgeindex == currentindex then
+ -- we found a backedge endpoint
+ -- merge all pertinent roots we found
+ while #mergestack > 0 do
+ mergeblocks(table.remove(mergestack))
+ end
+ -- embed the back edge
+ self:embed_edge(childrootvertex, vout, w, win)
+ numinsertededges = numinsertededges + 1
+ w.backedgeindex = 0 -- this shouldn't be necessary
+ end
+ if not w.pertinentroots:empty() then
+ -- we found a pertinent vertex with child blocks
+ -- create merge info for the later merge
+ local mergeinfo = {}
+ mergeinfo.parent = w
+ mergeinfo.parentin = win
+ local rootvertex = w.pertinentroots:first()
+ mergeinfo.root = rootvertex
+ -- check both directions for active vertices
+ local x, xin = get_successor_on_external_face(rootvertex, 1)
+ local y, yin = get_successor_on_external_face(rootvertex, 0)
+ local xpertinent = pertinent(x, currentindex)
+ local xexternallyactive = externally_active(x, currentindex)
+ local ypertinent = pertinent(y, currentindex)
+ local yexternallyactive = externally_active(y, currentindex)
+ -- chose the direction with the best vertex
+ if xpertinent and not xexternallyactive then
+ w, win = x, xin
+ mergeinfo.rootout = 0
+ elseif ypertinent and not yexternallyactive then
+ w, win = y, yin
+ mergeinfo.rootout = 1
+ elseif xpertinent then
+ w, win = x, xin
+ mergeinfo.rootout = 0
+ else
+ w, win = y, yin
+ mergeinfo.rootout = 1
+ end
+ -- this is what the paper sais, but it might cause problems
+ -- not sure though...
+ --[[if w == x then
+ mergeinfo.rootout = 0
+ else
+ mergeinfo.rootout = 1
+ end--]]
+ table.insert(mergestack, mergeinfo)
+ elseif not pertinent(w, currentindex)
+ and not externally_active(w, currentindex) then
+ -- nothing to see here, just continue on the external face
+ w, win = get_successor_on_external_face(w, win)
+ else
+ -- this is a stopping vertex, walkdown will end here
+ -- paper puts this into the if,
+ -- but this should always be the case, i think
+ assert(childrootvertex.rootchild.lowpoint < currentindex)
+ if #mergestack == 0 then
+ -- we're in the block we started at, so we embed a back edge
+ self:embed_edge(childrootvertex, vout, w, win, true)
+ end
+ break
+ end
+ end
+ if #mergestack > 0 then
+ -- this means, there is a pertinent vertex blocked by stop vertices,
+ -- so the graph is not planar and we can skip the second walkdown
+ break
+ end
+ end
+ return numinsertededges
+end
+
+-- embeds the back edges for the current vertex
+-- walkup and walkdown are called from here
+-- returns true, if all back edges could be embedded
+function BM:add_back_edges(vertex)
+ local pertinentroots = {} -- not in the paper
+ local numbackedges = 0
+ -- find all back edges to vertices with lower dfi
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfi > vertex.dfi
+ and nvertex.dfsparent ~= vertex
+ and nvertex ~= vertex.dfsparent then
+ numbackedges = numbackedges + 1
+ -- do the walkup
+ local rootvertex = walkup(nvertex, vertex)
+ if rootvertex then
+ -- remember the root vertex the walkup found, so we don't
+ -- have to call the walkdown for all root vertices
+ -- (or even know what the root vertices are)
+ table.insert(pertinentroots, rootvertex)
+ end
+ end
+ end
+ -- for all root vertices the walkup found
+ local insertededges = 0
+ while #pertinentroots > 0 do
+ -- do the walkdown
+ insertededges = insertededges
+ + self:walkdown(table.remove(pertinentroots), vertex)
+ end
+ if insertededges ~= numbackedges then
+ -- not all back edges could be embedded -> graph is not planar
+ return false
+ end
+ return true
+end
+
+-- the depth-first search of the postprocessing
+-- flips the blocks according to the sign field
+function BM:postdfs(vertex, sign)
+ sign = sign or 1
+ local root = vertex.parentroot
+ if root then
+ sign = 1
+ else
+ sign = sign * vertex.sign
+ end
+
+ if sign == -1 then
+ -- number of flips is odd, so we need to flip here
+ invert_adjacency(vertex)
+ end
+
+ -- for all dfs children
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfsparent == vertex then
+ -- recursive call
+ self:postdfs(nvertex, sign)
+ end
+ end
+end
+
+-- the postprocessing at the end of the algorithm
+-- calls the post depth-first search,
+-- removes the short circuit edges from the adjacency lists,
+-- adjusts the links of the vertices,
+-- merges root vertices
+-- and cleans up the vertices
+function BM:postprocess()
+ -- flip components
+ self:postdfs(self.vertices[1])
+
+ -- unlink the short circuit edges
+ for _, halfedge in ipairs(self.shortcircuitedges) do
+ halfedge.links[0].links[1] = halfedge.links[1]
+ halfedge.links[1].links[0] = halfedge.links[0]
+ end
+
+ -- vertex loop
+ local rootvertices = {}
+ local edgetoface = {}
+ for _, vertex in ipairs(self.vertices) do
+ -- check for root vertex and save it
+ local root = vertex.parentroot
+ if root then
+ table.insert(rootvertices, root)
+ end
+
+ -- clean up links and create adjacency matrix
+ local link = vertex.adjlistlinks[0]
+ local adjmat = {}
+ vertex.adjmat = adjmat
+ if link then
+ -- make sure the link points to a half edge
+ -- that is no short circuit edge
+ while link.shortcircuit do
+ link = link.links[0]
+ end
+ -- create link
+ vertex.link = link
+
+ -- create adjacency matrix
+ for halfedge in Embedding.adjacency_iterator(link) do
+ setmetatable(halfedge, Embedding.halfedgemetatable)
+ local target = halfedge.target
+ if target.isroot then
+ target = target.rootparent
+ end
+ adjmat[target] = halfedge
+ end
+ end
+
+ -- clean up vertex
+ vertex.sign = nil
+ vertex.childlist = nil
+ vertex.adjlistlinks = nil
+ vertex.pertinentroots = nil
+ vertex.dfi = nil
+ vertex.dfsparent = nil
+ vertex.leastancestor = nil
+ vertex.lowpoint = nil
+ vertex.parentroot = nil
+ end
+
+ -- root vertex loop
+ for _, root in ipairs(rootvertices) do
+ -- make sure the links point to a half edges
+ -- that are no short circuit edge
+ local link = root.adjlistlinks[0]
+ while link.shortcircuit do
+ link = link.links[0]
+ end
+
+ -- merge into parent
+ local rootparent = root.rootparent
+ local parentlink = rootparent.link
+ local adjmat = rootparent.adjmat
+ for halfedge in Embedding.adjacency_iterator(link) do
+ setmetatable(halfedge, Embedding.halfedgemetatable)
+ halfedge.twin.target = rootparent
+ adjmat[halfedge.target] = halfedge
+ end
+ if parentlink == nil then
+ assert(rootparent.link == nil)
+ rootparent.link = link
+ else
+ -- merge adjacency lists
+ parentlink.links[0].links[1] = link
+ link.links[0].links[1] = parentlink
+ local tmp = link.links[0]
+ link.links[0] = parentlink.links[0]
+ parentlink.links[0] = tmp
+ end
+ end
+end
+
+-- the entry point of the algorithm
+-- returns the array of vertices
+-- the vertices now only contain the inputvertex field
+-- and a field named "link" which contains an arbitrary half edge
+-- from the respective adjacency list
+-- the adjacency lists are in a circular order in respect to the plane graph
+function BM:run()
+ self:preprocess()
+ -- main loop over all vertices from lowest dfi to highest
+ for i = self.numvertices, 1, -1 do
+ local vertex = self.vertices[i]
+ self:add_trivial_edges(vertex)
+ if not self:add_back_edges(vertex) then
+ -- graph not planar
+ return nil
+ end
+ end
+ self:postprocess()
+ local embedding = Embedding.new()
+ embedding.vertices = self.vertices
+ return embedding
+end
+
+return BM
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua
new file mode 100644
index 00000000000..50fc3672207
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua
@@ -0,0 +1,787 @@
+local E = {}
+
+require("pgf.gd.planar").Embedding = E
+
+-- includes
+local LinkedList = require("pgf.gd.planar.LinkedList")
+
+E.vertexmetatable = {
+ __tostring = function(v)
+ if v.name then
+ return v.name
+ elseif v.inputvertex then
+ return v.inputvertex.name
+ else
+ return tostring(v)
+ end
+ end
+}
+
+E.halfedgemetatable = {
+ __tostring = function(e)
+ return tostring(e.twin.target)
+ .. " -> "
+ .. tostring(e.target)
+ end
+}
+
+-- create class properties
+E.__index = E
+
+function E.new()
+ local t = {
+ vertices = {},
+ }
+ setmetatable(t, E)
+ return t
+end
+
+function E:add_vertex(name, inputvertex, virtual)
+ virtual = virtual or nil
+ local vertex = {
+ adjmat = {},
+ name = name,
+ inputvertex = inputvertex,
+ virtual = virtual,
+ }
+ setmetatable(vertex, E.vertexmetatable)
+ table.insert(self.vertices, vertex)
+ return vertex
+end
+
+function E:add_edge(v1, v2, after1, after2, virtual)
+ assert(v1.link == nil or v1 == after1.twin.target)
+ assert(v2.link == nil or v2 == after2.twin.target)
+ assert(v1.adjmat[v2] == nil)
+ assert(v2.adjmat[v1] == nil)
+
+ virtual = virtual or nil
+
+ local halfedge1 = {
+ target = v2,
+ virtual = virtual,
+ links = {},
+ }
+ local halfedge2 = {
+ target = v1,
+ virtual = virtual,
+ links = {},
+ }
+ halfedge1.twin = halfedge2
+ halfedge2.twin = halfedge1
+
+ setmetatable(halfedge1, E.halfedgemetatable)
+ setmetatable(halfedge2, E.halfedgemetatable)
+
+ if v1.link == nil then
+ v1.link = halfedge1
+ halfedge1.links[0] = halfedge1
+ halfedge1.links[1] = halfedge1
+ else
+ halfedge1.links[0] = after1.links[0]
+ after1.links[0].links[1] = halfedge1
+ halfedge1.links[1] = after1
+ after1.links[0] = halfedge1
+ end
+
+ if v2.link == nil then
+ v2.link = halfedge2
+ halfedge2.links[0] = halfedge2
+ halfedge2.links[1] = halfedge2
+ else
+ halfedge2.links[0] = after2.links[0]
+ after2.links[0].links[1] = halfedge2
+ halfedge2.links[1] = after2
+ after2.links[0] = halfedge2
+ end
+
+ v1.adjmat[v2] = halfedge1
+ v2.adjmat[v1] = halfedge2
+
+ return halfedge1, halfedge2
+end
+
+function E:remove_virtual()
+ local virtuals = {}
+ for i, v in ipairs(self.vertices) do
+ if v.virtual then
+ table.insert(virtuals, i)
+ else
+ local start = v.link
+ local current = start
+ repeat
+ current = current.links[0]
+ if current.virtual then
+ current.links[0].links[1] = current.links[1]
+ current.links[1].links[0] = current.links[0]
+ v.adjmat[current.target] = nil
+ current.target.adjmat[v] = nil
+ end
+ until current == start
+ end
+ end
+ for i = #virtuals, 1, -1 do
+ self.vertices[virtuals[i]] = self.vertices[#self.vertices]
+ table.remove(self.vertices)
+ end
+end
+
+-- for the use in for-loops
+-- iterates over the adjacency list of a vertex
+-- given a half edge to start and a direction (0 or 1, default 0)
+function E.adjacency_iterator(halfedge, direction)
+ direction = direction or 0
+ local function next_edge(startedge, prevedge)
+ if prevedge == nil then
+ return startedge
+ else
+ local nextedge = prevedge.links[direction]
+ if nextedge ~= startedge then
+ return nextedge
+ else
+ return nil
+ end
+ end
+ end
+ return next_edge, halfedge, nil
+end
+
+function E.face_iterator(halfedge, direction)
+ direction = direction or 0
+ local function next_edge(startedge, prevedge)
+ if prevedge == nil then
+ return startedge
+ else
+ local nextedge = prevedge.twin.links[1 - direction]
+ if nextedge ~= startedge then
+ return nextedge
+ else
+ return nil
+ end
+ end
+ end
+ return next_edge, halfedge, nil
+end
+
+function E:triangulate()
+ local visited = {}
+ for _, vertex in ipairs(self.vertices) do
+ for start in E.adjacency_iterator(vertex.link) do
+ if not visited[start] then
+ local prev = start
+ local beforestart = start.links[0].twin
+ local current = start.twin.links[1]
+ local next = current.twin.links[1]
+ visited[start] = true
+ visited[current] = true
+ visited[next] = true
+ while next ~= beforestart do
+ local halfedge1, halfedge2
+ if vertex ~= current.target
+ and not vertex.adjmat[current.target] then
+ halfedge1, halfedge2 = self:add_edge(
+ vertex, current.target,
+ prev, next,
+ true
+ )
+
+ prev = halfedge1
+ current = next
+ next = next.twin.links[1]
+ elseif not prev.target.adjmat[next.target] then
+ halfedge1, halfedge2 = self:add_edge(
+ prev.target, next.target,
+ current, next.twin.links[1],
+ true
+ )
+
+ current = halfedge1
+ next = halfedge2.links[1]
+ else
+ local helper = next.twin.links[1]
+ halfedge1, halfedge2 = self:add_edge(
+ current.target, helper.target,
+ next, helper.twin.links[1],
+ true
+ )
+
+ next = halfedge1
+ end
+
+ visited[next] = true
+ visited[halfedge1] = true
+ visited[halfedge2] = true
+ end
+ end
+ end
+ end
+end
+
+function E:canonical_order(v1, v2, vn)
+ local n = #self.vertices
+ local order = { v1 }
+ local marks = { [v1] = "ordered", [v2] = 0 }
+ local visited = {}
+ local vk = v1
+ local candidates = LinkedList.new()
+ local listelements = {}
+ for k = 1, n-2 do
+ for halfedge in E.adjacency_iterator(vk.link) do
+ local vertex = halfedge.target
+ if vertex ~= vn then
+ local twin = halfedge.twin
+ visited[twin] = true
+ if marks[vertex] == nil then
+ marks[vertex] = "visited"
+ elseif marks[vertex] ~= "ordered" then
+ local neighbor1 = visited[twin.links[0]]
+ local neighbor2 = visited[twin.links[1]]
+ if marks[vertex] == "visited" then
+ if neighbor1 or neighbor2 then
+ marks[vertex] = 1
+ listelements[vertex] = candidates:addback(vertex)
+ else
+ marks[vertex] = 2
+ end
+ else
+ if neighbor1 == neighbor2 then
+ if neighbor1 and neighbor2 then
+ marks[vertex] = marks[vertex] - 1
+ else
+ marks[vertex] = marks[vertex] + 1
+ end
+ if marks[vertex] == 1 then
+ listelements[vertex]
+ = candidates:addback(vertex)
+ elseif listelements[vertex] then
+ candidates:remove(listelements[vertex])
+ listelements[vertex] = nil
+ end
+ end
+ end
+ end
+ end
+ end
+ vk = candidates:popfirst()
+ order[k+1] = vk
+ marks[vk] = "ordered"
+ end
+ order[n] = vn
+ return order
+end
+
+function E:get_biggest_face()
+ local number = 0
+ local edge
+ local visited = {}
+ for _, vertex in ipairs(self.vertices) do
+ for start in E.adjacency_iterator(vertex.link) do
+ local count = 0
+ if not visited[start] then
+ visited[start] = true
+ local current = start
+ repeat
+ count = count + 1
+ current = current.twin.links[1]
+ until current == start
+ if count > number then
+ number = count
+ edge = start
+ end
+ end
+ end
+ end
+ return edge, number
+end
+
+function E:surround_by_triangle(faceedge, facesize)
+ local divisor = 3
+ if facesize > 3 then
+ divisor = 4
+ end
+ local basenodes = math.floor(facesize / divisor)
+ local extranodes = facesize % divisor
+ local attachnodes = { basenodes, basenodes, basenodes }
+ if facesize > 3 then
+ attachnodes[2] = basenodes * 2
+ end
+ for i = 1,extranodes do
+ attachnodes[i] = attachnodes[i] + 1
+ end
+
+ local v = {
+ self:add_vertex("$v_1$", nil, true),
+ self:add_vertex("$v_n$", nil, true),
+ self:add_vertex("$v_2$", nil, true)
+ }
+ for i = 1,3 do
+ local currentv = v[i]
+ local nextv = v[i % 3 + 1]
+ self:add_edge(currentv, nextv, currentv.link, nextv.link, true)
+ end
+
+ local current = faceedge
+ local next = current.twin.links[1]
+ for i = 1,3 do
+ local vertex = v[i]
+ local otheredge = vertex.adjmat[v[i % 3 + 1]]
+ local previnserted = otheredge.links[1]
+ for count = 1, attachnodes[i] do
+ if not vertex.adjmat[current.target] then
+ previnserted, _ = self:add_edge(vertex, current.target,
+ previnserted, next,
+ true
+ )
+ end
+
+ current = next
+ next = next.twin.links[1]
+ end
+ if not vertex.adjmat[current.target] then
+ previnserted, _ = self:add_edge(
+ vertex, current.target,
+ previnserted, next,
+ true
+ )
+ current = previnserted
+ end
+ end
+ return v[1], v[3], v[2]
+end
+
+function E:improve()
+ local pairdata = {}
+ local inpair = {}
+ for i, v1 in ipairs(self.vertices) do
+ for j = i + 1, #self.vertices do
+ local v2 = self.vertices[j]
+ local pd = self:find_pair_components(v1, v2)
+ if pd then
+ inpair[v1] = true
+ inpair[v2] = true
+ table.insert(pairdata, pd)
+ end
+ end
+ if not inpair[v1] then
+ local pd = self:find_pair_components(v1, nil)
+ if pd then
+ inpair[v1] = true
+ table.insert(pairdata, pd)
+ end
+ end
+ end
+
+ local changed
+ local runs = 1
+ local edgepositions = {}
+ repeat
+ changed = false
+ for i, pd in ipairs(pairdata) do
+ self:improve_separation_pair(pd)
+ end
+ -- check for changes
+ for i, v in ipairs(self.vertices) do
+ local start = v.link
+ local current = start
+ local counter = 1
+ repeat
+ if counter ~= edgepositions[current] then
+ changed = true
+ edgepositions[current] = counter
+ end
+ counter = counter + 1
+ current = current.links[0]
+ until current == start
+ end
+ runs = runs + 1
+ until changed == false or runs > 100
+end
+
+function E:find_pair_components(v1, v2)
+ local visited = {}
+ local companchors = {}
+ local edgecomps = {}
+ local compvertices = {}
+ local islinear = {}
+ local edgeindices = {}
+
+ local pair = { v1, v2 }
+ local start = v1.link
+ local current = start
+ local edgeindex = 1
+ -- start searches from v1
+ repeat
+ edgeindices[current] = edgeindex
+ edgeindex = edgeindex + 1
+ if not edgecomps[current] then
+ local compindex = #companchors + 1
+ local ca, il
+ edgecomps[current] = compindex
+ compvertices[compindex] = {}
+ local target = current.target
+ if target == v2 then
+ edgecomps[current.twin] = compindex
+ ca = 3
+ il = true
+ else
+ ca, il = self:component_dfs(
+ target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices[compindex],
+ compindex
+ )
+ end
+ companchors[compindex] = ca
+ islinear[compindex] = il
+ end
+ current = current.links[0]
+ until current == start
+
+ if v2 then
+ start = v2.link
+ current = start
+ local lastincomp = true
+ local edgeindex = 1
+ -- now find the remaining blocks at v2
+ repeat
+ edgeindices[current] = edgeindex
+ edgeindex = edgeindex + 1
+ if not edgecomps[current] then
+ local compindex = #companchors + 1
+ edgecomps[current] = compindex
+ compvertices[compindex] = {}
+ self:component_dfs(
+ current.target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices[compindex],
+ compindex
+ )
+ companchors[compindex] = 2
+ end
+ current = current.links[0]
+ until current == start
+ end
+
+ -- init compedges, tricomps, twocomps
+ local tricomps = {}
+ local twocomps = {{}, {}}
+ for i, anchors in ipairs(companchors) do
+ if anchors == 3 then
+ table.insert(tricomps, i)
+ else
+ table.insert(twocomps[anchors], i)
+ end
+ end
+
+ local flipimmune = #tricomps == 2
+ and (islinear[tricomps[1]] or islinear[tricomps[2]])
+ if (#tricomps < 2 or flipimmune)
+ and (v2 ~= nil or #twocomps[1] < 2) then
+ return nil
+ end
+
+ -- order tri comps cyclic
+ local function sorter(a, b)
+ return #compvertices[a] < #compvertices[b]
+ end
+
+ table.sort(tricomps, sorter)
+
+ -- determine order of comps
+ local numtricomps = #tricomps
+ local comporder = { {}, {} }
+ local bottom = math.ceil(numtricomps / 2)
+ local top = bottom + 1
+ for i, comp in ipairs(tricomps) do
+ if i % 2 == 1 then
+ comporder[1][bottom] = comp
+ comporder[2][numtricomps - bottom + 1] = comp
+ bottom = bottom - 1
+ else
+ comporder[1][top] = comp
+ comporder[2][numtricomps - top + 1] = comp
+ top = top + 1
+ end
+ end
+
+ local pairdata = {
+ pair = pair,
+ companchors = companchors,
+ edgecomps = edgecomps,
+ edgeindices = edgeindices,
+ compvertices = compvertices,
+ tricomps = tricomps,
+ twocomps = twocomps,
+ comporder = comporder,
+ }
+ return pairdata
+end
+
+function E:component_dfs(v, pair, visited, edgecomps, compvertices, compindex)
+ visited[v] = true
+ local start = v.link
+ local current = start
+ local companchors = 1
+ local numedges = 0
+ local islinear = true
+ table.insert(compvertices, v)
+ repeat
+ numedges = numedges + 1
+ local target = current.target
+ if target == pair[1] or target == pair[2] then
+ edgecomps[current.twin] = compindex
+ if target == pair[2] then
+ companchors = 3
+ end
+ elseif not visited[target] then
+ local ca, il = self:component_dfs(
+ target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices,
+ compindex
+ )
+ if ca == 3 then
+ companchors = 3
+ end
+ islinear = islinear and il
+ end
+ current = current.links[0]
+ until current == start
+ return companchors, islinear and numedges == 2
+end
+
+function E:improve_separation_pair(pairdata)
+ local pair = pairdata.pair
+ local companchors = pairdata.companchors
+ local edgecomps = pairdata.edgecomps
+ local edgeindices = pairdata.edgeindices
+ local compvertices = pairdata.compvertices
+ local tricomps = pairdata.tricomps
+ local twocomps = pairdata.twocomps
+ local comporder = pairdata.comporder
+ local v1 = pair[1]
+ local v2 = pair[2]
+
+ local compedges = {}
+ for i = 1, #companchors do
+ compedges[i] = {{}, {}}
+ end
+
+ local numtricomps = #tricomps
+ local numtwocomps = { #twocomps[1], #twocomps[2] }
+
+ -- find compedges
+ for i = 1, #pair do
+ -- first find an edge that is the first of a triconnected component
+ local start2
+ if v2 then
+ start = pair[i].link
+ current = start
+ local last
+ repeat
+ local comp = edgecomps[current]
+ if companchors[comp] == 3 then
+ if last == nil then
+ last = comp
+ elseif last ~= comp then
+ start2 = current
+ break
+ end
+ end
+ current = current.links[0]
+ until current == start
+ else
+ start2 = pair[i].link
+ end
+ -- now list the edges by components
+ current = start2
+ repeat
+ table.insert(compedges[edgecomps[current]][i], current)
+ current = current.links[0]
+ until current == start2
+ end
+
+ -- count edges on each side of tri comps
+ local edgecount = {}
+ for _, comp in ipairs(tricomps) do
+ edgecount[comp] = {}
+ for i = 1, #pair do
+ local count = 1
+ local current = compedges[comp][i][1]
+ local other = pair[3 - i]
+ while current.target ~= other do
+ count = count + 1
+ current = current.twin.links[0]
+ end
+ edgecount[comp][i] = count
+ end
+ end
+
+ -- determine which comps have to be flipped
+ local flips = {}
+ local numflips = 0
+ local allflipped = true
+ for i, comp in ipairs(comporder[1]) do
+ local side1, side2
+ if i > numtricomps / 2 then
+ side1 = edgecount[comp][1]
+ side2 = edgecount[comp][2]
+ else
+ side1 = edgecount[comp][2]
+ side2 = edgecount[comp][1]
+ end
+ if side1 > side2 then
+ numflips = numflips + 1
+ flips[comp] = true
+ elseif side1 < side2 then
+ allflipped = false
+ end
+ end
+
+ if allflipped then
+ for i, comp in ipairs(tricomps) do
+ flips[comp] = false
+ end
+ else
+ for i, comp in ipairs(tricomps) do
+ if flips[comp] then
+ for _, v in ipairs(compvertices[comp]) do
+ local start = v.link
+ local current = start
+ repeat
+ current.links[0], current.links[1]
+ = current.links[1], current.links[0]
+ current = current.links[1]
+ until current == start
+ end
+ end
+ end
+ end
+
+ -- order edges cyclic per component (one cycle for all tri comps)
+ for i = 1, #pair do
+ if v2 then
+ local co
+ if allflipped then
+ co = comporder[3 - i]
+ else
+ co = comporder[i]
+ end
+
+ local id = co[numtricomps]
+ lastedges = compedges[id][i]
+ if flips[id] then
+ lastedge = lastedges[1]
+ else
+ lastedge = lastedges[#lastedges]
+ end
+
+ -- tri comps
+ for _, id in ipairs(co) do
+ local edges = compedges[id][i]
+ local from
+ local to
+ local step
+ if flips[id] then
+ from = #edges
+ to = 1
+ step = -1
+ else
+ from = 1
+ to = #edges
+ step = 1
+ end
+ for k = from, to, step do
+ local edge = edges[k]
+ lastedge.links[0] = edge
+ edge.links[1] = lastedge
+ lastedge = edge
+ end
+ end
+ end
+
+ -- two comps
+ for _, id in ipairs(twocomps[i]) do
+ lastedges = compedges[id][i]
+ lastedge = lastedges[#lastedges]
+ for _, edge in ipairs(compedges[id][i]) do
+ lastedge.links[0] = edge
+ edge.links[1] = lastedge
+ lastedge = edge
+ end
+ end
+ end
+
+ -- now merge the cycles
+ for i = 1, #pair do
+ local outeredges = {}
+ -- find the biggest face of the tri comps
+ if v2 then
+ local biggestedge
+ local biggestsize
+ local biggestindex
+ local start = compedges[tricomps[1]][i][1]
+ local current = start
+ repeat
+ local size = self:get_face_size(current)
+ if not biggestedge or size > biggestsize
+ or (size == biggestsize
+ and edgeindices[current] > biggestindex) then
+ biggestedge = current
+ biggestsize = size
+ biggestindex = edgeindices[current]
+ end
+ current = current.links[0]
+ until current == start
+ outeredges[1] = biggestedge
+ end
+
+ -- now for every two comp
+ for _, id in ipairs(twocomps[i]) do
+ local biggestedge
+ local biggestsize
+ local biggestindex
+ local start = compedges[id][i][1]
+ local current = start
+ repeat
+ local size = self:get_face_size(current)
+ if not biggestedge or size > biggestsize
+ or (size == biggestsize
+ and edgeindices[current] > biggestindex) then
+ biggestedge = current
+ biggestsize = size
+ biggestindex = edgeindices[current]
+ end
+ current = current.links[0]
+ until current == start
+ table.insert(outeredges, biggestedge)
+ end
+
+ -- now merge all comps at the outer edges
+ local lastedge = outeredges[#outeredges].links[0]
+ for _, edge in ipairs(outeredges) do
+ local nextlastedge = edge.links[0]
+ lastedge.links[1] = edge
+ edge.links[0] = lastedge
+ lastedge = nextlastedge
+ end
+ end
+end
+
+function E:get_face_size(halfedge)
+ local size = 0
+ local current = halfedge
+ repeat
+ size = size + 1
+ current = current.twin.links[1]
+ until current == halfedge
+ return size
+end
+
+return E
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua
new file mode 100644
index 00000000000..99a23501858
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua
@@ -0,0 +1,88 @@
+local LinkedList = {}
+
+LinkedList.__index = LinkedList
+
+function LinkedList.new()
+ local list = {elements = {}}
+ setmetatable(list, LinkedList)
+ return list
+end
+
+function LinkedList:addback(payload)
+ if payload == nil then
+ error("Need a payload!", 2)
+ end
+ local element = { payload = payload }
+ if self.head then
+ local tail = self.head.prev
+ self.head.prev = element
+ tail.next = element
+ element.next = self.head
+ element.prev = tail
+ else
+ self.head = element
+ element.next = element
+ element.prev = element
+ end
+ self.elements[element] = true
+ return element
+end
+
+function LinkedList:addfront(payload)
+ self.head = self:addback(payload)
+ return self.head
+end
+
+function LinkedList:remove(element)
+ if self.elements[element] == nil then
+ error("Element not in list!", 2)
+ end
+ if self.head == element then
+ if element.next == element then
+ self.head = nil
+ else
+ self.head = element.next
+ end
+ end
+ element.prev.next = element.next
+ element.next.prev = element.prev
+ self.elements[element] = nil
+end
+
+function LinkedList:popfirst()
+ if self.head == nil then
+ return nil
+ end
+ local element = self.head
+ if element.next == element then
+ self.head = nil
+ else
+ self.head = element.next
+ element.next.prev = element.prev
+ element.prev.next = element.next
+ end
+ self.elements[element] = nil
+ return element.payload
+end
+
+function LinkedList:poplast()
+ if self.head == nil then
+ return nil
+ end
+ self.head = self.head.prev
+ return self:popfirst()
+end
+
+function LinkedList:first()
+ return self.head and self.head.payload
+end
+
+function LinkedList:last()
+ return self.head and self.head.prev.payload
+end
+
+function LinkedList:empty()
+ return self.head == nil
+end
+
+return LinkedList
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua
new file mode 100644
index 00000000000..564216a8c37
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua
@@ -0,0 +1,49 @@
+local List = {}
+
+List.__index = List
+
+function List.new()
+ local t = {first = 0, last = -1}
+ setmetatable(t, List)
+ return t
+end
+
+function List:pushleft(value)
+ local first = self.first - 1
+ self.first = first
+ self[first] = value
+end
+
+function List:pushright(value)
+ local last = self.last + 1
+ self.last = last
+ self[last] = value
+end
+
+function List:popleft()
+ local first = self.first
+ if first > self.last then error("List is empty") end
+ local value = self[first]
+ self[first] = nil
+ self.first = first + 1
+ return value
+end
+
+function List:popright()
+ local last = self.last
+ if self.first > last then error("List is empty") end
+ local value = self[last]
+ self[last] = nil
+ self.last = last - 1
+ return value
+end
+
+function List:size()
+ return self.last - self.first + 1
+end
+
+function List:empty()
+ return self.last < self.first
+end
+
+return List
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua
new file mode 100644
index 00000000000..fbf94a52502
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua
@@ -0,0 +1,576 @@
+
+local PDP = {}
+require("pgf.gd.planar").PDP = PDP
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local Storage = require "pgf.gd.lib.Storage"
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Path = require "pgf.gd.model.Path"
+---
+PDP.__index = PDP
+
+function PDP.new(ugraph, embedding,
+ delta, gamma, coolingfactor,
+ expiterations,
+ startrepexp, endrepexp,
+ startattexp, endattexp,
+ appthreshold, stretchthreshold,
+ stresscounterthreshold,
+ numdivisions)
+ local t = {
+ ugraph = ugraph,
+ embedding = embedding,
+ delta = delta ,
+ gamma = gamma,
+ coolingfactor = coolingfactor,
+ expiterations = expiterations,
+ startrepexp = startrepexp,
+ endrepexp = endrepexp,
+ startattexp = startattexp,
+ endattexp = endattexp,
+ appthreshold = appthreshold,
+ stretchthreshold = stretchthreshold,
+ stresscounterthreshold = stresscounterthreshold,
+ numdivisions = numdivisions,
+ posxs = {},
+ posys = {},
+ cvsxs = {},
+ cvsys = {},
+ embeddingedges = {},
+ edgeids = {},
+ numedgeids = 0,
+ vertexids = {},
+ numvertexids = 0,
+ vertexpairs1 = {},
+ vertexpairs2 = {},
+ pairconnected = {},
+ edgepairsvertex = {},
+ edgepairsedge = {},
+ edgevertex1 = {},
+ edgevertex2 = {},
+ edgedeprecated = {},
+ subdivisionedges = {},
+ subdivisionvertices = {},
+ temperature = 1,
+ }
+
+ setmetatable(t, PDP)
+ return t
+end
+
+function PDP:run()
+ self:normalize_size()
+ self:find_force_pairs()
+
+ local delta = self.delta
+ local gamma = self.gamma
+ local coolingfactor = self.coolingfactor
+ local expiterations = self.expiterations
+ local startrepexp = self.startrepexp
+ local endattexp = self.endattexp
+ local startattexp = self.startattexp
+ local endrepexp = self.endrepexp
+
+ local vertexpairs1 = self.vertexpairs1
+ local vertexpairs2 = self.vertexpairs2
+ local pairconnected = self.pairconnected
+ local edgepairsvertex = self.edgepairsvertex
+ local edgepairsedge = self.edgepairsedge
+ local edgevertex1 = self.edgevertex1
+ local edgevertex2 = self.edgevertex2
+ local edgedeprecated = self.edgedeprecated
+
+ local forcexs = {}
+ local forceys = {}
+ local posxs = self.posxs
+ local posys = self.posys
+ local cvsxs = self.cvsxs
+ local cvsys = self.cvsys
+ local numcvs = {}
+ for i, v in ipairs(self.embedding.vertices) do
+ cvsxs[i] = {}
+ cvsys[i] = {}
+ posxs[i] = v.inputvertex.pos.x
+ posys[i] = v.inputvertex.pos.y
+ end
+
+ local numorigvertices = self.numvertexids
+ local numorigedges = self.numedgeids
+ local numdivisions = self.numdivisions
+ local divdelta = delta / (numdivisions + 1)
+ local stresscounter = {}
+ for i = 1, self.numedgeids do
+ stresscounter[i] = 0
+ end
+
+ local appthreshold = self.appthreshold
+ local stretchthreshold = self.stretchthreshold
+ local stresscounterthreshold = self.stresscounterthreshold
+
+ for i = 1, numorigedges do
+ local iv1 = self.embedding.vertices[edgevertex1[i]].inputvertex
+ local iv2 = self.embedding.vertices[edgevertex2[i]].inputvertex
+ local arc = self.ugraph:arc(iv1, iv2)
+ --TODO subdivide edge if desired
+ --self:subdivide_edge(i)
+ end
+
+ -- main loop
+ local iteration = 0
+ repeat
+ iteration = iteration + 1
+ local temperature = self.temperature
+ local ratio = math.min(1, iteration / expiterations)
+ local repexp = startrepexp + (endrepexp - startrepexp) * ratio
+ local attexp = startattexp + (endattexp - startattexp) * ratio
+ for i = 1, self.numvertexids do
+ forcexs[i] = 0
+ forceys[i] = 0
+ numcvs[i] = 0
+ end
+ -- vertex-vertex forces
+ for i = 1, #vertexpairs1 do
+ local id1 = vertexpairs1[i]
+ local id2 = vertexpairs2[i]
+ local diffx = posxs[id2] - posxs[id1]
+ local diffy = posys[id2] - posys[id1]
+ local dist2 = diffx * diffx + diffy * diffy
+ local dist = math.sqrt(dist2)
+ local dirx = diffx / dist
+ local diry = diffy / dist
+ assert(dist ~= 0)
+
+ local useddelta = delta
+ local hasdivvertex = id1 > numorigvertices or id2 > numorigvertices
+
+ -- calculate attractive force
+ if pairconnected[i] then
+ if hasdivvertex then
+ useddelta = divdelta
+ end
+ local mag = (dist / useddelta) ^ attexp * useddelta
+ local fax = mag * dirx
+ local fay = mag * diry
+ forcexs[id1] = forcexs[id1] + fax
+ forceys[id1] = forceys[id1] + fay
+ forcexs[id2] = forcexs[id2] - fax
+ forceys[id2] = forceys[id2] - fay
+ elseif hasdivvertex then
+ useddelta = gamma
+ end
+
+ -- calculate repulsive force
+ local mag = (useddelta / dist) ^ repexp * useddelta
+ local frx = mag * dirx
+ local fry = mag * diry
+ forcexs[id1] = forcexs[id1] - frx
+ forceys[id1] = forceys[id1] - fry
+ forcexs[id2] = forcexs[id2] + frx
+ forceys[id2] = forceys[id2] + fry
+ end
+
+ -- edge-vertex forces and collisions
+ for i = 1, #edgepairsvertex do
+ local edgeid = edgepairsedge[i]
+ if not edgedeprecated[edgeid] then
+ local id1 = edgepairsvertex[i]
+ local id2 = edgevertex1[edgeid]
+ local id3 = edgevertex2[edgeid]
+ assert(id2 ~= id1 and id3 ~= id1)
+
+ local abx = posxs[id3] - posxs[id2]
+ local aby = posys[id3] - posys[id2]
+ local dab2 = abx * abx + aby * aby
+ local dab = math.sqrt(dab2)
+ assert(dab ~= 0)
+ local abnx = abx / dab
+ local abny = aby / dab
+ local avx = posxs[id1] - posxs[id2]
+ local avy = posys[id1] - posys[id2]
+ local daiv = abnx * avx + abny * avy
+ local ivx = posxs[id2] + abnx * daiv
+ local ivy = posys[id2] + abny * daiv
+ local vivx = ivx - posxs[id1]
+ local vivy = ivy - posys[id1]
+ local dviv2 = vivx * vivx + vivy * vivy
+ local dviv = math.sqrt(dviv2)
+ local afactor, bfactor = 1, 1
+ local cvx
+ local cvy
+ if daiv < 0 then
+ cvx = -avx / 2
+ cvy = -avy / 2
+ local norm2 = cvx * cvx + cvy * cvy
+ bfactor = 1 + (cvx * abx + cvy * aby) / norm2
+ elseif daiv > dab then
+ cvx = (abx - avx) / 2
+ cvy = (aby - avy) / 2
+ local norm2 = cvx * cvx + cvy * cvy
+ afactor = 1 - (cvx * abx + cvy * aby) / norm2
+ else
+ if edgeid < numorigedges
+ and dviv < gamma * appthreshold
+ and dab > delta * stretchthreshold then
+ stresscounter[edgeid] = stresscounter[edgeid] + 1
+ end
+ assert(dviv > 0)
+ cvx = vivx / 2
+ cvy = vivy / 2
+ -- calculate edge repulsive force
+ local dirx = -vivx / dviv
+ local diry = -vivy / dviv
+ local mag = (gamma / dviv) ^ repexp * gamma
+ local fex = mag * dirx
+ local fey = mag * diry
+ local abratio = daiv / dab
+ forcexs[id1] = forcexs[id1] + fex
+ forceys[id1] = forceys[id1] + fey
+ forcexs[id2] = forcexs[id2] - fex * (1 - abratio)
+ forceys[id2] = forceys[id2] - fey * (1 - abratio)
+ forcexs[id3] = forcexs[id3] - fex * abratio
+ forceys[id3] = forceys[id3] - fey * abratio
+ end
+ local nv = numcvs[id1] + 1
+ local na = numcvs[id2] + 1
+ local nb = numcvs[id3] + 1
+ numcvs[id1] = nv
+ numcvs[id2] = na
+ numcvs[id3] = nb
+ cvsxs[id1][nv] = cvx
+ cvsys[id1][nv] = cvy
+ cvsxs[id2][na] = -cvx * afactor
+ cvsys[id2][na] = -cvy * afactor
+ cvsxs[id3][nb] = -cvx * bfactor
+ cvsys[id3][nb] = -cvy * bfactor
+ end
+ end
+
+ -- clamp forces
+ local scalefactor = 1
+ local collision = false
+ for i = 1, self.numvertexids do
+ local forcex = forcexs[i]
+ local forcey = forceys[i]
+ forcex = forcex * temperature
+ forcey = forcey * temperature
+ forcexs[i] = forcex
+ forceys[i] = forcey
+ local forcenorm2 = forcex * forcex + forcey * forcey
+ local forcenorm = math.sqrt(forcenorm2)
+ scalefactor = math.min(scalefactor, delta * 3 * temperature / forcenorm)
+ local cvys = cvsys[i]
+ for j, cvx in ipairs(cvsxs[i]) do
+ local cvy = cvys[j]
+ local cvnorm2 = cvx * cvx + cvy * cvy
+ local cvnorm = math.sqrt(cvnorm2)
+ local projforcenorm = (cvx * forcex + cvy * forcey) / cvnorm
+ if projforcenorm > 0 then
+ local factor = cvnorm * 0.9 / projforcenorm
+ if factor < scalefactor then
+ scalefactor = factor
+ collision = true
+ end
+ end
+ end
+ end
+ local moved = false
+ for i = 1, self.numvertexids do
+ local forcex = forcexs[i] * scalefactor
+ local forcey = forceys[i] * scalefactor
+ posxs[i] = posxs[i] + forcex
+ posys[i] = posys[i] + forcey
+ local forcenorm2 = forcex * forcex + forcey * forcey
+ if forcenorm2 > 0.0001 * delta * delta then moved = true end
+ end
+
+ -- subdivide stressed edges
+ if numdivisions > 0 then
+ for i = 1, numorigedges do
+ if stresscounter[i] > stresscounterthreshold then
+ self:subdivide_edge(i)
+ stresscounter[i] = 0
+ end
+ end
+ end
+ self.temperature = self.temperature * coolingfactor
+ until not collision and not moved
+ print("\nfinished PDP after " .. iteration .. " iterations")
+
+ -- write the positions back
+ for i, v in ipairs(self.embedding.vertices) do
+ v.inputvertex.pos.x = posxs[i]
+ v.inputvertex.pos.y = posys[i]
+ end
+
+ -- route the edges
+ for i = 1, self.numedgeids do
+ if self.subdivisionvertices[i] then
+ local iv1 = self.embedding.vertices[self.edgevertex1[i]].inputvertex
+ local iv2 = self.embedding.vertices[self.edgevertex2[i]].inputvertex
+ local arc = self.ugraph:arc(iv1, iv2)
+ local p = Path.new()
+ p:appendMoveto(arc.tail.pos:clone())
+ for _, vid in ipairs(self.subdivisionvertices[i]) do
+ p:appendLineto(self.posxs[vid], self.posys[vid])
+ end
+ p:appendLineto(arc.head.pos:clone())
+ arc.path = p
+ end
+ end
+end
+
+function PDP:subdivide_edge(edgeid)
+ assert(self.subdivisionedges[edgeid] == nil)
+ local numdivisions = self.numdivisions
+ local subdivisionedges = {}
+ local subdivisionvertices = {}
+ local id1 = self.edgevertex1[edgeid]
+ local id2 = self.edgevertex2[edgeid]
+ local x1 = self.posxs[id1]
+ local y1 = self.posys[id1]
+ local x2 = self.posxs[id2]
+ local y2 = self.posys[id2]
+ local prevvertexid = id1
+ for i = 1, numdivisions do
+ -- create new edge and vertex
+ local newvertexid1 = self.numvertexids + i
+ table.insert(subdivisionvertices, newvertexid1)
+ self.posxs[newvertexid1] = (x1 * (numdivisions + 1 - i) + x2 * i)
+ / (numdivisions + 1)
+ self.posys[newvertexid1] = (y1 * (numdivisions + 1 - i) + y2 * i)
+ / (numdivisions + 1)
+ self.cvsxs[newvertexid1] = {}
+ self.cvsys[newvertexid1] = {}
+
+ local newedgeid = self.numedgeids + i
+ table.insert(subdivisionedges, newedgeid)
+ table.insert(self.edgevertex1, prevvertexid)
+ table.insert(self.edgevertex2, newvertexid1)
+ prevvertexid = newvertexid1
+
+ -- pair the new vertex
+ -- with first vertex of the edge being devided
+ table.insert(self.vertexpairs1, self.edgevertex1[edgeid])
+ table.insert(self.vertexpairs2, newvertexid1)
+ table.insert(self.pairconnected, i == 1)
+
+ -- with second vertex of the edge being devided
+ table.insert(self.vertexpairs1, self.edgevertex2[edgeid])
+ table.insert(self.vertexpairs2, newvertexid1)
+ table.insert(self.pairconnected, i == numdivisions)
+
+ -- with each other
+ for j = i + 1, numdivisions do
+ local newvertexid2 = self.numvertexids + j
+ table.insert(self.vertexpairs1, newvertexid1)
+ table.insert(self.vertexpairs2, newvertexid2)
+ table.insert(self.pairconnected, j == i + 1)
+ end
+
+ -- with new edges
+ -- before vertex
+ for j = 1, i - 1 do
+ local newedgeid = self.numedgeids + j
+ table.insert(self.edgepairsvertex, newvertexid1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ -- after vertex
+ for j = i + 2, numdivisions + 1 do
+ local newedgeid = self.numedgeids + j
+ table.insert(self.edgepairsvertex, newvertexid1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+
+ -- pair the new edges with vertices of the edge being devided
+ if i > 1 then
+ table.insert(self.edgepairsvertex, id1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ table.insert(self.edgepairsvertex, id2)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ -- create last edge
+ table.insert(subdivisionedges, self.numedgeids + numdivisions + 1)
+ table.insert(self.edgevertex1, prevvertexid)
+ table.insert(self.edgevertex2, id2)
+
+ -- pair last edge with first vertex of the edge being devided
+ table.insert(self.edgepairsvertex, id1)
+ table.insert(self.edgepairsedge, self.numedgeids + numdivisions + 1)
+
+ self.subdivisionedges[edgeid] = subdivisionedges
+ self.subdivisionvertices[edgeid] = subdivisionvertices
+
+ -- pair new edges and vertices with existing edges and vertices
+ local sameface = false
+ local start = self.embeddingedges[edgeid]
+ local twin = start.twin
+ local donevertices = { [start.target] = true, [twin.target] = true }
+ local doneedges = { [start] = true, [twin] = true }
+ local current = start.twin.links[1]
+ for twice = 1, 2 do
+ while current ~= start do
+ if current == twin then
+ sameface = true
+ end
+
+ -- pair edge with the new vertices
+ -- or pair subdivision of edge with new vertices and edges
+ if not doneedges[current] then
+ local currentedgeid = self.edgeids[current]
+ if self.subdivisionvertices[currentedgeid] then
+ for _, vid in ipairs(self.subdivisionvertices[currentedgeid]) do
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.vertexpairs1, vid)
+ table.insert(self.vertexpairs2, newvertexid)
+ self.pairconnected[#self.vertexpairs1] = false
+ end
+ for i = 1, numdivisions + 1 do
+ local newedgeid = self.numedgeids + i
+ table.insert(self.edgepairsvertex, vid)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ end
+ for _, eid in ipairs(self.subdivisionedges[currentedgeid]) do
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.edgepairsvertex, newvertexid)
+ table.insert(self.edgepairsedge, eid)
+ end
+ end
+ else
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.edgepairsvertex, newvertexid)
+ table.insert(self.edgepairsedge, currentedgeid)
+ end
+ end
+ doneedges[current] = true
+ end
+
+ -- pair target vertex with the new vertices and edges
+ local vertexid = self.vertexids[current.target]
+ if not donevertices[current.target] then
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.vertexpairs1, vertexid)
+ table.insert(self.vertexpairs2, newvertexid)
+ self.pairconnected[#self.vertexpairs1] = false
+ end
+ for i = 1, numdivisions + 1 do
+ local newedgeid = self.numedgeids + i
+ table.insert(self.edgepairsvertex, vertexid)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ end
+ current = current.twin.links[1]
+ end
+ start = self.embeddingedges[edgeid].twin
+ current = start.twin.links[1]
+ if sameface then
+ break
+ end
+ end
+
+ self.edgedeprecated[edgeid] = true
+ self.numvertexids = self.numvertexids + numdivisions
+ self.numedgeids = self.numedgeids + numdivisions + 1
+end
+
+function PDP:find_force_pairs()
+ local donevertices = {}
+ -- number all vertices
+ local vertexids = self.vertexids
+ for i, v in ipairs(self.embedding.vertices) do
+ vertexids[v] = i
+ end
+ self.numvertexids = #self.embedding.vertices
+
+ local edgeids = self.edgeids
+ local numedgeids = 0
+ -- number all edges
+ for _, v in ipairs(self.embedding.vertices) do
+ local id = vertexids[v]
+ local start = v.link
+ local current = start
+ repeat
+ local targetid = vertexids[current.target]
+ if edgeids[current] == nil then
+ table.insert(self.edgevertex1, id)
+ table.insert(self.edgevertex2, targetid)
+ numedgeids = numedgeids + 1
+ edgeids[current] = numedgeids
+ edgeids[current.twin] = numedgeids
+ self.embeddingedges[numedgeids] = current
+ end
+ current = current.links[0]
+ until current == start
+ end
+
+ -- find all force pairs
+ for _, v in ipairs(self.embedding.vertices) do
+ local id = vertexids[v]
+ donevertices[id] = true
+ local vertexset = {}
+ local edgeset = {}
+ local start = v.link
+ repeat
+ local targetid = vertexids[start.target]
+ if vertexset[targetid] == nil and not donevertices[targetid] then
+ table.insert(self.pairconnected, true)
+ table.insert(self.vertexpairs1, id)
+ table.insert(self.vertexpairs2, targetid)
+ vertexset[targetid] = true
+ end
+ local current = start.twin.links[1]
+ while current.target ~= v do
+ local targetid = vertexids[current.target]
+ if vertexset[targetid] == nil and not donevertices[targetid] then
+ table.insert(self.pairconnected, self.ugraph:arc(v.inputvertex, current.target.inputvertex) ~= nil)
+ table.insert(self.vertexpairs1, id)
+ table.insert(self.vertexpairs2, targetid)
+ vertexset[targetid] = true
+ end
+ if edgeset[current] == nil then
+ table.insert(self.edgepairsvertex, id)
+ table.insert(self.edgepairsedge, edgeids[current])
+ edgeset[current] = true
+ edgeset[current.twin] = true
+ end
+ current = current.twin.links[1]
+ end
+ start = start.links[0]
+ until start == v.link
+ end
+
+ self.numedgeids = numedgeids
+end
+
+function PDP:normalize_size()
+ local minx = math.huge
+ local maxx = -math.huge
+ local miny = math.huge
+ local maxy = -math.huge
+
+ for _, v in ipairs(self.ugraph.vertices) do
+ minx = math.min(minx, v.pos.x)
+ maxx = math.max(maxx, v.pos.x)
+ miny = math.min(miny, v.pos.y)
+ maxy = math.max(maxy, v.pos.y)
+ end
+
+ local area = (maxx - minx) * (maxy - miny)
+ local gridarea = #self.ugraph.vertices * self.delta * self.delta
+
+ local scale = math.sqrt(gridarea) / math.sqrt(area)
+
+ for _, v in ipairs(self.ugraph.vertices) do
+ v.pos = v.pos * scale
+ end
+end
+
+-- done
+
+return PDP
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua
new file mode 100644
index 00000000000..8796148de80
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua
@@ -0,0 +1,159 @@
+
+
+local PlanarLayout = {}
+require("pgf.gd.planar").PlanarLayout = PlanarLayout
+
+-- imports
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Storage = require "pgf.gd.lib.Storage"
+local BoyerMyrvold = require "pgf.gd.planar.BoyerMyrvold2004"
+local ShiftMethod = require "pgf.gd.planar.ShiftMethod"
+local Embedding = require "pgf.gd.planar.Embedding"
+local PDP = require "pgf.gd.planar.PDP"
+local InterfaceToAlgorithms = require("pgf.gd.interface.InterfaceToAlgorithms")
+local createEdge = InterfaceToAlgorithms.createEdge
+local createVertex = InterfaceToAlgorithms.createVertex
+
+InterfaceToAlgorithms.declare {
+ key = "planar layout",
+ algorithm = PlanarLayout,
+ preconditions = {
+ connected = true,
+ loop_free = true,
+ simple = true,
+ },
+ postconditions = {
+ fixed = true,
+ },
+ summary = [["
+ The planar layout draws planar graphs without edge crossings.
+ "]],
+ documentation = [["
+ The planar layout is a pipeline of algorithms to produce
+ a crossings-free drawing of a planar graph.
+ First a combinatorical embedding of the graph is created using
+ the Algorithm from Boyer and Myrvold.
+ The combinatorical Embedding is then being improved by
+ by the Sort and Flip algorithm and triangulated afterwards.
+ To determine the actual node positions the shift method
+ by de Fraysseix, Pach and Pollack is used.
+ Finally the force based Planar Drawing Postprocessing improves the drawing.
+ "]],
+ examples = {
+ [["
+ \tikz \graph [nodes={draw, circle}] {
+ a -- {
+ b -- {
+ d -- i,
+ e,
+ f
+ },
+ c -- {
+ g,
+ h
+ }
+ },
+ f --[no span edge] a,
+ h --[no span edge] a,
+ i --[no span edge] g,
+ f --[no span edge] g,
+ c --[no span edge] d,
+ e --[no span edge] c
+ }
+ "]]
+ }
+}
+
+function PlanarLayout:run()
+ --local file = io.open("timing.txt", "a")
+
+ local options = self.digraph.options
+
+ -- get embedding
+ local bm = BoyerMyrvold.new()
+ bm:init(self.ugraph)
+ local embedding = bm:run()
+
+ assert(embedding, "Graph is not planar")
+
+ --local start = os.clock()
+ if options["use sf"] then
+ embedding:improve()
+ end
+
+ -- choose external face
+ local exedge, exsize = embedding:get_biggest_face()
+
+ -- surround graph with triangle
+ local v1, v2, vn = embedding:surround_by_triangle(exedge, exsize)
+
+ -- make maximal planar
+ embedding:triangulate()
+
+ if options["show virtual"] then
+ -- add virtual vertices to input graph
+ for _, vertex in ipairs(embedding.vertices) do
+ if vertex.virtual then
+ vertex.inputvertex = createVertex(self, {
+ name = nil,--vertex.name,
+ generated_options = {},
+ text = vertex.name
+ })
+ vertex.virtual = false
+ end
+ end
+
+ -- add virtual edges to input graph
+ for _, vertex in ipairs(embedding.vertices) do
+ for halfedge in Embedding.adjacency_iterator(vertex.link) do
+ if halfedge.virtual then
+ createEdge(
+ self,
+ vertex.inputvertex,
+ halfedge.target.inputvertex
+ )
+ end
+ halfedge.virtual = false
+ end
+ end
+ end
+
+ -- create canonical ordering
+ local order = embedding:canonical_order(v1, v2, vn)
+
+ local sm = ShiftMethod.new()
+ sm:init(order)
+ local gridpos = sm:run()
+
+ local gridspacing = options["grid spacing"]
+ for _, v in ipairs(order) do
+ if not v.virtual then
+ local iv = v.inputvertex
+ iv.pos.x = gridpos[v].x * gridspacing
+ iv.pos.y = gridpos[v].y * gridspacing
+ end
+ end
+
+ embedding:remove_virtual()
+
+ --start = os.clock()
+ if options["use pdp"] then
+ local pdp = PDP.new(
+ self.ugraph, embedding,
+ options["node distance"],
+ options["node distance"],
+ options["pdp cooling factor"],
+ options["exponent change iterations"],
+ options["start repulsive exponent"],
+ options["end repulsive exponent"],
+ options["start attractive exponent"],
+ options["end attractive exponent"],
+ options["edge approach threshold"],
+ options["edge stretch threshold"],
+ options["stress counter threshold"],
+ options["edge divisions"]
+ )
+ pdp:run()
+ end
+
+end
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua
new file mode 100644
index 00000000000..9716aa27e4a
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua
@@ -0,0 +1,128 @@
+local SM = {}
+require("pgf.gd.planar").ShiftMethod = SM
+
+-- imports
+local Embedding = require("pgf.gd.planar.Embedding")
+
+-- create class properties
+SM.__index = SM
+
+function SM.new()
+ local t = {}
+ setmetatable(t, SM)
+ return t
+end
+
+function SM:init(vertices)
+ self.vertices = vertices
+ self.xoff = {}
+ self.pos = {}
+ for _, v in ipairs(vertices) do
+ self.pos[v] = {}
+ end
+ self.left = {}
+ self.right = {}
+end
+
+function SM:run()
+ local v1 = self.vertices[1]
+ local v2 = self.vertices[2]
+ local v3 = self.vertices[3]
+
+ self.xoff[v1] = 0
+ self.pos[v1].y = 0
+ self.right[v1] = v3
+
+ self.xoff[v3] = 1
+ self.pos[v3].y = 1
+ self.right[v3] = v2
+
+ self.xoff[v2] = 1
+ self.pos[v2].y = 0
+
+ local n = #self.vertices
+ for k = 4, n do
+ local vk = self.vertices[k]
+ local wplink, wqlink, wp1qsum
+ if k ~= n then
+ wplink, wqlink, wp1qsum = self:get_attachments(vk)
+ else
+ wplink, wqlink, wp1qsum = self:get_last_attachments(vk, v1, v2)
+ end
+ local wp, wq = wplink.target, wqlink.target
+ local wp1 = wplink.links[0].target
+ local wq1 = wqlink.links[1 - 0].target
+ self.xoff[wp1] = self.xoff[wp1] + 1
+ self.xoff[wq] = self.xoff[wq] + 1
+ wp1qsum = wp1qsum + 2
+ self.xoff[vk] = (wp1qsum + self.pos[wq].y - self.pos[wp].y) / 2
+ self.pos[vk].y = (wp1qsum + self.pos[wq].y + self.pos[wp].y) / 2
+ -- = self.xoff[vk] + self.pos[wp].y ?
+ self.right[wp] = vk
+ if wp ~= wq1 then
+ self.left[vk] = wp1
+ self.right[wq1] = nil
+ self.xoff[wp1] = self.xoff[wp1] - self.xoff[vk]
+ end
+ self.right[vk] = wq
+ self.xoff[wq] = wp1qsum - self.xoff[vk]
+ end
+ self.pos[v1].x = 0
+ self:accumulate_offset(v1, 0)
+ return self.pos
+end
+
+function SM:get_attachments(vk)
+ local wplink, wqlink
+ local wp1qsum = 0
+ local start = vk.link
+ local startattach = self.xoff[start.target] ~= nil
+ local current = start.links[0]
+ local last = start
+ repeat
+ local currentattach = self.xoff[current.target] ~= nil
+ local lastattach = self.xoff[last.target] ~= nil
+ if currentattach ~= lastattach then
+ if currentattach then
+ wplink = current
+ else
+ wqlink = last
+ end
+ if currentattach == startattach and not startattach then
+ break
+ end
+ currentattach = lastattach
+ elseif currentattach then
+ wp1qsum = wp1qsum + self.xoff[current.target]
+ end
+ last = current
+ current = current.links[0]
+ until last == start
+ return wplink, wqlink, wp1qsum
+end
+
+function SM:get_last_attachments(vn, v1, v2)
+ local wplink, wqlink
+ local wp1qsum = 0
+ for halfedge in Embedding.adjacency_iterator(vn.link, ccwdir) do
+ local target = halfedge.target
+ if target == v1 then
+ wplink = halfedge
+ elseif target == v2 then
+ wqlink = halfedge
+ end
+ wp1qsum = wp1qsum + self.xoff[target]
+ end
+ return wplink, wqlink, wp1qsum
+end
+
+function SM:accumulate_offset(v, x)
+ x = x + self.xoff[v]
+ self.pos[v].x = x
+ local l = self.left[v]
+ local r = self.right[v]
+ if l then self:accumulate_offset(l, x) end
+ if r then self:accumulate_offset(r, x) end
+end
+
+return SM
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua
new file mode 100644
index 00000000000..68c46898e34
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua
@@ -0,0 +1,2 @@
+require "pgf.gd.planar.PlanarLayout"
+require "pgf.gd.planar.parameters"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua
new file mode 100644
index 00000000000..9e18eb07246
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua
@@ -0,0 +1,144 @@
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+declare {
+ key = "use pdp",
+ type = "boolean",
+ initial = "true",
+
+ summary = [["
+ Whether or not to use the Planar Drawing Postprocessing
+ to improve the drawing.
+ "]]
+}
+
+declare {
+ key = "use sf",
+ type = "boolean",
+ initial = "true",
+
+ summary = [["
+ Whether or not to use the Sort and Flip Algorithm
+ to improve the combinatorical embedding.
+ "]]
+}
+
+declare {
+ key = "grid spacing",
+ type = "number",
+ initial = "10",
+
+ summary = [["
+ If the |use pdp| option is not set,
+ this sets the spacing of the grid used by the shift method.
+ A bigger grid spacing will result in a bigger drawing.
+ "]]
+}
+
+declare {
+ key = "pdp cooling factor",
+ type = "number",
+ initial = "0.98",
+
+ summary = [["
+ This sets the cooling factor used by the Planar Drawing Postprocessing.
+ A higher cooling factor can result in better quality of the drawing,
+ but will increase the run time of the algorithm.
+ "]]
+}
+
+declare {
+ key = "start repulsive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ Start value of the exponent used in the calculation of all repulsive forces in PDP
+ "]]
+}
+
+declare {
+ key = "end repulsive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ End value of the exponent used in the calculation of all repulsive forces in PDP.
+ "]]
+}
+
+declare {
+ key = "start attractive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ Start value of the exponent used in PDP's calculation of the attractive force between
+ nodes connected by an edge.
+ "]]
+}
+
+declare {
+ key = "end attractive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ End value of the exponent used in PDP's calculation of the attractive force between
+ nodes connected by an edge.
+ "]]
+}
+
+declare {
+ key = "exponent change iterations",
+ type = "number",
+ initial = "1",
+
+ summary = [["
+ The number of iterations over which to modify the force exponents.
+ In iteration one the exponents will have their start value and in iteration
+ |exponent change iterations| they will have their end value.
+ "]]
+}
+
+declare {
+ key = "edge approach threshold",
+ type = "number",
+ initial = "0.3",
+
+ summary = [["
+ The maximum ration between the actual and the desired node-edge distance
+ which is required to count an edge as stressed.
+ "]]
+}
+
+declare {
+ key = "edge stretch threshold",
+ type = "number",
+ initial = "1.5",
+
+ summary = [["
+ The minimum ration between the actual and the desired edge length
+ which is required to count an edge as stressed.
+ "]]
+}
+
+declare {
+ key = "stress counter threshold",
+ type = "number",
+ initial = "30",
+
+ summary = [["
+ The number of iterations an edge has to be under stress before it will be subdevided.
+ "]]
+}
+
+declare {
+ key = "edge divisions",
+ type = "number",
+ initial = "0",
+
+ summary = [["
+ The number of edges in which stressed edges will be subdivided.
+ "]]
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
index 0dd9659852e..77166c5cbf5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua,v 1.1 2014/02/24 10:40:32 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
index 46c337090f4..1f68bd99f5f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua,v 1.2 2015/05/18 17:01:16 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
index 23a9d265923..9a99ea2275f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua,v 1.1 2014/04/28 12:28:46 tantau Exp $
+-- @release $Header$
-- The class; it processes necklace hints.
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
index 80364d11a39..17c959d6856 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua,v 1.1 2014/02/24 10:40:33 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
index b433e73a652..b13dcb9abb4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua,v 1.2 2013/01/01 17:10:09 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
index 9aff2aaf1d7..8c45e912dc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
local trees = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
index 272af54e55e..0b975fd3291 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua,v 1.4 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
index c808607385b..8eba23a2106 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua,v 1.11 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
index 24e9a69c385..791fb81e658 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua,v 1.7 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
@@ -634,4 +634,4 @@ end
-- Done
-return SpanningTreeComputation \ No newline at end of file
+return SpanningTreeComputation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
index 09c35611723..753f386bb9e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua,v 1.1 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
index f34aee06792..b8e36982cfc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex
new file mode 100644
index 00000000000..9d9055dfe96
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex
@@ -0,0 +1,21 @@
+% Copyright 2016 by Malte Skambath
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+\usepgflibrary{graphdrawing}
+
+\usegdlibrary{evolving}
+
+\newcount\mycount
+\tikzgraphsset{
+ nodes = {supernode/.expanded=\tikzgraphnodename},
+ when/.code = {\pgfparsetime{#1}\mycount=\pgftimeresult pt\tikzgraphsset{name/.expanded=\the\mycount,snapshot/.expanded=\the\mycount}}
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
index 9c017b5577d..61f2e4bed00 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
@@ -8,9 +8,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex,v 1.4 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.circular.code.tex}
\usegdlibrary{circular}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
index ad648c29402..385c9705953 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
@@ -8,7 +8,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex,v 1.39 2015/06/08 21:58:24 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.code.tex}
@@ -26,50 +26,50 @@
-%
+%
% All graph drawing keys normally live in the following namespace:
-% /graph drawing.
+% /graph drawing.
%
-\def\pgfgdset{\pgfqkeys{/graph drawing}}
+\def\pgfgdset{\pgfqkeys{/graph drawing}}%
% Setup a key
-%
+%
% #1 = key
-%
+%
% Description:
-%
+%
% An internal macro that sets up #1 as a graph drawing key.
-\def\pgfgd@callbackkey#1{
- \pgf@gd@setup@forwards{#1}
- \pgfutil@g@addto@macro\pgf@gd@forwards@list{\pgf@gd@setup@forwards{#1}}
-}
-\def\pgf@gd@setup@forwards#1{
+\def\pgfgd@callbackkey#1{%
+ \pgf@gd@setup@forwards{#1}%
+ \pgfutil@g@addto@macro\pgf@gd@forwards@list{\pgf@gd@setup@forwards{#1}}%
+}%
+\def\pgf@gd@setup@forwards#1{%
\let\pgf@temp\pgfutil@empty
- \foreach \pgf@gd@path in \pgf@gd@forwarding@list {
+ \foreach \pgf@gd@path in \pgf@gd@forwarding@list {%
\ifx\pgf@gd@path\pgfutil@empty\else%
\expandafter\pgfutil@g@addto@macro%
\expandafter\pgf@temp\expandafter{%
- \expandafter\pgfkeys\expandafter{\pgf@gd@path#1/.forward to=/graph drawing/#1}}
+ \expandafter\pgfkeys\expandafter{\pgf@gd@path#1/.forward to=/graph drawing/#1}}%
\fi%
}%
\pgf@temp
-}
+}%
\let\pgf@gd@forwards@list\pgfutil@empty
% Append to the forwarding list:
-%
+%
% #1 = paths to append to the forwarding list
-%
+%
% Description:
-%
+%
% Append the paths in #1 (with trailing slashes) to the forwarding
% list.
-%
+%
% If algorithms have already been declared, forwarding will also be
% setup for them (using a bit of magic...).
@@ -77,19 +77,19 @@
\let\pgf@gd@forwarding@list@orig\pgf@gd@forwarding@list
\def\pgf@gd@forwarding@list{#1}%
\pgf@gd@forwards@list%
- \expandafter\def\expandafter\pgf@gd@forwarding@list\expandafter{\pgf@gd@forwarding@list@orig,#1}
-}
+ \expandafter\def\expandafter\pgf@gd@forwarding@list\expandafter{\pgf@gd@forwarding@list@orig,#1}%
+}%
\let\pgf@gd@forwarding@list\pgfutil@empty
-%
-%
+%
+%
% Callbacks
-%
+%
% The following macros are called *from* the binding layer. You do not
% call them from the pgf layer.
-%
+%
%
@@ -109,7 +109,7 @@
% a large label.
%
% These graph drawing parameters are different from "usual" pgf
-% options: An alogrithmic parameter influenced the way the algorithm
+% options: An algorithmic parameter influenced the way the algorithm
% works, while usual options normally only influence how the result
% looks like. For instance, the fact that a node is red is not an
% graph drawing parameter (usually, at least), while the shape of a node
@@ -119,7 +119,7 @@
% (since only this layer "knows" which parameters there are). The
% binding to TeX will call the \pgfgddeclareparameter function
% internally.
-%
+%
% Specifying the set of graph drawing parameters for a given graph or
% node or edge works as follows: When the graph drawing engine is
% started for a graph (using \pgfgdbeginscope), a snapshot is taken of
@@ -132,8 +132,8 @@
\def\pgfgdcallbackdeclareparameter#1#2{%
\pgfkeysdef{/graph drawing/#1}{\pgf@gd@handle@parameter{#1}{#2}{##1}}%
- \pgfgd@callbackkey{#1}%
-}
+ \pgfgd@callbackkey{#1}%
+}%
\def\pgf@gd@handle@parameter#1#2#3{%
\def\pgf@temp{#3}%
\ifx\pgf@temp\pgfkeysnovalue@text%
@@ -146,18 +146,18 @@
local new, main = pgf.gd.interface.InterfaceToDisplay.pushOption('\pgfutil@luaescapestring{#1}',\pgfgdresult,\the\pgf@gd@parameter@stack@height)
tex.print(new..'\pgfutil@luaescapestring{\relax}')
if main then
- tex.print('\pgfutil@luaescapestring{\noexpand\pgfgdtriggerrequest}')
- end}%
+ tex.print('\pgfutil@luaescapestring{\noexpand\pgfgdtriggerrequest}')
+ end}%
}%
\newcount\pgf@gd@parameter@stack@height
-\def\pgfgdtriggerrequest{\pgfgdset{@request scope and layout}}
+\def\pgfgdtriggerrequest{\pgfgdset{@request scope and layout}}%
% Conversions are used to adapt the syntactic description of a
% parameter on the TikZ layer to the one expected by Lua. The set of
% permissible conversions is described in
-% InterfaceToAlgorithms.declareParameter.
+% InterfaceToAlgorithms.declareParameter.
\pgfgdset{
conversions/string/.code=\def\pgfgdresult{'\pgfutil@luaescapestring{\detokenize{#1}}'},
@@ -166,13 +166,14 @@
conversions/boolean/.code=\def\pgf@test{#1}\ifx\pgf@test\pgf@truetext\def\pgfgdresult{true}\else\ifx\pgf@test\pgfkeysnovalue@text\def\pgfgdresult{true}\else\def\pgfgdresult{false}\fi\fi,
conversions/number/.code=\pgfmathparse{#1}\let\pgfgdresult\pgfmathresult,
conversions/length/.code=\pgfmathparse{#1}\let\pgfgdresult\pgfmathresult,
+ conversions/time/.code=\pgfparsetime{#1}\let\pgfgdresult\pgftimeresult,
conversions/direction/.code=\pgf@lib@gd@grow@dir{#1}\let\pgfgdresult\pgfmathresult,
conversions/canvas coordinate/.code args={(#1pt,#2pt)}{\edef\pgfgdresult{pgf.gd.model.Coordinate.new(#1,#2)}},
% deprecated, will be removed:
conversions/coordinate/.code args={(#1pt,#2pt)}{\edef\pgfgdresult{{#1,#2}}}
-}
-\def\pgf@truetext{true}
-\def\pgfgd@niltext{nil}
+}%
+\def\pgf@truetext{true}%
+\def\pgfgd@niltext{nil}%
\def\pgf@lib@gd@grow@dir#1{%
\def\pgf@temp{#1}%
@@ -185,30 +186,30 @@
\pgfmathparse{#1}%
\fi
\fi
-}
+}%
-\def\pgf@orient@direction@down{-90}
-\def\pgf@orient@direction@up{90}
-\def\pgf@orient@direction@left{180}
-\def\pgf@orient@direction@right{0}
+\def\pgf@orient@direction@down{-90}%
+\def\pgf@orient@direction@up{90}%
+\def\pgf@orient@direction@left{180}%
+\def\pgf@orient@direction@right{0}%
-\def\pgf@orient@direction@south{-90}
-\def\pgf@orient@direction@north{90}
-\def\pgf@orient@direction@west{180}
-\def\pgf@orient@direction@east{0}
+\def\pgf@orient@direction@south{-90}%
+\def\pgf@orient@direction@north{90}%
+\def\pgf@orient@direction@west{180}%
+\def\pgf@orient@direction@east{0}%
-\expandafter\def\csname pgf@orient@direction@north east\endcsname{45}
-\expandafter\def\csname pgf@orient@direction@north west\endcsname{135}
-\expandafter\def\csname pgf@orient@direction@south east\endcsname{-45}
-\expandafter\def\csname pgf@orient@direction@south west\endcsname{-135}
+\expandafter\def\csname pgf@orient@direction@north east\endcsname{45}%
+\expandafter\def\csname pgf@orient@direction@north west\endcsname{135}%
+\expandafter\def\csname pgf@orient@direction@south east\endcsname{-45}%
+\expandafter\def\csname pgf@orient@direction@south west\endcsname{-135}%
-\expandafter\def\csname pgf@orient@direction@-\endcsname{0}
-\expandafter\def\csname pgf@orient@direction@|\endcsname{-90}
+\expandafter\def\csname pgf@orient@direction@-\endcsname{0}%
+\expandafter\def\csname pgf@orient@direction@|\endcsname{-90}%
-{
+{%
\catcode`\|=13
- \gdef\pgf@gd@lib@active@bar{|}
-}
+ \gdef\pgf@gd@lib@active@bar{|}%
+}%
@@ -220,7 +221,7 @@
% #2 = Layer
%
% Description:
-%
+%
% Executes /graph drawing/#1/begin rendering/.try
%
@@ -233,7 +234,7 @@
\unhbox\pgf@gd@postkind@box%
\fi%
\pgfgdset{/graph drawing/#1/begin rendering/.try}%
-}
+}%
% Callback for ending the rendering of a collection kind
%
@@ -241,47 +242,47 @@
% #2 = Layer
%
% Description:
-%
+%
% Executes /graph drawing/#1/end rendering/.try
%
\def\pgfgdcallbackrendercollectionkindstop#1#2{%
\pgfgdset{/graph drawing/#1/end rendering/.try}%
\egroup % close box
-}
+}%
-% Callback for rendering a collection
-%
+% Callback for rendering a collection
+%
% #1 = Kind
% #2 = Options
%
% Description:
-%
+%
% Executes /graph drawing/#1/render/.try={#2}
%
\def\pgfgdcallbackrendercollection#1#2{
\pgfgdset{/graph drawing/#1/render/.try={#2}}
-}
+}%
-% Graph events
-%
+% Graph events
+%
% Although a graph consists of nodes and edges, during the
% construction of the graph a lot of information concerning the
% structure of the graph is often available. For instance, as we
% specify a graph using the child-syntax, we do not only which edges
% are present, but we can implicitly specify an ordering on the
-% nodes. Even more, there is even information availble concerning
+% nodes. Even more, there is even information available concerning
% nodes that are not present at all: A child[missing] is not present
% as a node or an edge, but a tree drawing algorithm will want to know
% about this child nevertheless.
-%
+%
% In order to communicate such information to the graph drawing
% engine, "events" are used. As a graph is created, in addition to
% nodes and edges, "events" may happen. The events come in a
@@ -289,36 +290,36 @@
% each node and each edge, its index in the event sequence is
% stored, that is, it is stored how many events happened before the
% node or edge was created.
-%
+%
% Internally, an event consists of a name and, possibly, some
% parameters. When the parameter is created on the tikz level, it will
% be a string that is passed down to Lua. Internally created events
% will also have parameters that are objects.
-%
+%
% Two events are a bit special since they get special internal
% support: The begin and end events. The first signals that some kind
% of group has started; which is closed by the corresponding end
% event. The "kind" of group is indicated by the parameter of the
% begin event.
-%
-%
-%
+%
+%
+%
% Standard events are:
-%
+%
% For each node entered into a graph, a "node" event is automatically
% created internally with the parameter being the node. However, you
% can also create this event yourself. In this case, the parameter
% will be a string and will mean that the node is "virtual" or
% "missing", but space should be reserved for it, if possible (this is
% use, for instance, by certain tree layouts).
-%
+%
% For each edge entered into a graph, an "edge" event is automatically
% created, with the edge as the parameter. Again, an event with a
% string parameter corresponds to a "non-existing" node.
-%
+%
%
% Standard event groups are:
-%
+%
%
% The "descendants" event group include a set of nodes that, at least
% inside the specification, are descendants of the last node
@@ -326,68 +327,68 @@
% begin descendants
% ...
% end
-%
-%
+%
+%
% The "array" event group collects together some nodes in an array of
% nodes. This can be used, for instance, to specify matrices.
-%
+%
% begin array
% ...
-% end
+% end
% Create a new event
-%
+%
% #1 = event name (should be a valid lua identifier name)
% #2 = parameter (some text)
-%
+%
% Description:
-%
+%
% Adds a new event to the event sequence of the graph
\def\pgfgdevent#1#2{%
\directlua{pgf.gd.interface.InterfaceToDisplay.createEvent('\pgfutil@luaescapestring{#1}', '\pgfutil@luaescapestring{#2}')}%
-}
+}%
% Start an event group
-%
+%
% #1 = kind of event group
-%
+%
% Description:
-%
+%
% Creates a begin event with #1 as the parameter of the begin
% event.
\def\pgfgdbegineventgroup#1{%
\pgfgdevent{begin}{#1}%
-}
+}%
% End an event group
-%
+%
% Description:
-%
+%
% Creates an end event.
\def\pgfgdendeventgroup{%
\pgfgdevent{end}{}%
-}
+}%
% Creates an event group for the current TeX group
%
-% #1 = event group name
+% #1 = event group name
%
% Description:
-%
+%
% Issues a begin event for #1 and, using \aftergroup, adds an end
% event at the end of the current tex group.
\def\pgfgdeventgroup#1{%
\pgfgdbegineventgroup{#1}%
\aftergroup\pgfgdendeventgroup%
-}
+}%
@@ -401,7 +402,7 @@
%
% Callback method for \pgfpositionnodelater
-%
+%
% This function is called by \pgfnode whenever a node has been newly
% created inside a graph drawing scope. It will create a new vertex on
% the Lua layer.
@@ -421,10 +422,10 @@
\let\pgfsyssoftpath@curvetosupportatoken\pgf@gd@curvetosupportatoken%
\let\pgfsyssoftpath@closepathtoken\pgf@gd@closepathtoken%
\pgfpositionnodelaterpath%
- %
+ %
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- %
+ %
{%
\pgf@process{\pgfpointanchor{\pgfpositionnodelatername}{center}}
\pgfsettransform{\csname pgf@sh@nt@\pgfpositionnodelatername\endcsname}%
@@ -450,14 +451,14 @@
center = require 'pgf.gd.model.Coordinate'.new(\pgf@sys@tonumber\pgf@x,\pgf@sys@tonumber\pgf@y)
}
)
- pgf.temp = nil
+ pgf.temp = nil
}
}%
-}
+}%
-\def\pgf@gd@movetotoken#1#2{\directlua{pgf.temp:appendMoveto(\Pgf@geT#1,\Pgf@geT#2)}}
-\def\pgf@gd@linetotoken#1#2{\directlua{pgf.temp:appendLineto(\Pgf@geT#1,\Pgf@geT#2)}}
+\def\pgf@gd@movetotoken#1#2{\directlua{pgf.temp:appendMoveto(\Pgf@geT#1,\Pgf@geT#2)}}%
+\def\pgf@gd@linetotoken#1#2{\directlua{pgf.temp:appendLineto(\Pgf@geT#1,\Pgf@geT#2)}}%
\def\pgf@gd@rectcornertoken#1#2#3#4#5{%
\directlua{%
local x,y,dx,dy=\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5
@@ -465,17 +466,17 @@
pgf.temp:appendLineto(x,y+dy)
pgf.temp:appendLineto(x+dx,y+dy)
pgf.temp:appendLineto(x+dx,y)
- pgf.temp:appendClosepath()%
+ pgf.temp:appendClosepath()%
}%
-}
-\def\pgf@gd@curvetosupportatoken#1#2#3#4#5#6#7#8{\directlua{pgf.temp:appendCurveto(\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5,\Pgf@geT#7,\Pgf@geT#8)}}
-\def\pgf@gd@closepathtoken#1#2{\directlua{pgf.temp:appendClosepath()}}
+}%
+\def\pgf@gd@curvetosupportatoken#1#2#3#4#5#6#7#8{\directlua{pgf.temp:appendCurveto(\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5,\Pgf@geT#7,\Pgf@geT#8)}}%
+\def\pgf@gd@closepathtoken#1#2{\directlua{pgf.temp:appendClosepath()}}%
% Set options for an already existing node
-%
+%
% #1 = node name
-%
+%
% These node parameters of #1 will be updated with the current values
% of the node parameters. The node #1 must previously have been passed
% to the gd engine. If some of the options have already been set for
@@ -485,13 +486,13 @@
\directlua{
pgf.gd.interface.InterfaceToDisplay.addToVertexOptions('\pgfutil@luaescapestring{#1}',\the\pgf@gd@parameter@stack@height)
}
-}
+}%
%
% A callback for rendering (finally positioning) a node
-%
+%
% #1 = name of the node
% #2 = x min of the bounding box
% #3 = x max of the bounding box
@@ -500,11 +501,12 @@
% #6 = desired x pos of the node
% #7 = desired y pos of the node
% #8 = box register number of the TeX node
+% #9 = animation code
%
% This callback will be called by the engine for every original node
% when it finally needs to placed at a final position.
-\def\pgfgdcallbackrendernode#1#2#3#4#5#6#7#8{%
+\def\pgfgdcallbackrendernode#1#2#3#4#5#6#7#8#9{%
{%
\def\pgfpositionnodelatername{#1}
\def\pgfpositionnodelaterminx{#2}
@@ -512,10 +514,24 @@
\def\pgfpositionnodelaterminy{#4}
\def\pgfpositionnodelatermaxy{#5}
\directlua{pgf.gd.interface.InterfaceCore.binding:retrieveBox(#8,\pgfpositionnodelaterbox)}
- \pgfpositionnodenow{\pgfqpoint{#6}{#7}}
+ \def\pgf@temp{#9}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \pgfpositionnodenow{\pgfqpoint{#6}{#7}}%
+ \else%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing node animation/.try}%
+ #9%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \pgfpositionnodenow{\pgfqpoint{#6}{#7}}%
+ \endpgfidscope%
+ \fi%
}%
-}
+}%
+\ifx\pgfanimateattribute\pgfutil@undefined
+ \def\pgfanimateattribute#1#2{\tikzerror{You need to say \string\usetikzlibrary{animations} for animated graphs}}%
+\fi
% Adds an edge to the graph
@@ -531,14 +547,14 @@
% Creating an edge means that you tell the graph drawing algorithm
% that #1 and #2 are connected. The "kind" of connection is indicated
% by #3, which may be one of the following:
-%
+%
% -> = a directed edge (also known as an arc) from #1 to #2
% -- = an undirected edge between #1 and #2
% <- = a directed edge from #2 to #1, but with the "additional hint"
% that this is a "backward" edge. A graph drawing algorithm may
% or may not take this hint into account
% <-> = a bi-directed edge between #1 and #2.
-%
+%
%
% The parameters #4 and #5 are a bit more tricky. When an edge between
% two vertices of a graph is created via \pgfgdedge, nothing is
@@ -547,31 +563,31 @@
% creating the actual drawing commands for the edge. Thus, the actual
% drawing of the edge is done only when the graph drawing algorithm is
% done (namely in the macro \pgfgdcallbackedge, see later).
-%
+%
% Because of this "delayed" drawing of edges, options that influence
% the edge must be retained until the moment when the edge is actually
% drawn. Parameters #4 and #5 store such options.
-%
+%
% Let us start with #4. This parameter should be set to a list of
% key-value pairs like
-%
+%
% /tikz/.cd, color=red, very thick, this edge must be vertical
-%
+%
% Some of these options may be of interest to the graph drawing
-% algorithm (like the last option) while others will
+% algorithm (like the last option) while others will
% only be important during the drawing of edge (like the first
% option). The options that are important for the graph drawing
% algorithm must be passed to the algorithm via setting keys that have
-% been declared using the handler .edge parameter (see
+% been declared using the handler .edge parameter (see
% above).
-%
+%
% The tricky part is that options that are of interest to the graph
% drawing algorithm must be executed *before* the algorithm starts,
% but the options as a whole are usually only executed during the
% drawing of the edges, which is *after* the algorithm has finished.
-%
+%
% To overcome this problem, the following happens:
-%
+%
% The options in #4 are executed "tentatively" inside
% \pgfgdedge. However, this execution is done in a "heavily guarded
% sandbox" where all effects of the options (like changing the
@@ -579,7 +595,7 @@
% the changes of the graph drawing edge parameters leave the
% sandbox. These parameters are then passed down to the graph drawing
% engine.
-%
+%
% Later, when the edge is drawn using \pgfgdcallbackedge, the options #4
% are available once more and then they are executed normally.
%
@@ -587,9 +603,9 @@
% preset. Thus, you typically need to start it with, say, /tikz/.cd.
%
%
-% The text in #5 is some "auxilliary" text that is simply stored away
+% The text in #5 is some "auxiliary" text that is simply stored away
% and later directly to \pgfgdcallbackedge. This is a curtesy to TikZ,
-% which can use it to store its node labels.
+% which can use it to store its node labels.
%
% Example:
%
@@ -616,10 +632,10 @@
\endpgfinterruptpath%
}}%
\endgroup%
-}
+}%
\let\pgfgdprepareedge=\pgfutil@empty
-\def\pgfgdaddprepareedgehook#1{\expandafter\def\expandafter\pgfgdprepareedge\expandafter{\pgfgdprepareedge#1}}
+\def\pgfgdaddprepareedgehook#1{\expandafter\def\expandafter\pgfgdprepareedge\expandafter{\pgfgdprepareedge#1}}%
\newif\ifpgf@gd@nodes@behind@edges
@@ -629,14 +645,14 @@
% Define a callback for rendering edges
%
% #1 = macro name
-%
+%
% Descriptions:
-%
+%
% This is a callback from the graph drawing engine. At the end of the
% creation of a graph, when the nodes have been positioned, this macro
% is called once for each edge. The macro should take the following
% parameters:
-%
+%
% #1 = from node, optionally followed by "." and the tail anchor
% #2 = to node, optionally followed by "." and the head anchor
% #3 = direction (<-, --, ->, or <->)
@@ -644,28 +660,38 @@
% #5 = aux text (typically edge nodes)
% #6 = algorithm-generated options
% #7 = bend information
+% #8 = animations
%
% The first five parameters are the original values that were passed
% down to the \pgfgdedge command.
-%
+%
% #6 contains options that have been "computed by the algorithm". For
% instance, an algorithm might have determined, say, flow capacities
% for edges and it might now wish to communicate this information back
% to the upper layers. These options should be executed with the path
% /graph drawing.
-%
+%
% #7 contains algorithmically-computed information concerning how the
% edge should bend. This will be a text like
% "--(10pt,20pt)--(30pt,40pt)" in tikz-syntax, using the path
% operations "--", "..controls" and "--cycle".
-%
+%
% By default, a simple line is drawn between the nodes. Usually, you
% will wish to install a more "fancy" callback, here.
-\def\pgfgdsetedgecallback#1{\let\pgfgdcallbackedge=#1}
+\def\pgfgdsetedgecallback#1{\let\pgfgdcallbackedge=#1}%
-\def\pgfgddefaultedgecallback#1#2#3#4#5#6#7{%
+\def\pgfgddefaultedgecallback#1#2#3#4#5#6#7#8{%
{%
+ \def\pgf@temp{#8}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing edge animation/.try}%
+ #8%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \fi%
\pgfscope
\pgfpathmoveto{
\pgfutil@in@.{#1}%
@@ -685,14 +711,18 @@
}
\pgfusepath{stroke}
\endpgfscope
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \endpgfidscope%
+ \fi%
}
-}
+}%
-\pgfgdsetedgecallback{\pgfgddefaultedgecallback}
+\pgfgdsetedgecallback{\pgfgddefaultedgecallback}%
\def\pgf@gd@unravel#1.#2\relax{%
\pgfpointanchor{#1}{#2}%
-}
+}%
@@ -709,7 +739,7 @@
\catcode`\@=11\relax%
\setbox\pgf@gd@prekind@box=\box\pgfutil@voidb@x%
\setbox\pgf@gd@postkind@box=\box\pgfutil@voidb@x%
-}
+}%
\def\pgfgdcallbackendshipout{%
\box\pgf@gd@prekind@box%
\ifpgf@gd@nodes@behind@edges%
@@ -721,7 +751,7 @@
\fi%
\box\pgf@gd@postkind@box%
\endpgfscope
-}
+}%
\newbox\pgf@gd@node@box
\newbox\pgf@gd@edge@box
@@ -730,23 +760,23 @@
\def\pgfgdcallbackbeginnodeshipout{%
\setbox\pgf@gd@node@box=\hbox\bgroup%
-}
+}%
\def\pgfgdcallbackendnodeshipout{%
\egroup%
-}
+}%
\def\pgfgdcallbackbeginedgeshipout{%
\setbox\pgf@gd@edge@box=\hbox\bgroup%
-}
+}%
\def\pgfgdcallbackendedgeshipout{%
\egroup
-}
+}%
-% Generate a node
+% Generate a node
%
% This callback is called from the engine whenever an algorithm
% generates a new node internally.
@@ -764,14 +794,14 @@
\pgfkeys{#3}
\pgfnode{#2}{\pgfkeysvalueof{/graph drawing/generated
node/anchor}}{#4}{#1}{\pgfkeysvalueof{/graph drawing/generated
- node/use path}}
+ node/use path}}
}
-}
+}%
\pgfkeys{
/graph drawing/generated node/anchor/.initial=center,
/graph drawing/generated node/use path/.initial=\pgfusepath{}
-}
+}%
@@ -779,49 +809,49 @@
% Sublayouts
%
% Description: For a general introduction to (sub)layouts, see
-% Section~\ref{section-gd-sublayouts} in the manual.
-%
+% Section~\ref{section-gd-sublayouts} in the manual.
+%
\def\pgfgdbeginlayout{
\begingroup
\pgfgdlayoutscopeactivetrue
\advance\pgf@gd@parameter@stack@height by1\relax%
\directlua{pgf.gd.interface.InterfaceToDisplay.pushLayout(\the\pgf@gd@parameter@stack@height)}
-}
+}%
\def\pgfgdendlayout{
\endgroup%
-}
+}%
% Creates a subgraph node
-%
+%
% #1 = name
% #2 = node options
% #3 = node text
-%
+%
% Description:
-%
+%
% A subgraph node is a node that "surrounds" the nodes of a
% subgraph. The special property of a subgraph node opposed to a
% normal node is that it is created only after the subgraph has been
% laid out. However, the difference to a collection like "hyper" is
-% that the node is availble immediately as a normal node in the sense
+% that the node is available immediately as a normal node in the sense
% that you can connect edges to it.
-%
+%
% What happens internally is that subgraph nodes get "registered"
% immediately both on the pgf level and on the lua level, but the
% actual node is only created inside the layout pipeline using a
% callback. The actual node creation happens when the innermost layout
% in which the subgraph node is declared has finished.
-%
+%
% When you create a subgraph node using this macro, you also start a
% collection (of an internal kind) that stores the subgraph. All
% following nodes in the current TeX scope will become part of this
-% collection.
-%
+% collection.
+%
% See |InterfaceToDisplay.pushSubgraphVertex| for details.
\def\pgfgdsubgraphnode#1#2#3{%
@@ -839,45 +869,45 @@
})
}%
}
-}
+}%
\def\pgfgdsubgraphnodecontents#1{% helper function
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{%
\vrule width0pt height\pgfkeysvalueof{/graph drawing/subgraph bounding box height}\hfil}%
-}
+}%
\pgfgdset{
subgraph point cloud/.initial=,
subgraph bounding box width/.initial=,
subgraph bounding box height/.initial=,
-}
+}%
-%
+%
% Requests
-%
+%
% Description:
-%
+%
% This key is used to ``request'' a graph drawing scope and a
% layout. The objective of this key is to make it easier for users and
% algorithm designers to control the slightly involved
% back-and-forth-calling between the different layers.
-%
+%
% This key does the following: When called inside a pgfpicture
% (otherwise, the call is "illegal"), it will call a call-back with
% two parameters. This callback will get passed some code that should
% be executed at the beginning of ``the next scope'' and some code
% that should be executed at the end of that scope.
-%
+%
% The code passed to the callbacks will have a different effect,
% depending on whether we are currently inside a layout scope or not
-% (if no graph drawing scope is open, we are
+% (if no graph drawing scope is open, we are
% not inside a layout). If we are not inside a layout scope (or if the
% layout scope has been interrupted), the code will issue a
% \pgfgdbeginscope command in the opening code and a corresponding
% scope ending command in the closing code. Next, the two code pieces
% always contain \pgfgdbeginlayout and \pgfgdendlayout.
-%
+%
% Note that the "@request scope and layout" key will not immediately
% trigger a layout scope to be created; rather, the TikZ callback will
% call it only at the beginning of the scope, which will be after
@@ -887,39 +917,39 @@
% *after* the "@request scope and layout" key since the actual opening
% of the scope happens only before the "..." part is parsed.
-\pgfgdset{@request scope and layout/.code=\pgfgd@requestcallback{\pgfgdbeginrequest}{\pgfgdendrequest}}
+\pgfgdset{@request scope and layout/.code=\pgfgd@requestcallback{\pgfgdbeginrequest}{\pgfgdendrequest}}%
\def\pgfgd@requestcallback#1#2{%
#1\def\pgf@gd@after@request{#2\egroup}\bgroup\aftergroup\pgf@gd@after@request%
-} % Default for basic layer
+}% Default for basic layer
\def\pgfgdbeginrequest{%
\ifpgfgdlayoutscopeactive%
\else%
\expandafter\pgfgdbeginscope%
\fi%
- \pgfgdbeginlayout%
-}
+ \pgfgdbeginlayout%
+}%
\def\pgfgdendrequest{%
\pgfgdendlayout%
\ifpgfgdlayoutscopeactive%
\else%
\expandafter\pgfgdendscope%
- \fi%
-}
+ \fi%
+}%
\newif\ifpgfgdlayoutscopeactive
% Set the request callback
-%
+%
% #1 = A macro
-%
+%
% Description:
-%
+%
% Sets the request callback as described in the "@request scope and
% layout" key.
-\def\pgfgdsetrequestcallback#1{\let\pgfgd@requestcallback#1}
+\def\pgfgdsetrequestcallback#1{\let\pgfgd@requestcallback#1}%
@@ -932,7 +962,7 @@
% Begins a new graph drawing scope
-%
+%
% Description:
%
% Inside a graph drawing scope, all pgf nodes that are newly created
@@ -943,7 +973,7 @@
% explicitly, but have styles and keys invoke it internally.
%
% Usage:
-%
+%
% \pgfgdset{algorithm=somealgorithm}
% \pgfgdbeginscope
% \pgfnode{rectangle}{center}{A}{A}{}
@@ -953,9 +983,9 @@
% \pgfgdedge{B}{C}{->}{}{}
% \pgfgdedge{C}{A}{->}{}{}
% \pgfgdendscope
-%
+%
% Naturally, users will typically use TikZ's somewhat simpler syntax: '
-%
+%
% \tikz \graph [some algorithm] { A -> B -> C -> A };
\def\pgfgdbeginscope{%
@@ -975,7 +1005,7 @@
% Kill transformations (will be added by the position now
% macros)
\pgftransformreset
-}
+}%
@@ -987,7 +1017,7 @@
% Ends a graph drawing scope
-%
+%
% Description:
%
% This macro invokes the selected graph drawing algorithm and
@@ -1006,13 +1036,13 @@
\directlua{
pgf.gd.interface.InterfaceToDisplay.resumeGraphDrawingCoroutine()
}%
- \pgfutil@repeat%
+ \pgfutil@repeat%
\endgroup%
% Late positioning has ended
\directlua{pgf.gd.interface.InterfaceToDisplay.renderGraph()}%
\directlua{pgf.gd.interface.InterfaceToDisplay.endGraphDrawingScope()}%
\endgroup%
-}
+}%
@@ -1020,18 +1050,18 @@
% Hook into graph specification
-%
+%
% #1 = code
-%
+%
% Description:
-%
+%
% Allows you to specify code that should be active while the graph
% drawing engine collects the information concerning the graph, but
% which should no longer be active when the graph is rendered.
\def\pgfgdaddspecificationhook#1{
\expandafter\def\expandafter\pgfgd@latecallback\expandafter{\pgfgd@latecallback#1}
-}
+}%
\let\pgfgd@latecallback\pgfutil@empty
@@ -1046,24 +1076,24 @@
% Include a graph drawing library file.
%
% #1 = List of names of library file.
-%
+%
% Description:
%
% This command includes a list of graph drawing library files. For
% each file X in the list, the file pgf.gd.X.lua is included using
-% |require|.
+% |require|.
%
% For the convenience of Context users, both round and square brackets
% are possible for the argument.
-%
+%
%
% Example:
%
% \usegdlibrary{trees}
% \usegdlibrary[force,circular]
-\def\usegdlibrary{\pgfutil@ifnextchar[{\use@gdlibrary}{\use@@gdlibrary}}%}
-\def\use@gdlibrary[#1]{\use@@gdlibrary{#1}}
+\def\usegdlibrary{\pgfutil@ifnextchar[{\use@gdlibrary}{\use@@gdlibrary}}%}%
+\def\use@gdlibrary[#1]{\use@@gdlibrary{#1}}%
\def\use@@gdlibrary#1{%
\edef\pgf@list{#1}%
\pgfutil@for\pgf@temp:=\pgf@list\do{%
@@ -1075,56 +1105,49 @@
end}
\fi
}
-}
+}%
-% In the following code: Does anyone know how to determine the
-% file-system separator in Lua? Or in TeX?
-{
- \catcode`\%=11
+% LaTeX uses kpathsea for file lookup while ConTeXt uses its
+% resolvers. Luckily, kpathsea is still accessible in ConTeXt in a
+% subtable kpse.original which we use if kpse.find_file is nil.
+{%
+\catcode`\%=11
\directlua{
- function pgf_lookup_and_require(name)
- local sep = '/'
- if string.find(os.getenv('PATH'),';') then
- sep = '\string\\'
- end
- local function lookup(name)
- local sub = name:gsub('%.',sep)
- local find_func = function (name, suffix)
- if resolvers then
- local n = resolvers.findfile (name, suffix)
- return (not (n == '')) and n or nil
- else
- return kpse.find_file(name,suffix)
+ function pgf_lookup_and_require(name)
+ local sep = package.config:sub(1,1)
+ local function lookup(name)
+ local sub = name:gsub('%.',sep)
+ local find_file = context and
+ resolvers.findfile or
+ kpse.find_file
+ if find_file(sub, 'lua') then
+ require(name)
+ elseif find_file(sub, 'clua') then
+ collectgarbage('stop')
+ require(name)
+ collectgarbage('restart')
+ else
+ return false
+ end
+ return true
end
- end
- if find_func(sub, 'lua') then
- require(name)
- elseif find_func(sub, 'clua') then
- collectgarbage('stop')
- require(name)
- collectgarbage('restart')
- else
- return false
- end
- return true
+ return
+ lookup('pgf.gd.' .. name .. '.library') or
+ lookup('pgf.gd.' .. name) or
+ lookup(name .. '.library') or
+ lookup(name)
end
- return
- lookup('pgf.gd.' .. name .. '.library') or
- lookup('pgf.gd.' .. name) or
- lookup(name .. '.library') or
- lookup(name)
- end
-}
}
+}%
%
% Ok, fire up the system by creating the binding!
%
\directlua{
- require 'pgf.gd.interface.InterfaceToDisplay'
+ require 'pgf.gd.interface.InterfaceToDisplay'
pgf.gd.interface.InterfaceToDisplay.bind(require 'pgf.gd.bindings.BindingToPGF')
-}
+}%
@@ -1133,10 +1156,10 @@
% that have a special meaning on the display layer.
%
-\pgfkeys{/graph drawing/nodes behind edges/.append code=\csname pgf@gd@nodes@behind@edges#1\endcsname}
-\pgfkeys{/graph drawing/nodes behind edges/.default=true}
+\pgfkeys{/graph drawing/nodes behind edges/.append code=\csname pgf@gd@nodes@behind@edges#1\endcsname}%
+\pgfkeys{/graph drawing/nodes behind edges/.default=true}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
index 4bfe4a839a3..c5c4997d627 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex,v 1.2 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.examples.code.tex}
\usepgflibrary{graphdrawing}
\usegdlibrary{examples}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
index 3950a9062e1..cd6851466a3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex,v 1.7 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.force.code.tex}
@@ -34,23 +34,23 @@
%
initial step dimension/.graph parameter=number,
initial step dimension/.parameter initial=0,
- %
+ %
convergence tolerance/.graph parameter=number,
convergence tolerance/.parameter initial=0.01,
%
spring constant/.graph parameter=number,
spring constant/.parameter initial=0.01,
- %
+ %
approximate electric forces/.graph parameter=boolean,
approximate electric forces/.parameter initial=false,
approximate electric forces/.default=true,
- %
+ %
electric force order/.graph parameter=number,
electric force order/.parameter initial=1,
%
% Parameters related to the multilevel approach where the input graph
% is iteratively coarsened into graphs with fewer nodes, until either
- % the number of nodes is small enough or the number of nodes in the
+ % the number of nodes is small enough or the number of nodes in the
% could not be reduced by at least a user-defined ratio.
%
coarsen/.graph parameter=boolean,
@@ -103,10 +103,10 @@
algorithm=pgf.gd.force.SpringHu2006
}
-
+
%
% Spring-electrical algorithm based on the paper
-%
+%
% "Efficient, High-Quality Force-Directed Graph Drawing"
% Yifan Hu, 2006
%
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
index 37f28bc304a..794fff40275 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex,v 1.5 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.layered.code.tex}
\usepgflibrary{graphdrawing}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
index 7d0a9ed35b0..10231f221ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
@@ -8,7 +8,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex,v 1.8 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.trees.code.tex}
\usepgflibrary{graphdrawing}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
index 3c3532b394d..0967f817d27 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
@@ -8,16 +8,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex,v 1.20 2013/08/05 18:22:47 tantau Exp $
+\ProvidesFileRCS{tikzlibrarygraphdrawing.code.tex}
-\usepgflibrary{graphdrawing}
+\usepgflibrary{graphdrawing}%
-\def\tikz@lib@ensure@gd@loaded{}
+\def\tikz@lib@ensure@gd@loaded{}%
% Patch the level and sibling distances so that gd and plain tikz are
% in sync
-\tikzset{level distance=1cm, sibling distance=1cm}
+\tikzset{level distance=1cm, sibling distance=1cm}%
% Patch node distance because of its special syntax.
@@ -31,27 +31,27 @@
\else%
\tikz@gd@convert@and#1 and #1\pgf@stop%
\fi%
-}
-\def\tikz@gd@convert@and#1 and #2\pgf@stop{\pgfkeys{/graph drawing/node distance/orig={#1}}}
+}%
+\def\tikz@gd@convert@and#1 and #2\pgf@stop{\pgfkeys{/graph drawing/node distance/orig={#1}}}%
%
% Setup graph drawing for tikz
-%
+%
\def\tikz@gd@request@callback#1#2{%
\tikzset{
execute at begin scope={
- \tikzset{
+ \tikzset{
--/.style={arrows=-},
-!-/.style={draw=none,fill=none},
- }
+ }
\pgfgdsetedgecallback{\pgfgdtikzedgecallback}%
- %
+ %
% Setup for plain syntax
- %
+ %
\pgfgdaddspecificationhook{\tikz@lib@gd@spec@hook}%
#1
\let\tikzgdeventcallback\pgfgdevent%
@@ -62,27 +62,27 @@
#2%
}
}%
-}
+}%
\pgfgdsetrequestcallback\tikz@gd@request@callback
-\pgfgdappendtoforwardinglist{/tikz/,/tikz/graphs/}
+\pgfgdappendtoforwardinglist{/tikz/,/tikz/graphs/}%
\def\tikz@lib@gd@spec@hook{%
\tikzset{
edge macro=\tikz@gd@plain@edge@macro,
/tikz/at/.style={/graph drawing/desired at={##1}},
- %
+ %
% Setup for the tree syntax (do this late so that grow options
% are still valid after a layout has been chosen)
- %
+ %
/tikz/growth function=\relax,
/tikz/edge from parent macro=\tikz@gd@edge@from@parent@macro,
- %
- % Setup for the graphs syntax
- %
+ %
+ % Setup for the graphs syntax
+ %
/tikz/graphs/new ->/.code n args={4}{\pgfgdedge{##1}{##2}{->}{/tikz,##3}{##4}},
/tikz/graphs/new <-/.code n args={4}{\pgfgdedge{##1}{##2}{<-}{/tikz,##3}{##4}},
/tikz/graphs/new --/.code n args={4}{\pgfgdedge{##1}{##2}{--}{/tikz,##3}{##4}},
@@ -90,41 +90,58 @@
/tikz/graphs/new -!-/.code n args={4}{\pgfgdedge{##1}{##2}{-!-}{/tikz,##3}{##4}},
/tikz/graphs/placement/compute position/.code=,%
}
-}
+}%
\pgfgdaddprepareedgehook{
\tikz@enable@edge@quotes%
\let\tikz@transform=\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
\let\tikz@tonodes=\pgfutil@empty%
-}
+}%
\tikzset{
parent anchor/.forward to=/graph drawing/tail anchor,
child anchor/.forward to=/graph drawing/head anchor
-}
+}%
-\def\pgfgdtikzedgecallback#1#2#3#4#5#6#7{%
- \draw (#1)
- edge [to path={#7 \tikztonodes},#3,#4,/graph drawing/.cd,#6,/tikz/.cd]
- #5
- (#2);
-}
+\def\pgfgdtikzedgecallback#1#2#3#4#5#6#7#8{%
+ \def\pgf@temp{#8}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfscope%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing edge animation/.try}%
+ #8%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \fi%
+ \begingroup
+ \draw (#1)
+ edge [to path={#7 \tikztonodes},#3,#4,/graph drawing/.cd,#6,/tikz/.cd]
+ #5
+ (#2);
+ \endgroup
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \endpgfidscope%
+ \endpgfscope%
+ \fi%
+}%
\def\tikz@gd@edge@from@parent@macro#1#2{
[/utils/exec=\pgfgdedge{\tikzparentnode}{\tikzchildnode}{--}{/tikz,#1}{#2}]
-}
+}%
\def\tikz@gd@plain@edge@macro#1#2{
\pgfgdedge{\tikztostart}{\tikztotarget}{--}{/tikz,#1}{#2}
-}
+}%
-%
+%
% Conversions: Convert coordinates into pairs of values surrounded by
-% braces.
+% braces.
%
\pgfgdset{
@@ -140,7 +157,7 @@
\pgfmathsetmacro{\tikz@gd@temp@y}{\pgf@y}
\edef\pgfgdresult{pgf.gd.model.Coordinate.new(\tikz@gd@temp@x,\tikz@gd@temp@y)}
}
-}
+}%
@@ -150,11 +167,11 @@
\def\pgfgdcallbackcreatevertex#1#2#3#4{%
\node[every generated node/.try,name={#1},shape={#2},/graph drawing/.cd,#3]{#4};%
-}
+}%
-%
-% Subgraph handling
+%
+% Subgraph handling
%
% "General" text placement for subgraph nodes that works with all node
@@ -173,7 +190,7 @@
\vrule width0pt height.5\pgf@y depth.5\pgf@y\hfil}%
}%
},
-}
+}%
\def\tikz@lg@simple@contents@top#1{%
\def\pgfgdsubgraphnodecontents##1{%
@@ -190,13 +207,13 @@
\fi%
\fi%
\pgfmathparse{\pgfkeysvalueof{/tikz/subgraph text sep}}%
- \kern\pgfmathresult pt\relax%
+ \kern\pgfmathresult pt\relax%
\pgf@y=\pgfkeysvalueof{/graph drawing/subgraph bounding box height}\relax%
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{%
\vrule width0pt height.5\pgf@y depth.5\pgf@y\hfil}%
}%
}%
-}
+}%
\def\tikz@lg@simple@contents@bottom#1{%
\def\pgfgdsubgraphnodecontents##1{%
@@ -205,7 +222,7 @@
\setbox0=\vbox{%
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{\vrule width0pt height\pgf@y\hfil}%
\pgfmathparse{\pgfkeysvalueof{/tikz/subgraph text sep}}%
- \kern\pgfmathresult pt\relax%
+ \kern\pgfmathresult pt\relax%
\def\pgf@temp{##1}%
\ifx\pgf@temp\pgfutil@empty%
\else%
@@ -225,15 +242,15 @@
\box0\relax%
}%
}%
-}
+}%
-\tikzset{subgraph text top}
+\tikzset{subgraph text top}%
\tikzset{
subgraph nodes/.style={/tikz/every subgraph node/.style={#1}},
graphs/subgraph nodes/.style={/tikz/every subgraph node/.style={#1}},
graphs/@graph drawing setup/.style={/graph drawing/anchor at={(\tikz@lastx,\tikz@lasty)}}
-}
+}%