Hacker News new | past | comments | ask | show | jobs | submit login

I'm really impressed with the visual design, and curious about what's being used to generate the CSS.

I'm also wondering, are there any difficulties that arise when working with canvas and svg using just Om, or in plain React?




css is generated with less.

I can't say much about canvas, but using svg with React is a bit of a hassle. There isn't built-in support for every svg tag and attribute, so we have to maintain our own fork: https://github.com/precursorapp/react

Once you add support for the tags, though, it's no different than working with any other html in React. I think we'll see React start to eat into d3's market-share pretty soon.


Can you elaborate on this a bit? I'm not that familiar with react itself, having only used it through om, but I built a proof of concept that let me work with SVGs via om with code like:

    (defcomponent circle-view [data]
      (render [_]
              (let [size (get-in data [:circles :size])]
                (html [:div.circle
                       [:svg {:height size
                              :width size}
                        [:circle {:cx (/ size 2)
                                  :cy (/ size 2)
                                  :fill "yellow"
                                  :r (/ size 2)
                                  :stroke "green"
                                  :stroke-width 4}]]]))))
And it seemed to all work fine? (Using sablono obviously)


Oh sorry, I didn't mean to imply that none of the svg tags are present. Most of the common svg things work, but there are lots of missing tags and attributes. There's an issue for it here: https://github.com/facebook/react/pull/1032

Some of the things we had to add for Precursor were clipPath, foreginObject, mask, patternTransform, marker, and vector-effect.


Ah, ok, that makes sense. Thanks!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: