Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Jul 5, 2026. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqplot.lisp
More file actions
Latest commit
46 lines (38 loc) · 1.93 KB
/
Copy pathqplot.lisp
File metadata and controls
46 lines (38 loc) · 1.93 KB
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
;;; -*- Mode: LISP; Syntax: Ansi-Common-Lisp; Package: QPLOT -*-
;;; Copyright (c) 2026 Symbolics Pte. Ltd. All rights reserved.
;;; Geometry helpers for common Vega-Lite plot types.
(in-package#:qplot)
(defvar*qplot-debug*nil
"When non-nil, qplot pretty-prints the merged spec before returning the plot object.")
(define-conditionqplot-deprecated-warning (simple-warning)
()
(:documentation"Warning signaled when the deprecated QPLOT constructor compatibility seam is used.")
(:report (lambda (conditionstream)
(declare (ignorecondition))
(formatstream
"QPLOT is deprecated as a constructor entry point; prefer VEGA:MAKE-PLOT / MAKE-PLOT with the high-level data-plus-fragments path for new code."))))
(defvar*qplot-deprecation-warning-issued-p*nil
"Tracks whether the QPLOT deprecation warning has already been signaled.")
(defunqplot (name data &rest layers)
"Deprecated quick plot compatibility wrapper for iterative REPL exploration. Delegates high-level construction to VEGA:MAKE-PLOT and returns the plot object.
EXAMPLE:
(qplot 'cars vgcars
`(:title \"HP vs MPG\")
(scatter-plot :horsepower :miles-per-gallon :filled t)
(labs :x \"Horsepower\" :y \"MPG\"))
Prefer `(vega:make-plot data ...fragments...)` for new high-level construction
code. NAME is passed through to VEGA:MAKE-PLOT as plot metadata. The returned
plot is not registered, displayed, or bound globally. Use PLOT:PLOT explicitly
to display it.
Bind QPLOT::*QPLOT-DEBUG* to T to see the merged spec before the plot object
is returned."
(unless*qplot-deprecation-warning-issued-p*
(setf*qplot-deprecation-warning-issued-p*t)
(warn'qplot-deprecated-warning))
(let* ((spec (apply#'vega:merge-plists
`(:data (:values,data))
layers))
(plot (apply#'vega:make-plot data :name name layers)))
(when*qplot-debug*
(pprint spec))
plot))