Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:demo: don't access internal symbols
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: cf0910f19d9014c745a9b8b6381ad10e8603173f055f083a03b3f5bf3c553f89
User & Date: jack 2024-09-19 06:21:44
Context
2024-09-19
09:26
Update todo check-in: 82393ccdda user: jack tags: master, trunk
06:21
demo: don't access internal symbols check-in: cf0910f19d user: jack tags: master, trunk
06:08
allow for column access in user-supplied function check-in: 88737e42c9 user: jack tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Demo/demo.lisp.

︙︙
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
   :title "Multiple layers"
   :dataset +data/sinus+
   :coords (<coord-cartesian> :ylim (make-range -200 200))
   :aesthetics (list :x "x"
                     :y "y"
                     :ink "ink"
                     :line-style (lambda (raw-point)
                                   (let ((x (i::get-value raw-point "x")))
                                     (make-line-style :thickness (/ (sqrt (abs x)) 3)))))
   :layers (list (<geom-line>)
                 (<geom-point> :aesthetics
                               (list :ink c:+red+
                                     :line-style (make-line-style :thickness 5)))))
  "Three layers illustrating mapping and multiple layers.")

(define-demo-plot *test2*
  (<polyclot> :title "points"
              :dataset +data/series+
              :aesthetics (list :x "x" :y "y" :ink "ink"
                                :line-style (make-line-style :thickness 4
                                                             :cap-shape :round))
              :faceting (i::<faceting-wrap> :var '("ink") :ncol 2)
              :coords (<coord-cartesian>)
              :layers (list (<geom-point>))))

(define-demo-plot *test2/no-facet*
  (<polyclot> :title "points (no facet)"
              :dataset +data/series+
              :aesthetics (list :x "x" :y "y" :ink "ink"







|













|







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
   :title "Multiple layers"
   :dataset +data/sinus+
   :coords (<coord-cartesian> :ylim (make-range -200 200))
   :aesthetics (list :x "x"
                     :y "y"
                     :ink "ink"
                     :line-style (lambda (raw-point)
                                   (let ((x (get-value raw-point "x")))
                                     (make-line-style :thickness (/ (sqrt (abs x)) 3)))))
   :layers (list (<geom-line>)
                 (<geom-point> :aesthetics
                               (list :ink c:+red+
                                     :line-style (make-line-style :thickness 5)))))
  "Three layers illustrating mapping and multiple layers.")

(define-demo-plot *test2*
  (<polyclot> :title "points"
              :dataset +data/series+
              :aesthetics (list :x "x" :y "y" :ink "ink"
                                :line-style (make-line-style :thickness 4
                                                             :cap-shape :round))
              :faceting (<faceting-wrap> :var '("ink") :ncol 2)
              :coords (<coord-cartesian>)
              :layers (list (<geom-point>))))

(define-demo-plot *test2/no-facet*
  (<polyclot> :title "points (no facet)"
              :dataset +data/series+
              :aesthetics (list :x "x" :y "y" :ink "ink"
︙︙
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
         (data1 (list* '("x" "y" "ink") data1)))
    (<polyclot> :title "points/jitter"
                :dataset data1
                :aesthetics (list :x "x" :y "y" :ink "ink"
                                  :line-style (make-line-style :thickness 4))
                :coords (<coord-cartesian> :xlim (make-range -6 6)
                                           :ylim (make-range -6 6))
                :layers (list (<geom-point> :position-adjustment (i::<position-jitter>))))))

(define-demo-plot *test4*
  (<polyclot> :title "bar/discrete-cont"
              :dataset +data/lisps+ :aesthetics '(:x "dialect")
              :coords (<coord-cartesian> :ylim (make-range 0 15))
              :layers (list (<geom-bar>))
              ;; FIXME aes should be filled automatically







|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
         (data1 (list* '("x" "y" "ink") data1)))
    (<polyclot> :title "points/jitter"
                :dataset data1
                :aesthetics (list :x "x" :y "y" :ink "ink"
                                  :line-style (make-line-style :thickness 4))
                :coords (<coord-cartesian> :xlim (make-range -6 6)
                                           :ylim (make-range -6 6))
                :layers (list (<geom-point> :position-adjustment (<position-jitter>))))))

(define-demo-plot *test4*
  (<polyclot> :title "bar/discrete-cont"
              :dataset +data/lisps+ :aesthetics '(:x "dialect")
              :coords (<coord-cartesian> :ylim (make-range 0 15))
              :layers (list (<geom-bar>))
              ;; FIXME aes should be filled automatically
︙︙
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
              :dataset +data/ages+ :aesthetics '(:x "age")
              :coords (<coord-cartesian> :ylim (make-range 0 nil))
              :layers (list (<geom-bar>))
              :scales (list (make-scale :binned :x :bins 5)
                            (make-scale :continuous :y))))

#+ (or)
(i::dohash ((key val) (i::group-by '("sex" "eye") +data/ages+ :test #'equal))
  (format *debug-io* "~a~%----------------------~%" val)
  )



(defgeneric display (frame stream)
  (:method (frame stream)







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
              :dataset +data/ages+ :aesthetics '(:x "age")
              :coords (<coord-cartesian> :ylim (make-range 0 nil))
              :layers (list (<geom-bar>))
              :scales (list (make-scale :binned :x :bins 5)
                            (make-scale :continuous :y))))

#+ (or)
(i::dohash ((key val) (group-by '("sex" "eye") +data/ages+ :test #'equal))
  (format *debug-io* "~a~%----------------------~%" val)
  )



(defgeneric display (frame stream)
  (:method (frame stream)
︙︙