summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
committerKarl Berry <karl@freefriends.org>2014-02-27 00:01:50 +0000
commit90ae413a94da014dbf7a6a8ab584f7c668483a5a (patch)
tree4e0528a2b2fb2004988e7fc804ea2f1354f1f5d5 /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
parent800cc56380d1edfe567a6a66bef13e8950eb2b0c (diff)
pgf 3.0.0
git-svn-id: svn://tug.org/texlive/trunk@33057 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua58
1 files changed, 58 insertions, 0 deletions
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
new file mode 100644
index 00000000000..2ef55169bca
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
@@ -0,0 +1,58 @@
+-- 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/ControlSprings.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+
+---
+-- @section subsubsection {Forces and Their Effects: Springs}
+--
+-- The most important parameter of springs is their ``natural
+-- length'', which can be configured using the general-purpose
+-- |node distance| parameter. It is the ``equilibrium length'' of a
+-- spring between two nodes in the graph. When an edge has this
+-- lenght, no forces will ``push'' or ``pull'' along the edge.
+--
+-- The following examples shows how a simple graph can be scaled by
+-- changing the |node distance|:
+-- \begin{codeexample}[]
+-- \tikz \graph [spring layout, node distance=7mm] { subgraph C_n[n=3] };
+-- \tikz \graph [spring layout] { subgraph C_n[n=3] };
+-- \tikz \graph [spring layout, node distance=15mm]{ subgraph C_n[n=3] };
+-- \end{codeexample}
+-- \begin{codeexample}[]
+-- \tikz \graph [spring electrical layout, node distance=0.7cm] { subgraph C_n[n=3] };
+-- \tikz \graph [spring electrical layout] { subgraph C_n[n=3] };
+-- \tikz \graph [spring electrical layout, node distance=1.5cm] { subgraph C_n[n=3] };
+-- \end{codeexample}
+--
+-- @end
+
+
+
+---
+
+declare {
+ key = "spring constant",
+ type = "number",
+ initial = "0.01",
+
+ summary = [["
+ The ``spring constant'' is a factor from Hooke's law describing the
+ ``stiffness'' of a spring. This factor is used inside spring-based
+ algorithms to determine how strongly edges ``pull'' and ``push'' at
+ the nodes they connect.
+ "]]
+ }
+
+