Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoratePath #57

Open
jeffreyrosenbluth opened this issue Jun 9, 2014 · 2 comments
Open

decoratePath #57

jeffreyrosenbluth opened this issue Jun 9, 2014 · 2 comments

Comments

@jeffreyrosenbluth
Copy link
Member

The new semantics of trailVertices cause the example of decorateTrail in the manual to break. I think we should come up with a better example of decoratePath. Since the easiest fix to the code:

dot     = circle 1 # fc  black
dotSep  = 0.5
rowSep  = width (Dot :: D R2) + dotSep
mkRow n = hcat' (with & sep .~ dotSep) (replicate n dot)
mkTri n = cat' v (with & sep .~ rowSep & catMethod .~ Distrib) $ rows
   where
     rows = map mkRow [n, n-1 .. 1]
     v = fromDirection (1/6 @@ turn)

No longer uses the decoratePath function.

We also need to fix TriangularNumbers.lhs in the gallery, in this case a patch similar to the one above should work.

@byorgey
Copy link
Member

byorgey commented Jun 9, 2014

I agree we need a better example of decoratePath. In fact, I think the above code is a better way to make that triangle of dots, even with the old semantics of trailVertices! So it was never a very compelling example even to begin with.

I would actually go farther: I think we ought to deprecate decorateTrail and decoratePath, and add a function to lay out diagrams at a list of positions. (We already have position but we should make an unzipped version of it too, often when I use position I find myself using zip as well.) Then the focus turns to creating powerful/useful methods for constructing lists of points. Getting the vertices of a trail or path is only one such method.

@jeffreyrosenbluth
Copy link
Member Author

That's a very good idea. I also almost always use zip with position. I'll make a branch and code it up, it should be very easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants