Open timjs opened 6 years ago
If you want to add Bézier curves, you might consider going all the way and adding some sort of analog to the full SVG <path>
element.
The different svg curve and arc commands are fairly complicated, how simple or complex of an interface were you thinking for these?
I will attempt to add the function bezier : Point -> Point -> Point -> Point -> Path
like vilterp/elm-diagrams. Hopefully it isn't too difficult.
Do you just want cubic bezier? I can also try to add arc. I'm still trying to figure out how to calculate the bounding box. Should it be possible to join paths into longer paths?
Joining is not necessary I think. Having arc
would be nice
Sent with GitHawk
What do you want the type signature for arc to be? The generated path will be:
A rx ry x-axis-rotation large-arc-flag sweep-flag x y
What do other packages do? Take a look at the libraries for Haskell, Clean, Elm etc. I expect you can propose one or two variants and users can take a look
Sent with GitHawk
I would love to see this work like Haskell's Diagrams lib.
Though I guess with #40 having gone quiet, that doesn't seem likely any time soon... I'm half-tempted to put myself forward, but I really don't use Elm much.
With custom operators and kernel function removed, Elm became too frustrating to use. At some point, I might attempt to write a diagrams library for Idris 2 (which has a JS backend), but I don't think I'll get to it for some time.
That'd be cool, I've meaning to give Idris a good look.
Fully agree that Elm has some strange omissions that make me struggle to take it seriously, the complete non-extensibility of comparable
being the main one for me. Hence why I'm using Purescript at the day job.
But I do have a soft spot for Elm, because of things like how smooth the documentation and tooling are. I really want to be able to recommend it to people just wanting to start dipping their toes in to FP, and it's frustratingly close to being good enough. Anyway, I have one or two hobby projects where I'm stuck with Elm, and I don't really want to have to migrate.
You both put forward Elm's biggest pain points for me, and the reason I moved back to PureScript/Idris/Haskell as well. I only use Elm for teaching from time to time, because of the friendliness and tooling.
I'm only inclined to maintain this library by accepting pull requests from contributors. Could be for bug fixes or additional features.
Nastiest point for me is that Elm made client side text measuring a big pain in the * by restricting FFI. This is the only (pure!) foreign function this library needs.
A way to create Bézier curves would be great! The idea is to add a
curve
function which creates aPath
. The resulting path can be traced and closed in the same way assegement
s andline
s.Note: maybe we'll have to rename
path
topolyline
to avoid some confusion, see #10.