/usr/share/doc/libghc-diagrams-lib-doc/html/Diagrams-TwoD-Adjust.html is in libghc-diagrams-lib-doc 0.7.1.1-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Diagrams.TwoD.Adjust</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Diagrams-TwoD-Adjust.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Diagrams-TwoD-Adjust.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">diagrams-lib-0.7.1.1: Embedded domain-specific language for declarative graphics</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Maintainer</th><td>diagrams-discuss@googlegroups.com</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Diagrams.TwoD.Adjust</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A default diagram-adjustment implementation for two-dimensional
diagrams, useful for backend implementors.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:setDefault2DAttributes">setDefault2DAttributes</a> :: <a href="/usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> m => <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m</li><li class="src short"><a href="#v:adjustDiaSize2D">adjustDiaSize2D</a> :: <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core.html#t:Monoid-39-">Monoid'</a> m => (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a>) -> (<a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>) -> b -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>, <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m)</li><li class="src short"><a href="#v:adjustDia2D">adjustDia2D</a> :: <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core.html#t:Monoid-39-">Monoid'</a> m => (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a>) -> (<a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>) -> b -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>, <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m)</li><li class="src short"><a href="#v:adjustSize">adjustSize</a> :: <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>) -> <a href="Diagrams-Transform.html#t:Transformation">Transformation</a> <a href="Diagrams-TwoD-Types.html#t:R2">R2</a></li><li class="src short"><a href="#v:requiredScale">requiredScale</a> :: <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:setDefault2DAttributes" class="def">setDefault2DAttributes</a> :: <a href="/usr/share/doc/libghc-semigroups-doc/html/Data-Semigroup.html#t:Semigroup">Semigroup</a> m => <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m<a href="src/Diagrams-TwoD-Adjust.html#setDefault2DAttributes" class="link">Source</a></p><div class="doc"><p>Set default attributes of a 2D diagram (in case they have not
been set):
</p><ul><li> Line width 0.01
</li><li> Line color black
</li><li> Font size 1
</li><li> Line cap LineCapButt
</li><li> line join miter
</li><li> Miter limit 10
</li></ul></div></div><div class="top"><p class="src"><a name="v:adjustDiaSize2D" class="def">adjustDiaSize2D</a> :: <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core.html#t:Monoid-39-">Monoid'</a> m => (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a>) -> (<a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>) -> b -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>, <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m)<a href="src/Diagrams-TwoD-Adjust.html#adjustDiaSize2D" class="link">Source</a></p><div class="doc"><p>Adjust the size and position of a 2D diagram to fit within the
requested size. The first two arguments specify a method for
extracting the requested output size from the rendering options,
and a way of updating the rendering options with a new (more
specific) size.
</p></div></div><div class="top"><p class="src"><a name="v:adjustDia2D" class="def">adjustDia2D</a> :: <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core.html#t:Monoid-39-">Monoid'</a> m => (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a>) -> (<a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>) -> b -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> -> <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m -> (<a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Options">Options</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a>, <a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:QDiagram">QDiagram</a> b <a href="Diagrams-TwoD-Types.html#t:R2">R2</a> m)<a href="src/Diagrams-TwoD-Adjust.html#adjustDia2D" class="link">Source</a></p><div class="doc"><p><code>adjustDia2D</code> provides a useful default implementation of
the <code><a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#v:adjustDia">adjustDia</a></code> method from the <code><a href="/usr/share/doc/libghc-diagrams-core-doc/html/Diagrams-Core-Types.html#t:Backend">Backend</a></code> type class.
</p><p>As its first two arguments it requires a method for extracting
the requested output size from the rendering options, and a way
of updating the rendering options with a new (more specific) size.
</p><p>It then performs the following adjustments:
</p><ul><li> Set default attributes (see <code><a href="Diagrams-TwoD-Adjust.html#v:setDefault2DAttributes">setDefault2DAttributes</a></code>)
</li><li> Freeze the diagram in its final form
</li><li> Scale and translate the diagram to fit within the requested
size (see <code><a href="Diagrams-TwoD-Adjust.html#v:adjustDiaSize2D">adjustDiaSize2D</a></code>)
</li><li> Also return the actual adjusted size of the diagram.
</li></ul></div></div><div class="top"><p class="src"><a name="v:adjustSize" class="def">adjustSize</a> :: <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>) -> <a href="Diagrams-Transform.html#t:Transformation">Transformation</a> <a href="Diagrams-TwoD-Types.html#t:R2">R2</a><a href="src/Diagrams-TwoD-Adjust.html#adjustSize" class="link">Source</a></p><div class="doc"><div class="warning"><p>Deprecated: Use Diagrams.TwoD.Size.requiredScaleT instead.
</p></div><p>Re-export <code><a href="Diagrams-TwoD-Size.html#v:requiredScaleT">requiredScaleT</a></code> with the name <code><a href="Diagrams-TwoD-Adjust.html#v:adjustSize">adjustSize</a></code> for
backwards compatibility.
</p></div></div><div class="top"><p class="src"><a name="v:requiredScale" class="def">requiredScale</a> :: <a href="Diagrams-TwoD-Size.html#t:SizeSpec2D">SizeSpec2D</a> -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Double">Double</a><a href="src/Diagrams-TwoD-Size.html#requiredScale" class="link">Source</a></p><div class="doc"><p><code>requiredScale spec sz</code> returns a scaling factor necessary to
make something of size <code>sz</code> fit the requested size <code>spec</code>,
without changing the aspect ratio. Hence an explicit
specification of both dimensions may not be honored if the aspect
ratios do not match; in that case the scaling will be as large as
possible so that the object still fits within the requested size.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|