h3-core-0.0.1: Core library for h3

Copyright(c) Jann Müller 2018
LicenseMIT
MaintainerJann Müller <j.mueller.11@alumni.ucl.ac.uk>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.H3.Scalable

Contents

Description

Type classes for scales. A scale is a family of functions that are parameterised by a target range (for example, the dimensions of the diagram in pixels) and an additional set of options specific to each scale.

In h3, Scalable is the type class that represents scales. Scales used for visualisation commonly have metadata such as legends, grid lines etc. The ChartVisuals class deals with this kind of data.

Synopsis

Scales

class Scalable (f :: * -> *) a b where Source #

The class of scales. Each scale has an associated data type ScaleOptions that can be used to configure the scale.

Minimal complete definition

scale

Associated Types

type Target f :: * -> * Source #

Target f is the codomain of the scale. For example, if f is a scale that maps real numbers to real numbers, then Target f is Identity (a point). If it is an ordinal scale, then Target f is Extent (an interval).

type TargetRange f b :: * Source #

TargetRange f is the type of the range parameter of the scale. For example, if f is a scale that maps real numbers to real numbers, then TargetRange f is Extent (an interval). For ordinal scales, Target f is [], a list of possible values.

data ScaleOptions f a b :: * Source #

Additional parameters for the scale (other than target range).

Methods

scale :: ScaleOptions f a b -> TargetRange f b -> a -> Target f b Source #

Given ScaleOptions and a TargetRange, produce a map 'a -> (Target f) b'.

Instances
(Ord a, Eq a) => Scalable Ordinal a Double Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target Ordinal :: * -> * Source #

type TargetRange Ordinal Double :: * Source #

data ScaleOptions Ordinal a Double :: * Source #

(Ord a, Integral a) => Scalable Cardinal a Double Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target Cardinal :: * -> * Source #

type TargetRange Cardinal Double :: * Source #

data ScaleOptions Cardinal a Double :: * Source #

(Ord a, RealFrac a, Floating a) => Scalable Continuous a a Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target Continuous :: * -> * Source #

type TargetRange Continuous a :: * Source #

data ScaleOptions Continuous a a :: * Source #

(Applicative (Target f), Scalable f a b) => Scalable (Anchored f) a b Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target (Anchored f) :: * -> * Source #

type TargetRange (Anchored f) b :: * Source #

data ScaleOptions (Anchored f) a b :: * Source #

Methods

scale :: ScaleOptions (Anchored f) a b -> TargetRange (Anchored f) b -> a -> Target (Anchored f) b Source #

(Target f b ~ h b, Functor h, Scalable f a b) => Scalable (Transformed f) a b Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target (Transformed f) :: * -> * Source #

type TargetRange (Transformed f) b :: * Source #

data ScaleOptions (Transformed f) a b :: * Source #

Scalable f a b => Scalable (NoVisuals f) a b Source # 
Instance details

Defined in Data.H3.Visuals

Associated Types

type Target (NoVisuals f) :: * -> * Source #

type TargetRange (NoVisuals f) b :: * Source #

data ScaleOptions (NoVisuals f) a b :: * Source #

Methods

scale :: ScaleOptions (NoVisuals f) a b -> TargetRange (NoVisuals f) b -> a -> Target (NoVisuals f) b Source #

Scalable f a b => Scalable (NoGrid f) a b Source # 
Instance details

Defined in Data.H3.Visuals

Associated Types

type Target (NoGrid f) :: * -> * Source #

type TargetRange (NoGrid f) b :: * Source #

data ScaleOptions (NoGrid f) a b :: * Source #

Methods

scale :: ScaleOptions (NoGrid f) a b -> TargetRange (NoGrid f) b -> a -> Target (NoGrid f) b Source #

(Scalable f a b, Scalable g a c) => Scalable (Split f g) a (b, c) Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target (Split f g) :: * -> * Source #

type TargetRange (Split f g) (b, c) :: * Source #

data ScaleOptions (Split f g) a (b, c) :: * Source #

Methods

scale :: ScaleOptions (Split f g) a (b, c) -> TargetRange (Split f g) (b, c) -> a -> Target (Split f g) (b, c) Source #

(Target g b ~ TargetRange g b, Target f b ~ TargetRange g b, Scalable f a b, Scalable g c b) => Scalable (Nested f g) (a, c) b Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target (Nested f g) :: * -> * Source #

type TargetRange (Nested f g) b :: * Source #

data ScaleOptions (Nested f g) (a, c) b :: * Source #

Methods

scale :: ScaleOptions (Nested f g) (a, c) b -> TargetRange (Nested f g) b -> (a, c) -> Target (Nested f g) b Source #

(Scalable f a b, Scalable g c d) => Scalable (Product f g) (a, c) (b, d) Source # 
Instance details

Defined in Data.H3.Scales

Associated Types

type Target (Product f g) :: * -> * Source #

type TargetRange (Product f g) (b, d) :: * Source #

data ScaleOptions (Product f g) (a, c) (b, d) :: * Source #

Methods

scale :: ScaleOptions (Product f g) (a, c) (b, d) -> TargetRange (Product f g) (b, d) -> (a, c) -> Target (Product f g) (b, d) Source #

(Scalable f a b, Scalable g c d) => Scalable (Cartesian f g) (a, c) (b, d) Source # 
Instance details

Defined in Data.H3.Visuals

Associated Types

type Target (Cartesian f g) :: * -> * Source #

type TargetRange (Cartesian f g) (b, d) :: * Source #

data ScaleOptions (Cartesian f g) (a, c) (b, d) :: * Source #

Methods

scale :: ScaleOptions (Cartesian f g) (a, c) (b, d) -> TargetRange (Cartesian f g) (b, d) -> (a, c) -> Target (Cartesian f g) (b, d) Source #

Scalable ((->) a :: * -> *) a b Source # 
Instance details

Defined in Data.H3.Scalable

Associated Types

type Target ((->) a) :: * -> * Source #

type TargetRange ((->) a) b :: * Source #

data ScaleOptions ((->) a) a b :: * Source #

Methods

scale :: ScaleOptions ((->) a) a b -> TargetRange ((->) a) b -> a -> Target ((->) a) b Source #

Basic instances

arrow :: (a -> b) -> ScaleOptions ((->) a) a b Source #

Every function 'f :: a -> b' is a scale