diff options
author | Arun Isaac | 2021-12-13 14:48:13 +0530 |
---|---|---|
committer | Arun Isaac | 2021-12-13 14:48:13 +0530 |
commit | 50022ec01baadc6f2d1b51e932259fc8dea87650 (patch) | |
tree | bc8e40605ebd66da80fe784047dc3a1c63c54596 | |
parent | a166f61180880971b5b916604a74ee98955bf385 (diff) | |
download | gn-transform-databases-50022ec01baadc6f2d1b51e932259fc8dea87650.tar.gz |
Color table headers by size.
* dump.scm (human-units-color): New function.
(dump-schema): Use human-units-color.
-rwxr-xr-x | dump.scm | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -561,6 +561,13 @@ case-insensitive." ((2) "MiB") (else "GiB"))))) +(define (human-units-color bytes) + "Return the table header color coding for a table of size BYTES." + (let* ((color-scheme "purd4")) + (format #f "/~a/~a" + color-scheme + (1+ (min (floor-log1024 bytes) 3))))) + ;; This wrapper function is necessary to work around bugs in (ccwl ;; graphviz) whereby backslashes in node labels are escaped as \\, and ;; HTML strings are escaped incorrectly. @@ -636,7 +643,8 @@ serialized string." "white")) (label . ,(sxml->graphviz-html `(table (@ (border 0)) - (tr (td (@ (border 1)) + (tr (td (@ (border 1) + (bgcolor ,(human-units-color (table-size table)))) ,(format #f "~a (~a)" (table-name table) (human-units (table-size table))))) |