Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Stylistic or syntactical options for chart elements.
Synopsis
- data RectStyle = RectStyle {
- borderSize :: Double
- borderColor :: Colour
- color :: Colour
- defaultRectStyle :: RectStyle
- blob :: Colour -> RectStyle
- clear :: RectStyle
- border :: Double -> Colour -> RectStyle
- data TextStyle = TextStyle {}
- defaultTextStyle :: TextStyle
- styleBoxText :: TextStyle -> Text -> Point Double -> Rect Double
- data ScaleX
- data GlyphStyle = GlyphStyle {}
- defaultGlyphStyle :: GlyphStyle
- styleBoxGlyph :: GlyphStyle -> Rect Double
- gpalette1 :: Int -> GlyphShape
- data ScaleBorder
- data GlyphShape
- glyphText :: GlyphShape -> ByteString
- data LineStyle = LineStyle {}
- defaultLineStyle :: LineStyle
- data LineCap
- fromLineCap :: IsString s => LineCap -> s
- toLineCap :: (Eq s, IsString s) => s -> LineCap
- data LineJoin
- fromLineJoin :: IsString s => LineJoin -> s
- toLineJoin :: (Eq s, IsString s) => s -> LineJoin
- data Anchor
- fromAnchor :: IsString s => Anchor -> s
- toAnchor :: (Eq s, IsString s) => s -> Anchor
- data PathStyle = PathStyle {
- borderSize :: Double
- borderColor :: Colour
- color :: Colour
- defaultPathStyle :: PathStyle
RectStyle
Rectangle styling
>>>
defaultRectStyle
RectStyle {borderSize = 1.0e-2, borderColor = Colour 0.02 0.29 0.48 1.00, color = Colour 0.02 0.73 0.80 0.10}
RectStyle | |
|
Instances
Generic RectStyle Source # | |
Show RectStyle Source # | |
Eq RectStyle Source # | |
type Rep RectStyle Source # | |
Defined in Chart.Style type Rep RectStyle = D1 ('MetaData "RectStyle" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "RectStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "borderSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "borderColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour) :*: S1 ('MetaSel ('Just "color") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour)))) |
defaultRectStyle :: RectStyle Source #
the style
blob :: Colour -> RectStyle Source #
solid rectangle, no border
>>>
blob black
RectStyle {borderSize = 0.0, borderColor = Colour 0.00 0.00 0.00 0.00, color = Colour 0.00 0.00 0.00 1.00}
transparent rect
>>>
clear
RectStyle {borderSize = 0.0, borderColor = Colour 0.00 0.00 0.00 0.00, color = Colour 0.00 0.00 0.00 0.00}
border :: Double -> Colour -> RectStyle Source #
transparent rectangle, with border
>>>
border 0.01 transparent
RectStyle {borderSize = 1.0e-2, borderColor = Colour 0.00 0.00 0.00 0.00, color = Colour 0.00 0.00 0.00 0.00}
TextStyle
Text styling
>>>
defaultTextStyle
TextStyle {size = 0.12, color = Colour 0.05 0.05 0.05 1.00, anchor = AnchorMiddle, hsize = 0.45, vsize = 1.1, vshift = -0.25, rotation = Nothing, scalex = ScaleX, frame = Nothing}
Instances
defaultTextStyle :: TextStyle Source #
the offical text style
styleBoxText :: TextStyle -> Text -> Point Double -> Rect Double Source #
the extra area from text styling
Whether to scale text given X-axis scaling
GlyphStyle
data GlyphStyle Source #
Glyph styling
>>>
defaultGlyphStyle
GlyphStyle {size = 3.0e-2, color = Colour 0.02 0.73 0.80 0.20, borderColor = Colour 0.02 0.29 0.48 1.00, borderSize = 3.0e-3, shape = SquareGlyph, rotation = Nothing, translate = Nothing}
Instances
defaultGlyphStyle :: GlyphStyle Source #
the offical glyph style
styleBoxGlyph :: GlyphStyle -> Rect Double Source #
the extra area from glyph styling
gpalette1 :: Int -> GlyphShape Source #
Infinite list of glyph shapes
>>>
gpalette1 0
CircleGlyph
data ScaleBorder Source #
Should glyph borders be scaled?
Instances
Generic ScaleBorder Source # | |
Defined in Chart.Style type Rep ScaleBorder :: Type -> Type # from :: ScaleBorder -> Rep ScaleBorder x # to :: Rep ScaleBorder x -> ScaleBorder # | |
Show ScaleBorder Source # | |
Defined in Chart.Style showsPrec :: Int -> ScaleBorder -> ShowS # show :: ScaleBorder -> String # showList :: [ScaleBorder] -> ShowS # | |
Eq ScaleBorder Source # | |
Defined in Chart.Style (==) :: ScaleBorder -> ScaleBorder -> Bool # (/=) :: ScaleBorder -> ScaleBorder -> Bool # | |
type Rep ScaleBorder Source # | |
data GlyphShape Source #
glyph shapes
CircleGlyph | |
SquareGlyph | |
EllipseGlyph Double | |
RectSharpGlyph Double | |
RectRoundedGlyph Double Double Double | |
TriangleGlyph (Point Double) (Point Double) (Point Double) | line width is determined by borderSize |
VLineGlyph | |
HLineGlyph | |
PathGlyph ByteString ScaleBorder |
Instances
glyphText :: GlyphShape -> ByteString Source #
textifier
LineStyle
line style
>>>
defaultLineStyle
LineStyle {size = 1.2e-2, color = Colour 0.05 0.05 0.05 1.00, linecap = Nothing, linejoin = Nothing, dasharray = Nothing, dashoffset = Nothing}
See also https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
Instances
Generic LineStyle Source # | |
Show LineStyle Source # | |
Eq LineStyle Source # | |
type Rep LineStyle Source # | |
Defined in Chart.Style type Rep LineStyle = D1 ('MetaData "LineStyle" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "LineStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "size") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "color") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour) :*: S1 ('MetaSel ('Just "linecap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LineCap)))) :*: (S1 ('MetaSel ('Just "linejoin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LineJoin)) :*: (S1 ('MetaSel ('Just "dasharray") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Double])) :*: S1 ('MetaSel ('Just "dashoffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)))))) |
defaultLineStyle :: LineStyle Source #
the official default line style
line cap style
Instances
Generic LineCap Source # | |
Show LineCap Source # | |
Eq LineCap Source # | |
type Rep LineCap Source # | |
Defined in Chart.Style type Rep LineCap = D1 ('MetaData "LineCap" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "LineCapButt" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LineCapRound" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LineCapSquare" 'PrefixI 'False) (U1 :: Type -> Type))) |
fromLineCap :: IsString s => LineCap -> s Source #
textifier
line cap style
Instances
Generic LineJoin Source # | |
Show LineJoin Source # | |
Eq LineJoin Source # | |
type Rep LineJoin Source # | |
Defined in Chart.Style type Rep LineJoin = D1 ('MetaData "LineJoin" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "LineJoinMiter" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LineJoinBevel" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LineJoinRound" 'PrefixI 'False) (U1 :: Type -> Type))) |
fromLineJoin :: IsString s => LineJoin -> s Source #
textifier
position anchor
Instances
Generic Anchor Source # | |
Show Anchor Source # | |
Eq Anchor Source # | |
type Rep Anchor Source # | |
Defined in Chart.Style type Rep Anchor = D1 ('MetaData "Anchor" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "AnchorMiddle" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AnchorStart" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AnchorEnd" 'PrefixI 'False) (U1 :: Type -> Type))) |
fromAnchor :: IsString s => Anchor -> s Source #
text
PathStyle
Path styling
>>>
defaultPathStyle
PathStyle {borderSize = 1.0e-2, borderColor = Colour 0.02 0.29 0.48 1.00, color = Colour 0.66 0.07 0.55 1.00}
PathStyle | |
|
Instances
Generic PathStyle Source # | |
Show PathStyle Source # | |
Eq PathStyle Source # | |
type Rep PathStyle Source # | |
Defined in Chart.Style type Rep PathStyle = D1 ('MetaData "PathStyle" "Chart.Style" "chart-svg-0.5.1.1-8lY6oe5XleKGDEXDqpr6ug" 'False) (C1 ('MetaCons "PathStyle" 'PrefixI 'True) (S1 ('MetaSel ('Just "borderSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "borderColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour) :*: S1 ('MetaSel ('Just "color") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Colour)))) |
defaultPathStyle :: PathStyle Source #
the style