y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                            None-23459:;<=@DORT^b!vertical alignment horizontal 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  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 range7determine the range of a double-containered set of dataJthe rendering aspect of a chart expressed as a ratio of x-plane : y-plane. a 1:1 aspecta 1.5:1 aspect golden ratio a 3:1 aspecta skinny 5:1 aspectBconversion 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 premap',combine elements horizontally, with a premap(horizontal separator)vertical separator*write an svg to file+&convert an rgba spec to an AlphaColour,the official chart-unit blue-the official chart-unit grey.Bthe diagrams scaleX with a zero divide guard to avoid error throws/Bthe diagrams scaleY with a zero divide guard to avoid error throws0Athe diagrams scale with a zero divide guard to avoid error throws2These are difficult to avoid.  !"#$%&'()*+,-./012+  !"#$%&'()*+,-./0+   !"#$%&')(*+,-./0#   !"#$%&'()*+,-./012None%&,-23459:;<=@DORT^b3+Options to pixelate a Rect using a function7At 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.;0Just about everything on a chart is a rectangle.@solid rectangle, no borderAclear and transparent rectBclear rect, with borderCBplace a rect around an Chart, with a size equal to the chart rangeDA 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_ exampleE0Create rectangles (with the same configuration). Lrects def $ zipWith (\x y -> Rect x (x+1) 0 y) [0..] [1,2,3,5,8,0,-2,11,2,1] other/rectsExample.svg rects exampleFA chart of rectsG-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 pss = transpose [[exp (-(x**2)/2), 0.5 * exp (-(x**2)/8)] | x <- grid LowerPos (Range -5 5) 1000] let rss = (zipWith (\x y -> Rect x (x+1) 0 y) [0..]) <$> pss rectChart_ ropts widescreen rss other/rectChart_Example.svgrectChart_ exampleH$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_ exampleIRender 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 exampleJA chart of pixelsK)A chart of pixels scaled to its own range pixelChart_ asquare [[Pixel (Rect x (x+0.05) y (y+0.05)) (blend (x*y+x*x) ugrey ublue) | x <- grid OuterPos (one::Range Double) 20, y <- grid OuterPos (one::Range Double) 20]] other/pixelChart_Example.svgpixelChart_ exampleL9Transform a Rect into Pixels using a function over a PairM}Chart pixels using a function This is a convenience function, and the example below is equivalent to the pixelChart_ example 6pixelateChart def asquare one (\(Pair x y) -> x*y+x*x)3456789:;<=>?@ABCDEFGHIJKLMNO3456789:;<=>?@ABCDEFGHIJKLM;<=>?@BACDEFG789:HIJK3456LM3456789:;<=>?@ABCDEFGHIJKLMNONone-23459:;<=@DORT^b P5A label is a text element attached to a chart elementSdirection of labelTdistance to labelU text options\Create a textual chart element 5let text_Example = text_ def "Welcome to chart-unit!" other/text_Example.svg text_ example]#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 example^A chart of text_'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_ example`$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 examplePQRSTUVWXYZ[\]^_`abPQRSTUVWXYZ[\]^_`UVWXYZ[\]^_PQRST` PQRSTUVWXYZ[\]^_`abNone-23459:;<=@DORT^b c4The actual shape of a glyph can be any Chart elemente glyph radiush normalizedjCVertical line glyph shape with a reasonable thickness at "vline_ 1"kEHorizontal line glyph shape with a reasonable thickness as "hline_ 1"lCreate a glyph. let glyph_Example = glyph_ def other/glyph_Example.svgglyph_ examplemCreate positioned glyphs. >let ps = [Pair (x/10) ((sin x)/10) | x<-[0..10]] glyphs def ps other/glyphsExample.svgglyphs examplenA chart of glyphso)A chart of glyphs scaled to its own range let gopts = [def,def {glyphBorderColor=withOpacity red 0.2, glyphShape=triangle}] let p_1 = [Pair x (sin (x/10)) | x<-[0..100]] let p_2 = [Pair x (cos (x/10)) | x<-[0..100]] glyphChart_ gopts widescreen [p_1,p_2] other/glyphChart_Example.svgglyphChart_ examplep#Create labelled, positioned glyphs. )lglyphs def def $ zip (show <$> [0..]) ps other/lglyphsExample.svglglyphs exampleqA chart of labelled glyphsr2A 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_ examplecdefghijklmnopqrscdefghijklmnopqrcdefghikjlmpnoqr cdefghijklmnopqrsNone-23459:;<=@DORT^b tKThe 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 chartv normalizedx$A line connecting a series of points Ulines def [Pair (10*x/100.0) (cos (x * (10 / 100.0))) | x <- fromIntegral <$> [0..n]] other/linesExample.svg lines exampley!A single line connecting 2 pointszA 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 point}A 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 tuvwxyz{|}~ tuwvxyz{|}~ tuvwyx|z{}~ tuvwxyz{|}~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^b9Legend 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 example: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 exampleKGG   None-23459:;<=@DORT^b8     8     8     8     None-23459:;<=@DORT^b a scratch padW !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi  !"#$%&'()*+,-./03456789:;<=>?@ABCDEFGHIJKLMPQRSTUVWXYZ[\]^_`cdefghijklmnopqrtuwvxyz{|}~     j     !"#$%&'()*+,-./0123456789:;<=>?@AABCDDEFGGHIJKLMNOPQRSTUVWXYZ[[\]^__`abcdefghijkllmnopqrstuvwxyz{||}~                            !" !# !$ !% !& !' !( !) !* !+ !, !- !. !/ !0 !1 !23453463473483473493:;3:;3:<3=>3=?3=?3=@3AB3AC3AD3AE3AF3AG3AH3AI3AJ3AK3AL3AM3AN3AO3AP3AQ3AR3AS3AT3AU3AV3AWXYZXY[XY\XY]XY^XY_XY`XYaXYbXYcXYdXYeXfgXfhXfiXfjXfkXflXfmXfnXfoXfpXfqXfrXstu'chart-unit-0.5.1-IUWLgxVmDWp5Hjr4K5ZrQXChart Chart.Glyph 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-J9SCDseaq7G4fllXgt29K0Diagrams.TwoD.ShapestrianglesquareDiagrams.TwoD.EllipsecircleAlignVAlignTopAlignMid 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 textRotationtext_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 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 HudOptionshudPadhudAxes hudTitles hudLegendshudRange hudAspect hudCanvashudwithHud placeOutsideplaceGapdefXAxisdefYAxisaxis precisiontitlelegend$fDefaultLegendOptions$fDefaultTitleOptions$fDefaultAxisOptions$fDefaultHudOptions $fEqPlace $fShowPlace arrowColor_arrowHeadStyle_arrowMaxHeadLength_arrowMaxLength_arrowMaxStaffWidth_arrowMinHeadLength_arrowMinLength_arrowMinStaffWidth_glyphBorderColor_glyphBorderSize_ glyphColor_ glyphSize_ hudAspect_hudAxes_ hudCanvas_ 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_ textRotation_ textSize_ labelGap_labelOrientation_ labelText_scratch,diagrams-core-1.4.0.1-FEqaj5eUlHj1jc3kFXT5iADiagrams.Core.TypesDiagrameps#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