{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Graphics.Vega.VegaLite.Configuration
( ConfigurationProperty(..)
, FieldTitleProperty(..)
, ViewConfig(..)
, CompositionConfig(..)
, ScaleConfig(..)
, RangeConfig(..)
, AxisConfig(..)
, AxisChoice(..)
, LegendConfig(..)
, TitleConfig(..)
, TitleFrame(..)
, configuration
, title
) where
import qualified Data.Aeson as A
import qualified Data.Text as T
import Data.Aeson ((.=), object)
import Data.Aeson.Types (Pair)
#if !(MIN_VERSION_base(4, 12, 0))
import Data.Monoid ((<>))
#endif
import Graphics.Vega.VegaLite.Core
( AxisProperty
, axisProperty
, schemeProperty
)
import Graphics.Vega.VegaLite.Foundation
( Angle
, Color
, StyleLabel
, CompositionAlignment
, DashStyle
, DashOffset
, APosition
, FontWeight
, Opacity
, Orientation
, OverlapStrategy
, Side
, StrokeCap
, StrokeJoin
, Symbol
, HAlign
, VAlign
, BandAlign
, Padding
, Autosize
, ZIndex
, HeaderProperty
, ViewBackground
, Cursor
, fromT
, fromColor
, fromDS
, splitOnNewline
, header_
, anchorLabel
, fontWeightSpec
, orientationSpec
, hAlignLabel
, vAlignLabel
, bandAlignLabel
, strokeCapLabel
, strokeJoinLabel
, sideLabel
, overlapStrategyLabel
, symbolLabel
, compositionAlignmentSpec
, paddingSpec
, autosizeProperty
, viewBackgroundSpec
, cursorLabel
, (.=~), toObject
)
import Graphics.Vega.VegaLite.Geometry
( ProjectionProperty
, projectionProperty
)
import Graphics.Vega.VegaLite.Legend
( LegendLayout
, LegendOrientation
, legendOrientLabel
, legendLayoutSpec
)
import Graphics.Vega.VegaLite.Mark
( MarkProperty
, oldMprops_
)
import Graphics.Vega.VegaLite.Scale
( ScaleNice
, scaleNiceSpec
)
import Graphics.Vega.VegaLite.Selection
( Selection
, SelectionProperty
, selectionProperties
, selectionLabel
)
import Graphics.Vega.VegaLite.Specification
( VLSpec
, VLProperty(VLTitle)
, ConfigureSpec(..)
, BuildConfigureSpecs
, LabelledSpec
, PropertySpec
)
{-# DEPRECATED Autosize "Please change Autosize to AutosizeStyle" #-}
{-# DEPRECATED Background "Please change Background to BackgroundStyle" #-}
{-# DEPRECATED CountTitle "Please change CountTitle to CountTitleStyle" #-}
{-# DEPRECATED FieldTitle "Please change FieldTitle to FieldTitleStyle" #-}
{-# DEPRECATED Legend "Please change Legend to LegendStyle" #-}
{-# DEPRECATED NumberFormat "Please change NumberFormat to NumberFormatStyle" #-}
{-# DEPRECATED Padding "Please change Padding to PaddingStyle" #-}
{-# DEPRECATED Projection "Please change Projection to ProjectionStyle" #-}
{-# DEPRECATED Range "Please change Range to RangeStyle" #-}
{-# DEPRECATED Scale "Please change Scale to ScaleStyle" #-}
{-# DEPRECATED TimeFormat "Please change TimeFormat to TimeFormatStyle" #-}
{-# DEPRECATED View "Please change View to ViewStyle" #-}
{-# DEPRECATED NamedStyle "Please change Legend to MarkNamedStyles" #-}
{-# DEPRECATED NamedStyles "Please change Legend to MarkNamedStyles" #-}
data ConfigurationProperty
= ArcStyle [MarkProperty]
| AreaStyle [MarkProperty]
| AriaStyle Bool
| AutosizeStyle [Autosize]
| Axis [AxisConfig]
| AxisBand AxisChoice [AxisConfig]
| AxisBottom [AxisConfig]
| AxisDiscrete AxisChoice [AxisConfig]
| AxisLeft [AxisConfig]
| AxisPoint AxisChoice [AxisConfig]
| AxisQuantitative AxisChoice [AxisConfig]
| AxisRight [AxisConfig]
| AxisTemporal AxisChoice [AxisConfig]
| AxisTop [AxisConfig]
| AxisX [AxisConfig]
| AxisY [AxisConfig]
| AxisNamedStyles [(StyleLabel, [AxisProperty])]
| BackgroundStyle Color
| BarStyle [MarkProperty]
| BoxplotStyle [MarkProperty]
| CircleStyle [MarkProperty]
| ConcatStyle [CompositionConfig]
| CountTitleStyle T.Text
| CustomFormatStyle Bool
| ErrorBandStyle [MarkProperty]
| ErrorBarStyle [MarkProperty]
| FacetStyle [CompositionConfig]
| FieldTitleStyle FieldTitleProperty
| FontStyle T.Text
| GeoshapeStyle [MarkProperty]
| [HeaderProperty]
| HeaderColumnStyle [HeaderProperty]
| [HeaderProperty]
| [HeaderProperty]
| ImageStyle [MarkProperty]
| LegendStyle [LegendConfig]
| LineStyle [MarkProperty]
| LineBreakStyle T.Text
| MarkStyle [MarkProperty]
| MarkNamedStyles [(StyleLabel, [MarkProperty])]
| NumberFormatStyle T.Text
| PaddingStyle Padding
| PointStyle [MarkProperty]
| ProjectionStyle [ProjectionProperty]
| RangeStyle [RangeConfig]
| RectStyle [MarkProperty]
| RepeatStyle [CompositionConfig]
| RuleStyle [MarkProperty]
| ScaleStyle [ScaleConfig]
| SelectionStyle [(Selection, [SelectionProperty])]
| SquareStyle [MarkProperty]
| TextStyle [MarkProperty]
| TickStyle [MarkProperty]
| TimeFormatStyle T.Text
| TitleStyle [TitleConfig]
| TrailStyle [MarkProperty]
| ViewStyle [ViewConfig]
| Autosize [Autosize]
| Background Color
| CountTitle T.Text
| FieldTitle FieldTitleProperty
| Legend [LegendConfig]
| NumberFormat T.Text
| Padding Padding
| Projection [ProjectionProperty]
| Range [RangeConfig]
| Scale [ScaleConfig]
| TimeFormat T.Text
| View [ViewConfig]
| NamedStyle StyleLabel [MarkProperty]
| NamedStyles [(StyleLabel, [MarkProperty])]
data AxisChoice
= AxXY
| AxX
| AxY
toAxis :: T.Text -> [AxisConfig] -> LabelledSpec
toAxis :: Text -> [AxisConfig] -> LabelledSpec
toAxis Text
lbl [AxisConfig]
acs = (Text
"axis" forall a. Semigroup a => a -> a -> a
<> Text
lbl) forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map AxisConfig -> Pair
axisConfigProperty [AxisConfig]
acs)
toAxisChoice :: AxisChoice -> T.Text -> [AxisConfig] -> LabelledSpec
toAxisChoice :: AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
AxXY Text
lbl = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
lbl
toAxisChoice AxisChoice
AxX Text
lbl = Text -> [AxisConfig] -> LabelledSpec
toAxis (Text
"X" forall a. Semigroup a => a -> a -> a
<> Text
lbl)
toAxisChoice AxisChoice
AxY Text
lbl = Text -> [AxisConfig] -> LabelledSpec
toAxis (Text
"Y" forall a. Semigroup a => a -> a -> a
<> Text
lbl)
aprops_ :: T.Text -> [AxisProperty] -> LabelledSpec
aprops_ :: Text -> [AxisProperty] -> LabelledSpec
aprops_ Text
f [AxisProperty]
mps = Text
f forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map AxisProperty -> Pair
axisProperty [AxisProperty]
mps)
configProperty :: ConfigurationProperty -> LabelledSpec
configProperty :: ConfigurationProperty -> LabelledSpec
configProperty (ArcStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"arc" [MarkProperty]
mps
configProperty (AreaStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"area" [MarkProperty]
mps
configProperty (AriaStyle Bool
b) = Text
"aria" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Bool
b
configProperty (AutosizeStyle [Autosize]
aus) = Text
"autosize" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map Autosize -> Pair
autosizeProperty [Autosize]
aus)
configProperty (Axis [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"" [AxisConfig]
acs
configProperty (AxisBand AxisChoice
c [AxisConfig]
acs) = AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
c Text
"Band" [AxisConfig]
acs
configProperty (AxisBottom [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"Bottom" [AxisConfig]
acs
configProperty (AxisDiscrete AxisChoice
c [AxisConfig]
acs) = AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
c Text
"Discrete" [AxisConfig]
acs
configProperty (AxisLeft [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"Left" [AxisConfig]
acs
configProperty (AxisPoint AxisChoice
c [AxisConfig]
acs) = AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
c Text
"Point" [AxisConfig]
acs
configProperty (AxisQuantitative AxisChoice
c [AxisConfig]
acs) = AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
c Text
"Quantitative" [AxisConfig]
acs
configProperty (AxisRight [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"Right" [AxisConfig]
acs
configProperty (AxisTemporal AxisChoice
c [AxisConfig]
acs) = AxisChoice -> Text -> [AxisConfig] -> LabelledSpec
toAxisChoice AxisChoice
c Text
"Temporal" [AxisConfig]
acs
configProperty (AxisTop [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"Top" [AxisConfig]
acs
configProperty (AxisX [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"X" [AxisConfig]
acs
configProperty (AxisY [AxisConfig]
acs) = Text -> [AxisConfig] -> LabelledSpec
toAxis Text
"Y" [AxisConfig]
acs
configProperty (AxisNamedStyles [(Text, [AxisProperty])]
styles) =
let toStyle :: (Text, [AxisProperty]) -> LabelledSpec
toStyle = forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> [AxisProperty] -> LabelledSpec
aprops_
in Text
"style" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [LabelledSpec] -> VLSpec
toObject (forall a b. (a -> b) -> [a] -> [b]
map (Text, [AxisProperty]) -> LabelledSpec
toStyle [(Text, [AxisProperty])]
styles)
configProperty (BackgroundStyle Text
bg) = Text
"background" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
bg
configProperty (BarStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"bar" [MarkProperty]
mps
configProperty (BoxplotStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"boxplot" [MarkProperty]
mps
configProperty (CircleStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"circle" [MarkProperty]
mps
configProperty (ConcatStyle [CompositionConfig]
cps) = Text
"concat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map CompositionConfig -> Pair
compConfigProperty [CompositionConfig]
cps)
configProperty (CountTitleStyle Text
ttl) = Text
"countTitle" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
ttl
configProperty (CustomFormatStyle Bool
b) = Text
"customFormatTypes" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Bool
b
configProperty (ErrorBandStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"errorband" [MarkProperty]
mps
configProperty (ErrorBarStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"errorbar" [MarkProperty]
mps
configProperty (FacetStyle [CompositionConfig]
cps) = Text
"facet" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map CompositionConfig -> Pair
compConfigProperty [CompositionConfig]
cps)
configProperty (FieldTitleStyle FieldTitleProperty
ftp) = Text
"fieldTitle" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ FieldTitleProperty -> Text
fieldTitleLabel FieldTitleProperty
ftp
configProperty (FontStyle Text
font) = Text
"font" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
font
configProperty (GeoshapeStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"geoshape" [MarkProperty]
mps
configProperty (HeaderStyle [HeaderProperty]
hps) = Text -> [HeaderProperty] -> LabelledSpec
header_ Text
"" [HeaderProperty]
hps
configProperty (HeaderColumnStyle [HeaderProperty]
hps) = Text -> [HeaderProperty] -> LabelledSpec
header_ Text
"Column" [HeaderProperty]
hps
configProperty (HeaderFacetStyle [HeaderProperty]
hps) = Text -> [HeaderProperty] -> LabelledSpec
header_ Text
"Facet" [HeaderProperty]
hps
configProperty (HeaderRowStyle [HeaderProperty]
hps) = Text -> [HeaderProperty] -> LabelledSpec
header_ Text
"Row" [HeaderProperty]
hps
configProperty (ImageStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"image" [MarkProperty]
mps
configProperty (LegendStyle [LegendConfig]
lcs) = Text
"legend" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map LegendConfig -> Pair
legendConfigProperty [LegendConfig]
lcs)
configProperty (LineStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"line" [MarkProperty]
mps
configProperty (LineBreakStyle Text
s) = Text
"lineBreak" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
s
configProperty (MarkStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"mark" [MarkProperty]
mps
configProperty (MarkNamedStyles [(Text, [MarkProperty])]
styles) =
let toStyle :: (Text, [MarkProperty]) -> LabelledSpec
toStyle = forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> [MarkProperty] -> LabelledSpec
oldMprops_
in Text
"style" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [LabelledSpec] -> VLSpec
toObject (forall a b. (a -> b) -> [a] -> [b]
map (Text, [MarkProperty]) -> LabelledSpec
toStyle [(Text, [MarkProperty])]
styles)
configProperty (NumberFormatStyle Text
fmt) = Text
"numberFormat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
fmt
configProperty (PaddingStyle Padding
pad) = Text
"padding" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Padding -> VLSpec
paddingSpec Padding
pad
configProperty (PointStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"point" [MarkProperty]
mps
configProperty (ProjectionStyle [ProjectionProperty]
pps) = Text
"projection" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map ProjectionProperty -> Pair
projectionProperty [ProjectionProperty]
pps)
configProperty (RangeStyle [RangeConfig]
rcs) = Text
"range" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map RangeConfig -> Pair
rangeConfigProperty [RangeConfig]
rcs)
configProperty (RectStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"rect" [MarkProperty]
mps
configProperty (RepeatStyle [CompositionConfig]
cps) = Text
"repeat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map CompositionConfig -> Pair
compConfigProperty [CompositionConfig]
cps)
configProperty (RuleStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"rule" [MarkProperty]
mps
configProperty (ScaleStyle [ScaleConfig]
scs) = [ScaleConfig] -> LabelledSpec
scaleConfig_ [ScaleConfig]
scs
configProperty (SelectionStyle [(Selection, [SelectionProperty])]
selConfig) =
let selProp :: (Selection, t SelectionProperty) -> LabelledSpec
selProp (Selection
sel, t SelectionProperty
sps) = Selection -> Text
selectionLabel Selection
sel forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap SelectionProperty -> [Pair]
selectionProperties t SelectionProperty
sps)
in Text
"selection" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [LabelledSpec] -> VLSpec
toObject (forall a b. (a -> b) -> [a] -> [b]
map forall {t :: * -> *}.
Foldable t =>
(Selection, t SelectionProperty) -> LabelledSpec
selProp [(Selection, [SelectionProperty])]
selConfig)
configProperty (SquareStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"square" [MarkProperty]
mps
configProperty (TextStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"text" [MarkProperty]
mps
configProperty (TickStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"tick" [MarkProperty]
mps
configProperty (TimeFormatStyle Text
fmt) = Text
"timeFormat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
fmt
configProperty (TitleStyle [TitleConfig]
tcs) = Text
"title" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map TitleConfig -> Pair
titleConfigSpec [TitleConfig]
tcs)
configProperty (TrailStyle [MarkProperty]
mps) = Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
"trail" [MarkProperty]
mps
configProperty (ViewStyle [ViewConfig]
vcs) = Text
"view" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ViewConfig -> [Pair]
viewConfigProperties [ViewConfig]
vcs)
configProperty (Autosize [Autosize]
aus) = Text
"autosize" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map Autosize -> Pair
autosizeProperty [Autosize]
aus)
configProperty (Background Text
bg) = Text
"background" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
bg
configProperty (CountTitle Text
ttl) = Text
"countTitle" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
ttl
configProperty (FieldTitle FieldTitleProperty
ftp) = Text
"fieldTitle" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ FieldTitleProperty -> Text
fieldTitleLabel FieldTitleProperty
ftp
configProperty (Legend [LegendConfig]
lcs) = Text
"legend" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map LegendConfig -> Pair
legendConfigProperty [LegendConfig]
lcs)
configProperty (NumberFormat Text
fmt) = Text
"numberFormat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
fmt
configProperty (Padding Padding
pad) = Text
"padding" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Padding -> VLSpec
paddingSpec Padding
pad
configProperty (Projection [ProjectionProperty]
pps) = Text
"projection" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map ProjectionProperty -> Pair
projectionProperty [ProjectionProperty]
pps)
configProperty (Range [RangeConfig]
rcs) = Text
"range" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map RangeConfig -> Pair
rangeConfigProperty [RangeConfig]
rcs)
configProperty (Scale [ScaleConfig]
scs) = [ScaleConfig] -> LabelledSpec
scaleConfig_ [ScaleConfig]
scs
configProperty (TimeFormat Text
fmt) = Text
"timeFormat" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ Text
fmt
configProperty (View [ViewConfig]
vcs) = Text
"view" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ViewConfig -> [Pair]
viewConfigProperties [ViewConfig]
vcs)
configProperty (NamedStyle Text
nme [MarkProperty]
mps) = Text
"style" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [LabelledSpec] -> VLSpec
toObject [Text -> [MarkProperty] -> LabelledSpec
oldMprops_ Text
nme [MarkProperty]
mps]
configProperty (NamedStyles [(Text, [MarkProperty])]
styles) =
let toStyle :: (Text, [MarkProperty]) -> LabelledSpec
toStyle = forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> [MarkProperty] -> LabelledSpec
oldMprops_
in Text
"style" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [LabelledSpec] -> VLSpec
toObject (forall a b. (a -> b) -> [a] -> [b]
map (Text, [MarkProperty]) -> LabelledSpec
toStyle [(Text, [MarkProperty])]
styles)
data ScaleConfig
= SCBandPaddingInner Double
| SCBandPaddingOuter Double
| SCBarBandPaddingInner Double
| SCBarBandPaddingOuter Double
| SCRectBandPaddingInner Double
| SCRectBandPaddingOuter Double
| SCClamp Bool
| SCMaxBandSize Double
| SCMinBandSize Double
| SCMaxFontSize Double
| SCMinFontSize Double
| SCMaxOpacity Opacity
| SCMinOpacity Opacity
| SCMaxSize Double
| SCMinSize Double
| SCMaxStrokeWidth Double
| SCMinStrokeWidth Double
| SCPointPadding Double
| SCRound Bool
| SCUseUnaggregatedDomain Bool
| SCXReverse Bool
scaleConfig_ :: [ScaleConfig] -> LabelledSpec
scaleConfig_ :: [ScaleConfig] -> LabelledSpec
scaleConfig_ [ScaleConfig]
scs = Text
"scale" forall a. ToJSON a => Text -> a -> LabelledSpec
.=~ [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map ScaleConfig -> Pair
scaleConfigProperty [ScaleConfig]
scs)
data FieldTitleProperty
= Verbal
| Function
| Plain
fieldTitleLabel :: FieldTitleProperty -> T.Text
fieldTitleLabel :: FieldTitleProperty -> Text
fieldTitleLabel FieldTitleProperty
Verbal = Text
"verbal"
fieldTitleLabel FieldTitleProperty
Function = Text
"functional"
fieldTitleLabel FieldTitleProperty
Plain = Text
"plain"
data LegendConfig
= LeAria Bool
| LeAriaDescription T.Text
| LeClipHeight Double
| LeColumnPadding Double
| LeColumns Int
| LeCornerRadius Double
| LeDirection Orientation
| LeDisable Bool
| LeFillColor Color
| LeGradientDirection Orientation
| LeGradientHorizontalMaxLength Double
| LeGradientHorizontalMinLength Double
| LeGradientLabelLimit Double
| LeGradientLabelOffset Double
| LeGradientLength Double
| LeGradientOpacity Opacity
| LeGradientStrokeColor Color
| LeGradientStrokeWidth Double
| LeGradientThickness Double
| LeGradientVerticalMaxLength Double
| LeGradientVerticalMinLength Double
| LeGridAlign CompositionAlignment
| LeLabelAlign HAlign
| LeLabelBaseline VAlign
| LeLabelColor Color
| LeLabelFont T.Text
| LeLabelFontSize Double
| LeLabelFontStyle T.Text
| LeLabelFontWeight FontWeight
| LeLabelLimit Double
| LeLabelOffset Double
| LeLabelOpacity Opacity
| LeLabelOverlap OverlapStrategy
| LeLabelPadding Double
| LeLabelSeparation Double
| LeLayout [LegendLayout]
| LeLeX Double
| LeLeY Double
| LeOffset Double
| LeOrient LegendOrientation
| LePadding Double
| LeRowPadding Double
| LeStrokeColor Color
| LeStrokeDash DashStyle
| LeStrokeWidth Double
| LeSymbolBaseFillColor Color
| LeSymbolBaseStrokeColor Color
| LeSymbolDash DashStyle
| LeSymbolDashOffset DashOffset
| LeSymbolDirection Orientation
| LeSymbolFillColor Color
| LeSymbolLimit Int
| LeSymbolOffset Double
| LeSymbolOpacity Opacity
| LeSymbolSize Double
| LeSymbolStrokeColor Color
| LeSymbolStrokeWidth Double
| LeSymbolType Symbol
| LeTickCount Int
| LeTickCountTime ScaleNice
| LeNoTitle
| LeTitleAlign HAlign
| LeTitleAnchor APosition
| LeTitleBaseline VAlign
| LeTitleColor Color
| LeTitleFont T.Text
| LeTitleFontSize Double
| LeTitleFontStyle T.Text
| LeTitleFontWeight FontWeight
| LeTitleLimit Double
| LeTitleLineHeight Double
| LeTitleOpacity Opacity
| LeTitleOrient Side
| LeTitlePadding Double
| LeUnselectedOpacity Opacity
| LeZIndex ZIndex
legendConfigProperty :: LegendConfig -> Pair
legendConfigProperty :: LegendConfig -> Pair
legendConfigProperty (LeAria Bool
b) = Key
"bool" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
legendConfigProperty (LeAriaDescription Text
t) = Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
t
legendConfigProperty (LeClipHeight Double
x) = Key
"clipHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeColumnPadding Double
x) = Key
"columnPadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeColumns Int
n) = Key
"columns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Int
n
legendConfigProperty (LeCornerRadius Double
x) = Key
"cornerRadius" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeDirection Orientation
o) = Key
"direction" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Orientation -> VLSpec
orientationSpec Orientation
o
legendConfigProperty (LeDisable Bool
b) = Key
"disable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
legendConfigProperty (LeFillColor Text
s) = Key
"fillColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeGradientDirection Orientation
o) = Key
"gradientDirection" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Orientation -> VLSpec
orientationSpec Orientation
o
legendConfigProperty (LeGradientHorizontalMaxLength Double
x) = Key
"gradientHorizontalMaxLength" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientHorizontalMinLength Double
x) = Key
"gradientHorizontalMinLength" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientLabelLimit Double
x) = Key
"gradientLabelLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientLabelOffset Double
x) = Key
"gradientLabelOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientLength Double
x) = Key
"gradientLength" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientOpacity Double
x) = Key
"gradientOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientStrokeColor Text
s) = Key
"gradientStrokeColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeGradientStrokeWidth Double
x) = Key
"gradientStrokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientThickness Double
x) = Key
"gradientThickness" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientVerticalMaxLength Double
x) = Key
"gradientVerticalMaxLength" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGradientVerticalMinLength Double
x) = Key
"gradientVerticalMinLength" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeGridAlign CompositionAlignment
ga) = Key
"gridAlign" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= CompositionAlignment -> VLSpec
compositionAlignmentSpec CompositionAlignment
ga
legendConfigProperty (LeLabelAlign HAlign
ha) = Key
"labelAlign" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= HAlign -> Text
hAlignLabel HAlign
ha
legendConfigProperty (LeLabelBaseline VAlign
va) = Key
"labelBaseline" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VAlign -> Text
vAlignLabel VAlign
va
legendConfigProperty (LeLabelColor Text
s) = Key
"labelColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeLabelFont Text
s) = Key
"labelFont" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
legendConfigProperty (LeLabelFontSize Double
x) = Key
"labelFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLabelFontStyle Text
s) = Key
"labelFontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
legendConfigProperty (LeLabelFontWeight FontWeight
fw) = Key
"labelFontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
fw
legendConfigProperty (LeLabelLimit Double
x) = Key
"labelLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLabelOffset Double
x) = Key
"labelOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLabelOpacity Double
x) = Key
"labelOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLabelOverlap OverlapStrategy
olap) = Key
"labelOverlap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= OverlapStrategy -> VLSpec
overlapStrategyLabel OverlapStrategy
olap
legendConfigProperty (LeLabelPadding Double
x) = Key
"labelPadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLabelSeparation Double
x) = Key
"labelSeparation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLayout [LegendLayout]
ll) = Key
"layout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> VLSpec
object (forall a b. (a -> b) -> [a] -> [b]
map LegendLayout -> Pair
legendLayoutSpec [LegendLayout]
ll)
legendConfigProperty (LeLeX Double
x) = Key
"legendX" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeLeY Double
x) = Key
"legendY" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeOffset Double
x) = Key
"offset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeOrient LegendOrientation
orl) = Key
"orient" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= LegendOrientation -> Text
legendOrientLabel LegendOrientation
orl
legendConfigProperty (LePadding Double
x) = Key
"padding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeRowPadding Double
x) = Key
"rowPadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeStrokeColor Text
s) = Key
"strokeColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeStrokeDash DashStyle
xs) = Key
"strokeDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
xs
legendConfigProperty (LeStrokeWidth Double
x) = Key
"strokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolBaseFillColor Text
s) = Key
"symbolBaseFillColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeSymbolBaseStrokeColor Text
s) = Key
"symbolBaseStrokeColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeSymbolDash DashStyle
xs) = Key
"symbolDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
xs
legendConfigProperty (LeSymbolDashOffset Double
x) = Key
"symbolDashOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolDirection Orientation
o) = Key
"symbolDirection" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Orientation -> VLSpec
orientationSpec Orientation
o
legendConfigProperty (LeSymbolFillColor Text
s) = Key
"symbolFillColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeSymbolLimit Int
n) = Key
"symbolLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Int
n
legendConfigProperty (LeSymbolOffset Double
x) = Key
"symbolOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolOpacity Double
x) = Key
"symbolOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolSize Double
x) = Key
"symbolSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolStrokeColor Text
s) = Key
"symbolStrokeColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeSymbolStrokeWidth Double
x) = Key
"symbolStrokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeSymbolType Symbol
s) = Key
"symbolType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Symbol -> Text
symbolLabel Symbol
s
legendConfigProperty (LeTickCount Int
n) = Key
"tickCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Int
n
legendConfigProperty (LeTickCountTime ScaleNice
sn) = Key
"tickCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= ScaleNice -> VLSpec
scaleNiceSpec ScaleNice
sn
legendConfigProperty LegendConfig
LeNoTitle = Key
"title" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VLSpec
A.Null
legendConfigProperty (LeTitleAlign HAlign
ha) = Key
"titleAlign" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= HAlign -> Text
hAlignLabel HAlign
ha
legendConfigProperty (LeTitleAnchor APosition
anc) = Key
"titleAnchor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= APosition -> Text
anchorLabel APosition
anc
legendConfigProperty (LeTitleBaseline VAlign
va) = Key
"titleBaseline" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VAlign -> Text
vAlignLabel VAlign
va
legendConfigProperty (LeTitleColor Text
s) = Key
"titleColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
legendConfigProperty (LeTitleFont Text
s) = Key
"titleFont" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
legendConfigProperty (LeTitleFontSize Double
x) = Key
"titleFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeTitleFontStyle Text
s) = Key
"titleFontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
legendConfigProperty (LeTitleFontWeight FontWeight
fw) = Key
"titleFontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
fw
legendConfigProperty (LeTitleLimit Double
x) = Key
"titleLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeTitleLineHeight Double
x) = Key
"titleLineHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeTitleOpacity Double
x) = Key
"titleOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeTitleOrient Side
orient) = Key
"titleOrient" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Side -> Text
sideLabel Side
orient
legendConfigProperty (LeTitlePadding Double
x) = Key
"titlePadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeUnselectedOpacity Double
x) = Key
"unselectedOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
legendConfigProperty (LeZIndex ZIndex
z) = Key
"zindex" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= ZIndex
z
data RangeConfig
= RCategory T.Text
| RDiverging T.Text
| RHeatmap T.Text
| ROrdinal T.Text
| RRamp T.Text
| RSymbol T.Text
rangeConfigProperty :: RangeConfig -> Pair
rangeConfigProperty :: RangeConfig -> Pair
rangeConfigProperty RangeConfig
rangeCfg =
let (Key
l, Text
n) = case RangeConfig
rangeCfg of
RCategory Text
nme -> (Key
"category", Text
nme)
RDiverging Text
nme -> (Key
"diverging", Text
nme)
RHeatmap Text
nme -> (Key
"heatmap", Text
nme)
ROrdinal Text
nme -> (Key
"ordinal", Text
nme)
RRamp Text
nme -> (Key
"ramp", Text
nme)
RSymbol Text
nme -> (Key
"symbol", Text
nme)
in Key
l forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Pair] -> VLSpec
object [Text -> DashStyle -> Pair
schemeProperty Text
n []]
scaleConfigProperty :: ScaleConfig -> Pair
scaleConfigProperty :: ScaleConfig -> Pair
scaleConfigProperty (SCBandPaddingInner Double
x) = Key
"bandPaddingInner" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCBandPaddingOuter Double
x) = Key
"bandPaddingOuter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCBarBandPaddingInner Double
x) = Key
"barBandPaddingInner" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCBarBandPaddingOuter Double
x) = Key
"barBandPaddingOuter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCRectBandPaddingInner Double
x) = Key
"rectBandPaddingInner" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCRectBandPaddingOuter Double
x) = Key
"rectBandPaddingOuter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCClamp Bool
b) = Key
"clamp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
scaleConfigProperty (SCMaxBandSize Double
x) = Key
"maxBandSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMinBandSize Double
x) = Key
"minBandSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMaxFontSize Double
x) = Key
"maxFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMinFontSize Double
x) = Key
"minFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMaxOpacity Double
x) = Key
"maxOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMinOpacity Double
x) = Key
"minOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMaxSize Double
x) = Key
"maxSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMinSize Double
x) = Key
"minSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMaxStrokeWidth Double
x) = Key
"maxStrokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCMinStrokeWidth Double
x) = Key
"minStrokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCPointPadding Double
x) = Key
"pointPadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
scaleConfigProperty (SCRound Bool
b) = Key
"round" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
scaleConfigProperty (SCUseUnaggregatedDomain Bool
b) = Key
"useUnaggregatedDomain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
scaleConfigProperty (SCXReverse Bool
b) = Key
"xReverse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
{-# DEPRECATED ViewWidth "Please change ViewWidth to ViewContinuousWidth" #-}
{-# DEPRECATED ViewHeight "Please change ViewHeight to ViewContinuousHeight" #-}
data ViewConfig
= ViewBackgroundStyle [ViewBackground]
| ViewClip Bool
| ViewContinuousWidth Double
| ViewContinuousHeight Double
| ViewCornerRadius Double
| ViewCursor Cursor
| ViewDiscreteWidth Double
| ViewDiscreteHeight Double
| ViewFill Color
| ViewNoFill
| ViewFillOpacity Opacity
| ViewOpacity Opacity
| ViewStep Double
| ViewStroke Color
| ViewNoStroke
| ViewStrokeCap StrokeCap
| ViewStrokeDash DashStyle
| ViewStrokeDashOffset DashOffset
| ViewStrokeJoin StrokeJoin
| ViewStrokeMiterLimit Double
| ViewStrokeOpacity Opacity
| ViewStrokeWidth Double
| ViewWidth Double
| ViewHeight Double
viewConfigProperties :: ViewConfig -> [Pair]
viewConfigProperties :: ViewConfig -> [Pair]
viewConfigProperties (ViewBackgroundStyle [ViewBackground]
bs) = forall a b. (a -> b) -> [a] -> [b]
map ViewBackground -> Pair
viewBackgroundSpec [ViewBackground]
bs
viewConfigProperties (ViewClip Bool
b) = [Key
"clip" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b]
viewConfigProperties (ViewWidth Double
x) = [Key
"continuousWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewHeight Double
x) = [Key
"continuousHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewContinuousWidth Double
x) = [Key
"continuousWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewContinuousHeight Double
x) = [Key
"continuousHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewCornerRadius Double
x) = [Key
"cornerRadius" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewCursor Cursor
c) = [Key
"cursor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Cursor -> Text
cursorLabel Cursor
c]
viewConfigProperties (ViewDiscreteWidth Double
x) = [Key
"discreteWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewDiscreteHeight Double
x) = [Key
"discreteHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewFill Text
ms) = [Key
"fill" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
ms]
viewConfigProperties ViewConfig
ViewNoFill = [Key
"fill" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VLSpec
A.Null]
viewConfigProperties (ViewFillOpacity Double
x) = [Key
"fillOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewOpacity Double
x) = [Key
"opacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewStep Double
x) = [Key
"step" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewStroke Text
ms) = [Key
"stroke" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
ms]
viewConfigProperties ViewConfig
ViewNoStroke = [Key
"stroke" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VLSpec
A.Null]
viewConfigProperties (ViewStrokeCap StrokeCap
sc) = [Key
"strokeCap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StrokeCap -> Text
strokeCapLabel StrokeCap
sc]
viewConfigProperties (ViewStrokeDash DashStyle
xs) = [Key
"strokeDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
xs]
viewConfigProperties (ViewStrokeDashOffset Double
x) = [Key
"strokeDashOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewStrokeJoin StrokeJoin
sj) = [Key
"strokeJoin" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StrokeJoin -> Text
strokeJoinLabel StrokeJoin
sj]
viewConfigProperties (ViewStrokeMiterLimit Double
x) = [Key
"strokeMiterLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewStrokeOpacity Double
x) = [Key
"strokeOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
viewConfigProperties (ViewStrokeWidth Double
x) = [Key
"strokeWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x]
data AxisConfig
= Aria Bool
| AriaDescription T.Text
| AStyle [StyleLabel]
| BandPosition Double
| Disable Bool
| Domain Bool
| DomainCap StrokeCap
| DomainColor Color
| DomainDash DashStyle
| DomainDashOffset DashOffset
| DomainOpacity Opacity
| DomainWidth Double
| Format T.Text
| FormatAsNum
| FormatAsTemporal
| FormatAsCustom T.Text
| Grid Bool
| GridCap StrokeCap
| GridColor Color
| GridDash DashStyle
| GridDashOffset DashOffset
| GridOpacity Opacity
| GridWidth Double
| Labels Bool
| LabelAlign HAlign
| LabelAngle Angle
| LabelBaseline VAlign
| LabelNoBound
| LabelBound
| LabelBoundValue Double
| LabelColor Color
| LabelNoFlush
| LabelFlush
| LabelFlushValue Double
| LabelFlushOffset Double
| LabelFont T.Text
| LabelFontSize Double
| LabelFontStyle T.Text
| LabelFontWeight FontWeight
| LabelLimit Double
| LabelLineHeight Double
| LabelOffset Double
| LabelOpacity Opacity
| LabelOverlap OverlapStrategy
| LabelPadding Double
| LabelSeparation Double
| MaxExtent Double
| MinExtent Double
| NoTitle
| Orient Side
| Ticks Bool
| TickBand BandAlign
| TickCap StrokeCap
| TickColor Color
| TickCount Int
| TickCountTime ScaleNice
| TickDash DashStyle
| TickDashOffset DashOffset
| Bool
| TickOffset Double
| TickOpacity Opacity
| TickRound Bool
| TickSize Double
| TickWidth Double
| TitleAlign HAlign
| TitleAnchor APosition
| TitleAngle Angle
| TitleBaseline VAlign
| TitleColor Color
| TitleFont T.Text
| TitleFontSize Double
| TitleFontStyle T.Text
| TitleFontWeight FontWeight
| TitleLimit Double
| TitleLineHeight Double
| TitleOpacity Opacity
| TitlePadding Double
| TitleX Double
| TitleY Double
| TranslateOffset Double
axisConfigProperty :: AxisConfig -> Pair
axisConfigProperty :: AxisConfig -> Pair
axisConfigProperty (AStyle [Text
s]) = Key
"style" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
axisConfigProperty (AStyle [Text]
s) = Key
"style" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Text]
s
axisConfigProperty (Aria Bool
b) = Key
"aria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (AriaDescription Text
t) = Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
t
axisConfigProperty (BandPosition Double
x) = Key
"bandPosition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (Disable Bool
b) = Key
"disable" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (Domain Bool
b) = Key
"domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (DomainCap StrokeCap
c) = Key
"domainCap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StrokeCap -> Text
strokeCapLabel StrokeCap
c
axisConfigProperty (DomainColor Text
c) = Key
"domainColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
c
axisConfigProperty (DomainDash DashStyle
ds) = Key
"domainDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
ds
axisConfigProperty (DomainDashOffset Double
x) = Key
"domainDashOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (DomainOpacity Double
x) = Key
"domainOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (DomainWidth Double
w) = Key
"domainWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
w
axisConfigProperty (Format Text
fmt) = Key
"format" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
fmt
axisConfigProperty AxisConfig
FormatAsNum = Key
"formatNum" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromT Text
"number"
axisConfigProperty AxisConfig
FormatAsTemporal = Key
"formatNum" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromT Text
"type"
axisConfigProperty (FormatAsCustom Text
c) = Key
"formatType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
c
axisConfigProperty (Grid Bool
b) = Key
"grid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (GridCap StrokeCap
c) = Key
"gridCap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StrokeCap -> Text
strokeCapLabel StrokeCap
c
axisConfigProperty (GridColor Text
c) = Key
"gridColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
c
axisConfigProperty (GridDash DashStyle
ds) = Key
"gridDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
ds
axisConfigProperty (GridDashOffset Double
x) = Key
"gridDashOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (GridOpacity Double
o) = Key
"gridOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
o
axisConfigProperty (GridWidth Double
x) = Key
"gridWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelAlign HAlign
ha) = Key
"labelAlign" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= HAlign -> Text
hAlignLabel HAlign
ha
axisConfigProperty (LabelAngle Double
angle) = Key
"labelAngle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
angle
axisConfigProperty (LabelBaseline VAlign
va) = Key
"labelBaseline" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VAlign -> Text
vAlignLabel VAlign
va
axisConfigProperty AxisConfig
LabelNoBound = Key
"labelBound" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
False
axisConfigProperty AxisConfig
LabelBound = Key
"labelBound" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
True
axisConfigProperty (LabelBoundValue Double
x) = Key
"labelBound" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelColor Text
c) = Key
"labelColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
c
axisConfigProperty AxisConfig
LabelNoFlush = Key
"labelFlush" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
False
axisConfigProperty AxisConfig
LabelFlush = Key
"labelFlush" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
True
axisConfigProperty (LabelFlushValue Double
x) = Key
"labelFlush" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelFlushOffset Double
x) = Key
"labelFlushOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelFont Text
f) = Key
"labelFont" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
f
axisConfigProperty (LabelFontSize Double
x) = Key
"labelFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelFontStyle Text
s) = Key
"labelFontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
axisConfigProperty (LabelFontWeight FontWeight
fw) = Key
"labelFontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
fw
axisConfigProperty (LabelLimit Double
x) = Key
"labelLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelLineHeight Double
x) = Key
"labelLineHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelOffset Double
x) = Key
"labelOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelOpacity Double
x) = Key
"labelOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (LabelOverlap OverlapStrategy
strat) = Key
"labelOverlap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= OverlapStrategy -> VLSpec
overlapStrategyLabel OverlapStrategy
strat
axisConfigProperty (LabelPadding Double
pad) = Key
"labelPadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
pad
axisConfigProperty (LabelSeparation Double
x) = Key
"labelSeparation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (Labels Bool
b) = Key
"labels" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (MaxExtent Double
n) = Key
"maxExtent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
n
axisConfigProperty (MinExtent Double
n) = Key
"minExtent" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
n
axisConfigProperty (Orient Side
orient) = Key
"orient" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Side -> Text
sideLabel Side
orient
axisConfigProperty (TickBand BandAlign
band) = Key
"tickBand" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= BandAlign -> Text
bandAlignLabel BandAlign
band
axisConfigProperty (TickCap StrokeCap
c) = Key
"tickCap" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= StrokeCap -> Text
strokeCapLabel StrokeCap
c
axisConfigProperty (TickColor Text
c) = Key
"tickColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
c
axisConfigProperty (TickCount Int
n) = Key
"tickCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Int
n
axisConfigProperty (TickCountTime ScaleNice
sn) = Key
"tickCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= ScaleNice -> VLSpec
scaleNiceSpec ScaleNice
sn
axisConfigProperty (TickDash DashStyle
ds) = Key
"tickDash" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= DashStyle -> VLSpec
fromDS DashStyle
ds
axisConfigProperty (TickDashOffset Double
x) = Key
"tickDashOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TickExtra Bool
b) = Key
"tickExtra" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (TickOffset Double
x) = Key
"tickOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TickOpacity Double
x) = Key
"tickOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TickRound Bool
b) = Key
"tickRound" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty (TickSize Double
x) = Key
"tickSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TickWidth Double
x) = Key
"tickWidth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (Ticks Bool
b) = Key
"ticks" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
axisConfigProperty AxisConfig
NoTitle = Key
"title" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VLSpec
A.Null
axisConfigProperty (TitleAlign HAlign
algn) = Key
"titleAlign" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= HAlign -> Text
hAlignLabel HAlign
algn
axisConfigProperty (TitleAnchor APosition
a) = Key
"titleAnchor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= APosition -> Text
anchorLabel APosition
a
axisConfigProperty (TitleAngle Double
x) = Key
"titleAngle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleBaseline VAlign
va) = Key
"titleBaseline" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VAlign -> Text
vAlignLabel VAlign
va
axisConfigProperty (TitleColor Text
c) = Key
"titleColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
c
axisConfigProperty (TitleFont Text
f) = Key
"titleFont" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
f
axisConfigProperty (TitleFontSize Double
x) = Key
"titleFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleFontStyle Text
s) = Key
"titleFontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
axisConfigProperty (TitleFontWeight FontWeight
w) = Key
"titleFontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
w
axisConfigProperty (TitleLimit Double
x) = Key
"titleLimit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleLineHeight Double
x) = Key
"titleLineHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleOpacity Double
x) = Key
"titleOpacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitlePadding Double
x) = Key
"titlePadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleX Double
x) = Key
"titleX" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TitleY Double
x) = Key
"titleY" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
axisConfigProperty (TranslateOffset Double
x) = Key
"translate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
data TitleFrame
= FrBounds
| FrGroup
titleFrameSpec :: TitleFrame -> VLSpec
titleFrameSpec :: TitleFrame -> VLSpec
titleFrameSpec TitleFrame
FrBounds = VLSpec
"bounds"
titleFrameSpec TitleFrame
FrGroup = VLSpec
"group"
data TitleConfig
= TAlign HAlign
| TAnchor APosition
| TAngle Angle
| TAria Bool
| TBaseline VAlign
| TColor Color
| TdX Double
| TdY Double
| TFont T.Text
| TFontSize Double
| TFontStyle T.Text
| TFontWeight FontWeight
| TFrame TitleFrame
| TLimit Double
| TLineHeight Double
| TOffset Double
| TOrient Side
| TStyle [StyleLabel]
| TSubtitle T.Text
| TSubtitleColor Color
| TSubtitleFont T.Text
| TSubtitleFontSize Double
| TSubtitleFontStyle T.Text
| TSubtitleFontWeight FontWeight
| TSubtitleLineHeight Double
| TSubtitlePadding Double
| TZIndex ZIndex
titleConfigSpec :: TitleConfig -> Pair
titleConfigSpec :: TitleConfig -> Pair
titleConfigSpec (TAlign HAlign
ha) = Key
"align" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= HAlign -> Text
hAlignLabel HAlign
ha
titleConfigSpec (TAnchor APosition
an) = Key
"anchor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= APosition -> Text
anchorLabel APosition
an
titleConfigSpec (TAngle Double
x) = Key
"angle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TAria Bool
b) = Key
"aria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Bool
b
titleConfigSpec (TBaseline VAlign
va) = Key
"baseline" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= VAlign -> Text
vAlignLabel VAlign
va
titleConfigSpec (TColor Text
clr) = Key
"color" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
clr
titleConfigSpec (TdX Double
x) = Key
"dx" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TdY Double
x) = Key
"dy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TFont Text
fnt) = Key
"font" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
fnt
titleConfigSpec (TFontSize Double
x) = Key
"fontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TFontStyle Text
s) = Key
"fontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
titleConfigSpec (TFontWeight FontWeight
w) = Key
"fontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
w
titleConfigSpec (TFrame TitleFrame
tf) = Key
"frame" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= TitleFrame -> VLSpec
titleFrameSpec TitleFrame
tf
titleConfigSpec (TLimit Double
x) = Key
"limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TLineHeight Double
x) = Key
"lineHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TOffset Double
x) = Key
"offset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TOrient Side
sd) = Key
"orient" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Side -> Text
sideLabel Side
sd
titleConfigSpec (TStyle [Text
style]) = Key
"style" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
style
titleConfigSpec (TStyle [Text]
styles) = Key
"style" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [Text]
styles
titleConfigSpec (TSubtitle Text
s) = Key
"subtitle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
splitOnNewline Text
s
titleConfigSpec (TSubtitleColor Text
s) = Key
"subtitleColor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
fromColor Text
s
titleConfigSpec (TSubtitleFont Text
s) = Key
"subtitleFont" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
titleConfigSpec (TSubtitleFontSize Double
x) = Key
"subtitleFontSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TSubtitleFontStyle Text
s) = Key
"subtitleFontStyle" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
s
titleConfigSpec (TSubtitleFontWeight FontWeight
fw) = Key
"subtitleFontWeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= FontWeight -> VLSpec
fontWeightSpec FontWeight
fw
titleConfigSpec (TSubtitleLineHeight Double
x) = Key
"subtitleLineHeight" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TSubtitlePadding Double
x) = Key
"subtitlePadding" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
titleConfigSpec (TZIndex ZIndex
z) = Key
"zindex" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= ZIndex
z
data CompositionConfig
= CompColumns Int
| CompSpacing Double
compConfigProperty :: CompositionConfig -> Pair
compConfigProperty :: CompositionConfig -> Pair
compConfigProperty (CompColumns Int
n) = Key
"columns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Int
n
compConfigProperty (CompSpacing Double
x) = Key
"spacing" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Double
x
configuration ::
ConfigurationProperty
-> BuildConfigureSpecs
configuration :: ConfigurationProperty -> BuildConfigureSpecs
configuration ConfigurationProperty
cfg [ConfigureSpec]
ols = LabelledSpec -> ConfigureSpec
CS (ConfigurationProperty -> LabelledSpec
configProperty ConfigurationProperty
cfg) forall a. a -> [a] -> [a]
: [ConfigureSpec]
ols
title ::
T.Text
-> [TitleConfig]
-> PropertySpec
title :: Text -> [TitleConfig] -> PropertySpec
title Text
s [] =
(VLProperty
VLTitle, Text -> VLSpec
splitOnNewline Text
s)
title Text
s [TitleConfig]
topts =
(VLProperty
VLTitle,
[Pair] -> VLSpec
object (Key
"text" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text -> VLSpec
splitOnNewline Text
s forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map TitleConfig -> Pair
titleConfigSpec [TitleConfig]
topts))