I'm trying to use https://cljdoc.org/d/djblue/portal/0.51.1/api/portal.viewer#table with the table rows as a vector of vectors.
(portal.api/submit
(portal.viewer/table [[1 2]
[3 4]
[5 6]]
{:columns [:X :Y]}))
It looks like I'm doing something wrong with the column names.
Any idea what I might be missing?BTW I ended up adding support for this in https://github.com/djblue/portal/commit/2a55d25f7b3685de79d45b687e6ade1bce154aa1 👌
Oh thank you so much!
Ohh, currently the column metadata only works for map-of-maps or vector-of-maps.
https://github.com/djblue/portal/blob/master/src/portal/ui/viewer/table.cljs#L179-L200 could be updated to support :columns 🤔
Is this something you want to try?
Oh, I see, thanks. I misread the code an now you clarified it for me. 🙏 map-of-maps should be good enough for my case, thanks.
Some people here may find the following example useful. It is a self-contained tiny demo of how one may embed Portal views in a standalone HTML page. (It uses the https://github.com/scicloj/kind-portal adapter to support the https://scicloj.github.io/kindly/ convention, but you may simply remove this part if you are just interested in embedding Portal as-is.) Rendered page: https://scicloj.github.io/kind-portal/demo.html Source script: https://github.com/scicloj/kind-portal/blob/main/examples/standalone_html.clj