Fork me on GitHub
#hoplon
<
2016-06-29
>
flyboarder01:06:18

Hey guys looking to get some info for a solution we are designing. https://degree9.typeform.com/to/ZYV2Y7

onetom01:06:46

@flyboarder: > What do you feel is the single most important aspect of your business when it comes to technology?* I don't quite understand this question. Can you rephrase it please or give an example response?

flyboarder01:06:37

@onetom That is free to interpret, many business' use technology differently

flyboarder01:06:48

As an example and investigator may say "Video Surveillance"

onetom07:06:52

^ woohoo, thank you ❤️

adamw11:06:06

Hey ok so @jumblerg, here is a crazy question you might know a good solution for. Can you think of a sensible way to wire up a cell to the size of a given elem? I'm trying to do something perhaps a little nuts, auto-size an svg so it is responsive. To do that I can use transform on the svg object (we wired up the h/object tag using hoplon-ui internals, sorry sorry). I can apply a transform to the object (or its outer div) to scale it up to an appropriate size. But to do so I need to apply scale (svg:div). The div size changes based on the viewport size so... 🙂

adamw11:06:22

There is a good argument to be made that I shouldn't bother...

jumblerg14:06:52

@adamw: i haven’t done much with svg yet, but here’s some code i was using to get my transforms to scale down the size of the html then fill a space in my dashboard:

(elem :w (r 1 1) :h 300 :r 4 :c white :b 2 :bc (c 0xCCCCCC) :sv :auto :sh :hidden
  (elem :w (r 5 1) :h (r 5 1) :x (scale 0.2) :xx :left :xy :top :sv :hidden
    (cell= (render view)))

adamw14:06:25

@jumblerg: thanks. When you scale by .2 that's a fixed (known) scale ratio? Is there a way to determine the current viewport size? Perhaps I need to set an event listener on js/window onsize.

jumblerg14:06:53

for transforms, yeah. we need to make transforms take the same ratio types, but that was a more convenient, direct implementation, and i needed to make a think quick.

jumblerg14:06:36

plus the browser is inconsistent at every turn; everything is a special case, basically. everytime i think i have an abstraction that’s working well, another one comes along and throws a wrench into things.

jumblerg14:06:02

the scale fn in this case is a helper that returns a css 3d transform matrix.

adamw14:06:30

Yep, saw it in ui.attrs

jumblerg14:06:33

(.innerWidth js/window) etc should give you the viewport size

jumblerg14:06:42

if you look at the skin middlewarish fn, you can see the attributes i set there to get an svg to scale to the size of an elem

jumblerg14:06:11

i don’t recall if i ever got it quite right