diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface')
5 files changed, 19 insertions, 7 deletions
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$ |