Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Serve a chart web page with a web socket in it, that accepts ChartOptions
.
Synopsis
- startChartServer :: IO (ChartOptions -> IO Bool, IO ())
- startChartServerWith :: SocketConfig -> Page -> IO (ChartOptions -> IO Bool, IO ())
- printChart :: Show a => Bool -> (ChartOptions -> IO Bool) -> a -> IO ()
- chartSocketPage :: Page
Documentation
startChartServer :: IO (ChartOptions -> IO Bool, IO ()) Source #
Start the chart server. Returns the chart consumer, and a server quit signal effect.
An iconic ghci session transcript:
> import Chart.Examples > (sendChart, quitChartServer) <- startChartServer > sendChart unitExample
... point browser to localhost:9160 ...
> quitChartServer
startChartServerWith :: SocketConfig -> Page -> IO (ChartOptions -> IO Bool, IO ()) Source #
Start the chart server protocol with bespoke SocketConfig
and Page
configurations.
startChartServerWith (defaultSocketConfig & #port .~ 4567) (defaultSocketPage & #htmlBody %~ divClass_ "row" "bespoke footnote")
printChart :: Show a => Bool -> (ChartOptions -> IO Bool) -> a -> IO () Source #
Print a chart supplying a ChartOptions
consumer, and a showable thing that may be chartable. The first argument flags whether to also print the item to stdout.
chartSocketPage :: Page Source #
Page
containing a web socket and javascript needed to run it.