chart-svg
Safe HaskellNone
LanguageGHC2024

Chart.Markup

Description

Conversion between ChartOptions and Markup representations.

Synopsis

Documentation

newtype Markup #

A list of Elements or Tree Tokens

Constructors

Markup 

Fields

Instances

Instances details
Monoid Markup # 
Instance details

Defined in Data.Markup

Semigroup Markup # 
Instance details

Defined in Data.Markup

Eq Markup # 
Instance details

Defined in Data.Markup

Methods

(==) :: Markup -> Markup -> Bool #

(/=) :: Markup -> Markup -> Bool #

Ord Markup # 
Instance details

Defined in Data.Markup

Data Markup # 
Instance details

Defined in Data.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Markup -> c Markup #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Markup #

toConstr :: Markup -> Constr #

dataTypeOf :: Markup -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Markup) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Markup) #

gmapT :: (forall b. Data b => b -> b) -> Markup -> Markup #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Markup -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Markup -> r #

gmapQ :: (forall d. Data d => d -> u) -> Markup -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Markup -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Markup -> m Markup #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Markup -> m Markup #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Markup -> m Markup #

Generic Markup # 
Instance details

Defined in Data.Markup

Associated Types

type Rep Markup 
Instance details

Defined in Data.Markup

type Rep Markup = D1 ('MetaData "Markup" "Data.Markup" "markup-parse-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Markup" 'PrefixI 'True) (S1 ('MetaSel ('Just "elements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element])))

Methods

from :: Markup -> Rep Markup x #

to :: Rep Markup x -> Markup #

Show Markup # 
Instance details

Defined in Data.Markup

type Rep Markup # 
Instance details

Defined in Data.Markup

type Rep Markup = D1 ('MetaData "Markup" "Data.Markup" "markup-parse-0.3.0.0-inplace" 'True) (C1 ('MetaCons "Markup" 'PrefixI 'True) (S1 ('MetaSel ('Just "elements") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Element])))

data ChartOptions Source #

A product type consisting of a ChartTree, HudOptions and MarkupOptions, which is what you need to create Markup.

Instances

Instances details
Monoid ChartOptions Source # 
Instance details

Defined in Chart.Markup

Semigroup ChartOptions Source # 
Instance details

Defined in Chart.Markup

Eq ChartOptions Source # 
Instance details

Defined in Chart.Markup

Data ChartOptions Source # 
Instance details

Defined in Chart.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ChartOptions -> c ChartOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ChartOptions #

toConstr :: ChartOptions -> Constr #

dataTypeOf :: ChartOptions -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ChartOptions) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChartOptions) #

gmapT :: (forall b. Data b => b -> b) -> ChartOptions -> ChartOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ChartOptions -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ChartOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> ChartOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ChartOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ChartOptions -> m ChartOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ChartOptions -> m ChartOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ChartOptions -> m ChartOptions #

Generic ChartOptions Source # 
Instance details

Defined in Chart.Markup

Associated Types

type Rep ChartOptions 
Instance details

Defined in Chart.Markup

type Rep ChartOptions = D1 ('MetaData "ChartOptions" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) (C1 ('MetaCons "ChartOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "markupOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MarkupOptions) :*: (S1 ('MetaSel ('Just "hudOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HudOptions) :*: S1 ('MetaSel ('Just "chartTree") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChartTree))))
Read ChartOptions Source # 
Instance details

Defined in Chart.Markup

Show ChartOptions Source # 
Instance details

Defined in Chart.Markup

type Rep ChartOptions Source # 
Instance details

Defined in Chart.Markup

type Rep ChartOptions = D1 ('MetaData "ChartOptions" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) (C1 ('MetaCons "ChartOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "markupOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MarkupOptions) :*: (S1 ('MetaSel ('Just "hudOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HudOptions) :*: S1 ('MetaSel ('Just "chartTree") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChartTree))))

forgetHud :: ChartOptions -> ChartOptions Source #

Processes the hud options and turns them into charts, rescales the existing charts, resets the hud options to mempty, and turns on ScalePArea in chart styles.

Note that this is a destructive operation, and, in particular, that

view #chartTree (forgetHud (mempty & set #chartTree c)) /= c

asChartTree :: ChartOptions -> ChartTree Source #

Convert ChartOptions to a ChartTree, forgetting the original hud and chart data

vertCO :: Align -> Double -> [ChartOptions] -> ChartOptions Source #

Vertically stack a list of ChartOptions (proceeding upwards), at the supplied Align and with the supplied gap intercalated.

horiCO :: Align -> Double -> [ChartOptions] -> ChartOptions Source #

Horizontally stack a list of ChartOptions (proceeding to the right), at the supplied Align and with the supplied gap intercalated.

stackCO :: Int -> Align -> Align -> Double -> [ChartOptions] -> ChartOptions Source #

Stack a list of ChartOptions horizontally, then vertically (proceeding downwards which is opposite to the usual coordinate reference system but intuitively the way people read charts)

markupChartOptions :: ChartOptions -> Markup Source #

Convert ChartOptions to Markup

>>> markupChartOptions (ChartOptions (defaultMarkupOptions & #cssOptions % #preferColorScheme .~ PreferNormal) mempty mempty) & markdown_ Compact Xml
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"300\" height=\"300\" viewBox=\"-0.5 -0.5 1.0 1.0\"><style>\nsvg { font-family: system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\nticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;}</style><g class=\"chart\"></g><g class=\"hud\"></g></svg>"

markupChartTree :: ChartTree -> Markup Source #

Convert a ChartTree to markup

>>> lineExample & view #chartTree & markupChartTree & markdown_ Compact Xml
"<g class=\"line\"><g stroke-width=\"0.0150\" stroke=\"rgb(2%, 73%, 80%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,-1.0 1.0,-1.0 2.0,-5.0\"/></g><g stroke-width=\"0.0150\" stroke=\"rgb(2%, 29%, 48%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,0 2.8,-3.0\"/></g><g stroke-width=\"0.0150\" stroke=\"rgb(66%, 7%, 55%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0.5,-4.0 0.5,0\"/></g></g>"

markupChart :: Chart -> Markup Source #

Convert a Chart to Markup

>>> import Data.Markup
>>> import Optics.Core
>>> import Control.Category ((>>>))
>>> lineExample & toListOf (#chartTree % charts') & mconcat & fmap (markupChart >>> markdown_ Compact Xml)
["<g stroke-width=\"0.0150\" stroke=\"rgb(2%, 73%, 80%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,-1.0 1.0,-1.0 2.0,-5.0\"/></g>","<g stroke-width=\"0.0150\" stroke=\"rgb(2%, 29%, 48%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,0 2.8,-3.0\"/></g>","<g stroke-width=\"0.0150\" stroke=\"rgb(66%, 7%, 55%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0.5,-4.0 0.5,0\"/></g>"]

header :: Maybe Double -> Rect Double -> Markup -> Markup Source #

Create the classic SVG element

>>> header (Just 300) (Rect (-0.75) 0.75 (-0.5) 0.5) (element_ "foo" []) & markdown_ Compact Xml
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"450\" height=\"300\" viewBox=\"-0.75 -0.5 1.5 1.0\"><foo></foo></svg>"

renderChartOptions :: ChartOptions -> Text Source #

Render ChartOptions to an SVG Text snippet

>>> renderChartOptions (ChartOptions (defaultMarkupOptions & #cssOptions % #preferColorScheme .~ PreferNormal) mempty mempty)
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"300\" height=\"300\" viewBox=\"-0.5 -0.5 1.0 1.0\"><style>\nsvg { font-family: system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\nticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;}</style><g class=\"chart\"></g><g class=\"hud\"></g></svg>"

encodeChartOptions :: ChartOptions -> ByteString Source #

Render ChartOptions to an SVG ByteString

>>> encodeChartOptions (ChartOptions (defaultMarkupOptions & #cssOptions % #preferColorScheme .~ PreferNormal) mempty mempty)
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"300\" height=\"300\" viewBox=\"-0.5 -0.5 1.0 1.0\"><style>\nsvg { font-family: system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\nticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;}</style><g class=\"chart\"></g><g class=\"hud\"></g></svg>"

writeChartOptions :: FilePath -> ChartOptions -> IO () Source #

Convert ChartOptions to an SVG ByteString and save to a file

data CssOptions Source #

css options

>>> defaultCssOptions
CssOptions {shapeRendering = NoShapeRendering, preferColorScheme = PreferHud, fontFamilies = "\nsvg { font-family: system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\nticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;}", cssExtra = ""}

Instances

Instances details
Eq CssOptions Source # 
Instance details

Defined in Chart.Markup

Data CssOptions Source # 
Instance details

Defined in Chart.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CssOptions -> c CssOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CssOptions #

toConstr :: CssOptions -> Constr #

dataTypeOf :: CssOptions -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CssOptions) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CssOptions) #

gmapT :: (forall b. Data b => b -> b) -> CssOptions -> CssOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CssOptions -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CssOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> CssOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CssOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CssOptions -> m CssOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CssOptions -> m CssOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CssOptions -> m CssOptions #

Generic CssOptions Source # 
Instance details

Defined in Chart.Markup

Associated Types

type Rep CssOptions 
Instance details

Defined in Chart.Markup

Read CssOptions Source # 
Instance details

Defined in Chart.Markup

Show CssOptions Source # 
Instance details

Defined in Chart.Markup

type Rep CssOptions Source # 
Instance details

Defined in Chart.Markup

defaultCssOptions :: CssOptions Source #

No special shape rendering and default hud responds to user color scheme preferences.

data PreferColorScheme Source #

CSS prefer-color-scheme options

Constructors

PreferHud

includes css that switches approriate hud elements between light and dark.

PreferDark 
PreferLight 
PreferNormal 

Instances

Instances details
Eq PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

Data PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PreferColorScheme -> c PreferColorScheme #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PreferColorScheme #

toConstr :: PreferColorScheme -> Constr #

dataTypeOf :: PreferColorScheme -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PreferColorScheme) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PreferColorScheme) #

gmapT :: (forall b. Data b => b -> b) -> PreferColorScheme -> PreferColorScheme #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PreferColorScheme -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PreferColorScheme -> r #

gmapQ :: (forall d. Data d => d -> u) -> PreferColorScheme -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PreferColorScheme -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PreferColorScheme -> m PreferColorScheme #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PreferColorScheme -> m PreferColorScheme #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PreferColorScheme -> m PreferColorScheme #

Generic PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

Associated Types

type Rep PreferColorScheme 
Instance details

Defined in Chart.Markup

type Rep PreferColorScheme = D1 ('MetaData "PreferColorScheme" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) ((C1 ('MetaCons "PreferHud" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PreferDark" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PreferLight" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PreferNormal" 'PrefixI 'False) (U1 :: Type -> Type)))
Read PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

Show PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

type Rep PreferColorScheme Source # 
Instance details

Defined in Chart.Markup

type Rep PreferColorScheme = D1 ('MetaData "PreferColorScheme" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) ((C1 ('MetaCons "PreferHud" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PreferDark" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PreferLight" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PreferNormal" 'PrefixI 'False) (U1 :: Type -> Type)))

cssPreferColorScheme :: (Colour, Colour) -> PreferColorScheme -> ByteString Source #

CSS prefer-color-scheme text snippet

PreferHud flips HUD *ink colour* under @media (prefers-color-scheme: dark). Opacities stay on presentation attributes (axisbar 0.4, ticklines 0.05, etc.) by design — low-opacity hud chrome, not a bug to “fix” in CSS.

>>> cssPreferColorScheme (light, dark) PreferHud
"svg {color-scheme: light dark;} {.canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {fill: rgb(5%, 5%, 5%);} .ticklines g, .tickglyph g, .legendBorder g {stroke: rgb(5%, 5%, 5%);} .legendBorder g {fill: rgb(94%, 94%, 94%);}} @media (prefers-color-scheme:dark) {.canvas g, .title g, .axisbar g, .ticktext g, .tickglyph g, .ticklines g, .legendContent g text {fill: rgb(94%, 94%, 94%);} .ticklines g, .tickglyph g, .legendBorder g {stroke: rgb(94%, 94%, 94%);} .legendBorder g {fill: rgb(5%, 5%, 5%);}}"

fillSwitch :: (Colour, Colour) -> ByteString -> ByteString -> ByteString Source #

CSS snippet to switch between dark and light mode

fillSwitch (color1, color2) "dark" "stuff"

... will default to color1 for elements of the "stuff" class, but switch to color2 if "dark" mode is preferred by the user.

data ShapeRendering Source #

CSS glyphShape rendering options

Instances

Instances details
Eq ShapeRendering Source # 
Instance details

Defined in Chart.Markup

Data ShapeRendering Source # 
Instance details

Defined in Chart.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ShapeRendering -> c ShapeRendering #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ShapeRendering #

toConstr :: ShapeRendering -> Constr #

dataTypeOf :: ShapeRendering -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ShapeRendering) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ShapeRendering) #

gmapT :: (forall b. Data b => b -> b) -> ShapeRendering -> ShapeRendering #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ShapeRendering -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ShapeRendering -> r #

gmapQ :: (forall d. Data d => d -> u) -> ShapeRendering -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ShapeRendering -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ShapeRendering -> m ShapeRendering #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ShapeRendering -> m ShapeRendering #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ShapeRendering -> m ShapeRendering #

Generic ShapeRendering Source # 
Instance details

Defined in Chart.Markup

Associated Types

type Rep ShapeRendering 
Instance details

Defined in Chart.Markup

type Rep ShapeRendering = D1 ('MetaData "ShapeRendering" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) (C1 ('MetaCons "UseGeometricPrecision" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UseCssCrisp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoShapeRendering" 'PrefixI 'False) (U1 :: Type -> Type)))
Read ShapeRendering Source # 
Instance details

Defined in Chart.Markup

Show ShapeRendering Source # 
Instance details

Defined in Chart.Markup

type Rep ShapeRendering Source # 
Instance details

Defined in Chart.Markup

type Rep ShapeRendering = D1 ('MetaData "ShapeRendering" "Chart.Markup" "chart-svg-0.8.4.0-inplace" 'False) (C1 ('MetaCons "UseGeometricPrecision" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "UseCssCrisp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoShapeRendering" 'PrefixI 'False) (U1 :: Type -> Type)))

markupCssOptions :: CssOptions -> Markup Source #

Convert CssOptions to Markup

data MarkupOptions Source #

Markup options.

>>> defaultMarkupOptions
MarkupOptions {markupHeight = Just 300.0, chartAspect = FixedAspect 1.5, cssOptions = CssOptions {shapeRendering = NoShapeRendering, preferColorScheme = PreferHud, fontFamilies = "\nsvg { font-family: system-ui,-apple-system,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",\"Liberation Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\nticktext { font-family: SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;}", cssExtra = ""}, renderStyle = Compact}

Instances

Instances details
Eq MarkupOptions Source # 
Instance details

Defined in Chart.Markup

Data MarkupOptions Source # 
Instance details

Defined in Chart.Markup

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MarkupOptions -> c MarkupOptions #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MarkupOptions #

toConstr :: MarkupOptions -> Constr #

dataTypeOf :: MarkupOptions -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MarkupOptions) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MarkupOptions) #

gmapT :: (forall b. Data b => b -> b) -> MarkupOptions -> MarkupOptions #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MarkupOptions -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MarkupOptions -> r #

gmapQ :: (forall d. Data d => d -> u) -> MarkupOptions -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MarkupOptions -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MarkupOptions -> m MarkupOptions #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MarkupOptions -> m MarkupOptions #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MarkupOptions -> m MarkupOptions #

Generic MarkupOptions Source # 
Instance details

Defined in Chart.Markup

Associated Types

type Rep MarkupOptions 
Instance details

Defined in Chart.Markup

Read MarkupOptions Source # 
Instance details

Defined in Chart.Markup

Show MarkupOptions Source # 
Instance details

Defined in Chart.Markup

type Rep MarkupOptions Source # 
Instance details

Defined in Chart.Markup

defaultMarkupOptions :: MarkupOptions Source #

The official markup options

encodeNum :: Double -> ByteString Source #

Show a Double, or rounded to 4 decimal places if this is shorter.

>>> encodeNum 1
"1.0"
>>> encodeNum 1.23456
"1.2346"

encodePx :: Double -> ByteString Source #

SVG width and height, without any unit suffix, are defined as pixels, which are Integers

>>> encodePx 300.0
"300"