Skip to content

Commit 762f784

Browse files
committed
update README
1 parent 6a03e31 commit 762f784

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,8 @@ The following window reducers are supported:
12321232
* *difference* - the difference between the last and first window value
12331233
* *ratio* - the ratio of the last and first window value
12341234

1235+
By default, **shift** is *centered* and **reduce** is *mean*.
1236+
12351237
#### Plot.map(*outputs*, *options*)
12361238

12371239
```js
@@ -1256,37 +1258,37 @@ Plot.mapY("cumsum", {y: d3.randomNormal()})
12561258

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

1259-
#### Plot.normalizeX(*options*)
1261+
#### Plot.normalizeX(*basis*, *options*)
12601262

12611263
```js
12621264
Plot.normalizeX({y: "Date", x: "Close", stroke: "Symbol"})
12631265
```
12641266

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

1267-
#### Plot.normalizeY(*options*)
1269+
#### Plot.normalizeY(*basis*, *options*)
12681270

12691271
```js
12701272
Plot.normalizeY({x: "Date", y: "Close", stroke: "Symbol"})
12711273
```
12721274

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

1275-
#### Plot.windowX(*options*)
1277+
#### Plot.windowX(*k*, *options*)
12761278

12771279
```js
1278-
Plot.windowX({y: "Date", x: "Anomaly", k: 24})
1280+
Plot.windowX(24, {y: "Date", x: "Anomaly"})
12791281
```
12801282

1281-
Like [Plot.mapX](#plotmapxmap-options), but applies the window map method with the given *options*.
1283+
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.
12821284

1283-
#### Plot.windowY(*options*)
1285+
#### Plot.windowY(*k*, *options*)
12841286

12851287
```js
1286-
Plot.windowY({x: "Date", y: "Anomaly", k: 24})
1288+
Plot.windowY(24, {x: "Date", y: "Anomaly"})
12871289
```
12881290

1289-
Like [Plot.mapY](#plotmapymap-options), but applies the window map method with the given *options*.
1291+
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.
12901292

12911293
### Select
12921294

src/transforms/normalize.js

Lines changed: 2 additions & 2 deletions
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)