Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
Instances
Eq Margin Source # | |
Show Margin Source # | |
Generic Margin Source # | |
ToJSON Margin Source # | |
Defined in Graphics.Plotly.Internal 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
Instances
Axis Type
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 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
Instances
Show Axis Source # | |
Generic Axis Source # | |
ToJSON Axis Source # | |
Defined in Graphics.Plotly.Internal | |
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
Line | |
|
Instances
Show Line Source # | |
Generic Line Source # | |
ToJSON Line Source # | |
Defined in Graphics.Plotly.Internal | |
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
Instances
Show Marker Source # | |
Generic Marker Source # | |
ToJSON Marker Source # | |
Defined in Graphics.Plotly.Internal 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
Trace | |
|
Instances
Heatmap Trace
Instances
Show TraceH Source # | |
ToJSON TraceH Source # | |
Defined in Graphics.Plotly.Internal toEncoding :: TraceH -> Encoding toJSONList :: [TraceH] -> Value toEncodingList :: [TraceH] -> Encoding |
Surface Trace
Instances
Show TraceS Source # | |
ToJSON TraceS Source # | |
Defined in Graphics.Plotly.Internal toEncoding :: TraceS -> Encoding toJSONList :: [TraceS] -> Value toEncodingList :: [TraceS] -> Encoding |
Parallel Coordinate Trace
Instances
Show TraceP Source # | |
ToJSON TraceP Source # | |
Defined in Graphics.Plotly.Internal 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 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
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 | |
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
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 | |
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
Instances
Eq Symbol Source # | |
Show Symbol Source # | |
Generic Symbol Source # | |
ToJSON Symbol Source # | |
Defined in Graphics.Plotly.Internal 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
Discrete | |
Blackbody | |
Bluered | |
Blues | |
Cividis | |
Earth | |
Electric | |
Greens | |
Greys | |
Hot | |
Jet | |
Picnic | |
Portland | |
Rainbow | |
RdBu | |
Reds | |
Viridis | |
YlGnBu | |
YlOrRd |
Instances
Some Color Strings
Instances
Enum Color Source # | |
Defined in Graphics.Plotly.Internal | |
Eq Color Source # | |
Show Color Source # | |
Generic Color Source # | |
ToJSON Color Source # | |
Defined in Graphics.Plotly.Internal | |
type Rep Color Source # | |
Defined in Graphics.Plotly.Internal type Rep Color = D1 ('MetaData "Color" "Graphics.Plotly.Internal" "plotly-hs-0.1.0.0-5GqvvACHt0P1rkfhVJsYpr" 'False) (((C1 ('MetaCons "Red" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Green" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Blue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Yellow" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Magenta" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cyan" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Black" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Gray" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "White" 'PrefixI 'False) (U1 :: Type -> Type))))) |
data ColorMapping Source #
Type alias for mapping a color
Instances
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 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
Instances
Show XBins Source # | |
Generic XBins Source # | |
ToJSON XBins Source # | |
Defined in Graphics.Plotly.Internal | |
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 i
th 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