chart-svg-0.2.2: Charting library targetting SVGs.
Safe HaskellNone
LanguageHaskell2010

Chart.Render

Description

Rendering charts to SVG.

Note that type signatures are tightened to Double as sane SVG rendering suggests.

Synopsis

Documentation

data ChartSvg Source #

Specification of a chart for rendering to SVG

Instances

Instances details
Generic ChartSvg Source # 
Instance details

Defined in Chart.Render

Associated Types

type Rep ChartSvg :: Type -> Type #

Methods

from :: ChartSvg -> Rep ChartSvg x #

to :: Rep ChartSvg x -> ChartSvg #

Semigroup ChartSvg Source # 
Instance details

Defined in Chart.Render

Monoid ChartSvg Source # 
Instance details

Defined in Chart.Render

type Rep ChartSvg Source # 
Instance details

Defined in Chart.Render

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

writeChartSvg :: FilePath -> ChartSvg -> IO () Source #

Write to a file.

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.

svg2Tag :: Term [Attribute] (s -> t) => s -> t Source #

svg element + svg 2 attributes

cssCrisp :: Html () Source #

crisp edges css

geometricPrecision :: Html () Source #

crisp edges css

svg :: Chart Double -> Html () Source #

Low-level conversion of a Chart to svg

terms :: Text -> [Attribute] -> Html () Source #

Make Lucid Html given term and attributes

makeAttribute #

Arguments

:: Text

Attribute name.

-> Text

Attribute value.

-> Attribute 

Make an attribute builder.

low-level conversions

attsRect :: RectStyle -> [Attribute] Source #

RectStyle to Attributes

attsText :: TextStyle -> [Attribute] Source #

TextStyle to Attributes

attsGlyph :: GlyphStyle -> [Attribute] Source #

GlyphStyle to Attributes

attsLine :: LineStyle -> [Attribute] Source #

LineStyle to Attributes

attsPath :: PathStyle -> [Attribute] Source #

PathStyle to Attributes

svgShape :: GlyphShape -> Double -> Point Double -> Html () Source #

GlyphShape to svg Tree