-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.clj
79 lines (61 loc) · 1.51 KB
/
examples.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(ns examples
(:require [scicloj.kindly.v4.kind :as kind]
[tablecloth.api :as tc]
[scicloj.kind-portal.v1.api :as kind-portal]))
#_(kind-portal/open-if-needed)
4
{:x (range 4)}
(kind/pprint
{:x (range 99)})
(kind/vega-lite
{:$schema "https://vega.github.io/schema/vega-lite/v5.json"
:data {:values [{:a "A" :b 28}
{:a "B" :b 55}
{:a "C" :b 43}
{:a "D" :b 91}
{:a "E" :b 81}
{:a "F" :b 53}
{:a "G" :b 19}
{:a "H" :b 87}
{:a "I" :b 52}]}
:description "A simple bar chart with embedded data."
:encoding {:x {:axis {:labelAngle 0} :field "a" :type "nominal"}
:y {:field "b" :type "quantitative"}}
:mark "bar"})
(kind/hiccup [:h1 "a"])
(defonce image
(-> "https://upload.wikimedia.org/wikipedia/commons/c/c0/Doorway_from_Notre-Dame_at_Reugny_MET_DP132214v2.jpg"
(java.net.URL.)
(javax.imageio.ImageIO/read)))
image
(kind/code
"[{:a '(+ 2 1)}]")
(kind/md
["# abcd
efgh `ijkl`"
"
* a
* b
* c"])
(tc/dataset
{:x [1 2 3]
:y [4 5 6]})
[(kind/hiccup [:h1 "a"])
(tc/dataset
{:x [1 2 3]
:y [4 5 6]})]
(list
(kind/hiccup [:h1 "a"])
(tc/dataset
{:x [1 2 3]
:y [4 5 6]}))
#{(kind/hiccup [:h1 "a"])
(tc/dataset
{:x [1 2 3]
:y [4 5 6]})}
{:x (kind/hiccup [:h1 "y"])
(kind/hiccup [:h1 "y"]) :x}
(kind/table
(tc/dataset {:x [1 2 3]
:y ["A" "B" "C"]}
{:dataset-name "my-dataset"}))