PatternFly v6 chart components for Elm, built on gampleman/elm-visualization.
Live gallery: https://lenards.github.io/elm-patternfly-charts/
PF6.Charts.Area — filled line chart for continuous metricsPF6.Charts.Bar — grouped or single-series vertical barsPF6.Charts.BoxPlot — statistical distribution per categoryPF6.Charts.Bullet — measure vs. qualitative range + target markerPF6.Charts.Donut — ring chart with center metric labelPF6.Charts.DonutUtilization — single-metric with warning/danger thresholdsPF6.Charts.Line — multi-series continuous dataPF6.Charts.Pie — solid slices for part-to-wholePF6.Charts.Scatter — multi-series 2D point cloudPF6.Charts.Sparkline — miniature inline trend linePF6.Charts.Stack — stacked area chart for cumulative seriesPF6.Charts.Threshold — line chart with warning/danger threshold linesPF6.Charts.Skeleton — loading state placeholders for every chart typeimport PF6.Charts.Area as Area
view : Html msg
view =
Area.fromData
[ ( 0, 42 ), ( 1, 55 ), ( 2, 48 ), ( 3, 72 ), ( 4, 63 ) ]
|> Area.withWidth 500
|> Area.withXLabel "Time (min)"
|> Area.withYLabel "CPU %"
|> Area.withTitle "CPU Utilization"
|> Area.withTooltips True
|> Area.toSvgAll charts follow the same builder pattern: fromData |> withX |> toSvg.
PF6.Charts.Colors exposes the full PatternFly v6 color scalePF6.Charts.Theme with Theme.light and Theme.darkTheme.fromUiThemeColors accepts a plain record of hex strings,
no dependency on any UI librarywithLoading : Bool that swaps in a shimmer
placeholder while data is fetchingwithTooltips True on Area, Bar, Donut, Pie, and Scatter adds
browser-native <title> hover text, zero state requiredwithWidth/withHeight; pair with a
ResizeObserver port in your app (see the gallery's "Resize Observer" panel)If your app already uses a UI theme library you can extract its colors into a
plain record and pass it to Theme.fromUiThemeColors without adding a
dependency on that library here:
import PF6.Charts.Theme as ChartTheme
-- Convert your UI theme colors to hex strings however your library supports,
-- then build a ChartTheme:
myChartTheme : ChartTheme.Theme
myChartTheme =
ChartTheme.fromUiThemeColors
{ primary = "#0066cc"
, labelText = "#151515"
, background = "#ffffff"
, borderDefault = "#d2d2d2"
}cd demo
elm make src/Main.elm --output main.js
# then open index.html in a browser, or:
npx serve .elm-patternfly-charts/
├── src/PF6/Charts/ ← library source
├── demo/ ← gallery application
│ ├── src/Main.elm
│ └── index.html
└── docs/ ← GitHub Pages output (compiled demo)
├── index.html
└── main.jsTo rebuild docs/main.js after changes:
cd demo
elm make src/Main.elm --optimize --output ../docs/main.js