erkal / kite

An interactive visualization tool for graph theory

Home Page:https://erkal.github.io/kite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A couple minor possible simplifications

ianmackenzie opened this issue · comments

Hey Erkal, it was great to see this project - one of the largest/most complex apps I've seen using elm-geometry! Looks like you've used quite a bit of different functionality from a range of modules too, which is cool too see.

A couple very minor things I noticed when browsing through the code:

  • In Main.elm, I think fromEdgeMidpointToLabelMidpoint can be simplified slightly - you should be able to replace Direction2d.toVector |> Vector2d.scaleBy labelDistance with just Vector2d.withLength labelDistance. (Direction2d.toVector is there as an escape hatch but there are usually nicer approaches.)
  • In edgeIdsIntersectiongLineSegment in GraphFile.elm, it should be possible to replace the case expression inside the intersects function with just LineSegment2d.intersectionPoint l1 l2 /= Nothing.

Would love to hear about things that you found difficult or awkward when using the package, or any annoying functionality gaps - either here or as new feature requests on the elm-geometry repo. Let me know!

Hi Ian, thank you for the beautiful comments!
I did the two changes that you said, thanks.

I find elm-geometry really great. It made my life better.
The API is great. It makes my code much more readable.
I've also learned a lot from your Elm Europe talk.
I don't have anything else to say about the library other than "Thank you". :)