Clojure Oz Enviroment

{:deps
 {org.clojure/clojure {:mvn/version "1.10.0"}
  metasoarous/oz {:mvn/version "1.5.6"}}}
deps.edn
Extensible Data Notation

You can add dependencies by modifying the deps.edn above (requires a runtime restart)...

(require '[oz.core :as oz])
(require '[oz.core :as oz])

(defn play-data [& names]
  (for [n names
        i (range 20)]
    {:time i :item n :quantity (+ (Math/pow (* i (count n)) 0.8) 
                                  (rand-int (count n)))}))
user/play-data
(def line-plot
  {:data {:values (play-data "monkey" "slipper" "broom")}
   :encoding {:x {:field "time"}
              :y {:field "quantity"}
              :color {:field "item" :type "nominal"}}
   :mark "line"})

{:kind "iframe" :value (oz/html line-plot)}
2{:kind"iframe":value"<html><head><meta charset="UTF-8" /><meta content="width=device-width, initial-scale=1" name="viewport" /><link href="https://ozviz.io/oz.svg" rel="shortcut icon" type="image/x-icon" /><link href="http://ozviz.io/css/style.css" rel="stylesheet" type="text/css" /><link href="http://ozviz.io/fonts/lmroman12-regular.woff" rel="stylesheet" /><link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" /><script src="https://cdn.jsdelivr.net/npm/vega@4.4.0" type="text/javascript"></script><script src="https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc11" type="text/javascript"></script><script src="https://cdn.jsdelivr.net/npm/vega-embed@3.28.0" type="text/javascript"></script></head><body><div><div id="viz-c47de287-f61b-4fb0-9df2-869cee89209f"></div><script type="text/javascript">vegaEmbed('#viz-c47de287-f61b-4fb0-9df2-869cee89209f', {"data":{"values":[{"time":0,"item":"monkey","quantity":0.0},{"time":1,"item":"monkey","quantity":5.192962712629476},{"time":2,"item":"monkey","quantity":7.30037210271847},{"time":3,"item":"monkey","quantity":12.097596309015797},{"time":4,"item":"monkey","quantity":15.71068609258575},{"time":5,"item":"monkey","quantity":18.194870523363548},{"time":6,"item":"monkey","quantity":20.580936309501134},{"time":7,"item":"monkey","quantity":21.888381054913122},{"time":8,"item":"monkey","quantity":25.13058987556147},{"time":9,"item":"monkey","quantity":27.317280693371046},{"time":10,"item":"monkey","quantity":31.45580618665162},{"time":11,"item":"monkey","quantity":33.55190884598056},{"time":12,"item":"monkey","quantity":33.610188015018984},{"time":13,"item":"monkey","quantity":32.63440373999379},{"time":14,"item":"monkey","quantity":38.62768266080517},{"time":15,"item":"monkey","quantity":39.59266228400805},{"time":16,"item":"monkey","quantity":42.53159496449108},{"time":17,"item":"monkey","quantity":42.44642466614132},{"time":18,"item":"monkey","quantity":45.338844810888254},{"time":19,"item":"monkey","quantity":47.21034266761982},{"time":0,"item":"slipper","quantity":0.0},{"time":1,"item":"slipper","quantity":8.743276393803367},{"time":2,"item":"slipper","quantity":8.258523872989459},{"time":3,"item":"slipper","quantity":13.42287530066645},{"time":4,"item":"slipper","quantity":16.378925219250924},{"time":5,"item":"slipper","quantity":23.189151347155786},{"time":6,"item":"slipper","quantity":23.888381054913122},{"time":7,"item":"slipper","quantity":27.498670948012276},{"time":8,"item":"slipper","quantity":31.03516289842348},{"time":9,"item":"slipper","quantity":32.50885027594805},{"time":10,"item":"slipper","quantity":30.928050775697603},{"time":11,"item":"slipper","quantity":36.299260572778856},{"time":12,"item":"slipper","quantity":39.62768266080517},{"time":13,"item":"slipper","quantity":42.9175705807045},{"time":14,"item":"slipper","quantity":41.17246133441246},{"time":15,"item":"slipper","quantity":45.39533859324643},{"time":16,"item":"slipper","quantity":48.58875032686557},{"time":17,"item":"slipper","quantity":51.75489563854074},{"time":18,"item":"slipper","quantity":51.89569020671064},{"time":19,"item":"slipper","quantity":50.012816499808885},{"time":0,"item":"broom","quantity":0.0},{"time":1,"item":"broom","quantity":5.623898318388478},{"time":2,"item":"broom","quantity":8.309573444801934},{"time":3,"item":"broom","quantity":11.727161387290321},{"time":4,"item":"broom","quantity":14.98560543306118},{"time":5,"item":"broom","quantity":16.132639022018836},{"time":6,"item":"broom","quantity":19.194870523363548},{"time":7,"item":"broom","quantity":21.189151347155786},{"time":8,"item":"broom","quantity":23.127049995800743},{"time":9,"item":"broom","quantity":24.016965485301043},{"time":10,"item":"broom","quantity":22.86525259636632},{"time":11,"item":"broom","quantity":26.676874454922782},{"time":12,"item":"broom","quantity":30.45580618665162},{"time":13,"item":"broom","quantity":32.20529752834578},{"time":14,"item":"broom","quantity":33.9280507756976},{"time":15,"item":"broom","quantity":32.62634547570625},{"time":16,"item":"broom","quantity":34.30212829607493},{"time":17,"item":"broom","quantity":37.95707936800063},{"time":18,"item":"broom","quantity":38.59266228400805},{"time":19,"item":"broom","quantity":42.210162462449645}]},"encoding":{"x":{"field":"time"},"y":{"field":"quantity"},"color":{"field":"item","type":"nominal"}},"mark":"line"}, {"mode":"vega-lite"});</script></div><div class="vg-tooltip" id="vis-tooltip"></div></body></html>"}