georgesboris / elm-widgets-charts-alpha / W.Chart

Setup

globalStyles : TypedSvg.Core.Svg msg

fromX : List (ChartAttribute msg) -> { x : AxisConfigX x } -> ConfigX msg x

fromXY : List (ChartAttribute msg) -> { x : AxisConfigX x, y : AxisConfigYZ x y } -> ConfigXY msg x y

fromXYZ : List (ChartAttribute msg) -> { x : AxisConfigX x, y : AxisConfigYZ x y, z : AxisConfigYZ x z } -> ConfigXYZ msg x y z


type alias ConfigX msg x =
Internal.Config msg x () () { x : Point x }


type alias ConfigXY msg x y =
Internal.Config msg x y () { x : Point x
, y : List (Point y) 
}


type alias ConfigXYZ msg x y z =
Internal.Config msg x y z { x : Point x
, y : List (Point y)
, z : List (Point z) 
}


type alias Config msg x y z point =
Internal.Config msg x y z point


type alias ChartAttribute msg =
Attr (Internal.Attributes msg)

Axis

xAxis : List AxisAttribute -> { data : List x, toLabel : x -> String } -> AxisConfigX x

axis : List AxisAttribute -> { label : String, color : String, toValue : x -> Maybe Basics.Float } -> AxisConfigYZ x String

axisList : List AxisAttribute -> { data : List a, toLabel : a -> String, toColor : a -> String, toValue : a -> x -> Maybe Basics.Float } -> AxisConfigYZ x a

Axis Attributes

axisLabel : String -> AxisAttribute

defaultValue : Basics.Float -> AxisAttribute

format : (Basics.Float -> String) -> AxisAttribute

noAxisLine : AxisAttribute

noGridLines : AxisAttribute

safety : Basics.Float -> AxisAttribute

stacked : AxisAttribute

distribution : AxisAttribute

ticks : Basics.Int -> AxisAttribute


type alias AxisAttribute =
Attr Internal.AxisAttributes

Styles

Size

width : Basics.Int -> ChartAttribute msg

ratio : Basics.Float -> ChartAttribute msg

background : String -> ChartAttribute msg

Padding

padding : Basics.Int -> ChartAttribute msg

paddingX : Basics.Int -> ChartAttribute msg

paddingY : Basics.Int -> ChartAttribute msg

paddingCustom : { top : Basics.Int, left : Basics.Int, right : Basics.Int, bottom : Basics.Int } -> ChartAttribute msg

Colors

Font Sizes

fontSize : { small : Basics.Float, medium : Basics.Float, large : Basics.Float } -> ChartAttribute msg

Widgets

view : List (Internal.Widget msg x y z point) -> Config msg x y z point -> Html msg


type alias WidgetX msg x y z a =
Widget msg x y z { a | x : Point x }


type alias WidgetXY msg x y z a =
Widget msg x y z { a | x : Point x
, y : List (Point y) 
}


type alias WidgetXYZ msg x y z a =
Widget msg x y z { a | x : Point x
, y : List (Point y)
, z : List (Point z) 
}


type alias Widget msg x y z point =
Internal.Widget msg x y z point

Interaction

withActive : Maybe Coordinates -> Config msg x y z point -> Config msg x y z point

withHover : List (HoverAttribute msg point) -> Config msg x y z point -> Config msg x y z point

groupByXY : HoverAttribute msg point

onClick : ({ x : Basics.Float, y : Maybe Basics.Float } -> point -> msg) -> HoverAttribute msg point

onMouseEnter : ({ x : Basics.Float, y : Maybe Basics.Float } -> point -> msg) -> HoverAttribute msg point

onMouseLeave : ({ x : Basics.Float, y : Maybe Basics.Float } -> point -> msg) -> HoverAttribute msg point


type alias PointX x =
{ x : Point x }


type alias PointXY x y =
{ x : Point x
, y : List (Point y) 
}


type alias PointXYZ x y z =
{ x : Point x
, y : List (Point y)
, z : List (Point z) 
}

Helpful Types


type alias Context x y z =
Internal.Context x y z


type alias Coordinates =
{ x : Basics.Float
, y : Maybe Basics.Float 
}


type alias Point a =
Internal.DataPoint a


type alias RenderDatum =
Internal.RenderDatum


type alias AxisDataPoints x a =
Internal.AxisDataPoints x a

Debugging

debug : ChartAttribute msg