Fork me on GitHub
#portal
<
2023-01-16
>
Alan Birchenough22:01:28

Apologies in advance if this is a daft question, but I am trying to render a simple vega-lite chart in a REPL context, i.e., I don’t need to output it anywhere, just eyeball it. I note that there is a vega-lite viewer in portal, but I can’t find any instruction on how to use it. I have found that, if I tap a vega-lite JSON spec as a string, the portal vega-lite viewer is available, but if I convert this to EDN, it is not available, no matter whether the EDN has been read in via edn/read-string, or slimply slurped into a string. To render the Clojure form of the spec I have downloaded Oz, but I’m still curious about whether I should have been able to do this with portal. Any thoughts?

djblue22:01:34

The vega-lite spec looks like:

(s/def ::name string?)
(s/def ::description string?)
(s/def ::$schema
  (s/and string? #(re-matches #"\.github\.io/schema/vega-lite/v\d\.json" %)))

(s/def ::vega-lite
  (s/keys :req-un [::data]
          :opt-un [::name ::description ::$schema]))
This might be the missing piece :thinking_face:

Alan Birchenough22:01:19

Many thanks for the insight! I will check what I am tapping against that spec.