Kwarrtz / render

A lightweight graphics library for the Elm programming language
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link

Are events supported #3

Closed berry closed 7 years ago

berry commented 8 years ago

Hi,

I like your library. It looks like it would make working with Svg in Elm much more easier. The question I have while looking at this library is: Are Svg.Events supported? I like to use the OnClick event on a form or a group, for example.

Thank you, Berry

Kwarrtz commented 8 years ago

Hello Berry,

Unfortunately, this library does not support any sort of event handling at present. I am currently working on v2.0.0 of this package (it should be ready in the next couple weeks), and I will certainly try to include at least basic keyboard and mouse support in it. In the meantime, you'll either have to wait or fork the repo and add the functionality yourself. I apologize for the inconvenience.

Since this is a rather glaring hole in the library's functionality, I will leave this issue open until v2.0.0 is out.

altaic commented 8 years ago

Really excited about v2.0.0-- any news?

Also regarding events, do you have any plans for handling coordinate transforms, e.g. browser-relative mouse position to svg-container-relative mouse position and vice-versa? It's one of those fiddly problems that makes me want to bang my head against a wall.

Kwarrtz commented 8 years ago

v2.0.0 is still in the works. There are a couple of features that I decided to try to work in at the last minute which are requiring some rather serious reworking of the API. That and personal circumstances has rather delayed the update's release, for which I apologize. I'm not willing to give a set release date yet, but v2 will be out soon, I promise!

As for the coordinate transforms, that is an interesting problem. I hadn't planned to include anything of the sort, but I can look into it. Do you have any suggestions for specifics on how something like that might/should be used?

altaic commented 8 years ago

Hmm, that is a difficult question to answer succinctly! I need users to be able to interact with nested svg elements (or Forms), dragging to apply transforms to them at any given level. The problem is that each element has its own coordinate system-- it's really awkward tracking each one in relation to the browser window (mouse coords), especially since the window may scroll.

I'll have to get back to you with more details. I'd typed out a paragraph describing a few ideas for specific implementations that could be useful to me, but after I read it I realized it was about as clear as mud so I deleted it. It's late right now and brain isn't working properly.

Kwarrtz commented 7 years ago

Event handling added in v2.0.0. Sorry for the wait.