Skip to content

Commit f3d5635

Browse files
committed
verbose names
1 parent 43d353f commit f3d5635

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export {TickX, TickY, tickX, tickY} from "./marks/tick.js";
1717
export {bin, binX, binY, binR} from "./transforms/bin.js";
1818
export {group, groupX, groupY} from "./transforms/group.js";
1919
export {movingAverageX, movingAverageY} from "./transforms/movingAverage.js";
20-
export {first, last, maxX, maxY, minX, minY} from "./transforms/select.js";
20+
export {selectFirst, selectLast, selectMaxX, selectMaxY, selectMinX, selectMinY} from "./transforms/select.js";
2121
export {stackX, stackX1, stackX2, stackXMid, stackY, stackY1, stackY2, stackYMid} from "./transforms/stack.js";

src/transforms/select.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
import {greatest, group, least} from "d3-array";
22
import {maybeColor, range, valueof} from "../mark.js";
33

4-
export function first(options = {}) {
5-
return {...options, transform: select(selectFirst, undefined, options)};
4+
export function selectFirst(options = {}) {
5+
return {...options, transform: select(first, undefined, options)};
66
}
77

8-
export function last(options = {}) {
9-
return {...options, transform: select(selectLast, undefined, options)};
8+
export function selectLast(options = {}) {
9+
return {...options, transform: select(last, undefined, options)};
1010
}
1111

12-
export function minX(options = {}) {
13-
return {...options, transform: select(selectMin, "x", options)};
12+
export function selectMinX(options = {}) {
13+
return {...options, transform: select(min, "x", options)};
1414
}
1515

16-
export function minY(options = {}) {
17-
return {...options, transform: select(selectMin, "y", options)};
16+
export function selectMinY(options = {}) {
17+
return {...options, transform: select(min, "y", options)};
1818
}
1919

20-
export function maxX(options = {}) {
21-
return {...options, transform: select(selectMax, "x", options)};
20+
export function selectMaxX(options = {}) {
21+
return {...options, transform: select(max, "x", options)};
2222
}
2323

24-
export function maxY(options = {}) {
25-
return {...options, transform: select(selectMax, "y", options)};
24+
export function selectMaxY(options = {}) {
25+
return {...options, transform: select(max, "y", options)};
2626
}
2727

28-
function* selectFirst(I) {
28+
function* first(I) {
2929
yield I[0];
3030
}
3131

32-
function* selectLast(I) {
32+
function* last(I) {
3333
yield I[I.length - 1];
3434
}
3535

36-
function* selectMin(I, X) {
36+
function* min(I, X) {
3737
yield least(I, i => X[i]);
3838
}
3939

40-
function* selectMax(I, X) {
40+
function* max(I, X) {
4141
yield greatest(I, i => X[i]);
4242
}
4343

test/plots/stocks-index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default async function() {
4343
y: "multiple",
4444
stroke: "symbol"
4545
}),
46-
Plot.text(stocks, Plot.last({
46+
Plot.text(stocks, Plot.selectLast({
4747
x: "date",
4848
y: "multiple",
4949
z: "symbol",

0 commit comments

Comments
 (0)