Safe Haskell | None |
---|---|
Language | Haskell2010 |
Rendering charts to SVG.
Note that type signatures are tightened to Double as sane SVG rendering suggests.
Synopsis
- data ChartSvg = ChartSvg {
- svgOptions :: SvgOptions
- hudOptions :: HudOptions
- hudList :: [Hud Double]
- chartList :: [Chart Double]
- renderToCharts :: ChartSvg -> [Chart Double]
- renderToCRS :: SvgOptions -> [Chart Double] -> ([Chart Double], Rect Double, Point Double)
- chartSvg :: ChartSvg -> Text
- chartSvgDefault :: [Chart Double] -> Text
- chartSvgHud :: [Chart Double] -> Text
- renderChartsWith :: SvgOptions -> [Chart Double] -> Text
- renderHudChart :: SvgOptions -> [Hud Double] -> [Chart Double] -> Text
- writeChartSvg :: FilePath -> ChartSvg -> IO ()
- writeChartSvgDefault :: FilePath -> [Chart Double] -> IO ()
- writeChartSvgHud :: FilePath -> [Chart Double] -> IO ()
- svg2Tag :: Term [Attribute] (s -> t) => s -> t
- cssCrisp :: Html ()
- geometricPrecision :: Html ()
- svg :: Chart Double -> Html ()
- terms :: Text -> [Attribute] -> Html ()
- makeAttribute :: Text -> Text -> Attribute
- attsRect :: RectStyle -> [Attribute]
- attsText :: TextStyle -> [Attribute]
- attsGlyph :: GlyphStyle -> [Attribute]
- attsLine :: LineStyle -> [Attribute]
- attsPath :: PathStyle -> [Attribute]
- svgShape :: GlyphShape -> Double -> Point Double -> Html ()
Documentation
Specification of a chart for rendering to SVG
ChartSvg | |
|
Instances
Generic ChartSvg Source # | |
Semigroup ChartSvg Source # | |
Monoid ChartSvg Source # | |
type Rep ChartSvg Source # | |
Defined in Chart.Render type Rep ChartSvg = D1 ('MetaData "ChartSvg" "Chart.Render" "chart-svg-0.2.2-AJskDBGhW2w5nFQE5Ah360" 'False) (C1 ('MetaCons "ChartSvg" 'PrefixI 'True) ((S1 ('MetaSel ('Just "svgOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SvgOptions) :*: S1 ('MetaSel ('Just "hudOptions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HudOptions)) :*: (S1 ('MetaSel ('Just "hudList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Hud Double]) :*: S1 ('MetaSel ('Just "chartList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Chart Double])))) |
renderToCharts :: ChartSvg -> [Chart Double] Source #
Consume the ChartSvg and produce the combined huds and charts as a chart list.
chartSvg :: ChartSvg -> Text Source #
Render a chart using the supplied svg and hud config.
>>>
chartSvg mempty
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"300.0\" viewBox=\"-0.52 -0.52 1.04 1.04\" width=\"300.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"></svg>"
chartSvgDefault :: [Chart Double] -> Text Source #
Render a chart using the default svg options and no hud.
>>>
chartSvgDefault [] == chartSvg mempty
True
chartSvgHud :: [Chart Double] -> Text Source #
Render a chart using default svg and hud options.
>>>
chartSvgHud [] == (chartSvg $ mempty & #hudOptions .~ defaultHudOptions)
True
renderChartsWith :: SvgOptions -> [Chart Double] -> Text Source #
render Charts with the supplied options.
renderHudChart :: SvgOptions -> [Hud Double] -> [Chart Double] -> Text Source #
render charts with the supplied svg options and huds
writeChartSvgDefault :: FilePath -> [Chart Double] -> IO () Source #
Write a chart to a file with default svg options and no hud.
writeChartSvgHud :: FilePath -> [Chart Double] -> IO () Source #
Write a chart to a file with default svg and hud options.
geometricPrecision :: Html () Source #
crisp edges css
low-level conversions
attsGlyph :: GlyphStyle -> [Attribute] Source #
GlyphStyle to Attributes