You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-14Lines changed: 36 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -462,7 +462,7 @@ In addition to the [standard style options](#marks), the area mark supports the
462
462
463
463
#### Plot.area(*data*, *options*)
464
464
465
-
Plot.area is rarely used directly; it is only needed when the baseline and topline have neither common *x* nor *y* values. [Plot.areaY](#plotareaydata-options) is used in the common horizontal orientation where the baseline and topline share *x* values, while [Plot.areaX](#plotareaxdata-options) is used in the vertical orientation where the baseline and topline share *y* values.
465
+
Returns a new area with the given *data* and *options*. Plot.area is rarely used directly; it is only needed when the baseline and topline have neither common *x* nor *y* values. [Plot.areaY](#plotareaydata-options) is used in the common horizontal orientation where the baseline and topline share *x* values, while [Plot.areaX](#plotareaxdata-options) is used in the vertical orientation where the baseline and topline share *y* values.
466
466
467
467
#### Plot.areaX(*data*, *options*)
468
468
@@ -508,7 +508,7 @@ Insets are typically used to ensure a one-pixel gap between adjacent bars; note
508
508
509
509
#### Plot.barX(*data*, *options*)
510
510
511
-
The following channels are required:
511
+
Returns a new horizontal bar with the given *data* and *options*. The following channels are required:
512
512
513
513
***x1** - the starting horizontal position; bound to the *x* scale
514
514
***x2** - the ending horizontal position; bound to the *x* scale
@@ -521,7 +521,7 @@ If an **x** option is specified, it is shorthand for the **x2** option with **x1
521
521
522
522
#### Plot.barY(*data*, *options*)
523
523
524
-
The following channels are required:
524
+
Returns a new vertical bar with the given *data* and *options*. The following channels are required:
525
525
526
526
***y1** - the starting vertical position; bound to the *y* scale
527
527
***y2** - the ending vertical position; bound to the *y* scale
@@ -570,15 +570,15 @@ Insets are typically used to ensure a one-pixel gap between adjacent cells; note
570
570
571
571
#### Plot.cell(*data*, *options*)
572
572
573
-
If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
573
+
Returns a new cell with the given *data* and *options*. If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
574
574
575
575
#### Plot.cellX(*data*, *options*)
576
576
577
-
If the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …].
577
+
Equivalent to Plot.cell, except that if the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …].
578
578
579
579
#### Plot.cellY(*data*, *options*)
580
580
581
-
If the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …].
581
+
Equivalent to Plot.cell, except that if the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …].
582
582
583
583
### Dot
584
584
@@ -608,15 +608,15 @@ TODO Describe how missing or invalid data is handled. Dots with a nonpositive ra
608
608
609
609
#### Plot.dot(*data*, *options*)
610
610
611
-
If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
611
+
Returns a new dot with the given *data* and *options. If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
612
612
613
613
#### Plot.dotX(*data*, *options*)
614
614
615
-
If the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …].
615
+
Equivalent to Plot.dot except that if the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …].
616
616
617
617
#### Plot.dotY(*data*, *options*)
618
618
619
-
If the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …].
619
+
Equivalent to Plot.dot except that if the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …].
620
620
621
621
### Line
622
622
@@ -648,25 +648,47 @@ In addition to the [standard style options](#marks), the line mark supports the
648
648
649
649
#### Plot.line(*data*, *options*)
650
650
651
-
If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
651
+
Returns a new line with the given *data* and *options*. If both the **x** and **y** options are not specified, *data* is assumed to be an array of pairs [[*x₀*, *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …] such that **x** = [*x₀*, *x₁*, *x₂*, …] and **y** = [*y₀*, *y₁*, *y₂*, …].
652
652
653
653
#### Plot.lineX(*data*, *options*)
654
654
655
-
If the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …]. If the **y** option is not specified, it defaults to [0, 1, 2, …].
655
+
Equivalent to Plot.line except that if the **x** option is not specified, it defaults to the identity function assuming that *data* = [*x₀*, *x₁*, *x₂*, …]. If the **y** option is not specified, it defaults to [0, 1, 2, …].
656
656
657
657
#### Plot.lineY(*data*, *options*)
658
658
659
-
If the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …]. If the **x** option is not specified, it defaults to [0, 1, 2, …].
659
+
Equivalent to Plot.line except that if the **y** option is not specified, it defaults to the identity function assuming that *data* = [*y₀*, *y₁*, *y₂*, …]. If the **x** option is not specified, it defaults to [0, 1, 2, …].
660
660
661
661
### Link
662
662
663
663
[<imgsrc="./img/link.png"width="320"height="198"alt="a chart with links">](https://observablehq.com/@data-workflows/plot-link)
[Source](./src/marks/link.js) · [Examples](https://observablehq.com/@data-workflows/plot-link) · Draws line segments connecting pairs of points.
666
+
667
+
The following channels are required:
668
+
669
+
***x1** - the starting horizontal position of the link; bound to the *x* scale
670
+
***y1** - the starting vertical position of the link; bound to the *y* scale
671
+
***x2** - the ending horizontal position of the link; bound to the *x* scale
672
+
***y2** - the ending vertical position of the link; bound to the *y* scale
673
+
674
+
The following optional channels are also supported:
675
+
676
+
***z** - an ordinal value to control *z*-order (when overlapping)
677
+
***stroke** - a stroke color per series; bound to the *color* scale
678
+
***strokeOpacity** - a stroke opacity per series; bound to the *opacity* scale
679
+
***title** - a tooltip per series (a string of text, possibly with newlines)
680
+
681
+
The **stroke** and **strokeOpacity** options can be specified as either channels or constants. When the stroke is specified as a function or array, it is interpreted as a channel; when the stroke is specified as a string, it is interpreted as a constant if a valid CSS color and otherwise it is interpreted as a column name for a channel. Similarly when the stroke opacity is specified as a number, it is interpreted as a constant; otherwise it is interpeted as a channel.
682
+
683
+
TODO Describe the defaults for stroke.
684
+
685
+
TODO Describe how missing or invalid data is handled.
686
+
687
+
The link mark supports the [standard style options](#marks).
666
688
667
689
#### Plot.link(*data*, *options*)
668
690
669
-
…
691
+
Returns a new link with the given *data* and *options*.
0 commit comments