|
1 | 1 | import {greatest, group, least} from "d3-array";
|
2 | 2 | import {maybeColor, range, valueof} from "../mark.js";
|
3 | 3 |
|
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)}; |
6 | 6 | }
|
7 | 7 |
|
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)}; |
10 | 10 | }
|
11 | 11 |
|
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)}; |
14 | 14 | }
|
15 | 15 |
|
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)}; |
18 | 18 | }
|
19 | 19 |
|
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)}; |
22 | 22 | }
|
23 | 23 |
|
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)}; |
26 | 26 | }
|
27 | 27 |
|
28 |
| -function* selectFirst(I) { |
| 28 | +function* first(I) { |
29 | 29 | yield I[0];
|
30 | 30 | }
|
31 | 31 |
|
32 |
| -function* selectLast(I) { |
| 32 | +function* last(I) { |
33 | 33 | yield I[I.length - 1];
|
34 | 34 | }
|
35 | 35 |
|
36 |
| -function* selectMin(I, X) { |
| 36 | +function* min(I, X) { |
37 | 37 | yield least(I, i => X[i]);
|
38 | 38 | }
|
39 | 39 |
|
40 |
| -function* selectMax(I, X) { |
| 40 | +function* max(I, X) { |
41 | 41 | yield greatest(I, i => X[i]);
|
42 | 42 | }
|
43 | 43 |
|
|
0 commit comments