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
1
vote
1 answer

How to install diagrams?

I am trying to install the diagrams package. If I do cabal install diagrams I get (towards the end) Configuring lens-4.2... Building lens-4.2... Preprocessing library lens-4.2... src/Control/Lens/Internal/Zoom.hs:47:8: Could not find module…
PyRulez
  • 10,513
  • 10
  • 42
  • 87
1
vote
1 answer

Combine bezier curves with points to fill in color

I am a super beginner with no coding experience learning Haskell...so here goes and this question probably doesn't make that much sense but I'll try... I'm trying to fill in a diagram with color. The diagram consists of points forming a line, and a…
NadineK
  • 131
  • 1
  • 2
  • 9
0
votes
1 answer

Haskell Diagrams: Why doesn't envelope default to bounding box?

When I write: (square 10 ||| square 10 ||| square 10 ) `atop` square 30 I'd expect a row of three little squares fitting neatly inside a big one: +-----------------+ | | | | +-----+-----+-----+ | | | | | …
Adrian May
  • 2,127
  • 15
  • 24
0
votes
2 answers

How to retrieve the bounding box of an object with cairo

I'm making drawings with the Haskell cairo binding and I want to align some object vertically. To do that, I need to know the width (the bounding box or partially) of these objects. I tried to get it by making this trick : (origx,origy) <-…
JeanJouX
  • 2,555
  • 1
  • 25
  • 37
0
votes
1 answer

How to use ray tracing in Haskell Diagrams

The code rayTraceP (p2 (0, 0)) (r2 (1, 0)) (circle 1) causes the error message Could not deduce: V a0 ~ V2 from the context: (Traced a, TrailLike a, Transformable a, V a ~ V2) bound by the inferred type for…
E. Nerush
  • 69
  • 7
0
votes
1 answer

How do I hide the DOCTYPE declaration for svg files generated by diagrams?

I see that generateDoctype exists in the diagrams module: http://projects.haskell.org/diagrams/haddock/diagrams-svg/Diagrams-Backend-SVG.html#v:generateDoctype How do I set this to false? Right now I am generating my svg file with mathWith, as…
Joshua Meyers
  • 619
  • 1
  • 8
  • 17
0
votes
1 answer

Haskell Diagrams error: "No diagram selected."

I am attempting to create a set of diagrams, using the following main function: main = mainWith [("here0", myDiagram), ("here1", myDiagram)] and am getting the following error: No diagram selected. Available diagrams: here0 here1 Any idea what…
mherzl
  • 5,624
  • 6
  • 34
  • 75
0
votes
0 answers

How to fix these cabal installation errors while installing diagrams?

I am trying to install the diagrams package written in haskell using Cabal. I get the following errors when I run cabal install diagrams [~]$ cabal install diagrams Resolving dependencies... In order, the following will be installed: bytes-0.15.2…
smilingbuddha
  • 14,334
  • 33
  • 112
  • 189
0
votes
1 answer

draw points and lines with given coordinates using haskell diagrams

I have a list of points with absolute x and y coordinates: points :: [(1,1), (2,2), (3,3), (-105, -42.42)] And a list of edges as tuple of points: edges :: [((1,1), (2,2)), ((1,1),(-105, -42.42)), ((3,3), (-105, -42.42))] I now want to draw this…
fuji
  • 1,173
  • 1
  • 10
  • 27
0
votes
1 answer

connectPerim' Haskell Diagrams function

I have found some problems with connectPerim' function in Haskell Diagrams. This function connects perimeters of two figures in selected parts of perimeters (this time figures perimeter is divided into 12 parts and the number before "/" means which…
Darius
  • 71
  • 2
0
votes
1 answer

Haskell Diagrams Output without commandline

I have one question: I know how to output svg file with a help of ghc --make Strukturine.hs command in Terminal. As I understood it uses import Diagrams.Backend.SVG.CmdLine . Is it possible somehow load Strukturine.hs file with the help of…
Darius
  • 71
  • 2
0
votes
1 answer

How can I draw text on a haskell chart graphics?

I would like to draw some label besides points on a XY chart drawn using Chart with diagrams backend in Haskell. Eg. I have data like: data = [("foo", 1,2), ("bar", 1, 3), ... ] and would like to draw labels foo and bar at or near coordinates…
insitu
  • 4,488
  • 3
  • 25
  • 42
1 2 3
4