Y/9      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 None.3456;<=>?BFQTV`d0!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 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 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+  !"#$%&'()*+,-./0+   !"#$%&')(*+,-./0  None.3456;<=>?BFQTV`dA3DAn arrow structure contains position, direction and size information7Dtodo: quite a clunky specification of what an arrow is (or could be)AtEqualize the arrow space width with the data space one. this creates the right arrow sizing in physical chart spaceBGRescale 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 exampleCA chart of arrowsD&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_ example3456789:;<=>?@ABCD3456789:;<=>?@ABCD34567 89:;<=>?@None.3456;<=>?BFQTV`dJ H/Convert a one-dimensional data set to line dataI8Convert a one-dimensional data set to verticle line dataJ:Convert a one-dimensional data set to horizontal line dataKJConvert a one-dimensional data set to rectangular bars with a gap betweenL(Create line data for a formulae y = f(x)M(Create line data for a formulae x = f(y)N(Create rect data for a formulae y = f(x)O(Create rect data for a formulae x = f(y)P*Create rect data for a formulae c = f(x,y) HIJKLMNOP HIJKLMNOPNone&'-.3456;<=>?BFQTV`dq+Q+Options to pixelate a Rect using a functionUAt 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.Y0Just about everything on a chart is a rectangle.^solid rectangle, no border_clear and transparent rect`clear rect, with borderaBplace a rect around an Chart, with a size equal to the chart rangebA 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_ examplec0Create rectangles (with the same configuration). 7rects def (rectBars 0 [1, 2, 3, 5, 8, 0, -2, 11, 2, 1]) other/rectsExample.svg rects exampledA chart of rectse-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_ examplef$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_ examplegRender 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 examplehA chart of pixelsi)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_ examplej9Transform a Rect into Pixels using a function over a Pairk}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))QRSTUVWXYZ[\]^_`abcdefghijkYZ[\]^`_abcdeUVWXfghiQRSTjkQRSTUVWXYZ[\]None.3456;<=>?BFQTV`dJ n5A label is a text element attached to a chart elementqdirection of labelrdistance to labels 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 examplenopqrstzuvwxy{|}~stuvwxyz{|}~nopqrnopqrstuvwxyzNone.3456;<=>?BFQTV`d 4The actual shape of a glyph can be any Chart element glyph radius normalizedCVertical line glyph shape with a reasonable thickness at "vline_ 1"EHorizontal line glyph shape with a reasonable thickness as "hline_ 1"Create a glyph. let glyph_Example = glyph_ def other/glyph_Example.svgglyph_ exampleCreate positioned glyphs. TglyphsExample :: Chart b glyphsExample = glyphs def (dataXY sin (Range 0 (2*pi)) 30) other/glyphsExample.svgglyphs exampleA chart of glyphs)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_ example#Create labelled, positioned glyphs. )lglyphs def def $ zip (show <$> [0..]) ps other/lglyphsExample.svglglyphs exampleA chart of labelled glyphs2A 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_ exampleNone.3456;<=>?BFQTV`d 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.3456;<=>?BFQTV`d,Options 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.UU    None.3456;<=>?BFQTV`d=      !"#$%&'()*+,-./01234567=      !$"%#&('*)+1,-.0/432675None.3456;<=>?BFQTV`d8 a scratch pad;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./03456789:;<=>?@ABCDHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijknopqrstzuvwxy{|}~      !"#$%&'()*+,-./0123456788 Safe.3456;<=>?BFQTV`d  !!""#$%&'()*+,-./0123456789:;<=>?@ABCCDEFFGHIJKLMNOPQRSTUVWXYZ[\]^__`abbcdeefghijklmnopqrstuvwxyyz{|}}~                                                                       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9:;<=>?@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`XYaXYbXYcXYdXYeXYfXYgXYhXYiXYjklmklnkloklpkloklqkrskrtkrtkrukvwkvxkvykvzkv{kv|kv}kv~kvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkvkkk        )chart-unit-0.5.5.0-7FvfRhRu1kW6VFwb8AqpXWChart Chart.Glyph Chart.Core Chart.Arrow Chart.Data Chart.Rect Chart.Text Chart.Line Chart.Hud Chart.LensesPaths_chart_unit#text-1.2.2.2-EakMpasry3jA6OIwSZhq9MData.Text.InternalText1data-default-class-0.1.2.0-8hmGYd6GPAfLQPQcWKOjRmData.Default.ClassDefaultdef)diagrams-lib-1.4.2-DkSHrkgp6HCFPJpwI8EttDDiagrams.TwoD.ShapestrianglesquareDiagrams.TwoD.EllipsecircleAlignVAlignTopAlignMid AlignBottomAlignH AlignLeft AlignCenter AlignRightAspectUChartuchartRendereruchartRenderRange uchartDatacombine projectssrangeaspectasquare sixbyfourgolden widescreenskinnyalignHUalignHTUalignVU positionedp_r_stackverthorisepHorisepVertfileSvgucolorublueugreyscaleXscaleYscale$fR2Pair$fR1PairArrowarrowPosarrowDir ArrowOptionsarrowMinLengtharrowMaxLengtharrowMinHeadLengtharrowMaxHeadLengtharrowMinStaffWidtharrowMaxStaffWidth arrowColorarrowHeadStyle normArrowsarrows arrowChart arrowChart_$fDefaultArrowOptions $fEqArrow $fShowArrowlineOneD vlineOneD hlineOneDrectBarsdataXYdataYXrectXYrectYXrectFPixelationOptionspixelationGradientpixelationGrainPixel pixelRect pixelColor RectOptionsrectBorderSizerectBorderColor rectColorblobclearboxboundrect_rects rectChart rectChart_pixel_pixels pixelChart pixelChart_pixelate pixelateChart$fDefaultRectOptions$fDefaultPixelationOptions LabelOptions labelTextlabelOrientationlabelGap TextOptionstextSize textAlignH textColor textFillRule textRotationtextFonttext_texts textChart textChart_labelled$fDefaultTextOptions$fDefaultLabelOptions GlyphOptions glyphSize glyphColorglyphBorderColorglyphBorderSize glyphShapevline_hline_glyph_glyphs glyphChart glyphChart_lglyphs lglyphChart lglyphChart_$fDefaultGlyphOptions LineOptionslineSize lineColorlinesoneline lineChart lineChart_glines glineChart glineChart_$fDefaultLineOptions 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$fDefaultAxisOptions$fDefaultTitleOptions$fDefaultLegendOptions$fDefaultGridOptions$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-Jr13yMmEmaFHv2n4qTDKbkDiagrams.Core.TypesDiagramDiagrams.Combinatorsbeside'SVGFonts-1.6.0.3-LAJvlMdrlHC41C2CeYVCTtGraphics.SVGFonts.TexttextSVG_textSVG'textSVGTextOptsmodespacing underline textWidth textHeightModeINSIDE_HINSIDE_W INSIDE_WHSpacingHADVKERNGraphics.SVGFonts.Fontslin2linbitGraphics.SVGFonts.ReadFontloadFont#colour-2.3.4-3MiiEznBxpfEYrMTHbnSerData.Colour.Internal alphaChannelatopblend withOpacitydissolveopaquealphaColourConvert transparentblack colourConvertColour AlphaColour AffineSpace affineCombo ColourOpsoverdarken+numhask-range-0.1.3.0-9aIndCXYfaf31iVDu3Oja NumHask.Rect projectRectcornersRectRangesRect' NumHask.Range gridSensibleRangeRange' NumHask.SpaceSpaceElementGridspaceunion singletonlowerprojectcontainselementsingular intersectsuppermiddisjointnulgrid gridSpacePosOuterPosInnerPosLowerPosUpperPosMidPos NumHask.PairPairPair'&palette-0.1.0.5-2nC79OSEXWZHVTnhIQYwiNData.Colour.Palette.ColorSet d3Colors4 d3Colors2 d3Colors1infiniteWebColors webColors getWebColorrybColor BrightnessDarkestDarkLightLightestData.Colour.Palette.HarmonybwgaccentAnalogicanalogictetradtriad complement monochromeshadetonetint rotateColorslidersData.Colour.Palette.TypesKolorversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName