Changelog for diagrams-lib-1.1.0.3
1.1.0.3 (19 March 2014)
- Allow
lens-4.1
1.1.0.2 (18 March 2014)
- Allow
optparse-applicative-0.8
1.1.0.1 (9 March 2014)
- Allow
vector-space-points-0.2
1.1 (8 March 2014)
-
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.
- Require
-
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.
1.0.1 (26 January 2014)
- Depend on `hashable` package, and add `Hashable` instance for
`SizeSpec2D`.
Technically, the PVP specifies that adding a new instance
requires a major version bump. However, I highly doubt anyone
was making their own orphan `Hashable` instances before. Feel
free to yell at Brent if this breaks your build.
1.0.0.1 (28 November 2013)
- Allow semigroups-0.12
1.0 (25 November 2013)
-
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 modules
-
New instances
AdditiveGroupandVectorSpaceinstances forTurn,Rad,DegAlignableinstance for(->) eDefaultinstances forFillRule,FillRuleA,LineJoin,LineCap,FillColorShowinstances 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.
- Remove
-
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)
-
-
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.
0.7.1.1 (27 September 2013)
- allow semigroups-0.11
0.7.1 (11 September 2013)
-
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 forLineCap
LineJoinLineMiterLimitLineWidthLineColorFontSize
0.7 (9 August 2013)
-
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 module
-
New instances
IsPriminstances forPath,Ellipsoid,Image,Text, andScaleInvEq,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.
- allow
-
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)
0.6.0.3 (4 May 2013)
- bump upper bound to allow
NumInstances-1.3
0.6.0.2 (28 March 2013)
-
bump upper bound to allow
NumInstances-1.2 -
Quadratic solver is now more numerically stable, getting rid of some incorrect behavior of
juxtapose(#46)
0.6.0.1: 7 January 2013
- allow
semigroups-0.9
0.6: 11 December 2012
-
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
- Allow
-
Bug fixes
arcandarcTfunctions now always produce counterclockwise arcs, as claimed.
0.5: 9 March 2012
-
New features
mkSizeSpecfunction for constructing aSizeSpec2Dfrom twoMaybe Doublesbeneathas 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 timesatAnglefor 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
- Use a balanced folding scheme for
-
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
- depend on
- bump
vector-spaceupper bound
- Support for GHC 7.4.1:
-
Bug fixes
- Avoid scale by zero error in
showOrigin. - Base
adjustDia2Dtranslation on output size rather than diagram size.
- Avoid scale by zero error in
0.4.0.1: 30 October 2011
- bump
data-defaultdependency to allow version 0.3
0.4: 23 October 2011
-
documentation fixes
-
New functions and primitives
wedgeshape primitivefromDirectionfunction for converting angles to 2D unit vectors; inverse functiondirectiongeneralized 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
0.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.
- new customizable
-
Bug fixes
- Issue 32 (
memptynot behaving correctly within concatenations)
- Issue 32 (
0.2: 3 June 2011
-
documentation fixes
-
New functions and primitives
scaleToXandscaleToYfor scaling to an absolute width/heightreverseTrail- new
Angleclass and ability to use radians, degrees, or circle fractions for specifying angles rotateAboutandreflectAbouttransformations based on new conjugation functionsrectandroundedRectprimitivesexplodeTrail/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
0.1.1: 18 May 2011
- minor documentation fixes
- link to new website
0.1: 17 May 2011
- initial preview release