diff --git a/src/transforms/bin.js b/src/transforms/bin.js
index db0eb485ae..6691dff201 100644
--- a/src/transforms/bin.js
+++ b/src/transforms/bin.js
@@ -27,7 +27,7 @@ export function bin(outputs = {fill: "count"}, options = {}) {
return binn(x, y, null, null, outputs, maybeInsetX(maybeInsetY(options)));
}
-function maybeDenseInterval(bin, k, options) {
+function maybeDenseInterval(bin, k, options = {}) {
return options?.interval == null ? options : bin({[k]: options?.reduce === undefined ? reduceFirst : options.reduce, filter: null}, options);
}
diff --git a/test/output/shorthandArea.svg b/test/output/shorthandArea.svg
new file mode 100644
index 0000000000..df900b135a
--- /dev/null
+++ b/test/output/shorthandArea.svg
@@ -0,0 +1,74 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandAreaY.svg b/test/output/shorthandAreaY.svg
new file mode 100644
index 0000000000..3a9d7705d6
--- /dev/null
+++ b/test/output/shorthandAreaY.svg
@@ -0,0 +1,74 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandBarY.svg b/test/output/shorthandBarY.svg
new file mode 100644
index 0000000000..107b61b2df
--- /dev/null
+++ b/test/output/shorthandBarY.svg
@@ -0,0 +1,209 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandBinRectY.svg b/test/output/shorthandBinRectY.svg
new file mode 100644
index 0000000000..aebb721be0
--- /dev/null
+++ b/test/output/shorthandBinRectY.svg
@@ -0,0 +1,88 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandBoxX.svg b/test/output/shorthandBoxX.svg
new file mode 100644
index 0000000000..c2ac673da5
--- /dev/null
+++ b/test/output/shorthandBoxX.svg
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandCell.svg b/test/output/shorthandCell.svg
new file mode 100644
index 0000000000..4721f7de92
--- /dev/null
+++ b/test/output/shorthandCell.svg
@@ -0,0 +1,77 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandCellX.svg b/test/output/shorthandCellX.svg
new file mode 100644
index 0000000000..e59faec337
--- /dev/null
+++ b/test/output/shorthandCellX.svg
@@ -0,0 +1,180 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandDot.svg b/test/output/shorthandDot.svg
new file mode 100644
index 0000000000..540bd30a92
--- /dev/null
+++ b/test/output/shorthandDot.svg
@@ -0,0 +1,122 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandDotX.svg b/test/output/shorthandDotX.svg
new file mode 100644
index 0000000000..c0c381f7c8
--- /dev/null
+++ b/test/output/shorthandDotX.svg
@@ -0,0 +1,75 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandGroupBarY.svg b/test/output/shorthandGroupBarY.svg
new file mode 100644
index 0000000000..eb0b9d5a3b
--- /dev/null
+++ b/test/output/shorthandGroupBarY.svg
@@ -0,0 +1,62 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandLine.svg b/test/output/shorthandLine.svg
new file mode 100644
index 0000000000..e26914f283
--- /dev/null
+++ b/test/output/shorthandLine.svg
@@ -0,0 +1,83 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandLineY.svg b/test/output/shorthandLineY.svg
new file mode 100644
index 0000000000..6ed32217c2
--- /dev/null
+++ b/test/output/shorthandLineY.svg
@@ -0,0 +1,83 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandRectY.svg b/test/output/shorthandRectY.svg
new file mode 100644
index 0000000000..0a9be353d5
--- /dev/null
+++ b/test/output/shorthandRectY.svg
@@ -0,0 +1,116 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandRuleX.svg b/test/output/shorthandRuleX.svg
new file mode 100644
index 0000000000..5313fac52f
--- /dev/null
+++ b/test/output/shorthandRuleX.svg
@@ -0,0 +1,75 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandText.svg b/test/output/shorthandText.svg
new file mode 100644
index 0000000000..297548d1fc
--- /dev/null
+++ b/test/output/shorthandText.svg
@@ -0,0 +1,81 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandTextX.svg b/test/output/shorthandTextX.svg
new file mode 100644
index 0000000000..1b4a802332
--- /dev/null
+++ b/test/output/shorthandTextX.svg
@@ -0,0 +1,34 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandTickX.svg b/test/output/shorthandTickX.svg
new file mode 100644
index 0000000000..bad4c4b32a
--- /dev/null
+++ b/test/output/shorthandTickX.svg
@@ -0,0 +1,75 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandVector.svg b/test/output/shorthandVector.svg
new file mode 100644
index 0000000000..cdda4f9eab
--- /dev/null
+++ b/test/output/shorthandVector.svg
@@ -0,0 +1,122 @@
+
\ No newline at end of file
diff --git a/test/output/shorthandVectorX.svg b/test/output/shorthandVectorX.svg
new file mode 100644
index 0000000000..dc281fd9e1
--- /dev/null
+++ b/test/output/shorthandVectorX.svg
@@ -0,0 +1,75 @@
+
\ No newline at end of file
diff --git a/test/plots/index.js b/test/plots/index.js
index 47d0089d9a..693cd10825 100644
--- a/test/plots/index.js
+++ b/test/plots/index.js
@@ -133,6 +133,25 @@ export {default as seattleTemperatureCell} from "./seattle-temperature-cell.js";
export {default as sfCovidDeaths} from "./sf-covid-deaths.js";
export {default as sfTemperatureBand} from "./sf-temperature-band.js";
export {default as sfTemperatureBandArea} from "./sf-temperature-band-area.js";
+export {default as shorthandArea} from "./shorthand-area.js";
+export {default as shorthandAreaY} from "./shorthand-areaY.js";
+export {default as shorthandBarY} from "./shorthand-barY.js";
+export {default as shorthandBinRectY} from "./shorthand-binRectY.js";
+export {default as shorthandBoxX} from "./shorthand-boxX.js";
+export {default as shorthandCell} from "./shorthand-cell.js";
+export {default as shorthandCellX} from "./shorthand-cellX.js";
+export {default as shorthandDot} from "./shorthand-dot.js";
+export {default as shorthandDotX} from "./shorthand-dotX.js";
+export {default as shorthandGroupBarY} from "./shorthand-groupBarY.js";
+export {default as shorthandLine} from "./shorthand-line.js";
+export {default as shorthandLineY} from "./shorthand-lineY.js";
+export {default as shorthandRectY} from "./shorthand-rectY.js";
+export {default as shorthandRuleX} from "./shorthand-ruleX.js";
+export {default as shorthandText} from "./shorthand-text.js";
+export {default as shorthandTextX} from "./shorthand-textX.js";
+export {default as shorthandTickX} from "./shorthand-tickX.js";
+export {default as shorthandVector} from "./shorthand-vector.js";
+export {default as shorthandVectorX} from "./shorthand-vectorX.js";
export {default as simpsonsRatings} from "./simpsons-ratings.js";
export {default as simpsonsRatingsDots} from "./simpsons-ratings-dots.js";
export {default as simpsonsViews} from "./simpsons-views.js";
diff --git a/test/plots/shorthand-area.js b/test/plots/shorthand-area.js
new file mode 100644
index 0000000000..a54245eaec
--- /dev/null
+++ b/test/plots/shorthand-area.js
@@ -0,0 +1,47 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const timeSeries = [
+ [new Date("2018-01-02"), 170.160004],
+ [new Date("2018-01-03"), 172.529999],
+ [new Date("2018-01-04"), 172.539993],
+ [new Date("2018-01-05"), 173.440002],
+ [new Date("2018-01-08"), 174.350006],
+ [new Date("2018-01-09"), 174.550003],
+ [new Date("2018-01-10"), 173.160004],
+ [new Date("2018-01-11"), 174.589996],
+ [new Date("2018-01-12"), 176.179993],
+ [new Date("2018-01-16"), 177.899994],
+ [new Date("2018-01-17"), 176.149994],
+ [new Date("2018-01-18"), 179.369995],
+ [new Date("2018-01-19"), 178.610001],
+ [new Date("2018-01-22"), 177.300003],
+ [new Date("2018-01-23"), 177.300003],
+ [new Date("2018-01-24"), 177.250000],
+ [new Date("2018-01-25"), 174.509995],
+ [new Date("2018-01-26"), 172.000000],
+ [new Date("2018-01-29"), 170.160004],
+ [new Date("2018-01-30"), 165.529999],
+ [new Date("2018-01-31"), 166.869995],
+ [new Date("2018-02-01"), 167.169998],
+ [new Date("2018-02-02"), 166.000000],
+ [new Date("2018-02-05"), 159.100006],
+ [new Date("2018-02-06"), 154.830002],
+ [new Date("2018-02-07"), 163.089996],
+ [new Date("2018-02-08"), 160.289993],
+ [new Date("2018-02-09"), 157.070007],
+ [new Date("2018-02-12"), 158.500000],
+ [new Date("2018-02-13"), 161.949997],
+ [new Date("2018-02-14"), 163.039993],
+ [new Date("2018-02-15"), 169.789993],
+ [new Date("2018-02-16"), 172.360001],
+ [new Date("2018-02-20"), 172.050003],
+ [new Date("2018-02-21"), 172.830002],
+ [new Date("2018-02-22"), 171.800003],
+ [new Date("2018-02-23"), 173.669998],
+ [new Date("2018-02-26"), 176.350006],
+ [new Date("2018-02-27"), 179.100006],
+ [new Date("2018-02-28"), 179.259995]
+ ];
+ return Plot.area(timeSeries).plot();
+}
diff --git a/test/plots/shorthand-areaY.js b/test/plots/shorthand-areaY.js
new file mode 100644
index 0000000000..b5bd7e55e8
--- /dev/null
+++ b/test/plots/shorthand-areaY.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.areaY(numbers).plot();
+}
diff --git a/test/plots/shorthand-barY.js b/test/plots/shorthand-barY.js
new file mode 100644
index 0000000000..7edfa5e4d1
--- /dev/null
+++ b/test/plots/shorthand-barY.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.barY(numbers).plot();
+}
diff --git a/test/plots/shorthand-binRectY.js b/test/plots/shorthand-binRectY.js
new file mode 100644
index 0000000000..5ea3e87bb8
--- /dev/null
+++ b/test/plots/shorthand-binRectY.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.rectY(numbers, Plot.binX()).plot();
+}
diff --git a/test/plots/shorthand-boxX.js b/test/plots/shorthand-boxX.js
new file mode 100644
index 0000000000..4e7d90d3bd
--- /dev/null
+++ b/test/plots/shorthand-boxX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.boxX(numbers).plot();
+}
diff --git a/test/plots/shorthand-cell.js b/test/plots/shorthand-cell.js
new file mode 100644
index 0000000000..a88a0d8555
--- /dev/null
+++ b/test/plots/shorthand-cell.js
@@ -0,0 +1,20 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const matrix = [
+ ["Jacob", "Olivia"],
+ ["Mia", "Noah"],
+ ["Noah", "Ava"],
+ ["Ava", "Mason"],
+ ["Olivia", "Noah"],
+ ["Jacob", "Emma"],
+ ["Ava", "Noah"],
+ ["Noah", "Jacob"],
+ ["Olivia", "Ava"],
+ ["Mason", "Emma"],
+ ["Jacob", "Mia"],
+ ["Mia", "Jacob"],
+ ["Emma", "Jacob"]
+ ];
+ return Plot.cell(matrix).plot();
+}
diff --git a/test/plots/shorthand-cellX.js b/test/plots/shorthand-cellX.js
new file mode 100644
index 0000000000..983a1cc1c2
--- /dev/null
+++ b/test/plots/shorthand-cellX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.cellX(numbers).plot();
+}
diff --git a/test/plots/shorthand-dot.js b/test/plots/shorthand-dot.js
new file mode 100644
index 0000000000..0dca393818
--- /dev/null
+++ b/test/plots/shorthand-dot.js
@@ -0,0 +1,47 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const timeSeries = [
+ [new Date("2018-01-02"), 170.160004],
+ [new Date("2018-01-03"), 172.529999],
+ [new Date("2018-01-04"), 172.539993],
+ [new Date("2018-01-05"), 173.440002],
+ [new Date("2018-01-08"), 174.350006],
+ [new Date("2018-01-09"), 174.550003],
+ [new Date("2018-01-10"), 173.160004],
+ [new Date("2018-01-11"), 174.589996],
+ [new Date("2018-01-12"), 176.179993],
+ [new Date("2018-01-16"), 177.899994],
+ [new Date("2018-01-17"), 176.149994],
+ [new Date("2018-01-18"), 179.369995],
+ [new Date("2018-01-19"), 178.610001],
+ [new Date("2018-01-22"), 177.300003],
+ [new Date("2018-01-23"), 177.300003],
+ [new Date("2018-01-24"), 177.250000],
+ [new Date("2018-01-25"), 174.509995],
+ [new Date("2018-01-26"), 172.000000],
+ [new Date("2018-01-29"), 170.160004],
+ [new Date("2018-01-30"), 165.529999],
+ [new Date("2018-01-31"), 166.869995],
+ [new Date("2018-02-01"), 167.169998],
+ [new Date("2018-02-02"), 166.000000],
+ [new Date("2018-02-05"), 159.100006],
+ [new Date("2018-02-06"), 154.830002],
+ [new Date("2018-02-07"), 163.089996],
+ [new Date("2018-02-08"), 160.289993],
+ [new Date("2018-02-09"), 157.070007],
+ [new Date("2018-02-12"), 158.500000],
+ [new Date("2018-02-13"), 161.949997],
+ [new Date("2018-02-14"), 163.039993],
+ [new Date("2018-02-15"), 169.789993],
+ [new Date("2018-02-16"), 172.360001],
+ [new Date("2018-02-20"), 172.050003],
+ [new Date("2018-02-21"), 172.830002],
+ [new Date("2018-02-22"), 171.800003],
+ [new Date("2018-02-23"), 173.669998],
+ [new Date("2018-02-26"), 176.350006],
+ [new Date("2018-02-27"), 179.100006],
+ [new Date("2018-02-28"), 179.259995]
+ ];
+ return Plot.dot(timeSeries).plot();
+}
diff --git a/test/plots/shorthand-dotX.js b/test/plots/shorthand-dotX.js
new file mode 100644
index 0000000000..427027fa9d
--- /dev/null
+++ b/test/plots/shorthand-dotX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.dotX(numbers).plot();
+}
diff --git a/test/plots/shorthand-groupBarY.js b/test/plots/shorthand-groupBarY.js
new file mode 100644
index 0000000000..a93fe01077
--- /dev/null
+++ b/test/plots/shorthand-groupBarY.js
@@ -0,0 +1,6 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const gene = "AAAAGAGTGAAGATGCTGGAGACGAGTGAAGCATTCACTTTAGGGAAAGCGAGGCAAGAGCGTTTCAGAAGACGAAACCTGGTAGGTGCACTCACCACAG";
+ return Plot.barY(gene, Plot.groupX()).plot();
+}
diff --git a/test/plots/shorthand-line.js b/test/plots/shorthand-line.js
new file mode 100644
index 0000000000..a3526b01b8
--- /dev/null
+++ b/test/plots/shorthand-line.js
@@ -0,0 +1,47 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const timeSeries = [
+ [new Date("2018-01-02"), 170.160004],
+ [new Date("2018-01-03"), 172.529999],
+ [new Date("2018-01-04"), 172.539993],
+ [new Date("2018-01-05"), 173.440002],
+ [new Date("2018-01-08"), 174.350006],
+ [new Date("2018-01-09"), 174.550003],
+ [new Date("2018-01-10"), 173.160004],
+ [new Date("2018-01-11"), 174.589996],
+ [new Date("2018-01-12"), 176.179993],
+ [new Date("2018-01-16"), 177.899994],
+ [new Date("2018-01-17"), 176.149994],
+ [new Date("2018-01-18"), 179.369995],
+ [new Date("2018-01-19"), 178.610001],
+ [new Date("2018-01-22"), 177.300003],
+ [new Date("2018-01-23"), 177.300003],
+ [new Date("2018-01-24"), 177.250000],
+ [new Date("2018-01-25"), 174.509995],
+ [new Date("2018-01-26"), 172.000000],
+ [new Date("2018-01-29"), 170.160004],
+ [new Date("2018-01-30"), 165.529999],
+ [new Date("2018-01-31"), 166.869995],
+ [new Date("2018-02-01"), 167.169998],
+ [new Date("2018-02-02"), 166.000000],
+ [new Date("2018-02-05"), 159.100006],
+ [new Date("2018-02-06"), 154.830002],
+ [new Date("2018-02-07"), 163.089996],
+ [new Date("2018-02-08"), 160.289993],
+ [new Date("2018-02-09"), 157.070007],
+ [new Date("2018-02-12"), 158.500000],
+ [new Date("2018-02-13"), 161.949997],
+ [new Date("2018-02-14"), 163.039993],
+ [new Date("2018-02-15"), 169.789993],
+ [new Date("2018-02-16"), 172.360001],
+ [new Date("2018-02-20"), 172.050003],
+ [new Date("2018-02-21"), 172.830002],
+ [new Date("2018-02-22"), 171.800003],
+ [new Date("2018-02-23"), 173.669998],
+ [new Date("2018-02-26"), 176.350006],
+ [new Date("2018-02-27"), 179.100006],
+ [new Date("2018-02-28"), 179.259995]
+ ];
+ return Plot.line(timeSeries).plot();
+}
diff --git a/test/plots/shorthand-lineY.js b/test/plots/shorthand-lineY.js
new file mode 100644
index 0000000000..822752439f
--- /dev/null
+++ b/test/plots/shorthand-lineY.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.lineY(numbers).plot();
+}
diff --git a/test/plots/shorthand-rectY.js b/test/plots/shorthand-rectY.js
new file mode 100644
index 0000000000..9e803d2113
--- /dev/null
+++ b/test/plots/shorthand-rectY.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.rectY(numbers).plot();
+}
diff --git a/test/plots/shorthand-ruleX.js b/test/plots/shorthand-ruleX.js
new file mode 100644
index 0000000000..f8234f61b0
--- /dev/null
+++ b/test/plots/shorthand-ruleX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.ruleX(numbers).plot();
+}
diff --git a/test/plots/shorthand-text.js b/test/plots/shorthand-text.js
new file mode 100644
index 0000000000..a8971c3075
--- /dev/null
+++ b/test/plots/shorthand-text.js
@@ -0,0 +1,47 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const timeSeries = [
+ [new Date("2018-01-02"), 170.160004],
+ [new Date("2018-01-03"), 172.529999],
+ [new Date("2018-01-04"), 172.539993],
+ [new Date("2018-01-05"), 173.440002],
+ [new Date("2018-01-08"), 174.350006],
+ [new Date("2018-01-09"), 174.550003],
+ [new Date("2018-01-10"), 173.160004],
+ [new Date("2018-01-11"), 174.589996],
+ [new Date("2018-01-12"), 176.179993],
+ [new Date("2018-01-16"), 177.899994],
+ [new Date("2018-01-17"), 176.149994],
+ [new Date("2018-01-18"), 179.369995],
+ [new Date("2018-01-19"), 178.610001],
+ [new Date("2018-01-22"), 177.300003],
+ [new Date("2018-01-23"), 177.300003],
+ [new Date("2018-01-24"), 177.250000],
+ [new Date("2018-01-25"), 174.509995],
+ [new Date("2018-01-26"), 172.000000],
+ [new Date("2018-01-29"), 170.160004],
+ [new Date("2018-01-30"), 165.529999],
+ [new Date("2018-01-31"), 166.869995],
+ [new Date("2018-02-01"), 167.169998],
+ [new Date("2018-02-02"), 166.000000],
+ [new Date("2018-02-05"), 159.100006],
+ [new Date("2018-02-06"), 154.830002],
+ [new Date("2018-02-07"), 163.089996],
+ [new Date("2018-02-08"), 160.289993],
+ [new Date("2018-02-09"), 157.070007],
+ [new Date("2018-02-12"), 158.500000],
+ [new Date("2018-02-13"), 161.949997],
+ [new Date("2018-02-14"), 163.039993],
+ [new Date("2018-02-15"), 169.789993],
+ [new Date("2018-02-16"), 172.360001],
+ [new Date("2018-02-20"), 172.050003],
+ [new Date("2018-02-21"), 172.830002],
+ [new Date("2018-02-22"), 171.800003],
+ [new Date("2018-02-23"), 173.669998],
+ [new Date("2018-02-26"), 176.350006],
+ [new Date("2018-02-27"), 179.100006],
+ [new Date("2018-02-28"), 179.259995]
+ ];
+ return Plot.text(timeSeries).plot();
+}
diff --git a/test/plots/shorthand-textX.js b/test/plots/shorthand-textX.js
new file mode 100644
index 0000000000..055be4a586
--- /dev/null
+++ b/test/plots/shorthand-textX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.textX(numbers).plot();
+}
diff --git a/test/plots/shorthand-tickX.js b/test/plots/shorthand-tickX.js
new file mode 100644
index 0000000000..23a9894281
--- /dev/null
+++ b/test/plots/shorthand-tickX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.tickX(numbers).plot();
+}
diff --git a/test/plots/shorthand-vector.js b/test/plots/shorthand-vector.js
new file mode 100644
index 0000000000..6068db0622
--- /dev/null
+++ b/test/plots/shorthand-vector.js
@@ -0,0 +1,47 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const timeSeries = [
+ [new Date("2018-01-02"), 170.160004],
+ [new Date("2018-01-03"), 172.529999],
+ [new Date("2018-01-04"), 172.539993],
+ [new Date("2018-01-05"), 173.440002],
+ [new Date("2018-01-08"), 174.350006],
+ [new Date("2018-01-09"), 174.550003],
+ [new Date("2018-01-10"), 173.160004],
+ [new Date("2018-01-11"), 174.589996],
+ [new Date("2018-01-12"), 176.179993],
+ [new Date("2018-01-16"), 177.899994],
+ [new Date("2018-01-17"), 176.149994],
+ [new Date("2018-01-18"), 179.369995],
+ [new Date("2018-01-19"), 178.610001],
+ [new Date("2018-01-22"), 177.300003],
+ [new Date("2018-01-23"), 177.300003],
+ [new Date("2018-01-24"), 177.250000],
+ [new Date("2018-01-25"), 174.509995],
+ [new Date("2018-01-26"), 172.000000],
+ [new Date("2018-01-29"), 170.160004],
+ [new Date("2018-01-30"), 165.529999],
+ [new Date("2018-01-31"), 166.869995],
+ [new Date("2018-02-01"), 167.169998],
+ [new Date("2018-02-02"), 166.000000],
+ [new Date("2018-02-05"), 159.100006],
+ [new Date("2018-02-06"), 154.830002],
+ [new Date("2018-02-07"), 163.089996],
+ [new Date("2018-02-08"), 160.289993],
+ [new Date("2018-02-09"), 157.070007],
+ [new Date("2018-02-12"), 158.500000],
+ [new Date("2018-02-13"), 161.949997],
+ [new Date("2018-02-14"), 163.039993],
+ [new Date("2018-02-15"), 169.789993],
+ [new Date("2018-02-16"), 172.360001],
+ [new Date("2018-02-20"), 172.050003],
+ [new Date("2018-02-21"), 172.830002],
+ [new Date("2018-02-22"), 171.800003],
+ [new Date("2018-02-23"), 173.669998],
+ [new Date("2018-02-26"), 176.350006],
+ [new Date("2018-02-27"), 179.100006],
+ [new Date("2018-02-28"), 179.259995]
+ ];
+ return Plot.vector(timeSeries).plot();
+}
diff --git a/test/plots/shorthand-vectorX.js b/test/plots/shorthand-vectorX.js
new file mode 100644
index 0000000000..eba73a548f
--- /dev/null
+++ b/test/plots/shorthand-vectorX.js
@@ -0,0 +1,11 @@
+import * as Plot from "@observablehq/plot";
+
+export default async function() {
+ const numbers = [
+ 170.16, 172.53, 172.54, 173.44, 174.35, 174.55, 173.16, 174.59, 176.18, 177.90,
+ 176.15, 179.37, 178.61, 177.30, 177.30, 177.25, 174.51, 172.00, 170.16, 165.53,
+ 166.87, 167.17, 166.00, 159.10, 154.83, 163.09, 160.29, 157.07, 158.50, 161.95,
+ 163.04, 169.79, 172.36, 172.05, 172.83, 171.80, 173.67, 176.35, 179.10, 179.26
+ ];
+ return Plot.vectorX(numbers).plot();
+}