Skip to content

Commit a46e874

Browse files
committed
Update README
1 parent 8c44d97 commit a46e874

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Plot.plot({
392392

393393
[Marks](https://observablehq.com/@data-workflows/plot-marks) visualize data as geometric shapes such as bars, dots, and lines. An single mark can generate multiple shapes: for example, passing a [Plot.barY](#plotbarydata-options) to [Plot.plot](#plotplotoptions) will produce a bar for each element in the associated data. Multiple marks can be layered into [plots](#plotplotoptions).
394394

395-
Mark constructors take two arguments: **data** and **options**. Together, these describe a tabular dataset and how to visualize it. Options that are shared by all of a mark’s generated shapes are known as *constants*, while options that vary with the mark’s data are known as *channels*. Channels are typically bound to [scales](#scale-options) and encode abstract values, such as time or temperature, as visual values, such as position or color.
395+
Mark constructors take two arguments: **data** and **options**. Together these describe a tabular dataset and how to visualize it. Options that are shared by all of a mark’s generated shapes are known as *constants*, while options that vary with the mark’s data are known as *channels*. Channels are typically bound to [scales](#scale-options) and encode abstract values, such as time or temperature, as visual values, such as position or color.
396396

397397
A mark’s data is most commonly an array of objects representing a tabular dataset, such as the result of loading a CSV file, while a mark’s options bind channels (such as *x* and *y*) to columns in the data (such as *units* and *fruit*).
398398

@@ -475,7 +475,7 @@ Insets are specified in pixels. Corner radii are specified in either pixels or p
475475

476476
[<img src="./img/area.png" width="320" height="198" alt="an area chart">](https://observablehq.com/@data-workflows/plot-area)
477477

478-
[Source](./src/marks/area.js) · [Examples](https://observablehq.com/@data-workflows/plot-area) · Draws regions formed by a baseline (*x1*, *y1*) and a topline (*x2*, *y2*), as in an area chart. Often the baseline represents *y* = 0. While not required, typically the *x* and *y* scales are both quantitative.
478+
[Source](./src/marks/area.js) · [Examples](https://observablehq.com/@data-workflows/plot-area) · Draws regions formed by a baseline (*x1*, *y1*) and a topline (*x2*, *y2*) as in an area chart. Often the baseline represents *y* = 0. While not required, typically the *x* and *y* scales are both quantitative.
479479

480480
The following channels are required:
481481

@@ -536,33 +536,37 @@ For the required channels, see [Plot.barX](#plotbarxdata-options) and [Plot.barY
536536
Plot.barX(alphabet, {y: "letter", x: "frequency"})
537537
```
538538

539-
Returns a new horizontal bar with the given *data* and *options*. The following channels are required:
539+
Returns a new horizontal bar↔︎ with the given *data* and *options*. The following channels are required:
540540

541541
* **x1** - the starting horizontal position; bound to the *x* scale
542542
* **x2** - the ending horizontal position; bound to the *x* scale
543543

544+
If neither the **x1** nor **x2** option is specified, a **x** option may be specified as shorthand to apply an implicit [stackX transform](#plotstackxoptions); this is the typical configuration for a horizontal bar chart with bars aligned at *x* = 0. If the **x** option is not specified, it defaults to the identity function.
545+
544546
In addition to the [standard bar channels](#bar), the following optional channels are supported:
545547

546548
* **y** - the vertical position; bound to the *y* scale, which must be a *band* scale
547549

548-
If an **x** option is specified, it is shorthand for the **x2** option with **x1** equal to zero; this is the typical configuration for a horizontal bar chart with bars aligned at *x* = 0. If the **y** channel is not specified, the bar will span the full vertical extent of the plot (or facet).
550+
If the **y** channel is not specified, the bar will span the full vertical extent of the plot (or facet).
549551

550552
#### Plot.barY(*data*, *options*)
551553

552554
```js
553555
Plot.barY(alphabet, {x: "letter", y: "frequency"})
554556
```
555557

556-
Returns a new vertical bar with the given *data* and *options*. The following channels are required:
558+
Returns a new vertical bar↕︎ with the given *data* and *options*. The following channels are required:
557559

558560
* **y1** - the starting vertical position; bound to the *y* scale
559561
* **y2** - the ending vertical position; bound to the *y* scale
560562

563+
If neither the **y1** nor **y2** option is specified, a **y** option may be specified as shorthand to apply an implicit [stackY transform](#plotstackyoptions); this is the typical configuration for a vertical bar chart with bars aligned at *y* = 0. If the **y** option is not specified, it defaults to the identity function.
564+
561565
In addition to the [standard bar channels](#bar), the following optional channels are supported:
562566

563567
* **x** - the horizontal position; bound to the *x* scale, which must be a *band* scale
564568

565-
If a **y** option is specified, it is shorthand for the **y2** option with **y1** equal to zero; this is the typical configuration for a vertical bar chart with bars aligned at *y* = 0. If the **x** channel is not specified, the bar will span the full horizontal extent of the plot (or facet).
569+
If the **x** channel is not specified, the bar will span the full horizontal extent of the plot (or facet).
566570

567571
### Cell
568572

@@ -854,7 +858,7 @@ Equivalent to [Plot.text](#plottextdata-options), except **y** defaults to the i
854858

855859
[<img src="./img/tick.png" width="320" height="198" alt="a barcode plot">](https://observablehq.com/@data-workflows/plot-tick)
856860

857-
[Source](./src/marks/tick.js) · [Examples](https://observablehq.com/@data-workflows/plot-tick) · Draws an orthogonal line at the given horizontal ([Plot.tickX](#plottickxdata-options)) or vertical ([Plot.tickY](#plottickydata-options)) position, with an optional secondary position dimension along a band scale. (If the secondary dimension is quantitative instead of ordinal, use a [rule](#rule).) Ticks are often used to visualize distributions, as in a “barcode” plot.
861+
[Source](./src/marks/tick.js) · [Examples](https://observablehq.com/@data-workflows/plot-tick) · Draws an orthogonal line at the given horizontal ([Plot.tickX](#plottickxdata-options)) or vertical ([Plot.tickY](#plottickydata-options)) position, with an optional secondary position dimension along a band scale. (If the secondary dimension is quantitative instead of ordinal, use a [rule](#rule).) Ticks are often used to visualize distributions as in a “barcode” plot.
858862

859863
For the required channels, see [Plot.tickX](#plottickxdata-options) and [Plot.tickY](#plottickydata-options). The tick mark supports the [standard mark options](#marks), including insets. The **stroke** option defaults to currentColor.
860864

0 commit comments

Comments
 (0)