definition module TimeGraph import iTasks.WF.Definition import iTasks.UI.JS.Encoding import Graphics.Scalable.Image :: TimeGraphOptions a = { valueSpan :: a -> Span // turn value into rendering distance , measures :: [TimeGraphMeasure a] // the measures that are drawn across the graph , distance :: Span // the distance between two neighbouring values , maxValue :: a // the maximum value that can be rendered visibly , maxNoElts :: Int // the maximum number of elements that are rendered } :: TimeGraphMeasure a = { base :: a // the value at which the measure is rendered , label :: String // the label of the measure , left :: Bool // if True, label is rendered at left of graph, otherwise at right of graph , font :: FontDef // the font used to render this label } /** time_graph options values: is a task that renders @values in a graph using @options. The number of values that are shown is controlled by @options.maxNoElts. The dimensions of the graph are controlled by @options.distance (the width of each bar) and the application of the function @options.valueSpan to the displayed value (the height of each bar). The maximum value that can be displayed is controlled by @options.maxValue. The @options.measures show labelled lines across the bars. The position of the label is controlled by the .left field of the measure. The height is controlled by the .base field of the measure. Each label can have a different font, defined by the .font field of the measure. */ time_graph :: !(TimeGraphOptions a) ![a] -> Task [a] | JSEncode{|*|}, JSDecode{|*|}, iTask a