From 548973ef194aa710e476d03ac8b8bdab19242eca Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 6 Nov 2022 08:45:04 -0500 Subject: color by status --- emacsconf-schedule.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'emacsconf-schedule.el') diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el index b8c3892..2f9a029 100644 --- a/emacsconf-schedule.el +++ b/emacsconf-schedule.el @@ -338,6 +338,12 @@ Each function should take the info and manipulate it as needed, returning the ne (when track (dom-set-attribute node 'fill (plist-get track :color))))) +(defun emacsconf-schedule-svg-color-by-availability (o node &optional parent) + (dom-set-attribute node 'fill + (if (string-match "^[><]" (plist-get o :availability)) + "gray" + "green"))) + (defun emacsconf-schedule-svg (width height &optional info) (setq info (or info (emacsconf-get-talk-info))) (let ((days (seq-group-by (lambda (o) @@ -358,6 +364,21 @@ Each function should take the info and manipulate it as needed, returning the ne :tracks (emacsconf-by-track (cdr o))))) days)))) +(defun emacsconf-schedule-svg-color-by-status (o node &optional parent) + (dom-set-attribute node 'fill + (pcase (plist-get o :status) + ((rx (or "TO_PROCESS" + "PROCESSING" + "TO_AUTOCAP")) + "lightyellow") + ((rx (or "TO_ASSIGN")) + "yellow") + ((rx (or "TO_CAPTION")) + "lightgreen") + ((rx (or "TO_STREAM")) + "green") + (t "gray")))) + (defun emacsconf-schedule-svg-days (width height days) (let ((svg (svg-create width height :background "white")) (day-height (/ height (length days))) -- cgit v1.2.3