Skip to content

Commit addf7fe

Browse files
committed
update README
1 parent 51ba14b commit addf7fe

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,8 @@ The following window reducers are supported:
12581258
* *difference* - the difference between the last and first window value
12591259
* *ratio* - the ratio of the last and first window value
12601260

1261+
By default, **shift** is *centered* and **reduce** is *mean*.
1262+
12611263
#### Plot.map(*outputs*, *options*)
12621264

12631265
```js
@@ -1282,37 +1284,37 @@ Plot.mapY("cumsum", {y: d3.randomNormal()})
12821284

12831285
Equivalent to Plot.map({y: *map*, y1: *map*, y2: *map*}, *options*), but ignores any of **y**, **y1**, and **y2** not present in *options*.
12841286

1285-
#### Plot.normalizeX(*options*)
1287+
#### Plot.normalizeX(*basis*, *options*)
12861288

12871289
```js
12881290
Plot.normalizeX({y: "Date", x: "Close", stroke: "Symbol"})
12891291
```
12901292

1291-
Like [Plot.mapX](#plotmapxmap-options), but applies the normalize map method with the given *options*.
1293+
Like [Plot.mapX](#plotmapxmap-options), but applies the normalize map method with the given *basis*.
12921294

1293-
#### Plot.normalizeY(*options*)
1295+
#### Plot.normalizeY(*basis*, *options*)
12941296

12951297
```js
12961298
Plot.normalizeY({x: "Date", y: "Close", stroke: "Symbol"})
12971299
```
12981300

1299-
Like [Plot.mapY](#plotmapymap-options), but applies the normalize map method with the given *options*.
1301+
Like [Plot.mapY](#plotmapymap-options), but applies the normalize map method with the given *basis*.
13001302

1301-
#### Plot.windowX(*options*)
1303+
#### Plot.windowX(*k*, *options*)
13021304

13031305
```js
1304-
Plot.windowX({y: "Date", x: "Anomaly", k: 24})
1306+
Plot.windowX(24, {y: "Date", x: "Anomaly"})
13051307
```
13061308

1307-
Like [Plot.mapX](#plotmapxmap-options), but applies the window map method with the given *options*.
1309+
Like [Plot.mapX](#plotmapxmap-options), but applies the window map method with the given window size *k*. If *k* is an object, separate *shift* and *reduce* window options can also be specified.
13081310

1309-
#### Plot.windowY(*options*)
1311+
#### Plot.windowY(*k*, *options*)
13101312

13111313
```js
1312-
Plot.windowY({x: "Date", y: "Anomaly", k: 24})
1314+
Plot.windowY(24, {x: "Date", y: "Anomaly"})
13131315
```
13141316

1315-
Like [Plot.mapY](#plotmapymap-options), but applies the window map method with the given *options*.
1317+
Like [Plot.mapY](#plotmapymap-options), but applies the window map method with the given window size *k*. If *k* is an object, separate *shift* and *reduce* window options can also be specified.
13161318

13171319
### Select
13181320

src/transforms/normalize.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import {take} from "../mark.js";
44
import {mapX, mapY} from "./map.js";
55

66
export function normalizeX(basis, options) {
7-
if (arguments.length === 1 && basis !== undefined) ({basis, ...options} = basis);
7+
if (arguments.length === 1) ({basis, ...options} = basis);
88
return mapX(normalize(basis), options);
99
}
1010

1111
export function normalizeY(basis, options) {
12-
if (arguments.length === 1 && basis !== undefined) ({basis, ...options} = basis);
12+
if (arguments.length === 1) ({basis, ...options} = basis);
1313
return mapY(normalize(basis), options);
1414
}
1515

0 commit comments

Comments
 (0)