From c2f604c407c1160cbcfff39e97078815bfe41503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 21 May 2024 13:14:43 +0200 Subject: [PATCH 1/2] adopt and document the new apache-arrow date encoding ref. https://github.com/apache/arrow/pull/40960 --- docs/lib/arrow.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/lib/arrow.md b/docs/lib/arrow.md index 312ad0adc..d00b45c03 100644 --- a/docs/lib/arrow.md +++ b/docs/lib/arrow.md @@ -60,6 +60,7 @@ Visualized with [Plot’s difference mark](https://observablehq.com/plot/marks/d ```js echo Plot.plot({ + x: {type: "utc"}, marks: [ Plot.ruleY([0]), Plot.differenceY(table, {x: "date", y: "value"}) @@ -67,6 +68,12 @@ Plot.plot({ }) ``` +
+ +The chart above explicitly specifies _x_ as a UTC scale because, as of [apache-arrow@16.0.0](https://www.npmjs.com/package/apache-arrow/v/16.0.0), dates are represented as Unix timestamps (number of milliseconds since [Epoch]()). + +
+ ## Apache Parquet The [Apache Parquet](https://parquet.apache.org/) format is optimized for storage and transfer. To load a Parquet file — such as this sample of 250,000 stars from the [Gaia Star Catalog](https://observablehq.com/@cmudig/peeking-into-the-gaia-star-catalog) — use [`FileAttachment`](../files). This is implemented using Kyle Barron’s [parquet-wasm](https://kylebarron.dev/parquet-wasm/) library. From cd3aaa00dbe35a355fc4b90a1b1ecec4d3a3e63a Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Tue, 21 May 2024 09:11:26 -0700 Subject: [PATCH 2/2] copy edit --- docs/lib/arrow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lib/arrow.md b/docs/lib/arrow.md index d00b45c03..ef7a31fee 100644 --- a/docs/lib/arrow.md +++ b/docs/lib/arrow.md @@ -70,7 +70,7 @@ Plot.plot({
-The chart above explicitly specifies _x_ as a UTC scale because, as of [apache-arrow@16.0.0](https://www.npmjs.com/package/apache-arrow/v/16.0.0), dates are represented as Unix timestamps (number of milliseconds since [Epoch]()). +The chart above specifies _x_ as a UTC scale because Apache Arrow represents dates as numbers (milliseconds since [Unix epoch]()) rather than Date objects; without this hint, Plot would assume that _date_ column is quantitative rather than temporal and produce a less legible axis.