diagrams-core
Core libraries for diagrams EDSL
http://projects.haskell.org/diagrams
| Version on this page: | 1.4.2@rev:1 |
| LTS Haskell 24.16: | 1.5.1.1@rev:4 |
| Stackage Nightly 2025-10-24: | 1.5.1.1@rev:4 |
| Latest on Hackage: | 1.5.1.1@rev:4 |
diagrams-core-1.4.2@sha256:47de45658e8a805b7cb7f535e7b093daf7e861604fa3c70e25bd4ef481bf1571,2997Module documentation for 1.4.2
The core modules defining the basic data structures and algorithms for diagrams, a Haskell embedded domain-specific language for compositional, declarative drawing.
Changes
v1.4.2 (2019-10-19)
- New
KeyValconstructor forAnnotation(PR) - Updates for GHC 8.8
- Drop support for GHC 7.6 and 7.8
v1.4.1.1 (2018-06-17)
- Add some
ConstraintKindspragmas to allow compilation on GHC 7.8 and 7.6
v1.4.1 (2018-04-10)
- Allow
base-4.11 - Allow
lens-4.16 - Add
Semigroupinstance to build on GHC 8.4
v1.4.0.1
- Allow base-4.10
v1.4 (2016-10-26)
-
New features
-
New
eachNametraversal, for traversing over parts of aNamethat match a given type -
More documentation explaining
HasOriginandTransformableinstances forEnvelope
-
-
Dependency/version changes
- Allow
lens-4.15 - Many other upper bounds bumped; see minor release changelogs below.
- Allow
-
New instances
-
Transformableinstance forMeasured -
A bunch more instances for
Query(Distributive,Representable,Profunctor,Coseive,Closed,Costrong,Corepresentable)
-
-
API changes
-
Move some
Query-related functions todiagrams-lib(sample,value,resetValue,clearValue) -
Remove some redundant constraints in type signatures (should not actually affect API)
-
v1.3.0.8 (2016-06-05)
- allow
base-4.9 - build warning-free on GHC 8.0.1
v1.3.0.7 (2016-05-01)
- allow
lens-4.14
v1.3.0.6 (2016-02-19)
- allow
unordered-containers-0.2.*
v1.3.0.5 (2016-01-14)
- allow
unordered-containers-0.2.6
v1.3.0.4 (2015-11-10)
- allow
semigroups-0.18
v1.3.0.3 (2015-09-17)
- allow
lens-4.13 - allow
linear-1.20 - allow
semigroups-0.17
v1.3.0.2 (2015-07-19)
v1.3.0.1 (2015-05-26)
v1.3 (2015-04-19)
-
New features
-
Update for ghc-7.10.
-
Switch from
vector-spacetolinearfor linear algebra. -
OpacityGroupannotation for setting the opacity of diagrams as a group. Opacity groups can be applied with theopacityGrouporgroupOpacityfunctions. -
Added
atAttr,atMAttrandatTAttrlenses onto the attributes of styles. -
InSpaceandSameSpacesynonyms. -
sizefunction for computing the range of an enveloped object in the basis vectors. -
“Grouping” for transparent things #21
-
-
Dependency/version changes
- Allow
base-4.8 - Allow
lens-4.9
- Allow
-
New instances
Showinstances forAttributeandStyle.Each,IxedandAtinstances for andStyle.
-
API changes
-
Measurehas a new internal representation.Local,Global,Normalized, andOutputhave been renamed tolocal,global,normalizedandoutputrespectivly.Measureis now defined inDiagrams.Core.Measure. -
GTAttributehas been removed.MAttributenow holds measured attributes and no longer requires aDatainstance. -
Vis now a* -> *kind type family. -
New type family
Nfor the number type of an object,Scalartype family no longer exists. -
(|>)has moved to(.>>)to make room for lens’s snoc operator. -
Style’s internal representation now uses a hashmap of theTypeRep.
-
Merged pull requests:
-
Bump lens upper version bounds #74 (RyanGlScott)
-
Add Diagram B synonym for Diagram b v n #73 (jeffreyrosenbluth)
-
Bump linear upper version bounds #75 (RyanGlScott)
-
Change Measure back to not using Scalar v #65 (Mathnerd314)
-
Remove gratuitous Data constraints #69 (Mathnerd314)
v1.2.0.6 (2015-04-03)
Closed issues:
- Please add support for recent versions of vector-space #78
v1.2.0.5 (2015-01-13)
v1.2.0.4 (2014-12-04)
v1.2.0.3 (2014-11-17)
v1.2.0.2 (2014-08-22)
Closed issues:
- Warn against GND for IsName #67
v1.2.0.1 (2014-06-04)
Merged pull requests:
v1.2 (2014-06-02)
-
New features
-
New function
matrixHomRepto convert a transformation to a homogeneous matrix representation. -
New function
dropTranslto drop the translation component from a transformation. -
A mini-DSL for Measures.
-
New
extentfunction, used indiameter. -
New
dimensionfunction to return the dimension of a vector space. -
New
_relativeiso between points and vectors. -
avgScalefunction (for computing the average scaling factor of a transformation) has been moved fromdiagrams-libtodiagrams-coreand generalized to work over any vector space.
-
-
Dependency/version changes
- Allow
semigroups-0.15 - Allow
lens-4.2
- Allow
-
API changes
-
Major refactoring which removes
freeze(and henceSplittransforms, etc.) and adds units ofMeasure. -
Refactoring and simplification of the
Backendclass. -
Remove
Multibackend. -
Remove
nullPrim,IsPrimand simplifyRPrimso that it does not carry a transformation. -
Update
adjustDiato return a transformation, not just a scale factor. AddrenderDiaTwhich returns a transformation (for use by end users, e.g. to convert output coordinates back into local coordinates).
-
Implemented enhancements:
- Extracting things from Prim wrappers #42
Closed issues:
Merged pull requests:
-
Clean-slate redesign/simplification of
Backendclass #60 (byorgey) -
Avg scale #58 (jeffreyrosenbluth)
-
Preliminary implementation of Measure #55 (jeffreyrosenbluth)
-
No mco #62 (jeffreyrosenbluth)
v1.1 (2014-03-09)
-
New features
- New
basisfunction - New
determinantfunction for computing the determinant of aTransformation - Add
Typeableconstraint onPrims, making it possible to extract things back out of aPrimwrapper usingcast - Raw
Traces now return a sorted list of intersections, instead of only the smallest. This is used to implement a new family of functionsrayTraceV,rayTraceP,maxRayTraceV,maxRayTraceP, which work similarly to the parallel versions withoutRay, but return the first intersection in the positive direction from the given point, rather than the smallest in absolute terms. - New
Annotationtype and correspondingapplyAnnotationfunction, for attaching uninterpreted annotations at specific points in a diagram tree. Currently this is used for hyperlinks; more annotation types will be added in the future.
- New
-
Dependency/version changes
- Require
lens-4.0 - Allow
vector-space-points-0.2
- Require
-
Bug fixes
- Looking up a subdiagram by name now results in a diagram which still has that name (#43)
Closed issues:
- Named subdiagrams lose their names after being looked up #43
Merged pull requests:
-
Added
basis, simplifiedonBasis#54 (jeffreyrosenbluth) -
Determinants #53 (jeffreyrosenbluth)
-
Introduce Typeable constraint on Prims (see #42) #52 (byorgey)
-
return list of traces #48 (jeffreyrosenbluth)
v1.0.0.1 (2013-11-28)
v1.0 (2013-11-25)
-
New features
-
Delayed subtrees: instead of a primitive, one can now also have a delayed subtree at a leaf, containing a continuation which generates a
QDiagramwhen given the accumulated d-annotation at that point in the tree. Useful for things which need to know the final transformation applied to them before deciding what diagram to generate. The prototypical use case is arrows: see https://github.com/diagrams/diagrams-lib/issues/112 . However, this may be useful for other things as well: for example, diagrams which scale normally until hitting some maximum or minimum size, at which point they refuse to scale any further (or more generally diagrams which scale as some non-linear function of the transformation applied to them).The only downside is that the u-annotation must be fixed ahead of time—doing otherwise requires a more general solution for constraint solving.
-
New function
lookupNamefor doing a simple lookup of a named subdiagram -
New module
Diagrams.Core.Compile, containing a framework for compilingQDiagramsinto a simpler tree typeRTree, which may be used by backends for rendering.
-
-
New instances
-
Qualifiableinstances for(,),(,,),[],Set,Map k, and(->) e. -
(->) einstance forJuxtaposable(thanks to Carlos Scheidegger)
-
-
API changes
-
Export
pointDiagramfunction, which creates an otherwise empty diagram with a point (not empty) envelope -
A bunch of stuff now uses machinery from the
lenslibrary.envelope,trace, andsubMapare nowLens'esWrappedinstances forTrace,TransInv,QDiagram,SubMap,Envelope,Style,Query, andName(replacesNewtypeinstances)Isos forQuery,Envelope,QDiagram,SubMap,TransInv
-
Implemented enhancements:
- Tree structure in Backends #19
Merged pull requests:
-
Lens #44 (jeffreyrosenbluth)
v0.7.0.1 (2013-09-27)
Merged pull requests:
v0.7 (2013-08-09)
-
New features
- new function
onBasis, to extract the matrix equivalent of aTransformation SubMaps are nowDeletable- new function
localizefor hiding/deleting names from scope - new
IsPrimclass, containingtransformWithFreezefunction. This is primarily intended to support scale-invariant primitives (e.g. arrowheads) but may be useful for other stuff as well. The default implementation ofrenderDianow usestransformWithFreeze. - optimized
Transformableinstance forTransInv
- new function
-
New instances
-
Eq,Ord,Enveloped,Traced, andQualifiableinstances forTransInv -
Transformableinstance for functions, which acts by conjugation
-
-
API changes
namedandnamePointhave moved to thediagrams-libpackage.
-
Dependency/version changes
- allow
base-4.7 - upgrade to
monoid-extras-0.3
- allow
Implemented enhancements:
- Function to extract matrix coefficients from a Transformation #22
Closed issues:
- Support for monoid-extras-0.3.0.0 #38
Merged pull requests:
v0.6.0.2 (2013-03-06)
Fixed bugs:
- radius is wrong #35
Merged pull requests:
v0.6.0.1 (2013-01-07)
Fixed bugs:
- “type instance V (Point v) = v” is not visible without explicit import. #17
Merged pull requests:
v0.6 (2012-12-12)
-
New features
-
Proper support for subdiagrams: previous versions of diagrams-core had a mechanism for associating names with a pair of a location and an envelope. Now, names are associated with actual subdiagrams (including their location and envelope, along with all the other information stored by a diagram).
See
Diagrams.Core.Types. -
Traces: in addition to an envelope, each diagram now stores a “trace”, which is like an embedded raytracer: given any ray (represented by a base point and a vector), the trace computes the closest point of intersection with the diagram along the ray. This is useful for determining points on the boundary of a diagram, e.g. when drawing arrows between diagrams.
See
Diagrams.Core.Trace.
-
-
API changes
-
The modules have all been renamed to be more consistent with the module naming scheme in the rest of the diagrams universe. In particular:
Graphics.Rendering.Diagrams–>Diagrams.CoreGrahpics.Rendering.Diagrams.Core–>Diagrams.Core.TypesGraphics.Rendering.Diagrams.*–>Diagrams.Core.* -
Graphics.Rendering.Diagrams.UDTreehas been split out into a separatedual-treepackage (which has also been substantially rewritten). -
Graphics.Rendering.Diagrams.{Monoids,MList}have been split out into a separatemonoid-extraspackage. -
The
namesfunction now returns a list of names and their associated locations, instead of the associated subdiagrams. In particular the output is suitable to be rendered to aStringusingshow. -
The new
subMapfunction fills a similar role thatnamesused to play, returning the entire mapping from names to subdiagrams. -
New functions
envelope[VP]MayenvelopeVandenvelopePreturn the zero vector and origin, respectively, when called on an empty envelope. However, sometimes it’s useful to actually know whether the envelope was empty or not (the zero vector and the origin are legitimate outputs from non-empty envelopes). The new functions have their return type wrapped inMaybefor this purpose. -
New functions
envelopeSandenvelopeSMayLike
envelope[VP](May), but returning a scalar multiple of the input vector. -
The
Graphics.Rendering.Diagrams.Utilmodule has been removed, along with thewithLengthfunction. Calls towithLengthcan be replaced usingwithLength s v = s *^ normalized v -
Add needed constraints
(InnerSpace v, OrderedField (Scalar v), Monoid' m)to the type of therenderDiasmethod in theMultiBackendclass. -
Generalized
Transformableinstances for pairs and tuplesPreviously, the components of the tuples were required to have the same type; but everything still works as long as they all share the same vector space. This is actually useful in practice: say, if we wanted to pair a diagram with a path and then apply the same transformation to both.
-
-
Improvements
- More efficient implementation of
diameter
- More efficient implementation of
-
Dependency/version changes
- Tested with GHC 7.6.1
- allow
base-4.6 - allow
containers-0.5.* - allow
MemoTrie-0.6.1
-
Bug fixes
-
juxtaposeDefault now correctly handles empty envelopes (#37)
juxtaposeDefaultis now the identity on the second object if either one has an empty envelope. In particular this means thatmemptyis now an identity element forbesideand friends.
-
Implemented enhancements:
-
Turn R2 into D2 (Generalize R2 to any numeric type) #20
-
Terminology: rename “bounding function” -> “envelope”; “boundary function” -> “boundary” #16
-
Refactor: rename AnnDiagram to QDiagram #15
-
Combine (point, bounds) pairs stored in NameMap into a single “located bounding function” data structure #14
-
Remember more structure when building diagrams #12
-
Diagram-building service library + executable #7
Fixed bugs:
-
setBounds is incorrect – throws away bounds of subsequent diagrams too #13
-
Start developing test suites #10
-
Freezing does not appear to work with the SVG backend #9
-
Silent failure on other image types than .png #6
-
Tutorial contains links to old version of package #5
-
space is not left for empty diagram when using e.g. hcat’ with {sep = … } #3
-
Ellipse rotated incorrectly in test file with ellipse next to a square #2
Closed issues:
-
Rename core modules to remove Graphics.Rendering prefix. #28
-
Improve haddock documentation #11
-
Improve description of Envelope in Haddock documentation #1
Merged pull requests:
-
Add envelopeS / envelopeSMay for querying scalar displacements from envelopes #31 (mgsloan)
-
Rename
namestosubMap, and add new functionnames#26 (byorgey) -
Fix for juxtaposeDefault to correctly handle empty envelopes #24 (byorgey)
v0.5 (2012-03-09)
-
New features:
- New
Juxtaposableclass - New
NullBackendandDtypes, for conveniently giving a monomorphic type to diagrams when we don’t care which one it is. - #27: Change type of
adjustDiato return a new options record (with an explicitly filled-in size)
- New
-
New instances:
Enveloped,HasOrigin,Juxtaposable,HasStyle, andTransformableinstances forSets and tuplesV Double = DoubleJuxtaposableandBoundableinstances forMap
-
API changes
AnnDiagramrenamed toQDiagram- #61: terminology change from “bounds” to “envelope”
boundary->envelopeP- “bounding region” -> “envelope”
Bounds->EnvelopeBoundable->EnvelopedgetBounds->getEnvelope- etc.
- Split out definition of
Pointinto separate package (vector-space-points) - The
PointconstructorPis no longer exported fromGraphics.Rendering.Diagrams. See theDiagrams.TwoD.Typesmodule fromdiagrams-libfor new tools for working with abstract 2D points. If you really need thePconstructor, importGraphics.Rendering.Diagrams.Points. - Name-related functions now return “located bounding functions” instead of pairs of points and bounds, to allow for future expansion.
-
Dependency/version changes:
vector-space0.8 is now required.- Bump base upper bound to allow 4.5; now tested with GHC 7.4.1.
-
Bug fixes:
- Bug fix related to empty envelopes
0.4: 23 October 2011
- improved documentation
- a few new instances (Newtype Point, Boundable Point)
- new functions (value, clearValue, resetValue) for working with alternate query monoids
0.3: 18 June 2011
- big overhaul of name maps:
- allow arbitrary types as atomic names
- carry along bounding functions as well as names in NameMaps
- additional functions for querying information associated with names
- fix for issue #34 (fix behavior of setBounds)
- Transformable and HasOrigin instances for Transformations
0.2: 3 June 2011
- bounding regions can now be overridden
- new namePoint function for more flexibly assigning names to arbitrary points
- add HasStyle, Boundable, and HasOrigin instances for lists
- add a “trivial backend”
- transformable attributes
0.1.1: 18 May 2011
- link to new website
0.1: 17 May 2011
- initial preview release
* This Change Log was automatically generated by (and hand edited) github_changelog_generator
