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

Add lookupName function. #41

merged 1 commit into from Aug 14, 2013


None yet
2 participants

cmears commented Aug 14, 2013

Example of use:

-- If a straight line was drawn between two named subdiagrams, but
-- stopped at the edge of each subdiagram, where would the endpoints be?
connectionPoints n1 n2 d = do
  b1 <- lookupName n1 d
  b2 <- lookupName n2 d
  let v = location b2 .-. location b1
      midpoint = location b1 .+^ (v/2)
      p1 = fromJust $ traceP midpoint (-v) b1
      p2 = fromJust $ traceP midpoint v b2
  return (p1,p2)

(We also need to export it in diagrams-lib.)

Show outdated Hide outdated CHANGES.markdown

This comment has been minimized.

Show comment
Hide comment

byorgey Aug 14, 2013


Looks good, other than my comment re: CHANGES.markdown.


byorgey commented Aug 14, 2013

Looks good, other than my comment re: CHANGES.markdown.

cmears added a commit that referenced this pull request Aug 14, 2013

Merge pull request #41 from cmears/master
Add lookupName function.

@cmears cmears merged commit 7a71314 into diagrams:master Aug 14, 2013

1 check passed

default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment