Functions for building graphs and charts. A chart consists of one more graphs. Graphs come in various flavors, notably line and scatter.
In this module, Svg means TypedSvg.Core.Svg
Format determines the height, width, and appearance of the rendered chart
A Graph consists of data in the form of List (Float, Float),
a bounding box, a choice of color, and a GraphType, e.g, Line or Scatter.
A chart consists of a boundig box and a list of Graphs.
A chart is rendered to SVG by the view function.
Compute a bounding box from data, where
type alias Data =
List ( Float, Float )Make a graph of given GraphType and given color r, g, b from the given data. where
type alias Data =
List ( Float, Float )Render graph data to SVG as a broken line.
Draw a line through mean values of the data.
Render graph data to SVG as a scatter plot.
Render error bars with given confidence level for the given data as SVG
Convert a chart to (typed) SVG. Parameters:
Format: determines the dimensions and appearance of the output
Maybe (Svg mg): this is an "annotation," which maybeNothingorJust svgValue, wheresvgValueis any value of typeSvg msg.
HereSvgmeand TypedSvg.Core.Svg.
StatChart: the chart to be rendered
One use of annotations is to add error bars to a chart. See
./examples/src/Hubble.elm
Make a chart out of a graph
Add a graph to an existing StatChart
A box containing data of the form
List (Float, Float)