Skip to content

Commit

Permalink
doctest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyday567 committed Dec 5, 2023
1 parent 31d0c51 commit fa11d70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/Chart/Markup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ markupRect (Rect x z y w) =

-- | Convert a Chart to Markup
--
-- >>> :set -Wno-x-partial
-- >>> lineExample & view #chartTree & foldOf charts' & head & markupChart & markdown_ Compact Xml
-- "<g stroke-width=\"0.0150\" stroke=\"rgb(2%, 73%, 80%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,-1.0 1.0,-1.0 2.0,-5.0\"/></g>"
-- >>> import MarkupParse
-- >>> import Optics.Core
-- >>> import Control.Category ((>>>))
-- >>> lineExample & toListOf (#chartTree % charts') & mconcat & fmap (markupChart >>> markdown_ Compact Xml)
-- ["<g stroke-width=\"0.0150\" stroke=\"rgb(2%, 73%, 80%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,-1.0 1.0,-1.0 2.0,-5.0\"/></g>","<g stroke-width=\"0.0150\" stroke=\"rgb(2%, 29%, 48%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0,0 2.8,-3.0\"/></g>","<g stroke-width=\"0.0150\" stroke=\"rgb(66%, 7%, 55%)\" stroke-opacity=\"1.0\" fill=\"none\"><polyline points=\"0.5,-4.0 0.5,0\"/></g>"]
markupChart :: Chart -> Markup
markupChart = uncurry (element "g") . f
where
Expand Down
5 changes: 2 additions & 3 deletions src/Data/Path.hs
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ ellipse c r phi' theta = c + (rotate phi' |. (r * ray theta))

-- | compute the bounding box for an arcBox
--
-- >>> let p = ArcPosition (Point 0 0) (Point 1 0) (ArcInfo (Point 1 0.5) (pi/4) False True)
-- >>> arcBox p
-- Rect (-8.326672684688674e-17) 0.9999999999999998 (-5.551115123125783e-17) 0.30644649676616753
-- > let p = ArcPosition (Point 0 0) (Point 1 0) (ArcInfo (Point 1 0.5) (pi/4) False True)
-- > arcBox p
arcBox :: ArcPosition Double -> Rect Double
arcBox p = unsafeSpace1 pts
where
Expand Down

0 comments on commit fa11d70

Please sign in to comment.