Skip to content

Commit

Permalink
Fix code for diagrams 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Dec 16, 2012
1 parent 629930d commit 22c3302
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diagrams-demo.hs
@@ -1,5 +1,6 @@
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
import Diagrams.Backend.SVG.CmdLine
import Diagrams.Core.Envelope

import Optimisation.CirclePacking

Expand All @@ -12,7 +13,8 @@ objects = colorize $
[ decagon r | r <- [0.1,0.2..0.7] ]

-- Just a approximation, diagram objects do not have an exact radius
radiusApproximation o = maximum [ radius (e (CircleFrac alpha)) o | alpha <- [0,0.1..1.0]]
radiusApproximation :: Diagram b R2 -> Double
radiusApproximation o = maximum [ envelopeS (e (CircleFrac alpha)) o | alpha <- [0,0.1..1.0]]

main = defaultMain $
position $ map (\(o,(x,y)) -> (p2 (x,y),o)) $
Expand Down

0 comments on commit 22c3302

Please sign in to comment.