Fork me on GitHub
#hoplon
<
2016-11-08
>
flyboarder19:11:32

@jumblerg: did you have any thoughts on SVG in UI? @vigilancetech was asking about it, thought I'd get your opinion.

jumblerg19:11:54

there are several ways to go about data visualization; i have some longer term ideas that would basically generalize all the svg functionality into the elem as well, eg you could pass an elem a path and it would just do the right thing.

jumblerg19:11:32

but svg elements are a bit more sane than html elements; the thing to do, while working with ui, is to use the existing svg fns exposed by hoplon, probably.

jumblerg19:11:48

the issue right now is that elem expect their kids to be elems, so i need to introduce a new kind of elem, like an html, svg, or hoplon, that will allow the hoplon's core low lovel functions to be used.

jumblerg19:11:45

another way to do this is to use innerHTML to evaluate a string of svg or html markup to dom elements.

flyboarder21:11:45

@jumblerg so any known issue with using the existing hoplon svg elements?

jumblerg21:11:43

yes, if you mix those in any hoplon constructors, whether they return svg or html elements, ui will break. the reason for this is that layout, in ui, is done by a parent to its children; these children consequently need to implement, in effect, an interface the parent can use to manage them.

jumblerg21:11:33

in practice, however, we could permit these to be used at the terminal elem nodes of the dom; i need to reintroduce a construct for this purpose.

flyboarder21:11:53

@jumblerg : hmm this seems like more work than just implementing the svg element then huh

jumblerg21:11:00

i can add something relatively easily when i get some time.

jumblerg21:11:27

actually, i think it may only require creating a new ui component without the align, pad and gutter middlewares that are user for layout: https://github.com/hoplon/ui/blob/master/src/hoplon/ui.cljs#L179-L227

jumblerg21:11:07

make a leaf, like node, but without align, pad, and gutter

jumblerg21:11:50

@flyboarder: then compose them together just like the elem

jumblerg21:11:12

maybe name it html or something

jumblerg21:11:13

i think that may be enough to allow hoplon element functions, like the svg constructors, inside.

flyboarder21:11:13

Interesting!!

jumblerg21:11:10

pull requests accepted and much appreciated! 🙂

jumblerg21:11:56

otherwise, i'll take a quick stab at it myself later tonight.

jumblerg22:11:51

this did require some changes to the ordering of the middlewares, so there's a decent chance it may have broken some things which are difficult to detect without robust automated tests in place - but that's why this libary is experimental, no matter how many times @alandipert tries to tell people otherwise.

jumblerg22:11:18

(yeah, i just listened to your little podcast last night...)

jumblerg23:11:35

sample usage

(hoplon.ui/elem :s 400
  (hoplon.ui/html :s (r 1 1)
    (hoplon.core/div "i'm a plain html div element.  i could also be an svg element.")))

flyboarder23:11:34

@vigilancetech: ^^ jumblerg made some changes today :)