Questions tagged [haskell-diagrams]

Diagrams is a powerful, flexible, declarative domain-specific language for creating vector graphics, using the Haskell programming language.

Diagrams is a powerful, flexible, declarative domain-specific language for creating vector graphics, using the Haskell programming language.

diagrams.github.io

57 questions
2
votes
1 answer

Haskell Diagrams alignment function

I'm trying use Haskell Diagrams to make my own function which places two diagrams horizontally/vertically adjacent to one another (like ||| or ===) but with a space between them. If I try to do like this, I get error: Illegal equational constraint V…
Darius
  • 71
  • 2
1
vote
1 answer

What is the difference between gi-cairo and cairo libraries

I making a program to draw some vector graphics on top of a GTK program written with Haskell. I upgraded my program to the gi-gtk library in replacement of Gtk2Hs to benefit of Gtk3 and when I see tutorial/example about drawing in Gtk windows with…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
1
vote
0 answers

Animate a Haskell-Diagrams

I'm trying to create an animation out of a Haskell Diagram. I'm using Reanimate for this. I tried this code: {-# LANGUAGE OverloadedStrings #-} module Reanimate.Diagrams ( renderDiagram ) where import Data.Text.Lazy (toStrict) import…
cdupont
  • 1,138
  • 10
  • 17
1
vote
0 answers

Haskell Diagrams, get the length of a TrailLike

I need to find the length of a trail in Haskell Diagrams. I've found the function stdArcLength which seems to give me the length. I have no idea how I would convert this into an Int or a Double. round and floor throws ambigoues errors. How should I…
Chris Wohlert
  • 610
  • 3
  • 12
1
vote
1 answer

How to properly setup Chart using Diagrams backend?

I am trying to test Chart using the Diagrams backend (both from Stackage) with this example import Graphics.Rendering.Chart.Easy import Graphics.Rendering.Chart.Backend.Diagrams signal :: [Double] -> [(Double,Double)] signal xs = [ (x,(sin…
atis
  • 881
  • 5
  • 22
1
vote
1 answer

Haskell Diagrams, Normalized FontSize not working as expected

I am new to Diagrams, so I've been reading the docs, and I came upon Normalized units. This is exactly what I think I want. I am creating a Diagram, with a couple of bounding boxes around a lot of other diagrams. The diagram is quite big, and all…
Chris Wohlert
  • 610
  • 3
  • 12
1
vote
1 answer

Sampling points along a path

Say I have a type Path a = Double -> a. That describes some notion of a "path" in a given type a. In my case I want to use this to draw a curve in a 2-dimensional space. I use diagrams so let a = P2 Double (P2). What I'm looking for is a (generic)…
fredefox
  • 681
  • 3
  • 11
1
vote
1 answer

Diagrams and gtk2hs

I've been working on my summer research project, and I've been using the Diagrams library to draw graphs with edges, nodes. I'm simulating the spread of information throughout the graph, so my diagram is constantly updating discretely. I have all of…
1
vote
1 answer

What Diagrams backends support animation?

In the diagrams tutorial the following text appears: Some backends support rendering animations (typically as individually indexed files of frames). > -- Animation > > a :: Animation Cairo V2 Double > a = ... > > main = mainWith a So from here I…
Wheat Wizard
  • 3,982
  • 14
  • 34
1
vote
1 answer

Haskell diagrams: generating SVG without compiling?

I tried the Fibonacci demo from the diagrams gallery but, as many of their examples do, it requires compilation and then the mainWith function takes various options, including a file name for SVG output. I'd like to get the same result of an .svg…
guthrie
  • 4,529
  • 4
  • 26
  • 31
1
vote
1 answer

Parse error with Haskell diagrams-builder

I'm trying to use the diagrams-builder package with LaTeX in order to generate diagrams in line. Following the tutorial here, I have a file called test.tex with the following contents: \documentclass[10pt]{article} \usepackage[backend=ps,…
Noah Halford
  • 293
  • 1
  • 6
1
vote
1 answer

How do I use the same output for multiple diagrams?

I also posted the following as a diagrams-doc issue, but I thought it might be more appropriate here. The user manual says this: One situation in which output units can be particularly useful is when preparing a document (paper, blog post, etc.)…
Joshua Meyers
  • 619
  • 1
  • 8
  • 17
1
vote
1 answer

Haskell diagrams SVG clipped

The quickstart for the diagrams package tells me to compile and run the following program: {-# LANGUAGE NoMonomorphismRestriction #-} import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine main = mainWith (circle 1 :: Diagram B) It them…
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
1
vote
1 answer

Trying to install diagrams on OS X

I'm trying to install diagrams on OS X. While downloading it, I get this kind of error message: Building linear-1.20.4... Failed to install linear-1.20.4 Build log ( /Users/Max/.cabal-sandbox/logs/linear-1.20.4.log ): then some time later after…
Max K
  • 171
  • 12
1
vote
1 answer

Diagrams boundingRect including the lines' width

Is there an equivalent to the boundingRect function which includes the diagram's lines width(*), so that each line, however thick it is, is entirely contained within the bounding rectangle? (the boundingRect function "ignores" their thickness and…
Janthelme
  • 989
  • 10
  • 23