membrane

Ben Sless 2023-03-13T09:29:01.473279Z

Following our chats, how's that for a tabs view?

(defui tabbed [{:keys [tabs focus orientation]
                :or {orientation :left}}]
  (let [the-tabs
        (for [[text _] tabs]
          (let [hover? (get extra [:hover? text])]
            (basic/button {:text text
                           :hover? hover?
                           :on-click (fn [] [[:set $focus text]])})))]
    (case orientation
      :left
      (ui/horizontal-layout
       (apply ui/vertical-layout the-tabs)
       (get tabs focus))
      :right
      (ui/horizontal-layout
       (get tabs focus)
       (apply ui/vertical-layout the-tabs))
      :down
      (ui/vertical-layout
       (get tabs focus)
       (apply ui/horizontal-layout the-tabs))
      :up
      (ui/vertical-layout
       (apply ui/horizontal-layout the-tabs)
       (get tabs focus)))))

genekim 2023-03-13T23:01:38.818399Z

https://clojurians.slack.com/archives/CQT1NFF4L/p1678736832100809?thread_ts=1678672410.695219&channel=CQT1NFF4L&message_ts=1678736832.100809 @smith.adriane holy cow. This is awesome. How did you do the “click to turn all edges from that node red?” I’m guessing you used your wrapper around graphviz, but how are you catching the event when node is clicked, and how are you turning the edges red? Thanks!

phronmophobic 2023-03-13T23:09:40.417839Z

The edges are highlighted on mouse hover. The code is still a WIP, but I just pushed it https://github.com/phronmophobic/dewey/blob/main/examples/cosmos/src/cosmos_viewer.clj.

phronmophobic 2023-03-13T23:22:02.965589Z

There are around 130k nodes, so I build an rtree before hand to make hit detection fast. Likewise, I also organize edges by id ahead of time.

phronmophobic 2023-03-14T05:14:06.996599Z

Been trying out different color schemes and this one is my favorite.

🔥 1
phronmophobic 2023-03-14T05:38:37.843049Z

It's cool how much it looks like a cell https://images.fineartamerica.com/images-medium-large-5/4-eosinophil-white-blood-cell-tem-science-photo-library.jpg

🤯 1
phronmophobic 2023-03-15T04:45:09.391299Z

Just the edges

🔥 1