Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Examples of chart construction.
Synopsis
- unitExample :: ChartOptions
- hudOptionsExample :: ChartOptions
- lineExample :: ChartOptions
- rectExample :: ChartOptions
- textExample :: ChartOptions
- glyphsExample :: ChartOptions
- pathExample :: ChartOptions
- barExample :: ChartOptions
- barDataExample :: BarData
- sbarExample :: ChartOptions
- waveExample :: ChartOptions
- surfaceExample :: ChartOptions
- rosenbrock :: Double -> Double -> Point Double -> (Double, Point Double)
- arcFlagsExample :: ChartOptions
- ellipseExample :: ChartAspect -> ChartOptions
- quadExample :: ChartOptions
- cubicExample :: ChartOptions
- vennExample :: ChartOptions
- arrowExample :: ChartOptions
- dateExample :: ChartOptions
- gradientExample :: ChartOptions
- wheelExample :: ChartOptions
- debugExample :: ChartOptions -> ChartOptions
- compoundExample :: ChartOptions
- stackExample :: ChartOptions
- priorityv1Example :: ChartOptions
- priorityv2Example :: ChartOptions
- pathChartOptions :: [(FilePath, ChartOptions)]
- writeAllExamples :: IO ()
- writeAllExamplesDark :: IO ()
Unit & Hud
unitExample :: ChartOptions Source #
unit example
hudOptionsExample :: ChartOptions Source #
A BlankChart
, defaultHudOptions
example.
Iconic primitives.
lineExample :: ChartOptions Source #
line example
rectExample :: ChartOptions Source #
rect example
textExample :: ChartOptions Source #
text example
glyphsExample :: ChartOptions Source #
glyphs example
pathExample :: ChartOptions Source #
Compound path example.
Compounds
barExample :: ChartOptions Source #
Bar chart example.
barDataExample :: BarData Source #
Example data for Bar chart
sbarExample :: ChartOptions Source #
Stacked bar chart example.
waveExample :: ChartOptions Source #
wave example
surfaceExample :: ChartOptions Source #
The common way to create a surface chart (or contour chart or heat map) is usually a grid over a function, a process reified in surfacef
.
This is also an example of mix
and mixes
. In this example, colors with the same lightness have been chosen in the gradient and the result should appear a fairly uniform lightness across the surface.
rosenbrock :: Double -> Double -> Point Double -> (Double, Point Double) Source #
function for testing
f(x,y) = (a-x)^2 + b * (y - x^2)^2 = a^2 - 2ax + x^2 + b * y^2 - b * 2 * y * x^2 + b * x ^ 4 f'x = -2a + 2 * x - b * 4 * y * x + 4 * b * x ^ 3 f'y = 2 * b * y - 2 * b * x^2 f a b (Point x y) = (a^2 - 2ax + x^2 + b * y^2 - b * 2 * y * x^2 + b * x^4, Point (-2a + 2 * x - b * 4 * y * x + 4 * b * x ^ 3), 2 * b * y - 2 * b * x^2)
arcFlagsExample :: ChartOptions Source #
Reproduction of the flag explanation chart in https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
ellipseExample :: ChartAspect -> ChartOptions Source #
ellipse example
Under scaling, angles are not invariant, and this effects the glyphShape of ellipses and thus SVG arc paths. Compare the effect of aspect changes to the axes of this ellipse:
Below is the same ellipse with FixedAspect 2. Points scale exactly, but the original points that represent the end points of the axes are no longer on the new axes of the ellipse.
quadExample :: ChartOptions Source #
quad example
cubicExample :: ChartOptions Source #
cubic example
vennExample :: ChartOptions Source #
venn diagram
arrowExample :: ChartOptions Source #
arrow example
Which happens to be the gradient of the surface example.
dateExample :: ChartOptions Source #
date example
A hud that has date as the x-axis, and time as the y-axis. See placedTimeLabelContinuous
.
Colour
gradientExample :: ChartOptions Source #
gradient example
Mixing Colours using the oklch color model.
wheelExample :: ChartOptions Source #
Color wheel displaying palette choices
Debugging
debugExample :: ChartOptions -> ChartOptions Source #
Adding reference points and bounding boxes to visualize chart alignment for use in debugging charts.
Compound Charts
compoundExample :: ChartOptions Source #
A merge of two rect charts with different data ranges.
stackExample :: ChartOptions Source #
Usage of stack.
Priority
priorityv1Example :: ChartOptions Source #
priority Version 1 example
priorityv2Example :: ChartOptions Source #
priority Version 2 example
Writing to file
pathChartOptions :: [(FilePath, ChartOptions)] Source #
All the examples and the associated filepaths
writeAllExamples :: IO () Source #
Run this to refresh example SVG's.
writeAllExamplesDark :: IO () Source #
Version of charts with a dark-friendly hud