| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Display.Terminal.Plot
Description
A plotly-express-style one-shot plotting API for terminal output.
Each chart kind has a small record spec (with sensible defaults) and a single render function. Customise plots by record-update on the spec:
bar ((mkBar Sex) { y = Just Survived }) titanic bar ((mkBar "ocean_proximity") { y = Just "median_house_value", agg = Mean }) housing
Synopsis
- data Agg
- data Bar = Bar {}
- mkBar :: Text -> Bar
- bar :: HasCallStack => Bar -> DataFrame -> IO ()
- data Histogram = Histogram {}
- mkHistogram :: Text -> Histogram
- histogram :: HasCallStack => Histogram -> DataFrame -> IO ()
- data Scatter = Scatter {}
- mkScatter :: Text -> Text -> Scatter
- scatter :: HasCallStack => Scatter -> DataFrame -> IO ()
- data Line = Line {}
- mkLine :: Text -> [Text] -> Line
- line :: HasCallStack => Line -> DataFrame -> IO ()
- data Pie = Pie {}
- mkPie :: Text -> Pie
- pie :: HasCallStack => Pie -> DataFrame -> IO ()
- data Box = Box {}
- mkBox :: [Text] -> Box
- box :: HasCallStack => Box -> DataFrame -> IO ()
- heatmap :: HasCallStack => DataFrame -> IO ()
- correlationMatrix :: HasCallStack => DataFrame -> IO ()
- plotHistogram :: HasCallStack => Text -> DataFrame -> IO ()
- plotScatter :: HasCallStack => Text -> Text -> DataFrame -> IO ()
- plotBars :: HasCallStack => Text -> DataFrame -> IO ()
- plotLines :: HasCallStack => Text -> [Text] -> DataFrame -> IO ()
- plotPie :: HasCallStack => Text -> Maybe Text -> DataFrame -> IO ()
- plotBoxPlots :: HasCallStack => [Text] -> DataFrame -> IO ()
- plotStackedBars :: HasCallStack => Text -> [Text] -> DataFrame -> IO ()
- plotHeatmap :: HasCallStack => DataFrame -> IO ()
- extractNumericColumn :: HasCallStack => Text -> DataFrame -> [Double]
- extractStringColumn :: HasCallStack => Text -> DataFrame -> [Text]
Aggregation
Aggregation strategy for grouped/categorical plots.
Bar charts
Bar-chart specification.
x is required; everything else has a default. When y is Nothing the
chart counts rows per group; otherwise y is aggregated using agg.
Constructors
| Bar | |
Fields
| |
Histograms
Histogram specification for a numeric column.
mkHistogram :: Text -> Histogram Source #
Scatter plots
Scatter-plot specification.
Line charts
Line-chart specification: one x column, one or more y series.
Pie charts
Pie-chart specification.
Constructors
| Pie | |
Box plots
Box-plot specification across one or more numeric columns.
Whole-frame plots
heatmap :: HasCallStack => DataFrame -> IO () Source #
Heatmap of all numeric columns in the dataframe; each numeric column becomes a column of the matrix.
correlationMatrix :: HasCallStack => DataFrame -> IO () Source #
Pearson correlation heatmap across all numeric columns.
Deprecated legacy entry points
These shims delegate to the parametrized API. They are kept for one release to ease migration; prefer the spec-based functions above for new code.
plotHistogram :: HasCallStack => Text -> DataFrame -> IO () Source #
Deprecated: use 'histogram (mkHistogram col)' instead
Use histogram with mkHistogram instead.
plotScatter :: HasCallStack => Text -> Text -> DataFrame -> IO () Source #
plotBoxPlots :: HasCallStack => [Text] -> DataFrame -> IO () Source #
plotStackedBars :: HasCallStack => Text -> [Text] -> DataFrame -> IO () Source #
Stacked-bar plot: one bar per category, segments from the listed value columns. Kept as a direct passthrough to granite — has no spec record because no aggregation is involved (segments are summed per category).
plotHeatmap :: HasCallStack => DataFrame -> IO () Source #
extractNumericColumn :: HasCallStack => Text -> DataFrame -> [Double] Source #
extractStringColumn :: HasCallStack => Text -> DataFrame -> [Text] Source #