Modül:Grafiksel kronoloji
local getArgs = require('Module:Arguments'). getArgs
local compressSparseArray = require('Module:TableTools'). compressSparseArray
local jeoloji = require('Modül:Jeolojik aralık')
local p = {}
-- -- UTILITY FUNCTIONS
-- -- Default colors for first 28 bars/periods
local defaultColor = {"#6ca","#ff9","#6cf","#c96","#fcc","#9f9","#96c","#cc6","#ccc","#f66","#6c6","#99f","#c66","#f9c", "#396","#ff3","#06c","#963","#c9c","#9c6","#c63","#c96","#999","#c03","#393","#939","#996","#f69"} -- The default width of annotations (in em) local defaultAW = 8
-- Previous version default width (in em)
local oldDefaultAW = 7
-- Function to turn blank arguments back into nil
-- Parameters:
-- s = a string argument
-- Returns
-- if s is empty, turn back into nil (considered false by Lua)
local function ignoreBlank(s) if s == "" then return nil end return s
end
-- Function to suppress incorrect CSS values
-- Parameters:
-- val = dimensional value -- unit = unit of value
-- nonneg = [bool] value needs to be non-negative
-- formatstr = optional format string
-- Returns:
-- correct string for html, or nil if val is negative
local function checkDim(val, unit, nonneg, formatstr) if not val then return nil end val = tonumber(val) if not val or (nonneg and val < 0) then return nil end if formatstr then return mw.