diagrams-lib
Embedded domain-specific language for declarative graphics
| LTS Haskell 24.16: | 1.5.0.1 |
| Stackage Nightly 2025-10-24: | 1.5.0.1 |
| Latest on Hackage: | 1.5.0.1 |
diagrams-lib-1.5.0.1@sha256:6ae3ffbd9948b5f8bd1ccf7d2939e2d5923fc831c2e8c1f05223f5ffc333d8c5,8066Module documentation for 1.5.0.1
- Diagrams
- Diagrams.Align
- Diagrams.Angle
- Diagrams.Animation
- Diagrams.Attributes
- Diagrams.Backend
- Diagrams.BoundingBox
- Diagrams.Combinators
- Diagrams.Coordinates
- Diagrams.CubicSpline
- Diagrams.Deform
- Diagrams.Direction
- Diagrams.Envelope
- Diagrams.LinearMap
- Diagrams.Located
- Diagrams.Names
- Diagrams.Parametric
- Diagrams.Path
- Diagrams.Points
- Diagrams.Prelude
- Diagrams.Query
- Diagrams.Segment
- Diagrams.Size
- Diagrams.Tangent
- Diagrams.ThreeD
- Diagrams.Trace
- Diagrams.Trail
- Diagrams.TrailLike
- Diagrams.Transform
- Diagrams.TwoD
- Diagrams.TwoD.Adjust
- Diagrams.TwoD.Align
- Diagrams.TwoD.Arc
- Diagrams.TwoD.Arrow
- Diagrams.TwoD.Arrowheads
- Diagrams.TwoD.Attributes
- Diagrams.TwoD.Combinators
- Diagrams.TwoD.Curvature
- Diagrams.TwoD.Deform
- Diagrams.TwoD.Ellipse
- Diagrams.TwoD.Image
- Diagrams.TwoD.Model
- Diagrams.TwoD.Offset
- Diagrams.TwoD.Path
- Diagrams.TwoD.Points
- Diagrams.TwoD.Polygons
- Diagrams.TwoD.Segment
- Diagrams.TwoD.Shapes
- Diagrams.TwoD.Size
- Diagrams.TwoD.Text
- Diagrams.TwoD.Transform
- Diagrams.TwoD.Types
- Diagrams.TwoD.Vector
- Diagrams.Util
The standard library for diagrams, a Haskell embedded domain-specific language for compositional, declarative drawing.
Changes
v1.5.0.1 (2025-08-25)
- Fix bug in
bezierFindRootthat caused diagrams to hang when computing the trace of certain degenerate Bezier curves. See https://github.com/diagrams/diagrams-contrib/issues/91 .
v1.5-r2 (2025-06-12)
- Allow
optparse-applicative-0.19
v1.5-r1 (2025-05-17)
- Allow
monoid-extras-0.7
v1.5 (2025-02-13)
- Allow
base-4.21and test on GHC 9.12 - Remove looped compilation mode options (#372)
- This allows us to remove the
fsnotifydependency, which in turn allows compiling diagrams to Wasm. - To recover similar functionality (automatically recompiling
every time a source file changes), try an external tool like
ghcidorghciwatch, or, more generically,entr.
- This allows us to remove the
v1.4.7 (2024-10-26)
- Switch to
data-default-0.8instead ofdata-default-class
v1.4.6.2-r3 (2024-08-23)
- Allow
hashable-1.5
v1.4.6.2-r2 (2024-07-01)
- Allow
tasty-quickcheck-0.11
v1.4.6.2-r1 (2024-05-01)
- Allow
base-4.21(GHC 9.10),containers-0.7,lens-5.3, andfilepath-1.5
v1.4.6.2 (2024-05-01)
- Support for
linear-1.23. This version oflinearintroduces a breaking change, so add an internal compatibility module that allows diagrams to work with any version oflinearboth before and after the change.
v1.4.6.1 (2024-02-26)
- Fix compilation on BSD (#367, thanks to Finn Espen Gundersen)
v1.4.6-r4 (2024-01-11)
- Allow
base-4.19and test with GHC 9.8 - Allow
text-2.1
v1.4.6-r3 (2023-09-14)
- Allow
tasty-1.5
v1.4.6-r2 (2023-08-16)
- Allow
bytestring-0.12anddeepseq-1.5
v1.4.6-r1 (2023-05-25)
- Allow
optparse-applicative-0.18
v1.4.6 (2023-05-15)
- Allow
base-4.18; test with GHC 9.6 (thanks to @sergv) - Fix some warnings (thanks to @sergv)
v1.4.5.3 (2022-09-19)
-
Update to
fsnotify-0.4 -
Revisions:
- r1: require
lens-5.1 - r2: allow
mtl-2.3 - r3 (3 Dec 2022): allow
linear-1.22
- r1: require
v1.4.5.2 (2022-09-14)
- Fix build with
transformers-0.6 - Fix some deprecation warnings
v1.4.5.1-r3 (2022-08-27)
- Allow
base-4.17andlens-5.2; test with GHC 9.4
v1.4.5.1-r2 (2022-02-01)
- Allow
optparse-applicative-0.17
v1.4.5.1-r1 (2022-01-08)
- Allow
text-2.0
v1.4.5.1 (2021-12-17)
- Bug fix: make things compile again under versions of
lensbefore 5.1.
v1.4.5 (2021-12-16)
- Allow
base-4.16(tested with GHC 9.2.1) - Allow
semigroups-0.20,lens-5.1,hashable-1.4,transformers-0.6 - Add
Eqinstance forSizeSpec
v1.4.4-r1 (2021-06-05)
- Bumps to dependency upper bounds:
- Allow
tasty-1.4 - Allow
bytestring-0.11
- Allow
v1.4.4 (2021-05-24)
-
Bumps to upper bounds, to allow building with:
base-4.15(tested with GHC 9.0.1)optparse-applicative(tested with GHC 8.8.4 & 8.10.2)
-
Updated use of Kinds thoughout the package
-
Drop support for GHC 8.2 or earlier
v1.4.3 (2019-11-06)
- Bumps to upper bounds, to allow building with:
base-4.13(tested with GHC 8.8.1)intervals-0.9semigroups-0.19hashable-1.3
- Many bug fixes, including
- Added derived
EqandOrdinstances forFixedSegment
v1.4.2.3 (2018-06-11)
- Bug fix for
extrudeEnvelopeand friends (#316)
v1.4.2.2 (2018-05-08)
- Fixes for GHC < 8.0
v1.4.2.1 (2018-04-13)
- Allow
base-4.11(GHC 8.4) - Allow
tasty-quickcheck-0.10 - Bug fix for
Diagrams.TwoD.Offset.capArc(#310)
v1.4.2-r1 (2017-12-20)
Hackage revision to allow tasty-1.0 in the test suite.
v1.4.2 (2017-12-20)
- New functions:
boxGrid, for computing a grid of regularly spaced points.scalingRotationToandscaleRotateTo, for affine conformal 2D transformations.
- Documentation fixes:
dirBetweenPolyOrientation
- Upper bound updates: allow
tasty-0.12,tasty-quickcheck-0.9,tasty-hunit-0.10,optparse-applicative-0.14 - Test with GHC 8.2.2
v1.4.1.2 (2017-06-10)
- Fix test suite compilation failure #299.
v1.4.1.1 (2017-06-06)
- Fix
Diagrams.Points.centroidto make it total. - Fix bug in
Diagrams.Transform.Matrix.fromMatWithInv(and hence also related functions which called it, such asfromMat22andfromMat33).
v1.4.1 (2017-05-28)
- New functions
embeddedImageandloadImageEmbBSfor loading images. - Fix #289 which could have caused strange behavior in looped compilation mode on 32-bit platforms.
- Allow
intervals-0.8anddirectory-1.3. - Minor fixes to compile with GHC 8.2.
v1.4.0.1 (2016-11-07)
- Fix test suite compilation problem (#286)
v1.4 (2016-10-26)
-
New features
-
New
mkText'function, which allows making a text primitive without recommending a fill colour or font size so users can recommend their own (e.g. using therecommendFontSizefunction). -
New functions
reflectXYandreflectionXY -
New
composeAlignedcombinator for doing composition under an alignment while leaving the local origin unaffected. -
Add
_LocLoopand_LocLineprisms -
New
bsplinefunction for creating uniform cubic B-splines -
New 3D features:
- New
Skinnedclass - Improved handling of 3D primitives
- CSG
- New
-
New standard attributes for separate fill and stroke opacity (see #248).
-
New
HasQueryclass for things which can be spatially queried for values from some monoid. -
New function
inquirefor testing whether a given point is inside a diagram. -
New font weights:
bolder,lighter,thinWeight,ultraLight,light,mediumWeight,heavy,semiBold,ultraBold. Note that currently only the SVG backend deals with the new weights. -
Export
GetSegmentCodomainand update documentation -
Improved performance of 2D rotations
-
-
New instances
-
Alignableinstance forLocated -
ToPathinstances for lines and loops -
Serializeinstances forTrail,Path,Located,SegTree,Segment -
Genericinstances forPath,Located -
Actioninstance forAngle: angles act by rotation.
-
-
API changes
snugBL,snugBR,snugTRandsnugBRare deprecated. These functions were unintuitive, ad-hoc, and not particularly useful, especially since e.g.snugLandsnugBdo not commute. You can use something likesnugB . snugLdirectly, or usesnugwith a direction vector. See #250 for more details.
-
Dependency/version changes
- upgrade
fsnotifyand drop dependency on deprecatedsystem-filepath - Allow
lens-4.15 - Many other bumped upper bounds, see release notes for minor releases below
- upgrade
-
Bug fixes
v1.3.1.4 (2016-08-16) (16 August 2016)
- allow
optparse-applicative-0.13
v1.3.1.3 (2016-06-05)
- allow
base-4.9 - allow
data-default-class-0.1 - test with GHC 8.0.1
v1.3.1.2 (2016-05-01)
- allow
lens-4.14
v1.3.1.2 (2016-02-19)
- allow
unordered-containers-0.2.*
v1.3.1.0 (2016-02-14)
- improve path offset calculations
v1.3.0.9 (2016-01-14)
- allow
unordered-containers-0.2.6
v1.3.0.8 (2015-11-10)
- allow
semigroups-0.18
v1.3.0.7 (2015-10-08)
- Add
LambdaCaseextension to.cabalfile, socabalcorrectly reports thatdiagrams-libdoes not build onGHC-7.4.
v1.3.0.6 (2015-09-29)
- Allow
optparse-applicative-0.12
v1.3.0.5 (2015-09-18)
- Fix compilation problem with
lens-4.13
v1.3.0.4 (2015-09-17)
Dependency/version changes
- Allow
lens-1.13 - Allow
semigroups-0.17 - Require
linear-1.20
v1.3.0.3 (2015-08-10)
Dependency/version changes
- Drop dependency on deprecated
system-filepathpackage - Require
fsnotify-0.2.1
v1.3.0.2 (2015-07-19)
v1.3.0.1 (2015-05-26)
v1.3 (2015-04-19)
New features
-
Native image type that backends can specify.
-
Affine maps between spaces for path-like objects. A new
Diagrams.ThreeD.Projectionshas some helper functions for orthographic and perspective projections. -
Intersections for path-like objects using Bézier clipping.
-
Helper functions in
Diagrams.Matrixfor converting between transforms and matrices. -
New
Diagramsmodule that only exports functions defined in diagrams. -
New
Directiontype.Directionis a vector that’s forgot it’s magnitude. Some functions have changed their type fromR2toDirection V2 nto make it clear that magnitude has no effect. -
Use the
fsnotifypackage for command line looping. Command line looping now works on Windows. -
groupOpacityfunction added for lowering the opacity of a diagram as a whole. -
New
ToPathclass for converting path-like things to aPath.
New instances
-
Eachinstances forBoundingBox,Offset,Segment,FixedSegmentandPath. -
Reversinginstances forOffset,Segment,FixedSegment,TrailandPath. -
AsEmptyinstances forBoundingBox,TrailandPath. -
ConsandSnocinstances forPathandLine. -
New
Showinstances forAngle,Segment,SomeColor,Trail'andat. -
Tangentinstance for(FixedSegment v n). -
Ordinstances forLineMiterLimit,LineJoinandLineCap.
New helper functions
-
_Lineand_Loopprisms. -
Style lenses:
_fontSize,_lineWidth,_fillTexture,_lineTexture,_opacity,_font,_lineCap,_lineJoin_dashing. -
_SomeColoriso and_ACprism onto anAlphaColour. -
atPointsfunction to zip points with diagrams.
API changes
-
Diagramtype synonym now only takes a backend token:Diagram B -
Types that previously had a
vvariable now havevandn. -
Control.LensandData.Default.Classare now exported from fromDiagrams.Prelude -
Measurehas a new internal representation.Local,Global,Normalized, andOutputhave been renamed tolocal,global,normalizedandoutputrespectivly. -
SizeSpec2Dhas moved toSizeSpec v ninDiagrams.SizeSpec.Dims, Height, Width andAbsolutehave moved todims2D,mkHeight,mkWidthandabsolute` respectively. -
Colorinstances forColourandAlphaColourare limited toDoublefor better type inference. -
underhas been renamed tounderT. Newtransformed,translated,movedTo,movedFromandrotatedisomorphisms to use with lens’sunderfunction. -
strokeis now polymorphic. UsestrokePathorstrokePto get oldstrokebehaviour. -
angleBetweennow works for any vector space, which means the angle is always positive. The old behaviour can be retrieved fromsignedAngleBetween -
arcnow takes a startingDirectionand a sweepAngle.arcCWandarcCCWtake a start and finishDirection.
Dependency/version changes
- use
linearinstead ofvector-space
Closed issues:
-
Perspective deformation of square vertices yields extra point #244
-
Local fontsize renders inconsistentl on diffrent backends #243
-
Factor out Diagrams.Solve into a package? #235
Merged pull requests:
1.2.0.9 (2 April 2015)
-
allow
lens-4.9 -
allow
vector-space-0.10
v1.2.0.8 (2015-01-13)
Merged pull requests:
v1.2.0.7 (2014-12-07)
v1.2.0.6 (2014-12-04)
Merged pull requests:
v1.2.0.5 (2014-11-17)
Implemented enhancements:
Fixed bugs:
Sectionableinstance forSegTreeis not a linear reparameterization. #217
Closed issues:
-
bezierFromSweep very slow? #227
-
All lines render at same width #222
-
numerically stable cubic rootfinder #204
Merged pull requests:
-
Diagram b v n to QDiagram b v n Any #219 (jeffreyrosenbluth)
v1.2.0.4 (2014-10-08)
Merged pull requests:
v1.2.0.3 (2014-09-07)
Closed issues:
- arrowFromLocatedTrail function #205
Merged pull requests:
v1.2.0.2 (2014-08-22)
Implemented enhancements:
- Generalize Angle class? #38
Fixed bugs:
- –selection and –src both use -s abbreviation #172
Closed issues:
- Spike arrowhead and tail render with oversized joint #203
Merged pull requests:
-
add atPoints, deprecate decorateFoo #198 (jeffreyrosenbluth)
-
Add bg’ #197 (jeffreyrosenbluth)
-
add convenience synonyms [hv]sep for [hv]cat’ (with & sep .~ x) #196 (byorgey)
-
Vertices #192 (jeffreyrosenbluth)
v1.2.0.1 (2014-06-04)
Closed issues:
- Local headLength / headGaps act like Output #193
Merged pull requests:
v1.2 (2014-06-02)
New features
-
Several attributes (such as line width, dashing size, arrowhead size, and font size) that formerly had a value of type
Doublenow have the more general typeMeasure R2. This allows the attributes to be specified relative to one of four measurement frames:Local,Global,Normalized, andOutput. -
New DSL for specifying measurements.
-
New synonyms for specifying measurements, e.g.
thin,thick, andmedium,large. -
Support for radial and linear gradients for fills and strokes.
-
New
DImagetype that supports both embedded and external images in Backends that support them. -
New
lengthsTraversal for settingheadLengthandtailLengthsimultaneously. -
FrustrumandBoxshapes added toDiagrams.ThreeD.Shapes. -
New function
quartFormto find roots of quartic polynomials. -
New Lenses for polar coordinates.
-
New trig functions,
sinA,atanA, etc. which takeAngleas input or output.
New instances
Transformableinstances forLineWidth,Dashing,LineTexture, andFillTexture.
API changes
-
FillColorandLineColorattributes have been replaced with the more generalFillTextureandLineTexture. Use thesolidfunction to convert a color to a texture. -
The size of arrow heads and tails is now specified in terms of length instead of the radius of their circumcircle.
-
Gaps at the ends of arrows are now specified using
Measure R2. -
The
gaptraversal has been replaced bygapsfor consistency in naming, thoughgapis still provided for backwards compatibility. -
fontSizenow takes a value of typeMeasure R2. -
Get rid of (bitrotted)
Showbackend. -
Functions in
TwoD.Adjustnow return the adjustment transformation itself in addition to the resizedDiagramandOptionsrecord; this can be used, e.g. to convert screen coordinates back into diagram coordinates. -
Export
pathLocSegments. -
The
avgScalefunction has been moved toDiagrams.Core. -
The
Angledefinition and related functions (e.g.angleBetween) have moved to a separate module,Diagrams.Angle. -
A separate
Diagrams.TwoD.Attributesmodule now contains most of the attributes that require 2D transformation instances. -
The
splitColorFillsfunction has been replaced bysplitTextureFills.
Dependency/version changes
-
Allow
semigroups-0.15 -
Allow `opt-parse-applicative-0.9.0
-
Allow
lens-4.2
Implemented enhancements:
Closed issues:
-
fails to build against HP #190
-
text does not scale #179
-
Please add support for latest version of intervals library #170
-
presence of arrowHead can tilt connection sideways #162
Merged pull requests:
-
Quartic formula, no obvious bugs #187 (Mathnerd314)
-
Arrow length #185 (jeffreyrosenbluth)
-
Texture #181 (jeffreyrosenbluth)
-
arrow envelopes #180 (jeffreyrosenbluth)
-
make headSize and tailSize back into ArrowOpts fields #177 (byorgey)
-
updated the upper bounds of the .cabal constraints for ‘semigroups’ package #176 (zgredzik)
-
Image2 #174 (jeffreyrosenbluth)
-
Image #173 (jeffreyrosenbluth)
-
Preliminary implementation of Measure #159 (jeffreyrosenbluth)
-
Gradient #136 (jeffreyrosenbluth)
v1.1.0.7 (2014-05-15)
- Allow
semigroups-0.14
v1.1.0.6 (2014-04-10)
- Allow
semigroups-0.13
v1.1.0.4 (2014-04-04)
Merged pull requests:
-
Make Diagrams.Transform.under more polymorphic #168 (FlorentBecker)
v1.1.0.3 (2014-03-19)
- Allow
lens-4.1
v1.1.0.2 (2014-03-19)
Merged pull requests:
-
move avgScale to core #167 (jeffreyrosenbluth)
-
3d color & lighting, more solids, Angle utilities #166 (bergey)
-
Added bothSize function, lineHead and lineTail #165 (jeffreyrosenbluth)
v1.1.0.1 (2014-03-09)
-
Depend on
hashablepackage, and addHashableinstance forSizeSpec2D.Technically, the PVP specifies that adding a new instance requires a major version bump. However, I highly doubt anyone was making their own orphan
Hashableinstances before. Feel free to yell at Brent if this breaks your build.
v1.1 (2014-03-09)
New features
-
Support for
Deformations, arbitrary (non-affine) transformations on objects such as points, paths, and located trails (though not on diagrams). -
New functions
clipTo, which clips a diagram’s envelope and trace along with its visual representation, andclipped, which clips the diagram’s visual representation but replaces its envelope and trace with those of the clipping path. -
New
arrowVfunction, for creating an arrow with the direction and magnitude of a given vector. -
gaptraversal, for setting the head and tail gaps of an arrow simultaneously. -
Generalized types for
centerXYandsnugXY, based on newbasisfunction from `diagrams-core -
New 3D
Transforms, alignment, and 3D-specificPrelude. -
New
framefunction similar topad, but increases the envelope of a diagram by an amount specified in local units in every direction irrespective of the local origin. -
New
splitFillsfunction for pushing fill attributes down to subtrees containing only loops (mostly of relevance only to backend implementors).
New instances
-
Typeableinstances for all data types that are used as diagram primitives. -
Sectionableinstance forFixedSegment.
API changes
-
Angleis now a type, rather than a class. It uses a single internal representation for angles, and lensesturn,rad,anddegare supplied for constructing (using@@) and viewing (using^.)Angles in various units. In addition, theNuminstance forAnglehas been removed, eliminating a class of errors where a bare number is interpreted in units other than what you expect. -
Removed
Numinstance for angles.
Dependency/version changes
-
Require
lens >= 4.0. -
Allow
array-0.5. -
Allow
hashable-1.1. -
Remove
NumInstancesdependency.
Bug fixes
-
Exclude joins in offsets on close segments (#160).
-
Exclude extra segment when joining loops in offset (#155).
Performance improvements
colorToSRGBAfunction now avoids expensive matrix operations, offering dramatic speedups in rendering diagrams with many color attributes.
Implemented enhancements:
-
Better color model in 3D #121
-
Projective/perspective transforms for points and paths #108
-
clipTo function #35
Fixed bugs:
- Offset Bug #155
Closed issues:
- Expand of an expand #160
Merged pull requests:
-
fix doc for === and ||| #164 (denys-duchier)
-
Exclude extra segment when joining loops in offset. Fixes #155. #158 (fryguybob)
-
added basis, generalized
centerXYandsnugXY#157 (jeffreyrosenbluth) -
derive Typeable for all data types used in Prims #156 (byorgey)
-
removed NumInstances dependency #153 (jeffreyrosenbluth)
-
Change internal color representation to SRGBA #149 (jeffreyrosenbluth)
v1.0.1 (2014-01-26)
Implemented enhancements:
- Module for generating nice colors/color schemes #77
Closed issues:
- “Maybe.fromJust: Nothing” error when connecting translated small diagram #147
Merged pull requests:
-
return list of traces #145 (jeffreyrosenbluth)
-
added clipTo #144 (jeffreyrosenbluth)
v1.0.0.1 (2013-11-28)
v1.0 (2013-11-25)
New features
-
New modules
Diagrams.TwoD.ArrowandDiagrams.TwoD.Arrowheadsfor creating arrows. -
New module
Diagrams.Backend.CmdLine, providing a flexible framework for creating command-line-driven diagram rendering executables. -
New functions in
Diagrams.Offset:offsetTrailandoffsetPathfor one-sided offsets of trails and paths;expandTrailandexpandPathfor “stroking” trails and paths, computing a path whose fill corresponds to the stroke of the given trail or path. -
New module
Diagrams.Tangentfor computing tangent and normal vectors of segments, trails, and paths. -
New functions in
Diagrams.Alignto allow diagrams to be aligned byTracecalledsnug,snugByandsnugCenterand the ability to define other boundary functions for alignment. FunctionssnugL,snugR, etc. are included inTwoD.Align. -
Lenses from
Control.Lensare now used consistently for record fields throughout the library. -
New function
angleRatiofor calculating the ratio between two angles. -
Restricted identity functions
asTurn,asRad, andasDegfor resolving type ambiguity -
New miter limit attribute.
-
New function
annularWedgeinTwoD.Arc -
New
avgScaleutility inTwoD.Transform, for backends which cannot fully implement freezing of line width -
New function
heptagon, a vast improvement over the linguistic frankensteinseptagon. -
New function
lookupName(re-exported fromdiagrams-core) for simple lookups of named subdiagrams -
New function
angleBetweento calculate the angle between two vectors. -
New function
arcBetweento draw an arc between two given points. -
A bunch of new modules containing types, primitives and utilities for constructing 3D diagrams:
Diagrams.ThreeD.Align,.Camera,.Light,.Shapes,.Transform,.Types, and.Vector. This is still a “feature preview” (in particular, appropriate 3D backends are still under construction).
New instances
-
AdditiveGroupandVectorSpaceinstances forTurn,Rad,Deg -
Alignableinstance for(->) e -
Defaultinstances forFillRule,FillRuleA,LineJoin,LineCap,FillColor -
Showinstances forFillRule,FillRuleA
API changes
-
eno longer exported fromDiagrams.Prelude. -
Diagrams.BoundingBoxis no longer exported fromDiagrams.Prelude. -
Re-export
Diagrams.Core.pointDiagramfromDiagrams.Prelude. -
Added
fromAlphaColourmethod toColorclass. -
&renamed to^& -
Stop re-exporting
tan,over, andbothfromData.Colour. -
New coordinate lenses
_x,_y, and_zforR2,P2,R3,P3 -
Export
fullTurnfromDiagrams.Prelude. -
Codomain (Located a)is nowPoint (Codomain a)instead ofLocated (Codomain a). -
Export
domainBoundsfromDiagrams.Parametric. -
Adjusting functionality moved from
Diagrams.Parametricto its own module,Diagrams.Parametric.Adjust. -
Rename
strokeT(and primed variant) tostrokeTrail; renamestrokeLocTtostrokeLocTrail. -
ScaleInvis now in its own module,Diagrams.TwoD.Transform.ScaleInv. -
Re-export
Imagetype (but not constructor) fromDiagrams.TwoD -
Removed
FloatingandRealFloatinstances forTurnandDeg -
offsetSegmentnow returns aLocatedinstead of a tuple. -
Removed
NumandFractionalinstances forR2.
Dependency/version changes
-
Remove
newtypedependency -
New dependencies on
lens,tagged,optparse-applicative,filepath,safe,vector-space-points,MemoTrie -
Depend on
intervals >= 0.3 && < 0.5.
Bug fixes
-
Depend on
intervals 0.3, which allows diagrams to build on Windows, by evading a GHCi linker bug which affects the FFI use in previous versions of intervals (diagrams-contrib#14) -
Use point envelope at the origin for text objects instead of an empty envelope (#115, #116).
-
Adjusting the end of a trail now works correctly (#95).
-
Only look for miter join on corners in
Diagrams.TwoD.Offset(#118). -
wedgefromDiagrams.TwoD.Arcis now a Loop (#99) -
Arrows do not behave correctly under scaling #112
Performance improvements
-
R2is now strict andUNPACKed -
Add strictness to
Offset,Segment,OffsetEnvelope, andSizeSpec2D. -
Make
getEnvelopecalculation forSegmentmore efficient by floating divisions out of the inner calculation. -
Use a specialized
HasTrieinstance forR2.
Closed issues:
Merged pull requests:
-
Lenses for setting arrow head, tail, and shaft colors #138 (byorgey)
-
Add helpers for common optparse-applicative backend command line. #135 (fryguybob)
-
add located lens for access into Located things #134 (byorgey)
-
Lens #131 (jeffreyrosenbluth)
-
correctly (?) compute shaftScale by solving a quadratic #127 (byorgey)
-
calculate arrow shaftScale using projection of ends onto shaft offset #125 (bergey)
v0.7.1.1 (2013-09-27)
Implemented enhancements:
-
Use a point envelope for built-in text objects #116
-
implement rotations in 3D #86
-
Control over boundary conditions on cubic splines. #32
Fixed bugs:
- diagrams with empty envelopes are not properly separated by struts #115
Closed issues:
Merged pull requests:
v0.7.1 (2013-09-11)
New features
-
New standard miter limit attribute
-
New functions
lineColorA,lineWidthA,lineMiterLimitA,fontSizeAfor directly applying attribute values -
setDefault2DAttributesnow sets default line cap (butt), line join (miter), and miter limit (10) attributes
New instances
-
Data.Defaultinstances for -
LineCap -
LineJoin -
LineMiterLimit -
LineWidth -
LineColor -
FontSize
Implemented enhancements:
Fixed bugs:
Merged pull requests:
-
change Codomain of Located to Point (Codomain a) #102 (byorgey)
-
Default and Show instances for FillRule and FillRuleA #100 (jbracker)
-
Changes required due to the introduction of Roles in GHC #98 (co-dan)
-
removed default implementation of reverseDomain #97 (jeffreyrosenbluth)
-
fixed issue #95 #96 (jeffreyrosenbluth)
v0.7 (2013-08-09)
New features
-
New module
Diagrams.TwoD.Curvature, for computing the curvature of 2D segments at any given point. -
New module
Diagrams.Offset, containing anoffsetSegmentfunction that builds a trail a fixed distance from the original segment. This is a precursor to planned functionsoffsetTrailandoffsetPath. -
New function
Diagrams.TwoD.Transform.onBasis, for extracting a matrix representation of a 2D transformation -
New functions
extrudeEnvelopeandintrudeEnvelope, for extending or shrinking an envelope only in a certain direction. -
Generalize the
Colorclass to absolute colors. This addresses concerns raised in issue #66 by letting the backend choose which color space to renderColorinstances to. Functions are provided for backwards compatibility with the old semantics. -
New function
scaleInvPrimfor creating a diagram from a single scale-invariant primitive. -
New module
Diagrams.Parametric, containing a collection of classes abstracting over “parametric” things:Parametric,DomainBounds,EndValues,Sectionable, andHasArcLength, with instances for segments, trails, and related things. -
A big refactoring of segments and trails:
-
Segments can now be either “closed” or “open”.
-
There are now two types of trails: “lines” (which travel from point A to point B) or “loops” (closed curves which end where they started).
Trailis now a wrapper type which can contain both loops and lines. -
There is a new
Locatedwrapper type for adding locations to translation-invariant things.Paths now consist of a collection ofLocated Trails. -
The
PathLikeclass is now renamed toTrailLike; thetrailLikefunction takes aLocated Trailas input.
-
-
New convenience functions
boundaryFromandboundaryFromMay, for computing boundaries of subdiagrams. -
Re-export from
diagrams-liba lot of things defined indiagrams-core, to make them easier for users to find. Several new modules have been created as a result:Diagrams.Query,Diagrams.Envelope,Diagrams.Trace, andDiagrams.Names. -
Export the
centroidfunction fromDiagrams.Prelude. -
triangleis now a synonym foreqTriangle.
New instances
-
IsPriminstances forPath,Ellipsoid,Image,Text, andScaleInv -
Eq,Ord, andShowinstances forSizeSpec2D
API changes
-
CircleFrachas been renamedTurn(thoughCircleFracis retained as a deprecated synonym). -
Diagrams.Coordinatesis no longer exported fromDiagrams.Prelude. This is for compatibility withlens, as(&)is a rather important lens operator and clashes withDiagrams.Coordinates. Users who want theCoordinatesstuff can importDiagrams.Coordinatesexplicitly.
Dependency/version changes
-
allow
base-4.7 -
upgrade to
monoid-extras-0.3 -
depend on
data-default-classinstead ofdata-default -
Tested with GHC 7.7.
Bug fixes
-
Added a special case that was a not handled properly by the quadratic solver, resulting in bogus envelopes in certain cases (#88).
-
Import only
Data.NumInstances.Tupleinstead ofData.NumInstances. Previously,Diagrams.PreludeexportedEq,Show, andNuminstances for functions and tuples; now it only exports tuple instances. Users wishing to useDiagrams.CubicSplinewith a vector space built over functions (!?) can importData.NumInstances.Functionthemselves. (#48) -
Do scaling on a
Pathbefore constructing aTrailLikeinrect(#43)
Implemented enhancements:
-
Split PathLike, Trail, and Path into separate modules #25
-
Add support for path-oriented diagrams. #13
Fixed bugs:
-
Wrong envelope for cubic segment #88
-
Fix documentation of beside, (===), and (|||) re: monoidal semantics #83
-
reverseTrail should not generate extra segments for closed trails #24
Closed issues:
- Test issue #91
Merged pull requests:
-
Add parametric generalizations for segments, trails, Located, etc. #92 (byorgey)
-
Adding type signature so it compiles with GHC7.7 #90 (co-dan)
-
bug fix: add special case for b==0 to quadform solver #89 (byorgey)
-
Stop exporting Diagrams.Coordinates from Diagrams.Prelude #82 (byorgey)
v0.6.0.3 (2013-05-04)
Closed issues:
- Offset #80
Merged pull requests:
v0.6.0.2 (2013-03-29)
Implemented enhancements:
- Don’t export Eq and Show instances for functions from Diagrams.Prelude #48
Closed issues:
- radius is wrong #75
Merged pull requests:
types-generalized (2013-02-13)
v0.6.0.1 (2013-01-07)
Fixed bugs:
-
text on zero width rect leads to nans #51
-
wrong result when using
besidewith circle and vector (1 & (-1)) #46 -
Handle
rectwith zero arguments. #43
Closed issues:
- Generalization of color space used in rendering #66
Merged pull requests:
v0.6 (2012-12-12)
New features
-
boundingRectfunction for constructing a bounding rectangle -
bgfunction for “setting the background color” (i.e. placing atop a colored bounding rectangle) -
New functions
setDefault2DAttributesandadjustDiaSize2D.adjustDia2Ddoes both — so the behavior ofadjustDia2Dhas not changed, but it is now possible to apply just one of the two adjustments using the new functions. -
Diagrams.TwoD.Transformnow exports aScaleInvtype for creating scale-invariant objects, which are only affected by rotational and translational components of transformations. -
The new
Diagrams.Coordinatesmodule provides nicer syntax for constructing and pattern-matching point and vector literals. -
New
fromFixedSegfunction inDiagrams.Segment, which decomposes aFixedSegmentinto a starting point and aSegment. -
New
withTracefunction for setting theTraceof a diagram. -
Three new size-related functions:
-
New
sizedfunction for scaling an object to a particular size. One particularly nice use of this is to obviate the need to keep fiddling with the line width to get diagrams to “look right”; just set the line width relative to some arbitrary scale (e.g. assuming the final diagram will fit into a 1x1 box) and then applysizedto the final diagram to make it that given arbitrary size. It can also be used for easily making something (a diagram, path, trail, …) the same size as something else, with the help of the newsizeSpec2Dfunction. -
New
sizedAsfunction, for setting the size of some object to be “the same as” some other object. -
New
sizeSpec2Dfunction for conveniently calculating the size of an object as aSizeSpec2Dvalue (for use with the newsizedfuntion).
-
-
New
extrudeEnvelopeandintrudeEnvelopefunctions for modifying envelopes in a single direction only, as well as new functionsextrude{Left,Right,Bottom,Top}specializingextrudeEnvelopeto 2D. -
arcCWdraws clockwise arcs;arc'draws arcs counterclockwise or clockwise as the radius is positive or negative, respectively. -
fill color attribute is generalized to support “recommended” and “committed” colors; text objects use a recommended fill color of black.
New instances
-
The
Showinstance forR2now produces something like2 & 6instead ofR2 { unR2 = (2,6) }. TheReadinstance has also been changed to match, soread . show = id. -
Envelopedinstance forFixedSegment -
Tracedinstances forSegment,FixedSegment,Trail, andPath -
New derived
Eqinstances forLineCapA,LineJoinA,Dashing,DashingA,FillRule,Font,FontSize,FontSlant,FontSlantA,FontWeight, andFontWeightA -
Renderable Ellipsoid NullBackendinstance
API changes
-
Data.Colour(minusatopandAffineSpace) is now re-exported from Diagrams.Prelude for convenience. -
The
beneathfunction is now infixl 6. -
The
BoundingBoxmodule has had a complete overhaul. There is now a special empty bounding box, and bounding boxes are an instance ofMonoid. -
The type of
withEnvelopehas been slightly generalized. -
Diagrams.TwoD.Adjust.adjustSizeis now deprecated; it has been renamed and moved toDiagrams.TwoD.Size.requiredScaleT. -
expandPathhas been renamed toscalePath.
Dependency/version changes
-
Allow
data-default0.4 and 0.5 -
Allow
base-4.6 -
Allow
containers-0.5
Bug fixes
arcandarcTfunctions now always produce counterclockwise arcs, as claimed.
Implemented enhancements:
-
Enhancements for
arcs. #54 -
align and friends should be in terms of a new ‘Alignable’ class instead of ‘Boundable’ #31
-
Tools for more accurate boundary calculations in common cases #30
-
Reimplement Diagrams.TwoD.Ellipse in terms of Diagrams.TwoD.Arc #27
-
Function to convert angles into 2D unit vectors #23
-
2D specialization of ‘beside’ which takes an angle instead of a vector #22
-
Generalize showOrigin function #21
-
Add generic ‘extent’ and ‘breadth’ ? functions #20
-
Add shearing transformations to standard library #19
-
Add support for text #15
-
Allow the user to choose the fill rule used for paths when stroking #14
-
Image primitives #10
-
Merge polygon code from Dmitry Olshansky #4
Fixed bugs:
-
Enhancements for
arcs. #54 -
boundingBox computes incorrect bounding box for transformed diagrams #39
-
hcat is really *terrible* performance-wise #28
-
stroke sets the fill rule attribute to a default value, so it can’t be changed later #26
-
Text alignment should be with respect to descent and ascent lines rather than text bounding box #17
-
incorrect bounds for Bezier segments #11
-
More combinators in D.Combinators #5
Merged pull requests:
-
Renamed
expandPathtoscalePathto make room #61 (fryguybob) -
Added
Eqinstances for some data structures. #59 (fryguybob) -
More involved diameter benchmark + better implementation #58 (mgsloan)
-
Update to track with diagrams-core renaming, and a better Show instance for R2 #47 (byorgey)
-
Minor tweaks due to monoid-extra and dual-tree changes #45 (byorgey)
-
split out default attribute setting and size adjustment into separate functions #42 (byorgey)
-
New module enabling nice syntax for constructing and pattern-matching literal points and vectors #1 (byorgey)
v0.5.0.1 (2012-07-24)
v0.5 (2012-03-09)
New features
-
mkSizeSpecfunction for constructing aSizeSpec2Dfrom twoMaybe Doubles -
beneathas convenient synonym forflip atop -
Improvements and extensions to rounded rectangles by Peter Hall:
-
roundedRect'allows rounded rectangles with a different radius specified for each corner -
both
roundedRect'androundedRectnow allow negative radii, resulting in “inverted” circular corners
-
-
#64: New
Alignableclass for things that can be aligned. -
explodeTrailandexplodePathhave been generalized to return anyPathLiketype. -
New path functions
pathCentroid(compute the centroid of a path’s vertices) andexpandPath(scale a path about its centroid). -
Generalized
centroidfunction now exported from new moduleDiagrams.Points. -
Initial (experimental) support for animation:
-
AnimationandQAnimationdefined as synonyms forActivediagrams (seeactivepackage) -
Instances for
Active:V,HasOrigin,Transformable,HasStyle,PathLike,Juxtaposable,Alignable -
animEnvelopeandanimRectfunctions for automatic bounding of animations
-
-
addClosingSegmentfunction for making the implicit closing segment of a closed trail explicit -
Improvements to
BoundingBoxmodule from Michael Sloan: querying ofBoundingBoxbounds, corners, extents, and transformation of objects to fit within a given box. -
Text alignment options from Michael Sloan
-
viewfunction for restricting a diagram’s envelope to a rectangular region. -
iterateNfunction for iterating a finite number of times -
atAnglefor placing two diagrams next to each other along a specified angle. -
padXandpadYfunctions for padding in the X- and Y-directions independently. -
generalized
showOriginfunction from Ian Ross -
#40: add shears to
Diagrams.TwoD.Transform
Performance improvements
-
Use a balanced folding scheme for
cat', reducing time in some cases from \(O(n^2)\) to \(O(n \log n)\) -
More efficient implementation of
beside
New instances
-
Alignableinstances forQDiagram,Path,Envelope,Active,Set,Map,[] -
Renderableinstances forNullBackend(Trail,Path,Segment,Image,Text) -
Instances for
Active:V,HasOrigin,Transformable,HasStyle,PathLike,Juxtaposable,Alignable
API changes
-
R2used to be a synonym for(Double, Double)but is now abstract. To convert between pairs ofDoublesandR2, use the new functionsr2andunr2. There are two reasons for this change: 1. to allow for future changes to the implementation ofR2; 2.(Double, Double)was an awkward special case getting in the way of useful tuple instances for classes likeHasOrigin,Enveloped, and so on. -
circlePathhas been removed; its functionality has been subsumed bycircle. -
adjustSegmentnow takes an extra tolerance option. -
Ellipses are now represented using Bezier approximations rather than a separate special type.
-
BoundingBoxno longer has aTransformableinstance; the old instance was misleading at best. -
Change semantics of
beside(hence also(|||)and(===)) so the result’s origin is the same as that of the first argument. -
adjustDia2Dnow takes aSizeSpec2D. -
besideand related functions are now implemented in terms ofjuxtapose. -
Instead of taking an
R2,roundedRectnow takes a pair ofDoubles, to be more consistent withrect.
Dependency/version changes
-
Support for GHC 7.4.1:
-
depend on
colour>= 2.3.2 -
update
baseandarrayupper bounds
-
-
bump
vector-spaceupper bound
Bug fixes
- Avoid scale by zero error in
showOrigin. - Base
adjustDia2Dtranslation on output size rather than diagram size.
[v0.4.0.1] () (30 October 2011)
- bump
data-defaultdependency to allow version 0.3
v0.4 (23 October 2011)
documentation fixes
New functions and primitives
-
wedgeshape primitive -
fromDirectionfunction for converting angles to 2D unit vectors;inverse function
directiongeneralized to return any Angle type -
New functions for computing and adjusting segment lengths
-
scaleUToXandscaleUToYfor doing uniform scales resulting in a desired width or height. -
circlePath,reversePath,decoratePath
New features
-
Completely new and improved polygon generation API
-
Cubic splines
-
User-controllable path fill rules
Bug fixes
-
fix incorrect corner case in arc generation
-
fix incorrect
reverseTrailfunction
v0.3 (18 June 2011)
New features
-
new customizable
stroke'function which lets you assign names to path vertices -
circleandsquarefunctions now take a size argument -
function for adjusting 2D diagrams to requested size abstracted from cairo backend
-
generalize
PathLikeclass to include an instance for diagrams, and collapse things likepolygon/polygonPathinto a single polymorphic function -
basic text support
-
basic support for external images
-
very sketchy initial proof-of-concept library of 3D primitives. See also diagrams-povray package.
Bug fixes
- Issue 32 (
memptynot behaving correctly within concatenations)
v0.2 (3 June 2011)
New functions and primitives
-
scaleToXandscaleToYfor scaling to an absolute width/height -
reverseTrail -
new
Angleclass and ability to use radians, degrees, or circle fractions for specifying angles -
rotateAboutandreflectAbouttransformations based on new conjugation functions -
rectandroundedRectprimitives -
explodeTrail/Pathfor breaking trails and paths into individual segments
New features
-
opacity attribute
-
support for path clipping
- New modules
Diagrams.BoundingBox
Fixes and updates
withBoundsnow properly uses the new bounds instead of just combining them with the old
v0.1.1 (18 May 2011)
-
minor documentation fixes
-
link to new website
v0.1 [17 May 2011]
- initial preview release
* This Change Log was automatically generated by (and then edited by hand) github_changelog_generator