This library aims to allow you to visualize a variety of graphs in
an intuitve manner without comprimising flexibility regarding configuration.
It is insprired by the elm-html api, using the element attrs children pattern.
This is still in beta! The api might and probably will change!
Represents a child element of the plot.
Convinience type to represent coordinates.
Convinience type to represent style.
This is the function processing your entire plot configuration. Pass your attributes and elements to this function and a svg plot will be returned!
So this is like plot, except the message to is Interaction msg. It's a message wrapping
your message, so you can use the build in inteactions (like the hint!) in the plot as well as adding your own.
See this example.
Adds a hint to your plot. See this example
Remember to use plotInteractive for the events to be processed!.
This element is passed a function which can translate your values into svg coordinates. This way you can build your own serie types. Although if you feel like you're missing something let me know!
This wraps all your bar series.
Adds classes to the svg element.
Adds an id to the svg element.
Specify margin around the plot. Useful when your ticks are outside the
plot and you would like to add space to see them! Values are in pixels and
the format is ( top, right, bottom, left ).
Default: ( 0, 0, 0, 0 )
Adds padding to your plot, meaning extra space below
and above the lowest and highest point in your plot.
The unit is pixels and the format is ( bottom, top ).
Default: ( 0, 0 )
Specify the size of your plot in pixels and in the format
of ( width, height ).
Default: ( 800, 500 )
Adds styles to the svg element.
Alter the domain's lower boundery. The function provided will
be passed the lowest y-value present in any of your series and the result will
be the lower boundery of your series. So if you would like
the lowest boundery to simply be the edge of your series, then set
this attribute to the function identity.
If you want it to always be -5, then set this attribute to the function always -5.
The default is identity.
Note: If you are using padding as well, the extra padding will still be
added outside the domain.
Alter the domain's upper boundery. The function provided will
be passed the lowest y-value present in any of your series and the result will
be the upper boundery of your series. So if you would like
the lowest boundery to always be 10, then set this attribute to the function always 10.
The default is identity.
Note: If you are using padding as well, the extra padding will still be
added outside the domain.
Provide a function to determine the lower boundery of range.
See domainLowest and imagine we're talking about the x-axis.
Provide a function to determine the upper boundery of range.
See domainHighest and imagine we're talking about the x-axis.
For an example of the update flow see this example.
Get the hovered position from state.