Skip to content

Commit b9f746b

Browse files
committed
Update README
1 parent 6e46277 commit b9f746b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,19 +1132,19 @@ Groups on the first channel of *z*, *fill*, or *stroke*, if any. If none of *z*,
11321132

11331133
[<img src="./img/window.png" width="320" height="198" alt="moving averages of daily highs and lows">](https://observablehq.com/@data-workflows/plot-map)
11341134

1135-
[Source](./src/transforms/map.js) · [Examples](https://observablehq.com/@data-workflows/plot-map) · Groups data into series along the *z* dimension, and then applies a mapping function to the values for each series, say to normalize them relative to some basis or to apply a moving average.
1135+
[Source](./src/transforms/map.js) · [Examples](https://observablehq.com/@data-workflows/plot-map) · Groups data into series along the *z* dimension and then applies a mapping function to each series’ values, say to normalize them relative to some basis or to apply a moving average.
11361136

1137-
The map transform derives new output channels from corresponding input channels. The output channels have the same length as the input channels; the map transform does not affect the mark’s data or index. The map transform is similar to running [*array*.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on the input channel’s values with the given function; however, the map transform is series-aware: the data is first grouped into series along the *z* dimension in the same fashion as the [area](#area) and [line](#line) marks so that series are processed independently. (You wouldn’t want a moving average to bleed between series, would you?)
1137+
The map transform derives new output channels from corresponding input channels. The output channels have strictly the same length as the input channels; the map transform does not affect the mark’s data or index. The map transform is similar to running [*array*.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on the input channel’s values with the given function; however, the map transform is series-aware: the data are first grouped into series along the *z* dimension in the same fashion as the [area](#area) and [line](#line) marks so that series can be processed independently. (You wouldn’t want a moving average to bleed between series, right?)
11381138

1139-
Like the [group](#group) and [bin](#bin) transforms, the base [Plot.map](#plotmapoutputs-options) takes two arguments: an *outputs* object that describes the output channels to compute, and an *options* object that describes the input channels and additional options to propagate. The other map transforms, such as [Plot.normalizeX](#plotnormalizexoptions) and [Plot.windowX](#plotwindowxoptions), call Plot.map internally.
1139+
Like the [group](#group) and [bin](#bin) transforms, the [Plot.map](#plotmapoutputs-options) transform takes two arguments: an *outputs* object that describes the output channels to compute, and an *options* object that describes the input channels and additional options to propagate. The other map transforms, such as [Plot.normalizeX](#plotnormalizexoptions) and [Plot.windowX](#plotwindowxoptions), call Plot.map internally.
11401140

11411141
The following map methods are supported:
11421142

11431143
* *cumsum* - a cumulative sum
11441144
* a function to be passed an array of values, returning new values
11451145
* an object that implements the *map* method
11461146

1147-
The *map* method is repeatedly passed the index for each series (an array of integers), the corresponding input channel’s array of values, and the output channel’s array of values; it must populate the slots specified by the index in the output array.
1147+
If a function is used, it must return an array of the same length as the given input. If a *map* method is used, it is repeatedly passed the index for each series (an array of integers), the corresponding input channel’s array of values, and the output channel’s array of values; it must populate the slots specified by the index in the output array.
11481148

11491149
The Plot.normalizeX and Plot.normalizeY transforms take an additional **basis** option which specifies how to normalize the series values. The following normalization methods are supported:
11501150

0 commit comments

Comments
 (0)