Skip to content

Commit d2afa58

Browse files
authored
better interval examples (#2150)
1 parent 4e9e0e9 commit d2afa58

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

docs/transforms/interval.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ There’s also an [**interval** scale option](../features/scales.md#scale-transf
1414

1515
The **interval transform** turns a quantitative or temporal *value* into a continuous extent [*start*, *stop*]. For example, if *value* is an instant in time, the interval transform could return a *start* of UTC midnight and a *stop* of the UTC midnight the following day.
1616

17-
The interval transform is often used for time-series bar charts. For example, consider the chart below of the daily trade volume of Apple stock. Because of the [barY mark](../marks/bar.md), the *x* scale is ordinal (*band*). And because the regularity of the data is not specified (*i.e.*, because Plot has no way of knowing that this is daily data), every distinct value must have its own label, leading to crowding. If a day were missing data, it would be difficult to spot! 👓
17+
The interval transform is often used for time-series bar charts. For example, consider the chart below of the daily trade volume of Apple stock. Because of the [barY mark](../marks/bar.md), the *x* scale is ordinal (*band*). And because the regularity of the data is not specified (*i.e.*, because Plot has no way of knowing that this is daily data), every distinct value must have its own label, leading to crowding. If a day were missing data, it would be difficult to spot! 👓
1818

1919
:::plot https://observablehq.com/@observablehq/plot-band-scale-interval
2020
```js
2121
Plot.plot({
2222
marginBottom: 80,
23-
x: {
24-
type: "band", // ⚠️ not utc
25-
tickRotate: -90,
26-
fontVariant: "tabular-nums",
27-
label: null
28-
},
23+
x: {type: "band"}, // ⚠️ not utc
2924
y: {
3025
transform: (d) => d / 1e6,
3126
label: "Daily trade volume (millions)"
@@ -66,12 +61,7 @@ The meaning of the **interval** mark option depends on the associated mark, such
6661
```js
6762
Plot.plot({
6863
marginBottom: 80,
69-
x: {
70-
type: "band", // ⚠️ not utc
71-
tickRotate: -90,
72-
label: null,
73-
fontVariant: "tabular-nums"
74-
},
64+
x: {type: "band"}, // ⚠️ not utc
7565
y: {
7666
grid: true,
7767
transform: (d) => d / 1e6,

0 commit comments

Comments
 (0)