Copyright | (c) Jann Müller 2018 |
---|---|
License | MIT |
Maintainer | Jann Müller <j.mueller.11@alumni.ucl.ac.uk> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Shapes that make up charts.
Synopsis
- data Shape s n
- = ALine [n]
- | ARectangle !(Extent n)
- | AnArea [n]
- | AColouredShape s !(Shape s n)
- | AGroup [Shape s n]
- | ALabel !TextAnchor !(FontSize String) !(FontWeight String) !String n
- | AnOpacity Double !(Shape s n)
- | EmptyShape
- mapColour :: (s -> t) -> Shape s n -> Shape t n
- data TextAnchor
- newtype FontSize s = FontSize {
- getFontSize :: s
- _FontSize :: forall p f a b. (Profunctor p, Functor f) => p (FontSize a) (f (FontSize b)) -> p a (f b)
- newtype FontWeight s = FontWeight {
- getFontWeight :: s
- _FontWeight :: forall p f a b. (Profunctor p, Functor f) => p (FontWeight a) (f (FontWeight b)) -> p a (f b)
- newtype Pixel a = Pixel {
- getPixel :: a
- _Pixel :: forall p f a b. (Profunctor p, Functor f) => p (Pixel a) (f (Pixel b)) -> p a (f b)
- newtype LabelOffset a = LabelOffset {
- getLabelOffset :: a
- _LabelOffset :: forall p f a b. (Profunctor p, Functor f) => p (LabelOffset a) (f (LabelOffset b)) -> p a (f b)
- data VisualElements s n = VisualElements {
- veTicks :: [n]
- veAxes :: [(n, n)]
- veGridLines :: [(n, n)]
- veAxisLabels :: [(String, n)]
- veLegend :: [Shape s n]
- backgroundShapes :: VisualElements s n -> Shape String n
- foregroundShapes :: VisualElements String (x, y) -> Shape String (x, y)
- class ChartVisuals c a b where
- newtype Vis a = Vis a
- noGrid :: ScaleOptions f a b -> ScaleOptions (NoGrid f) a b
- data NoGrid (f :: * -> *) a
- noVisuals :: ScaleOptions f a b -> ScaleOptions (NoVisuals f) a b
- data NoVisuals (f :: * -> *) a
- cartesian :: Extent d -> Extent b -> FontSize String -> LabelOffset (b, d) -> ScaleOptions f a b -> ScaleOptions g c d -> ScaleOptions (Cartesian f g) (a, c) (b, d)
- data Cartesian (f :: * -> *) (g :: * -> *) a
- data family ScaleOptions f a b :: *
Shapes
Shapes that make up charts. s
is the type of colours, and n
the type
of coordinates. For a 2D chart n
should be something like (Double,
Double)
.
ALine [n] | An open line of several points |
ARectangle !(Extent n) | A rectangle, defined by its lower left and upper right corners (if |
AnArea [n] | An area (closed line) |
AColouredShape s !(Shape s n) | Set the colour of a shape |
AGroup [Shape s n] | Group several shapes together |
ALabel !TextAnchor !(FontSize String) !(FontWeight String) !String n | A label |
AnOpacity Double !(Shape s n) | Set the opacity of a shape |
EmptyShape | Empty shape |
Instances
Functor (Shape s) Source # | |
Foldable (Shape s) Source # | |
Defined in Data.H3.Visuals fold :: Monoid m => Shape s m -> m # foldMap :: Monoid m => (a -> m) -> Shape s a -> m # foldr :: (a -> b -> b) -> b -> Shape s a -> b # foldr' :: (a -> b -> b) -> b -> Shape s a -> b # foldl :: (b -> a -> b) -> b -> Shape s a -> b # foldl' :: (b -> a -> b) -> b -> Shape s a -> b # foldr1 :: (a -> a -> a) -> Shape s a -> a # foldl1 :: (a -> a -> a) -> Shape s a -> a # elem :: Eq a => a -> Shape s a -> Bool # maximum :: Ord a => Shape s a -> a # minimum :: Ord a => Shape s a -> a # | |
Traversable (Shape s) Source # | |
(Show n, Show s) => Show (Shape s n) Source # | |
data TextAnchor Source #
Indicates where a text element should be anchored, that is where its origin is placed relative to the text.
Instances
Font size
FontSize | |
|
Instances
Functor FontSize Source # | |
Eq s => Eq (FontSize s) Source # | |
Ord s => Ord (FontSize s) Source # | |
Show s => Show (FontSize s) Source # | |
Generic (FontSize s) Source # | |
type Rep (FontSize s) Source # | |
Defined in Data.H3.Visuals |
_FontSize :: forall p f a b. (Profunctor p, Functor f) => p (FontSize a) (f (FontSize b)) -> p a (f b) Source #
Font size iso
newtype FontWeight s Source #
Font weight
FontWeight | |
|
Instances
_FontWeight :: forall p f a b. (Profunctor p, Functor f) => p (FontWeight a) (f (FontWeight b)) -> p a (f b) Source #
Font weight iso
Pixel unit in the target coordinate system
Instances
Functor Pixel Source # | |
Eq a => Eq (Pixel a) Source # | |
Floating a => Floating (Pixel a) Source # | |
Fractional a => Fractional (Pixel a) Source # | |
Num a => Num (Pixel a) Source # | |
Ord a => Ord (Pixel a) Source # | |
Real a => Real (Pixel a) Source # | |
Defined in Data.H3.Visuals toRational :: Pixel a -> Rational # | |
RealFrac a => RealFrac (Pixel a) Source # | |
Show a => Show (Pixel a) Source # | |
_Pixel :: forall p f a b. (Profunctor p, Functor f) => p (Pixel a) (f (Pixel b)) -> p a (f b) Source #
Pixel iso
newtype LabelOffset a Source #
Instances
_LabelOffset :: forall p f a b. (Profunctor p, Functor f) => p (LabelOffset a) (f (LabelOffset b)) -> p a (f b) Source #
LabelOffset iso
data VisualElements s n Source #
A collection of scale metadata that needs to be visualised. n
is the
type of coordinates in the target coordinate system, to allow combinators
such as Product
and Cartesian
to adjust the locations of the elements.
VisualElements | |
|
Instances
Functor (VisualElements s) Source # | |
Defined in Data.H3.Visuals fmap :: (a -> b) -> VisualElements s a -> VisualElements s b # (<$) :: a -> VisualElements s b -> VisualElements s a # | |
(Show n, Show s) => Show (VisualElements s n) Source # | |
Defined in Data.H3.Visuals showsPrec :: Int -> VisualElements s n -> ShowS # show :: VisualElements s n -> String # showList :: [VisualElements s n] -> ShowS # | |
Semigroup (VisualElements s n) Source # | |
Defined in Data.H3.Visuals (<>) :: VisualElements s n -> VisualElements s n -> VisualElements s n # sconcat :: NonEmpty (VisualElements s n) -> VisualElements s n # stimes :: Integral b => b -> VisualElements s n -> VisualElements s n # | |
Monoid (VisualElements s n) Source # | |
Defined in Data.H3.Visuals mempty :: VisualElements s n # mappend :: VisualElements s n -> VisualElements s n -> VisualElements s n # mconcat :: [VisualElements s n] -> VisualElements s n # |
backgroundShapes :: VisualElements s n -> Shape String n Source #
foregroundShapes :: VisualElements String (x, y) -> Shape String (x, y) Source #
Scales that generate visual elements
class ChartVisuals c a b where Source #
The class of scales that have metadata in the form of VisualElements
.
visuals :: c -> a -> VisualElements String b Source #
Instances
Vis a |
Instances
Modifiers for visuals
noGrid :: ScaleOptions f a b -> ScaleOptions (NoGrid f) a b Source #
data NoGrid (f :: * -> *) a Source #
Instances
Scalable f a b => Scalable (NoGrid f) a b Source # | |
(h ~ TargetRange f b, ChartVisuals (Vis (ScaleOptions f a b)) h b) => ChartVisuals (Vis (ScaleOptions (NoGrid f) a b)) h b Source # | |
Defined in Data.H3.Visuals visuals :: Vis (ScaleOptions (NoGrid f) a b) -> h -> VisualElements String b Source # | |
type Target (NoGrid f) Source # | |
Defined in Data.H3.Visuals | |
data ScaleOptions (NoGrid f) a b Source # | |
Defined in Data.H3.Visuals | |
type TargetRange (NoGrid f) b Source # | |
Defined in Data.H3.Visuals |
noVisuals :: ScaleOptions f a b -> ScaleOptions (NoVisuals f) a b Source #
data NoVisuals (f :: * -> *) a Source #
Instances
Scalable f a b => Scalable (NoVisuals f) a b Source # | |
(h ~ TargetRange f b, Scalable f a b) => ChartVisuals (Vis (ScaleOptions (NoVisuals f) a b)) h b Source # | |
Defined in Data.H3.Visuals visuals :: Vis (ScaleOptions (NoVisuals f) a b) -> h -> VisualElements String b Source # | |
type Target (NoVisuals f) Source # | |
Defined in Data.H3.Visuals | |
data ScaleOptions (NoVisuals f) a b Source # | |
Defined in Data.H3.Visuals | |
type TargetRange (NoVisuals f) b Source # | |
Defined in Data.H3.Visuals |
cartesian :: Extent d -> Extent b -> FontSize String -> LabelOffset (b, d) -> ScaleOptions f a b -> ScaleOptions g c d -> ScaleOptions (Cartesian f g) (a, c) (b, d) Source #
data Cartesian (f :: * -> *) (g :: * -> *) a Source #
Instances
Constructors
data family ScaleOptions f a b :: * Source #
Additional parameters for the scale (other than target range).