[M9      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 None-23459:;<=@DORT^b /Convert a one-dimensional data set to line data8Convert a one-dimensional data set to verticle line data:Convert a one-dimensional data set to horizontal line data *Convert a one-dimensional data set to bars (Create line data for a formulae y = f(x) (Create line data for a formulae x = f(y) (Create rect data for a formulae y = f(x) (Create rect data for a formulae x = f(y)*Create rect data for a formulae c = f(x,y)        None-23459:;<=@DORT^b!vertical alignmenthorizontal alignment8a wrapped Rect specifying the shape od the chart canvas.The Aspect tends to be:independent of the data rangenexpressed in terms around a width magnitude of one. chart default options are callibrated to this convention.ka UChart provides a late binding of a chart Aspect so multiple charts can be rendered using the same range.bA Chart is simply a type synonym for a typical Diagrams object. A close relation to this type is 9 B, but this usage tends to force a single backend (B comes from the backend libraries), so making Chart b's maintains backend polymorphism.aJust about everything - text, circles, lines, triangles, charts, axes, titles, legends etc - are fs, which means that most things are amenable to full use of the combinatorially-inclined diagrams-lib.Arender a list of charts, taking into account each of their ranges <project a double-containered set of data to a new Rect range!7determine the range of a double-containered set of data"Jthe rendering aspect of a chart expressed as a ratio of x-plane : y-plane.# a 1:1 aspect$a 1.5:1 aspect% golden ratio& a 3:1 aspect'a skinny 5:1 aspect(Bconversion of horizontal alignment to (one :: Range Double) limits)5svg text is forced to be lower left (-0.5) by default*@conversion of vertical alignment to (one :: Range Double) limits+position an element at a point,!convert an R2 to a diagrams Point-convert an R2 to a V2.IfoldMap for beside; stacking chart elements in a direction, with a premap/*combine elements vertically, with a premap0,combine elements horizontally, with a premap1horizontal separator2vertical separator3write an svg to file4&convert an rgba spec to an AlphaColour5the official chart-unit blue6the official chart-unit grey7Bthe diagrams scaleX with a zero divide guard to avoid error throws8Bthe diagrams scaleY with a zero divide guard to avoid error throws9Athe diagrams scale with a zero divide guard to avoid error throws;These are difficult to avoid. !"#$%&'()*+,-./0123456:789:;+ !"#$%&'()*+,-./0123456789+! "#$%&'()*+,-./0213456789# !"#$%&'()*+,-./0123456:789:;None%&,-23459:;<=@DORT^b<+Options to pixelate a Rect using a function@At some point, a color of a rect becomes more about data than stylistic option, hence the pixel. Echewing rect border leaves a Pixel with no stylistic options to choose.D0Just about everything on a chart is a rectangle.Isolid rectangle, no borderJclear and transparent rectKclear rect, with borderLBplace a rect around an Chart, with a size equal to the chart rangeMA single rectangle specified using a Rect x z y w where (x,y) is location of lower left corner (z,w) is location of upper right corner let opts o = def {labelText = (labelText def) {textColor=withOpacity black 0.8, textSize = 0.3}, labelOrientation=o} labelled (opts (Pair 2 1)) ("z,w") $ labelled (opts (Pair -2 -1)) ("x,y") (rect_ def (Ranges (2*.one) one)) other/rect_Example.svg rect_ exampleN0Create rectangles (with the same configuration). 5rects def (rectOneD [1, 2, 3, 5, 8, 0, -2, 11, 2, 1]) other/rectsExample.svg rects exampleOA chart of rectsP-A chart of rectangles scaled to its own range let ropts = [def {rectBorderSize=0}, def {rectBorderSize=0,rectColor=ucolor 0.3 0.3 0.3 0.2}] let rss = [ rectXY (\x -> exp (-(x ** 2) / 2)) (Range -5 5) 50 , rectXY (\x -> 0.5 * exp (-(x ** 2) / 8)) (Range -5 5) 50 ] rectChart_ ropts widescreen rss other/rectChart_Example.svgrectChart_ exampleQ$A pixel is a rectangle with a color. tlet opt = def {textColor=withOpacity black 0.8, textSize = 0.2} text_ opt "I'm a pixel!" <> pixel_ (Pixel one ublue) other/pixel_Example.svgpixel_ exampleRRender multiple pixels pixels $ [Pixel (Rect (5*x) (5*x+0.1) (sin (10*x)) (sin (10*x) + 0.1)) (dissolve (2*x) ublue) | x <- grid OuterPos (Range 0 1) 100] other/pixelsExample.svgpixels exampleSA chart of pixelsT)A chart of pixels scaled to its own range !pixelChart_Example :: Chart b pixelChart_Example = pixelChart_ asquare [ (\(r,c) -> Pixel r (blend c (rybColor 14 `withOpacity` 1) (ucolor 0.8 0.8 0.8 0.3))) <$> rectF (\(Pair x y) -> 4*(x*x+y*y)) one (Pair 40 40) ] other/pixelChart_Example.svgpixelChart_ exampleU9Transform a Rect into Pixels using a function over a PairV}Chart pixels using a function This is a convenience function, and the example below is equivalent to the pixelChart_ example :pixelateChart def asquare one (\(Pair x y) -> (x+y)*(x+y))<=>?@ABCDEFGHIJKLMNOPQRSTUVWX<=>?@ABCDEFGHIJKLMNOPQRSTUVDEFGHIKJLMNOP@ABCQRST<=>?UV<=>?@ABCDEFGHIJKLMNOPQRSTUVWXNone-23459:;<=@DORT^b Y5A label is a text element attached to a chart element\direction of label]distance to label^ text optionsfCreate a textual chart element 5let text_Example = text_ def "Welcome to chart-unit!" other/text_Example.svg text_ exampleg#Creatye positioned text from a list Tlet ts = map (Text.singleton) ['a'..'z'] texts def ts [Pair (0.05*x) 0 |x <- [0..5]] other/textsExample.svg texts examplehA chart of texti'A chart of text scaled to its own range import qualified Data.Text as Text let ps = [Pair (sin (x*0.1)) x | x<-[0..25]] textChart_ (repeat $ def {textSize=0.33}) widescreen [zip ts ps] other/textChart_Example.svgtextChart_ examplej$Label a chart element with some text ~let lopts = def {textAlignH = AlignLeft, textRotation=45} labelled (LabelOptions lopts (Pair 1 1) 0.05) "a label" (glyph_ def) other/labelledExample.svglabelled exampleYZ[\]^_`abcdefghijklYZ[\]^_e`abcdfghij^_`abcdefghiYZ[\]j YZ[\]^_`abcdefghijklNone-23459:;<=@DORT^b m4The actual shape of a glyph can be any Chart elemento glyph radiusr normalizedtCVertical line glyph shape with a reasonable thickness at "vline_ 1"uEHorizontal line glyph shape with a reasonable thickness as "hline_ 1"vCreate a glyph. let glyph_Example = glyph_ def other/glyph_Example.svgglyph_ examplewCreate positioned glyphs. TglyphsExample :: Chart b glyphsExample = glyphs def (dataXY sin (Range 0 (2*pi)) 30) other/glyphsExample.svgglyphs examplexA chart of glyphsy)A chart of glyphs scaled to its own range gopts :: [GlyphOptions b] gopts = [ glyphBorderSize_ .~ 0.001 $ def , glyphBorderSize_ .~ 0.001 $ glyphSize_ .~ 0.1 $ glyphColor_ .~ rybColor 7 `withOpacity` 0.4 $ def {glyphShape = triangle} ] gdata :: [[Pair Double]] gdata = [ dataXY sin (Range 0 (2*pi)) 30 , dataXY cos (Range 0 (2*pi)) 30 ] glyphChart_Example :: Chart b glyphChart_Example = glyphChart_ gopts widescreen gdata other/glyphChart_Example.svgglyphChart_ examplez#Create labelled, positioned glyphs. )lglyphs def def $ zip (show <$> [0..]) ps other/lglyphsExample.svglglyphs example{A chart of labelled glyphs|2A chart of labelled glyphs scaled to its own range let g = Pair <$> [0..5] <*> [0..5] :: [Pair Int] let xs = [(\(p@(Pair x y)) -> ((show x <> "," <> show y), fromIntegral <$> p)) <$> g] lglyphChart_ [def {labelGap=0.01}] [def] sixbyfour xs other/lglyphChart_Example.svglglyphChart_ examplemnopqrstuvwxyz{|}mnopqrstuvwxyz{|mnopqrsutvwzxy{| mnopqrstuvwxyz{|}None-23459:;<=@DORT^b ~KThe main features of a line (that distinguish it from a glyph say) is that:Eit exists over multiple points (a line can't exist at a single point);line rendering is normalized to the eventual physical chart normalized$A line connecting a series of points )lines def (dataXY cos (Range 0 (4*pi)) n) other/linesExample.svg lines example!A single line connecting 2 pointsA chart of lines(A chart of lines scaled to its own range 4import Data.Colour.Palette.Harmony (tetrad) ls = map (uncurry Pair) <$> [[(0.0,1.0),(1.0,1.0),(2.0,5.0)], [(0.0,0.0),(3.0,3.0)], [(0.5,4.0),(0.5,0)]] lopts = zipWith (\x y -> LineOptions x (withOpacity y 0.6)) [0.01,0.02,0.005] (tetrad blue) lineChart_ lopts sixbyfour ls other/lineChart_Example.svglineChart_ example!Lines with glyphs atop eack pointA chart of glines/A chart of glyphs_lines scaled to its own range let gopts = zipWith (\x y -> def {glyphColor=transparent, glyphBorderColor=withOpacity x 0.6, glyphShape=y}) (tetrad green) [triangle, square, circle] glineChart_ lopts gopts sixbyfour ls other/glineChart_Example.svglineChart_ example ~ ~ ~ ~None-23459:;<=@DORT^bDAn arrow structure contains position, direction and size informationDtodo: quite a clunky specification of what an arrow is (or could be)tEqualize the arrow space width with the data space one. this creates the right arrow sizing in physical chart spaceGRescale data across position, and between position and arrow direction.Tnote that, due to this auto-scaling, there is no such thing as a single arrow_ chart arrows (def {arrowMaxLength=0.5,arrowMaxHeadLength=0.2,arrowMaxStaffWidth=0.01}) [Arrow (Pair x (sin (5*x))) (Pair x (cos x)) | x<-grid MidPos (one::Range Double) 100] other/arrowsExample.svgarrows exampleA chart of arrows&An arrow chart scaled to its own range let as = normArrows [Arrow (Pair x y) (Pair (sin 1/x+0.0001) (cos 1/y+0.0001)) | x<-grid MidPos (one::Range Double) 20, y<-grid MidPos (one::Range Double) 20] arrowChart_ [def] asquare [as] other/arrowChart_Example.svgarrowChart_ example None-23459:;<=@DORT^bOptions for gridlines.Style of grid linesno ticks on axis7sensibly rounded line placement and a guide to how manyexactly n lines using Posspecific line placement9Legend options. todo: allow for horizontal concatenation.OLegendType reuses all the various chart option types to help formulate a legendMOptions for titles. Defaults to center aligned, and placed at Top of the hudStyle of tick marks on an axis.no ticks on axisspecific labels.sensibly rounded ticks and a guide to how manyexactly n equally spaced ticksspecific labels and placement{Axes are somewhat complicated. For instance, they contain a range within which tick marks need to be supplied or computed.?Orientation for a hud element. Watch this space for curvature!ePlacement of hud elements around (what is implicity but maybe shouldn't just be) a rectangular canvasVarious options for a hud.UDefaults to the classical x- and y-axis, a sixbyfour aspect, no titles and no legends Create a hud. hud def other/hudExample.svg hud exampletodo: the example highlights the issues with using beside. The x-axis is placed first, and then the y-axis. In setting that ;z the combination of the canvas, and the x-axis, it calculates the middle, which has moved slightly from the canvas middle.:create a chart with a hud from data (using the data range) $withHudExample :: Chart b withHudExample = withHud hopts (lineChart lopts) ls where hopts = def {hudTitles=[(def,"withHud Example")], hudLegends=[def {legendChartType=zipWith (\x y -> (LegendLine x 0.05, y)) lopts ["line1", "line2", "line3"]}]} other/withHudExample.svgwithHud example;Direction to place stuff on the outside of the built-up hud#A gap to add when placing elements.default X axisdefault Y axisDcreate an axis, based on AxisOptions, a physical aspect, and a rangeUnder-the-hood, the axis function has gone through many a refactor, and still has a ways to go. A high degree of technical debt tends to acrue here. axisExample :: Chart b axisExample = axis aopts one (Range 0 100000) where aopts = def {axisLabel=(axisLabel def) { labelGap=0.0001, labelText=(labelText (axisLabel def)) { textSize=0.06, textAlignH=AlignLeft, textRotation=(-45)}}} other/axisExample.svg axis exampleProvide formatted text for a list of numbers so that they are just distinguished. 'precision 2 ticks' means give the tick labels as much precision as is needed for them to be distinguished, but with at least 2 significant figues.Create a title for a chart. The logic used to work out placement is flawed due to being able to freely specify text rotation. It works for specific rotations (Top, Bottom at 0, Left at 90, Right @ 270)(Create a legend based on a LegendOptions nlegendExample :: Chart b legendExample = legend $ def {legendChartType=legends} where legends = [ (LegendText def, "legend")] <> [ (LegendPixel (blob (withOpacity blue 0.4)) 0.05, "pixel")] <> -- [ (LegendArrow (def {arrowMinStaffWidth=0.01, -- arrowMinHeadLength=0.03}) 0.05, "arrow")] <> [ (LegendRect def 0.05, "rect")] <> [ (LegendGLine def def 0.10, "glyph+line")] <> [ (LegendGlyph def, "just a glyph")] <> (zipWith (\x y -> (LegendLine x 0.05, y)) lopts ["short", "much longer name", "line 3"]) other/legendExample.svglegend exampleCreate a grid line for a chart.ZUU   None-23459:;<=@DORT^b=      !"#$%&'()*+,-./01234567=      !"#$%&'()*+,-./01234567=      !$"%#&('*)+1,-.0/432675=      !"#$%&'()*+,-./01234567None-23459:;<=@DORT^b8 a scratch pad8<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789<=>?@ABCDEFGHIJKLMNOPQRSTUVYZ[\]^_e`abcdfghijmnopqrstuvwxyz{|~      !"#$%&'()*+,-./01234567888   !"#$%&'())**+,-./0123456789:;<=>?@ABCDEFGHIJKKLMNNOPQQRSTUVWXYZ[\]^_`abcdeefghiijklmnopqrstuvwwxyz{|}~                                                                       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 89:;<=>?@AB@AC@AD@AE@AE@AF@AG@AH@AI@AJ@AK@AL@AM@AN@AO@AP@AQ@RS@RT@RU@VWXYZXY[XY\XY]XY^XY_XY`XYaXYbXYcXYdXYeXYfXYgXYhXYiXYjklmklnkloklpkloklqkrskrskrtkuvkuwkuwkuxkyzky{ky|ky}ky~kykykykykykykykykykykykykykykykyky'chart-unit-0.5.2-7uiOK46VBjdIqfIpVbhdfGChart Chart.Glyph Chart.Data Chart.Core Chart.Rect Chart.Text Chart.Line Chart.Arrow Chart.Hud Chart.Lenses#text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqhData.Text.InternalText0data-default-class-0.1.2.0-GsXqKN6o1X9jr0fF5qCVDData.Default.ClassDefaultdef*diagrams-lib-1.4.1.2-CWo32F66oJTKn79uA7JrmDiagrams.TwoD.ShapestrianglesquareDiagrams.TwoD.EllipsecirclelineOneD vlineOneD hlineOneDrectOneDdataXYdataYXrectXYrectYXrectFAlignVAlignTopAlignMid AlignBottomAlignH AlignLeft AlignCenter AlignRightAspectUChartuchartRendereruchartRenderRange uchartDatacombine projectssrangeaspectasquare sixbyfourgolden widescreenskinnyalignHUalignHTUalignVU positionedp_r_stackverthorisepHorisepVertfileSvgucolorublueugreyscaleXscaleYscale$fR2Pair$fR1PairPixelationOptionspixelationGradientpixelationGrainPixel pixelRect pixelColor RectOptionsrectBorderSizerectBorderColor rectColorblobclearboxboundrect_rects rectChart rectChart_pixel_pixels pixelChart pixelChart_pixelate pixelateChart$fDefaultPixelationOptions$fDefaultRectOptions LabelOptions labelTextlabelOrientationlabelGap TextOptionstextSize textAlignH textColor textFillRule textRotationtextFonttext_texts textChart textChart_labelled$fDefaultLabelOptions$fDefaultTextOptions GlyphOptions glyphSize glyphColorglyphBorderColorglyphBorderSize glyphShapevline_hline_glyph_glyphs glyphChart glyphChart_lglyphs lglyphChart lglyphChart_$fDefaultGlyphOptions LineOptionslineSize lineColorlinesoneline lineChart lineChart_glines glineChart glineChart_$fDefaultLineOptionsArrowarrowPosarrowDir ArrowOptionsarrowMinLengtharrowMaxLengtharrowMinHeadLengtharrowMaxHeadLengtharrowMinStaffWidtharrowMaxStaffWidth arrowColorarrowHeadStyle normArrowsarrows arrowChart arrowChart_$fDefaultArrowOptions $fEqArrow $fShowArrow GridOptionsgridOrientation gridStylegridLine GridStyleGridNone GridRound GridExact GridPlaced LegendOptionslegendChartTypelegendInnerPadlegendInnerSep legendGap legendRowPad legendPlace legendAlign legendSep legendRect legendText LegendType LegendText LegendGlyph LegendLine LegendGLine LegendRect LegendArrow LegendPixel TitleOptions titleText titleAlign titlePlacetitleGap TickStyleTickNone TickLabels TickRound TickExact TickPlaced AxisOptionsaxisPadaxisOrientation axisPlaceaxisRectaxisRectHeightaxisMark axisMarkStartaxisGap axisLabel axisTickStyle OrientationHoriVertPlace PlaceLeft PlaceRightPlaceTop PlaceBottom HudOptionshudPadhudAxeshudGrids hudTitles hudLegendshudRange hudAspect hudCanvashudwithHud placeOutsideplaceGapdefXAxisdefYAxisaxis precisiontitlelegenddefXGriddefYGridgridl$fDefaultGridOptions$fDefaultLegendOptions$fDefaultTitleOptions$fDefaultAxisOptions$fDefaultHudOptions $fEqPlace $fShowPlace arrowColor_arrowHeadStyle_arrowMaxHeadLength_arrowMaxLength_arrowMaxStaffWidth_arrowMinHeadLength_arrowMinLength_arrowMinStaffWidth_glyphBorderColor_glyphBorderSize_ glyphColor_ glyphSize_ hudAspect_hudAxes_ hudCanvas_ hudGrids_ hudLegends_hudPad_ hudRange_ hudTitles_axisGap_ axisLabel_axisMarkStart_ axisMark_axisOrientation_axisPad_ axisPlace_axisRectHeight_ axisRect_axisTickStyle_ titleAlign_ titleGap_ titlePlace_ titleText_ legendAlign_legendChartType_ legendGap_legendInnerPad_legendInnerSep_ legendPlace_ legendRect_ legendRowPad_ legendSep_ legendText_ lineColor_ lineSize_rectBorderColor_rectBorderSize_ rectColor_ textAlignH_ textColor_ textFillRule_ textFont_ textRotation_ textSize_ labelGap_labelOrientation_ labelText_ gridLine_gridOrientation_ gridStyle_scratch,diagrams-core-1.4.0.1-GSKjuSI9jsG2kfSw9t4BQaDiagrams.Core.TypesDiagramepsDiagrams.Combinatorsbeside'SVGFonts-1.6.0.2-8Oor0MIJt3673BK5HOBh9mGraphics.SVGFonts.TexttextSVG_textSVG'textSVGTextOptsmodespacing underline textWidth textHeightModeINSIDE_HINSIDE_W INSIDE_WHSpacingHADVKERNGraphics.SVGFonts.Fontslin2linbitGraphics.SVGFonts.ReadFontloadFont#colour-2.3.3-7zspnmhVLMd3uThUzy60rYData.Colour.Internal alphaChannelatopblend withOpacitydissolveopaquealphaColourConvert transparentblack colourConvertColour AlphaColour AffineSpace affineCombo ColourOpsoverdarken*numhask-range-0.1.1-8MET5LfqG7N1O1IjOp8GO8 NumHask.Rect projectRectcornersRectRangesRect' NumHask.PairPairPair' NumHask.Range gridSensibleRangeRange' NumHask.SpaceSpaceElementGrid singletonunionspacelowercontainsprojectelementsingularuppermidnulgrid gridSpacePosOuterPosInnerPosLowerPosUpperPosMidPos&palette-0.1.0.5-3wdshIsuEZiFRJBEhNCauCData.Colour.Palette.ColorSet d3Colors4 d3Colors2 d3Colors1infiniteWebColors webColors getWebColorrybColor BrightnessDarkestDarkLightLightestData.Colour.Palette.HarmonybwgaccentAnalogicanalogictetradtriad complement monochromeshadetonetint rotateColorslidersData.Colour.Palette.TypesKolor