| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Plotly.Internal
Description
Internal Functions and Types for Plotly Plots in Haskell
Synopsis
- omitNulls :: [Pair] -> [Pair]
- prependColor :: [[Double]] -> Int -> [[Double]]
- type Script = ByteString
- toHtml :: Script -> ByteString
- data Margin = Margin {}
- data Layout = Layout {}
- data AxisType
- = Linear
- | Log
- | Date
- | Category
- | MultiCategory
- data Axis = Axis {}
- data Line = Line {
- showscale :: !(Maybe Bool)
- reversescale :: !(Maybe Bool)
- colorscale :: !(Maybe ColorScale)
- colormap :: !(Maybe ColorMap)
- color :: !(Maybe [Double])
- data Marker = Marker {}
- data Trace = Trace {}
- data TraceH = TraceH {}
- data TraceS = TraceS {}
- data TraceP = TraceP {}
- data Dimension = Dimension {}
- data Type
- data Mode
- = Lines
- | Markers
- | LinesMarkers
- data Symbol
- = Circle
- | CircleOpen
- | Cross
- | Diamond
- | DiamondOpen
- | Square
- | SquareOpen
- | X
- data ColorScale
- data Color
- data ColorMapping = ColorMapping !Double !Color
- type ColorMap = [ColorMapping]
- data BarMode
- data XBins = XBins {}
- traceData :: Int -> Script
- traceLine :: ToJSON a => a -> Int -> ByteString
- toScript :: ToJSON a => Maybe Layout -> [a] -> ByteString
- mkTrace :: Maybe String -> Maybe Mode -> Maybe Marker -> Type -> BarMode -> XBins -> [Double] -> [Double] -> [Double] -> Trace
- mkTraceH :: ColorScale -> Bool -> Bool -> [String] -> [String] -> [[Double]] -> TraceH
- mkTraceS :: Maybe String -> ColorScale -> [Double] -> [Double] -> [[Double]] -> TraceS
- mkTraceP :: ColorScale -> Bool -> Bool -> [Double] -> [String] -> [[[Double]]] -> TraceP
- mkTraceP' :: [String] -> [[[Double]]] -> TraceP
Documentation
omitNulls :: [Pair] -> [Pair] Source #
Thanks Alan Zimmerman https://gist.github.com/alanz/2465584
prependColor :: [[Double]] -> Int -> [[Double]] Source #
Prepend Color Column to Parallel Coordinate Plot
type Script = ByteString Source #
Internal Type Alias
toHtml :: Script -> ByteString Source #
Takes a Script and inserts it into the default HTML template
Layout Margins
Constructors
| Margin | |
Instances
| Eq Margin Source # | |
| Show Margin Source # | |
| Generic Margin Source # | |
| ToJSON Margin Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Margin -> Encoding toJSONList :: [Margin] -> Value toEncodingList :: [Margin] -> Encoding | |
| type Rep Margin Source # | |
Defined in Graphics.Plotly.Internal type Rep Margin = D1 ('MetaData "Margin" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Margin" 'PrefixI 'True) ((S1 ('MetaSel ('Just "l") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "r") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "b") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "t") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) | |
Layout for Plots
Constructors
| Layout | |
Instances
Axis Type
Constructors
| Linear | Linear Axis (default) |
| Log | Logarithmic Axis |
| Date | Date Axis |
| Category | Categorical Axis |
| MultiCategory | Multi Category Axis (?) |
Instances
| Eq AxisType Source # | |
| Show AxisType Source # | |
| Generic AxisType Source # | |
| ToJSON AxisType Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: AxisType -> Encoding toJSONList :: [AxisType] -> Value toEncodingList :: [AxisType] -> Encoding | |
| type Rep AxisType Source # | |
Defined in Graphics.Plotly.Internal type Rep AxisType = D1 ('MetaData "AxisType" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) ((C1 ('MetaCons "Linear" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Log" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Date" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Category" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MultiCategory" 'PrefixI 'False) (U1 :: Type -> Type)))) | |
Axis Layout
Constructors
| Axis | |
Instances
| Show Axis Source # | |
| Generic Axis Source # | |
| ToJSON Axis Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Axis -> Encoding toJSONList :: [Axis] -> Value toEncodingList :: [Axis] -> Encoding | |
| type Rep Axis Source # | |
Defined in Graphics.Plotly.Internal type Rep Axis = D1 ('MetaData "Axis" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Axis" 'PrefixI 'True) ((S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "showGrid") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "zeroLine") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "type'") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AxisType)))) | |
Parallel Coordinate Lines
Constructors
| Line | |
Fields
| |
Instances
| Show Line Source # | |
| Generic Line Source # | |
| ToJSON Line Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Line -> Encoding toJSONList :: [Line] -> Value toEncodingList :: [Line] -> Encoding | |
| type Rep Line Source # | |
Defined in Graphics.Plotly.Internal type Rep Line = D1 ('MetaData "Line" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Line" 'PrefixI 'True) ((S1 ('MetaSel ('Just "showscale") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "reversescale") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "colorscale") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ColorScale)) :*: (S1 ('MetaSel ('Just "colormap") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ColorMap)) :*: S1 ('MetaSel ('Just "color") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [Double])))))) | |
Marker Config
Constructors
| Marker | |
Instances
| Show Marker Source # | |
| Generic Marker Source # | |
| ToJSON Marker Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Marker -> Encoding toJSONList :: [Marker] -> Value toEncodingList :: [Marker] -> Encoding | |
| type Rep Marker Source # | |
Defined in Graphics.Plotly.Internal type Rep Marker = D1 ('MetaData "Marker" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Marker" 'PrefixI 'True) (S1 ('MetaSel ('Just "size") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "symbol") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Symbol) :*: S1 ('MetaSel ('Just "opacity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))) | |
Data Trace
Constructors
| Trace | |
Fields
| |
Instances
Heatmap Trace
Constructors
| TraceH | |
Instances
| Show TraceH Source # | |
| ToJSON TraceH Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: TraceH -> Encoding toJSONList :: [TraceH] -> Value toEncodingList :: [TraceH] -> Encoding | |
Surface Trace
Constructors
| TraceS | |
Instances
| Show TraceS Source # | |
| ToJSON TraceS Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: TraceS -> Encoding toJSONList :: [TraceS] -> Value toEncodingList :: [TraceS] -> Encoding | |
Parallel Coordinate Trace
Constructors
| TraceP | |
Instances
| Show TraceP Source # | |
| ToJSON TraceP Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: TraceP -> Encoding toJSONList :: [TraceP] -> Value toEncodingList :: [TraceP] -> Encoding | |
Axis Dimension for Parallel Coordinate Plot
Instances
| Show Dimension Source # | |
| Generic Dimension Source # | |
| ToJSON Dimension Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Dimension -> Encoding toJSONList :: [Dimension] -> Value toEncodingList :: [Dimension] -> Encoding | |
| type Rep Dimension Source # | |
Defined in Graphics.Plotly.Internal type Rep Dimension = D1 ('MetaData "Dimension" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Dimension" 'PrefixI 'True) (S1 ('MetaSel ('Just "range") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [Int])) :*: (S1 ('MetaSel ('Just "label") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "values") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Double])))) | |
Plot Type
Constructors
| Scatter | Scatter Plot |
| Histogram | Histogram |
| Heatmap | Heatmap |
| Scatter3D | 3D Scatter |
| Surface | 3D Surface |
| ParCoords | Parallel Coordinate Plot |
Instances
| Eq Type Source # | |
| Show Type Source # | |
| Generic Type Source # | |
| ToJSON Type Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Type -> Encoding toJSONList :: [Type] -> Value toEncodingList :: [Type] -> Encoding | |
| type Rep Type Source # | |
Defined in Graphics.Plotly.Internal type Rep Type = D1 ('MetaData "Type" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) ((C1 ('MetaCons "Scatter" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Histogram" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Heatmap" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Scatter3D" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Surface" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ParCoords" 'PrefixI 'False) (U1 :: Type -> Type)))) | |
Scatter Mode
Constructors
| Lines | Draw Lines |
| Markers | Draw Markers only |
| LinesMarkers | Draw Both |
Instances
| Eq Mode Source # | |
| Show Mode Source # | |
| Generic Mode Source # | |
| ToJSON Mode Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Mode -> Encoding toJSONList :: [Mode] -> Value toEncodingList :: [Mode] -> Encoding | |
| type Rep Mode Source # | |
Defined in Graphics.Plotly.Internal type Rep Mode = D1 ('MetaData "Mode" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "Lines" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Markers" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LinesMarkers" 'PrefixI 'False) (U1 :: Type -> Type))) | |
Marker Symbols
Constructors
| Circle | |
| CircleOpen | |
| Cross | |
| Diamond | |
| DiamondOpen | |
| Square | |
| SquareOpen | |
| X |
Instances
| Eq Symbol Source # | |
| Show Symbol Source # | |
| Generic Symbol Source # | |
| ToJSON Symbol Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: Symbol -> Encoding toJSONList :: [Symbol] -> Value toEncodingList :: [Symbol] -> Encoding | |
| type Rep Symbol Source # | |
Defined in Graphics.Plotly.Internal type Rep Symbol = D1 ('MetaData "Symbol" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (((C1 ('MetaCons "Circle" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CircleOpen" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cross" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Diamond" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "DiamondOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Square" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "SquareOpen" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "X" 'PrefixI 'False) (U1 :: Type -> Type)))) | |
data ColorScale Source #
Color scales for Heamap / 3D Plots
Constructors
| Discrete | |
| Blackbody | |
| Bluered | |
| Blues | |
| Cividis | |
| Earth | |
| Electric | |
| Greens | |
| Greys | |
| Hot | |
| Jet | |
| Picnic | |
| Portland | |
| Rainbow | |
| RdBu | |
| Reds | |
| Viridis | |
| YlGnBu | |
| YlOrRd |
Instances
Some Color Strings
Instances
data ColorMapping Source #
Type alias for mapping a color
Constructors
| ColorMapping !Double !Color |
Instances
| Show ColorMapping Source # | |
Defined in Graphics.Plotly.Internal Methods showsPrec :: Int -> ColorMapping -> ShowS # show :: ColorMapping -> String # showList :: [ColorMapping] -> ShowS # | |
| Generic ColorMapping Source # | |
Defined in Graphics.Plotly.Internal Associated Types type Rep ColorMapping :: Type -> Type # | |
| ToJSON ColorMapping Source # | |
Defined in Graphics.Plotly.Internal Methods toJSON :: ColorMapping -> Value toEncoding :: ColorMapping -> Encoding toJSONList :: [ColorMapping] -> Value toEncodingList :: [ColorMapping] -> Encoding | |
| type Rep ColorMapping Source # | |
Defined in Graphics.Plotly.Internal type Rep ColorMapping = D1 ('MetaData "ColorMapping" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "ColorMapping" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Color))) | |
type ColorMap = [ColorMapping] Source #
Type alias for a list of color mappings
Bar Layout
Instances
| Eq BarMode Source # | |
| Show BarMode Source # | |
| Generic BarMode Source # | |
| ToJSON BarMode Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: BarMode -> Encoding toJSONList :: [BarMode] -> Value toEncodingList :: [BarMode] -> Encoding | |
| type Rep BarMode Source # | |
Defined in Graphics.Plotly.Internal type Rep BarMode = D1 ('MetaData "BarMode" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) ((C1 ('MetaCons "Stack" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Group" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Overlay" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Relative" 'PrefixI 'False) (U1 :: Type -> Type))) | |
Bins in Histogram
Constructors
| XBins | |
Instances
| Show XBins Source # | |
| Generic XBins Source # | |
| ToJSON XBins Source # | |
Defined in Graphics.Plotly.Internal Methods toEncoding :: XBins -> Encoding toJSONList :: [XBins] -> Value toEncodingList :: [XBins] -> Encoding | |
| type Rep XBins Source # | |
Defined in Graphics.Plotly.Internal type Rep XBins = D1 ('MetaData "XBins" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (C1 ('MetaCons "XBins" 'PrefixI 'True) (S1 ('MetaSel ('Just "size") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "start") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "end") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Double))))) | |
traceLine :: ToJSON a => a -> Int -> ByteString Source #
Generates line for ith trace variable
toScript :: ToJSON a => Maybe Layout -> [a] -> ByteString Source #
Converts layout and list of traces to Script for insertion into HTML
mkTrace :: Maybe String -> Maybe Mode -> Maybe Marker -> Type -> BarMode -> XBins -> [Double] -> [Double] -> [Double] -> Trace Source #
Trace contructor, different order of arguments
mkTraceH :: ColorScale -> Bool -> Bool -> [String] -> [String] -> [[Double]] -> TraceH Source #
Heatmap Trace constructor
mkTraceS :: Maybe String -> ColorScale -> [Double] -> [Double] -> [[Double]] -> TraceS Source #
Heatmap Trace constructor