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
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -376,7 +376,7 @@ Plot.plot({
376
376
x:"sex"
377
377
},
378
378
marks: {
379
-
Plot.frame(), // draws a outline around each facet
379
+
Plot.frame(), // draws an outline around each facet
380
380
Plot.dot(penguins.slice(), {x:"culmen_length_mm", y:"culmen_depth_mm", fill:"#eee"}), // draws all penguins on each facet
381
381
Plot.dot(penguins, {x:"culmen_length_mm", y:"culmen_depth_mm"}) // draws only the current facet’s subset
382
382
}
@@ -483,19 +483,15 @@ In addition to the [standard mark options](#marks), the following optional chann
483
483
***y2** - the vertical position of the topline; bound to the *y* scale
484
484
***z** - a categorical value to group data into series
485
485
486
-
If **x2** is not specified, it defaults to **x1**. If **y2** is not specified, it defaults to **y1**.
486
+
If **x2** is not specified, it defaults to **x1**. If **y2** is not specified, it defaults to **y1**. These defaults facilitate sharing *x* or *y* coordinates between the baseline and topline, as is commonly the case (with [Plot.areaY](#plotareaydata-options) and [Plot.areaX](#plotareaxdata-options), respectively).
487
487
488
-
A path is created for each series in the data. If **z** is not specified, series can be defined implicitly by the **fill** or *stroke* channels, in that order of priority. If neither **z**, **fill**and **stroke**are specified as channels, the data is assumed to represent a single series.
488
+
By default, the data is assumed to represent a single series (*e.g.*, a single value over time). If the **z**channel is specified, data is grouped by *z* to form separate series. Typically *z* is a categorical value such as a series name. If **z** is not specified, it defaults to **fill**if a channel, or **stroke**if a channel.
489
489
490
-
**stroke** defaults to none, and **fill** defaults to currentColor if stroke is none, and to none otherwise.
491
-
492
-
TODO Describe how varying color and opacity within a series is not recommended.
493
-
494
-
Each area is drawn in input order; consider [sorting](#Transforms) if the original data is not already sorted along the *x* axis.
490
+
The **stroke** color defaults to none. The **fill** color defaults to currentColor if the stroke is none, and to none otherwise. If both the stroke and fill are defined as channels, or if the *z* channel is also specified, it is possible that the stroke or fill could vary within a series. Varying color within a series is not supported, so only the first value for each series is considered. This limitation also applies to the **fillOpacity**, **strokeOpacity**, and **title** channels.
495
491
496
-
Areas will stop the path before any invalid point and start again at the next valid point, thus creating interruptions rather than interpolating between valid points.
492
+
Points along the baseline and topline are connected in input order. Likewise, if there are multiple series via the *z*, *fill*, or *stroke* channel, series are drawn in input order such that the last series is drawn on top. Typically, the given data is already in sorted order, such as chronological for time series; to sort the data, use a [sort transform](#transforms).
497
493
498
-
The area mark supports [curve options](#curves) to control interpolation between points.
494
+
The area mark supports [curve options](#curves) to control interpolation between points. If any of the *x1*, *y1*, *x2*, or *y2* values are invalid (undefined, null, or NaN), the baseline and topline will be interrupted at this point, resulting in a break that separates the series’ shape into multiple segments. (See [d3-shape’s *area*.defined](https://github.com/d3/d3-shape/blob/master/README.md#area_defined) for more.) If an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. In addition, some curves such as *cardinal-open* only render a visible segment if it contains multiple points.
0 commit comments