[{"name":"Facet","comment":" Utilities for creating scales for multiple data series together (fixed) or\nseparately (free). Used internally by [Sparklines](#Sparklines) facet views,\nbut may be useful generally.\n\n\n# Basic types\n\n@docs Scaling, Scaling2d, Scale, Scale2d\n\n\n# Continuous scales\n\n@docs linearScale, fixedLinearScale, freeLinearScales, timeScale, fixedTimeScale, freeTimeScales\n\n\n# Band scales\n\n@docs timeBandScale, fixedTimeBandScale, freeTimeBandScales\n\n","unions":[{"name":"Scale","comment":" Either a single fixed scale or a list of free scales. A result type.\n","args":["a"],"cases":[["FixedScale",["a"]],["FreeScales",["List.List a"]]]},{"name":"Scaling","comment":" A declarative type for how to scale data series\n","args":[],"cases":[["Fixed",[]],["Free",[]]]}],"aliases":[{"name":"Scale2d","comment":" Either a single fixed scale or a list of free scales, for x and y dimensions.\nA result type.\n","args":["x","y"],"type":"{ x : Facet.Scale x, y : Facet.Scale y }"},{"name":"Scaling2d","comment":" A declarative type for how to scale x and y dimensions of data series\n","args":[],"type":"{ x : Facet.Scaling, y : Facet.Scaling }"}],"values":[{"name":"fixedLinearScale","comment":" Create a fixed linear scale from a list of arbitrary data series, given the\naccessor and the range. (The domain of fixed scales is from the minimum\nvalue of all the series to the maximum value of all the series.)\n","type":"(a -> Basics.Float) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> Scale.ContinuousScale Basics.Float"},{"name":"fixedTimeBandScale","comment":" Create a fixed time band scale from a list of arbitrary data series,\ngiven the\n[BandScale configuration](https://package.elm-lang.org/packages/gampleman/elm-visualization/latest/Scale#BandScale)\n, accessor and the range. (The domain of fixed time band scales is a list of\ntimes from the earliest in all the series to the latest in all the series.)\n\nNote that this function does _not_ change the data in any way, so you should\npre-aggregate data by time interval and deal with possible gaps in intervals.\nThe [Timeseries](#Timeseries) module has tools for doing this.\n\n","type":"Scale.BandConfig -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> Scale.BandScale Time.Posix"},{"name":"fixedTimeScale","comment":" Create a fixed continuous time scale from a list of arbitrary data series,\ngiven the accessor and the range. (The domain of fixed scales is from the\nminimum value (time) of all the series to the maximum value of all the series.)\n","type":"Time.Zone -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> Scale.ContinuousScale Time.Posix"},{"name":"freeLinearScales","comment":" Create free linear scales from a list of arbitrary data series, given the\naccessor and the range. (The domain of free scales is the domain of each\ndata series separately.)\n","type":"(a -> Basics.Float) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> List.List (Scale.ContinuousScale Basics.Float)"},{"name":"freeTimeBandScales","comment":" Create free time band scales from a list of arbitrary data series,\ngiven the\n[BandScale configuration](https://package.elm-lang.org/packages/gampleman/elm-visualization/latest/Scale#BandScale)\n, accessor and the range. (The domain of free time band scales is a list of\ntimes from the earliest to the latest, within each series separately.)\n\nNote that this function does _not_ change the data in any way, so you should\npre-aggregate data by time interval and deal with possible gaps in intervals.\nThe [Timeseries](#Timeseries) module has tools for doing this.\n\n","type":"Scale.BandConfig -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> List.List (Scale.BandScale Time.Posix)"},{"name":"freeTimeScales","comment":" Create free continuous time scales from a list of arbitrary data series,\ngiven the accessor and the range. (The domain of free scales is the domain of\neach data series separately.)\n","type":"Time.Zone -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List (List.List a) -> List.List (Scale.ContinuousScale Time.Posix)"},{"name":"linearScale","comment":" Create a linear scale from a single arbitrary data series, given the\naccessor and the range.\n","type":"(a -> Basics.Float) -> ( Basics.Float, Basics.Float ) -> List.List a -> Scale.ContinuousScale Basics.Float"},{"name":"timeBandScale","comment":" Create a single time band scale from an arbitrary data series,\ngiven the\n[BandScale configuration](https://package.elm-lang.org/packages/gampleman/elm-visualization/latest/Scale#BandScale)\n, accessor and the range.\n\nNote that this function does _not_ change the data in any way, so you should\npre-aggregate data by time interval and deal with possible gaps in intervals.\nThe [Timeseries](#Timeseries) module has tools for doing this.\n\n","type":"Scale.BandConfig -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List a -> Scale.BandScale Time.Posix"},{"name":"timeScale","comment":" Create a continuous time scale from a single arbitrary data series, given\nthe accessor and the range.\n","type":"Time.Zone -> (a -> Time.Posix) -> ( Basics.Float, Basics.Float ) -> List.List a -> Scale.ContinuousScale Time.Posix"}],"binops":[]},{"name":"Sparklines","comment":" Sparkline view functions. There are two basic chart types:\n\n  - [Line charts](#line)\n  - [Columns charts](#columns)\n\nThese are conceptually very similar, except columns charts aggregate\nobservations under a specified time interval, whereas line charts do not do any\naggregation, but plot the observations according to a continuous time scale,\nand draw a line between them.\n\nThe data to be charted must be a `List (Time.Posix, Float)`. For line charts,\nin most cases the X values should be unique, i.e. there should one Y\nfor every X, but this is not enforced. For columns charts, this constraint is\nenforced by aggregating Y values over each given time interval, using a\nprovided aggregation function (by default, `List.sum`). (If you want the same\nbehavior for line charts, i.e. aggregating over time intervals, use the\nfunctions in the [Timeseries](Timeseries) module on your data first.)\n\nThere are also functions for scaling multiple data series together, i.e.\nfor creating 'facet' charts from small multiples:\n\n  - [Faceted line charts](#lineFacets)\n  - [Faceted columns charts](#columnsFacets)\n\nPlease note that these functions do not themselves group your data into small\nmultiples, nor do they position or label the series each chart represents.\nThat is all up to you. The purpose of these chart functions is to render the\ncharts scaling the X and Y dimensions of the series according to the parameters\nyou specify.\n\nFinally, a function to create a single line chart with multiple series (with\nboth X and Y dimensions scaled together) is provided:\n\n  - [Multiple-lines charts](#lines)\n\n\n# Highlighting\n\nFor any chart type you can define which observations are _highlighted_.\nOften this is the last observation, or the min and/or the max, but there are\nsome more options as well (see [Highlight](#Highlight)). Highlighted\nobservations are rendered as circles (points) with a configurable color.\n\n\n# Brushing\n\nFor any chart type except multiple-lines charts, you can provide and configure a\nan elm-visualization\n[Brush](https://package.elm-lang.org/packages/elm-visualization/latest/Brush)\nto allow interactive selection of observations. This can also be\nconfigured to display X and Y values at the start and end of the selection --\ninteractive axis labels.\n\n\n# Access to highlighted and selected data\n\nIn addition, functions are available that return charts together with\nthe data that is currently highlighted and selected (brushed), to make it\neasy to build a separate view based on the current highlights/selections.\n\n\n# Examples\n\nSee the examples directory for all features in action.\n\n\n# Reference\n\n\n## Single charts\n\n@docs line, lines, columns\n\n\n## Facet charts\n\n@docs lineFacets, columnsFacets\n\n\n## Charts together with selected/highlighted data\n\n@docs ChartData, lineData, lineFacetsData, columnsData, columnsFacetsData\n\n\n## Highlighting\n\n@docs Highlight\n\n\n## Basic configuration\n\n@docs lineConfig, columnsConfig, withPadding, withCssBlock, withHighlight, withBandConfig, defaultColorPairs, Config\n\n\n## Brushing configuration\n\n@docs withBrush, withBrushLabels, withBrushLabelsX, withBrushLabelsY, BrushingAppearanceConfig, BrushingLabelsConfig, defaultBrushingAppearance, formattingLabelsX, formattingLabelsY, coloringLabels, sizingLabels\n\n","unions":[{"name":"Config","comment":" Chart configuration. See above for usage examples.\n","args":["msg"],"cases":[]},{"name":"Highlight","comment":" Options for chart highlighting.\n\n  - `NoHighlight`: Don't highlight anything\n  - `HighlightLast`: Highlight the last observation\n  - `HighlightNegative`: Highlight all values less than 0\n  - `HighlightMin`: Highlight the minimum value in the series\n  - `HighlightMax`: Highlight the maximum value in the series\n  - `HighlightMinMax`: Highlight the minimum and maximum values in the series\n  - `HighlightPeaks`: Highlight positive peaks detected in the series, with\n    specified parameters.\n\nSee [elm-visualization's peaks function](https://package.elm-lang.org/packages/gampleman/elm-visualization/latest/Statistics#peaks) for details on that calculation and the parameters needed.\n\nExample:\n\n    config : Config msg\n    config =\n        lineConfig Time.Day Time.utc 100 50\n            |> withHighlight HighlightMax\n\n","args":[],"cases":[["NoHighlight",[]],["HighlightLast",[]],["HighlightNegative",[]],["HighlightMin",[]],["HighlightMax",[]],["HighlightMinMax",[]],["HighlightPeaks",["{ lookaround : Basics.Int, sensitivity : Basics.Float, coallesce : Basics.Int }"]]]}],"aliases":[{"name":"BrushingAppearanceConfig","comment":" Configuration for the appearance of the brush overlay. Note that\ncolors are specified using `TypedSvg.Type.Paint`.\n\n  - `area`: the fill color of the brushed area (or bars) of the chart\n  - `bounds`: the stroke color of the bounds lines of the brush\n  - `boundsDashed`: True if you want dashed bounds lines\n  - `highlight`: the color of bounds lines and labels when the observations are\n    highlighted\n\n","args":[],"type":"{ area : TypedSvg.Types.Paint, bounds : TypedSvg.Types.Paint, boundsDashed : Basics.Bool, highlight : TypedSvg.Types.Paint }"},{"name":"BrushingLabelsConfig","comment":" Configuration for the appearance of the brush overlay labels. Note that\ncolor is specified using `TypedSvg.Type.Paint`, and size is specified using\n`TypedSvg.Type.Length`.\n\n  - `color`: the text color of labels\n  - `size`: the size of label text\n  - `labelX`: how to display X (time) values\n  - `labelY`: how to display Y (float) values\n\nNote `labelX` uses the time zone specified in top-level Config.\n\n","args":[],"type":"{ color : TypedSvg.Types.Paint, size : TypedSvg.Types.Length, labelX : Time.Zone -> Time.Posix -> String.String, labelY : Basics.Float -> String.String }"},{"name":"ChartData","comment":" Data type for chart and selected and highlighted data returned by\n[lineData](#lineData), [lineFacetsData](#lineFacetsData),\n[columnsData](#columnsData), and [columnsFacetsData](#columnsFacetsData).\n","args":["msg"],"type":"{ chart : TypedSvg.Core.Svg msg, selected : Timeseries.Series, highlighted : Timeseries.Series }"}],"values":[{"name":"coloringLabels","comment":" Set label (background) color (in TypedSvg.Types.Paint).\n","type":"TypedSvg.Types.Paint -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"columns","comment":" Produce a columns chart, passing in an optional brush for interactive\nselection. (See Example/Brush for a full example of how to set up brushes).\n\nExample:\n\n    chart : Svg msg\n    chart =\n        columns config (Just brush) series\n\n","type":"Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> Timeseries.Series -> TypedSvg.Core.Svg msg"},{"name":"columnsConfig","comment":" Basic columns chart configuration, given an aggregation function,\na Time.Interval, a Time.Zone, the width, and the height of chart.\n\nExample for a columns chart aggregating by the mean of observations over\nmonth intervals:\n\n    config : Config msg\n    config =\n        columnsConfig\n            (\\ys -> List.sum ys / (List.length ys |> toFloat))\n            Time.Month\n            Time.utc\n            100\n            50\n\n","type":"(List.List Basics.Float -> Basics.Float) -> Time.Extra.Interval -> Time.Zone -> Basics.Float -> Basics.Float -> Sparklines.Config msg"},{"name":"columnsData","comment":" Same as [columns](#columns), but returning [ChartData](#ChartData)\nwith highlighted and selected (brushed) data, in addition to the chart.\n","type":"Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> Timeseries.Series -> Sparklines.ChartData msg"},{"name":"columnsFacets","comment":" Produce a list of columns charts, scaling the given timeseries data together\nas specified by a [Facet.Scaling2d](Facet#Scaling2d), and passing in an\noptional brush for synchronized brushing across all charts. (See\nExample/Brush for an example of this).\n\nExample (fixed X and free Y scales):\n\n    charts : List (Svg msg)\n    charts =\n        columnsFacets\n            { x = Facet.Fixed, y = Facet.Free }\n            config\n            (Just brush)\n            [ series1, series2, series3, ... ]\n\n","type":"Facet.Scaling2d -> Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> List.List Timeseries.Series -> List.List (TypedSvg.Core.Svg msg)"},{"name":"columnsFacetsData","comment":" Same as [columnsFacets](#columnsFacets), but returning [ChartData](#ChartData)\nwith highlighted and selected (brushed) data, in addition to the chart.\n","type":"Facet.Scaling2d -> Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> List.List Timeseries.Series -> List.List (Sparklines.ChartData msg)"},{"name":"defaultBrushingAppearance","comment":" Default brushing appearance options.\nYellow selection area, 70% black solid (non-dashed) bounds lines, red when\nhighlighted.\n","type":"Sparklines.BrushingAppearanceConfig"},{"name":"defaultColorPairs","comment":" A default set of color-pairs for [multi-lines charts](#lines). Uses\nelm-visualization `category10` color scale, with line color at 70% alpha of\nthe highlight color. Need a better default.\n","type":"List.List ( TypedSvg.Types.Paint, TypedSvg.Types.Paint )"},{"name":"formattingLabelsX","comment":" Format time interval labels (x axis) with custom function.\n\nNote: The time zone in top-level Config is used to render labels.\n\nMost date/time formatting libraries should compose with this. Internally,\n[ryannhg/date-format](https://package.elm-lang.org/packages/ryannhg/date-format/latest)\nis used for default formats based on the given interval.\n\nExample:\n\n    yyyymmdd : Time.Zone -> Time.Posix -> String\n    yyyymmdd =\n        DateFormat.format\n            [ DateFormat.yearNumber\n            , DateFormat.monthFixed\n            , DateFormat.dayOfMonthFixed\n            ]\n\n    config : Config Msg\n    config =\n        lineConfig Time.utc 100 50\n            |> withBrushLabels UpdateBrush defaultBrushingAppearance\n            |> formattingLabelsX yyyymmdd\n\n","type":"(Time.Zone -> Time.Posix -> String.String) -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"formattingLabelsY","comment":" Format labels for the y axis with custom function\n","type":"(Basics.Float -> String.String) -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"line","comment":" Produce a line chart, passing in an optional brush for interactive\nselection. (See Example/Brush for a full example of how to set up brushes).\n\nExample:\n\n    chart : Svg msg\n    chart =\n        line config (Just brush) series\n\n","type":"Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> Timeseries.Series -> TypedSvg.Core.Svg msg"},{"name":"lineConfig","comment":" Basic line chart configuration, given a Time.Zone, width, and height of chart.\n","type":"Time.Zone -> Basics.Float -> Basics.Float -> Sparklines.Config msg"},{"name":"lineData","comment":" Same as [line](#line), but returning [ChartData](#ChartData)\nwith highlighted and selected (brushed) data, in addition to the chart.\n","type":"Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> Timeseries.Series -> Sparklines.ChartData msg"},{"name":"lineFacets","comment":" Produce a list of line charts, scaling the given timeseries data together\nas specified by a [Facet.Scaling2d](Facet#Scaling2d), and passing in an\noptional brush for synchronized brushing across all charts. (See\nExample/Brush for an example of this).\n\nExample (fixed X and free Y scales):\n\n    charts : List (Svg msg)\n    charts =\n        lineFacets\n            { x = Facet.Fixed, y = Facet.Free }\n            config\n            (Just brush)\n            [ series1, series2, series3, ... ]\n\n","type":"Facet.Scaling2d -> Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> List.List Timeseries.Series -> List.List (TypedSvg.Core.Svg msg)"},{"name":"lineFacetsData","comment":" Same as [lineFacets](#lineFacets), but returning [ChartData](#ChartData)\nwith highlighted and selected (brushed) data, in addition to the chart.\n","type":"Facet.Scaling2d -> Sparklines.Config msg -> Maybe.Maybe (Brush.Brush Brush.OneDimensional) -> List.List Timeseries.Series -> List.List (Sparklines.ChartData msg)"},{"name":"lines","comment":" Produce a multi-line chart, with all given series scaled together on both\nX and Y dimensions, using the given list of color pairs for the line and\nhighlight colors respectively of each series. (Note that colors are specified\nas `TypedSvg.Types.Paint`.)\n\nExample:\n\n    chart : Svg msg\n    chart =\n        lines defaultColorPairs config [series1, series2, series3, ... ]\n\nNote that neither brushing nor returning highlighted data is implemented\ncurrently for multi-line charts.\n\n","type":"List.List ( TypedSvg.Types.Paint, TypedSvg.Types.Paint ) -> Sparklines.Config msg -> List.List Timeseries.Series -> TypedSvg.Core.Svg msg"},{"name":"sizingLabels","comment":" Set label size (in TypedSvg.Types.Length).\n","type":"TypedSvg.Types.Length -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withBandConfig","comment":" Configure the band-scale used for columns charts. Refer to\nelm-visualization [Scale.BandConfig](https://package.elm-lang.org/packages/elm-visualization/gampleman.elm-visualization/latest/Scale#BandConfig) for details.\n","type":"Scale.BandConfig -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withBrush","comment":" Configure brushing in chart (with no labels)\n\nExample:\n\n    type Msg\n        = UpdateBrush Brush.OnBrush\n        | ...\n\n    config : Config Msg\n    config =\n        lineConfig Time.utc 100 50\n            |> withBrush UpdateBrush defaultBrushingAppearance\n\n","type":"(Brush.OnBrush -> msg) -> Sparklines.BrushingAppearanceConfig -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withBrushLabels","comment":" Configure brushing in chart with both X and Y labels\n\nExample:\n\n    type Msg\n        = UpdateBrush Brush.OnBrush\n        | ...\n\n    config : Config Msg\n    config =\n        lineConfig Time.utc 100 50\n            |> withBrushLabels UpdateBrush defaultBrushingAppearance\n\n","type":"(Brush.OnBrush -> msg) -> Sparklines.BrushingAppearanceConfig -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withBrushLabelsX","comment":" Configure brushing in chart with only X labels\n","type":"(Brush.OnBrush -> msg) -> Sparklines.BrushingAppearanceConfig -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withBrushLabelsY","comment":" Configure brushing in chart with only Y labels\n","type":"(Brush.OnBrush -> msg) -> Sparklines.BrushingAppearanceConfig -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withCssBlock","comment":" Set CSS block name (default is \"sparklines\")\n","type":"String.String -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withHighlight","comment":" Set [highlight](#Highlight) to include in chart\n","type":"Sparklines.Highlight -> Sparklines.Config msg -> Sparklines.Config msg"},{"name":"withPadding","comment":" Set padding (in pixels) around chart\n","type":"Basics.Float -> Sparklines.Config msg -> Sparklines.Config msg"}],"binops":[]},{"name":"Timeseries","comment":" Utility functions for timeseries data, i.e. `List (Time.Posix, Float)`.\nIn particular, functions for normalizing (removing gaps) and aggregating data\nover time intervals.\n\nTime interval types and operations provided by\n[justinmimbs/time-extra](https://package.elm-lang.org/packages/justinmimbs/time-extra/latest)\n\nThe [groupByIntervals](#groupByIntervals) function is used internally to prepare\ndata series for a [columns](Sparklines#columns) chart, and\n[groupByIntervalsMultiple](#groupByIntervalsMultiple) is used internally for\n[columnsFacets](Sparklines#columnsFacets) charts with fixed X scales.\n\nThese may be generally useful, for example if you want to pre-aggregate your\ndata by time interval for [line](Sparklines#line) and\n[lineFacets](Sparklines#lineFacets) charts (which do not automatically use\nthese functions).\n\n\n# Types\n\n@docs Series, Observation\n\n\n# Time interval extents\n\n@docs intervalExtent, intervalExtentMultiple\n\n\n# Normalizing and aggregating data over time intervals\n\n@docs groupByIntervals, groupByIntervalsMultiple, groupByIntervalsInExtent\n\n","unions":[],"aliases":[{"name":"Observation","comment":" Representation of a single observation in a time series\n","args":[],"type":"( Time.Posix, Basics.Float )"},{"name":"Series","comment":" Representation of a time series\n","args":[],"type":"List.List Timeseries.Observation"}],"values":[{"name":"groupByIntervals","comment":" Group series by given time interval, aggregating y values by given function,\nand normalizing the series such that missing observations for time intervals\nare set to y = 0.\n","type":"(List.List Basics.Float -> Basics.Float) -> Time.Extra.Interval -> Time.Zone -> Timeseries.Series -> Timeseries.Series"},{"name":"groupByIntervalsInExtent","comment":" Group series by given time interval and extent, aggregating y values by\ngiven function, and normalizing the series such that missing observations for\ntime intervals are set to y = 0.\n","type":"(List.List Basics.Float -> Basics.Float) -> Time.Extra.Interval -> Time.Zone -> ( Time.Posix, Time.Posix ) -> Timeseries.Series -> Timeseries.Series"},{"name":"groupByIntervalsMultiple","comment":" Group multiple series by given time interval, aggregating y values by\ngiven function, and normalizing all series such that they all have the same\nextent and missing observations for time intervals in each series are set to\ny = 0.\n","type":"(List.List Basics.Float -> Basics.Float) -> Time.Extra.Interval -> Time.Zone -> List.List Timeseries.Series -> List.List Timeseries.Series"},{"name":"intervalExtent","comment":" Calculate the extent of a time series when grouped by the given interval.\nNote the lower bound is \"rounded down\" and the upper bound is \"rounded up\".\n","type":"Time.Extra.Interval -> Time.Zone -> Timeseries.Series -> Maybe.Maybe ( Time.Posix, Time.Posix )"},{"name":"intervalExtentMultiple","comment":" Calculate the extent of multiple time series when grouped by the given\ninterval, where the lower bound is the earliest time interval across all\nseries and the higher bound is the latest time interval across all series.\nNote the lower bound is \"rounded down\" and the upper bound is \"rounded up\".\n","type":"Time.Extra.Interval -> Time.Zone -> List.List Timeseries.Series -> Maybe.Maybe ( Time.Posix, Time.Posix )"}],"binops":[]}]