Fork me on GitHub

Hey. Is it possible to apply some styling to a table cell (for example) based on the results of calling a function. Like highlighting all the negative numbers in red? Or something similar?


Hi! You mean in any kind of table, or in table-view provided by reveal?


I mean in a table view in reveal ... Maybe allowing me to enter a function to call on each row or cell to apply a style? ... Is it something I could do by implementing a custom view? ... I was thinking about it in terms of analysing a large data set, so you could get a quick visual idea of rows some categories in the data ...


In default table view it's not possible, but it's possible to do, although it will require copying most of the reveal's table view source and modifying it.


the place that will require change is vlaaad.reveal.view/describe-cell


I tried this to highlight all keywords:

(defn- describe-cell [x]
  {:content-display :graphic-only
   :style-class "reveal-table-cell"
   :style {:-fx-background-color (if (keyword? x) :red :transparent)}
   :graphic {:fx/type summary :value x}})
scary, yet indicative 😄


😉 ... many thanks ... I'll have a look and see if I can create something ... I think ideally i'd like to be able to input the function from the ui rather than hardcode keyword? or whatever ...


kind of like using grasp, but for the data visualisation 😉


hmm, I like this idea... I'll keep it in mind


I was also thinking of trying to implement a graph view of data ... For things like state machines or nodes in a graph ... It'd be really useful to be able to highlight nodes in a graph that match other criteria ... Like people who bought this product also bought these products... And highlight the products over $100 .... Or whatever


Maybe multiple colours for different criteria?


I found this ... But have not tried to go any further, and probably won't have time to for a few weeks at least


But I'm pretty impressed with reveal ... Many thanks for releasing it into the world