Editing diagrams, part 1: a test of your intuition

51 views
Skip to first unread message

Brent Yorgey

unread,
May 9, 2019, 6:36:48 AM5/9/19
to diagrams-discuss
Hi all,

As you may be aware, in diagrams 2.0 it will be possible to access and edit subdiagrams via lenses/traversals.  So for example, consider

d :: Diagram V2
d = hcat (zipWith (.>>) "ABCDE" (replicate 5 (circle 1))) # fc blue

which produces

image.png
We can edit the diagram like so:

main :: IO ()
main = mainWith Rasterific $ d # (named 'C' %~ fc red) # frame 1 # bg white

which produces

image.png
Now, consider this code:

main :: IO ()
main = mainWith Rasterific $ d # (named 'C' %~ scale 2) # frame 1 # bg white

What image do you think will result?  What image do you think should result?

It's probably obvious that I'm asking because I think the foregoing two questions may have different answers.  But I don't want to bias the results by telling you what I think yet.  Once I get some responses I'll follow up with another email getting into more of the technical details. =)

-Brent

Felipe Lessa

unread,
Jul 12, 2019, 6:55:32 PM7/12/19
to Brent Yorgey, diagrams-discuss
On 09/05/2019 11:36, Brent Yorgey wrote:
Now, consider this code:

main :: IO ()
main = mainWith Rasterific $ d # (named 'C' %~ scale 2) # frame 1 # bg white

What image do you think will result?  What image do you think should result?

A big blue circle in the middle, touching but not overlapping the other four circles :).

Cheers,

-- 
Felipe.
pEpkey.asc
Reply all
Reply to author
Forward
0 new messages