Skip to content

Commit 2ae600f

Browse files
committed
stack transforms
1 parent 398f7cc commit 2ae600f

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

src/transforms/stack.d.ts

+78
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,104 @@ export interface StackOptions {
7171
z?: ChannelValue;
7272
}
7373

74+
/**
75+
* Transforms a length channel *x* into starting and ending position channels
76+
* *x1* and *x2* by “stacking” elements that share a given *y* position. The
77+
* starting position of each element equals the ending position of the preceding
78+
* element in the stack. Non-positive values are stacked to the left of zero,
79+
* with *x2* to the left of *x1*. A new *x* channel is derived that represents
80+
* the midpoint between *x1* and *x2*, for example to place a label. If not
81+
* specified, the input channel *x* defaults to the constant one. Elements can
82+
* be stacked in a given *order*. After stacking, an optional *offset* can be
83+
* applied.
84+
*/
7485
export function stackX<T>(options?: T & StackOptions): Transformed<T>;
7586

87+
/**
88+
* Transforms a length channel *x* into starting and ending position channels
89+
* *x1* and *x2* by “stacking” elements that share a given *y* position. The
90+
* starting position of each element equals the ending position of the preceding
91+
* element in the stack. Non-positive values are stacked to the left of zero,
92+
* with *x2* to the left of *x1*. A new *x* channel is derived that represents
93+
* the midpoint between *x1* and *x2*, for example to place a label. If not
94+
* specified, the input channel *x* defaults to the constant one. Elements can
95+
* be stacked in a given *order*. After stacking, an optional *offset* can be
96+
* applied.
97+
*/
7698
export function stackX<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
7799

100+
/**
101+
* Like **stackX**, but returns the starting position *x1* as the *x* channel,
102+
* for example to position a dot on the left-hand side of each element of a
103+
* stack.
104+
*/
78105
export function stackX1<T>(options?: T & StackOptions): Transformed<T>;
79106

107+
/**
108+
* Like **stackX**, but returns the starting position *x1* as the *x* channel,
109+
* for example to position a dot on the left-hand side of each element of a
110+
* stack.
111+
*/
80112
export function stackX1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
81113

114+
/**
115+
* Like **stackX**, but returns the starting position *x2* as the *x* channel,
116+
* for example to position a dot on the right-hand side of each element of a
117+
* stack.
118+
*/
82119
export function stackX2<T>(options?: T & StackOptions): Transformed<T>;
83120

121+
/**
122+
* Like **stackX**, but returns the starting position *x2* as the *x* channel,
123+
* for example to position a dot on the right-hand side of each element of a
124+
* stack.
125+
*/
84126
export function stackX2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
85127

128+
/**
129+
* Transforms a length channel *y* into starting and ending position channels
130+
* *y1* and *y2* by “stacking” elements that share a given *x* position. The
131+
* starting position of each element equals the ending position of the preceding
132+
* element in the stack. Non-positive values are stacked below zero, with *y2*
133+
* below *y1*. A new *y* channel is derived that represents the midpoint between
134+
* *y1* and *y2*, for example to place a label. If not specified, the input
135+
* channel *y* defaults to the constant one. Elements can be stacked in a given
136+
* *order*. After stacking, an optional *offset* can be applied.
137+
*/
86138
export function stackY<T>(options?: T & StackOptions): Transformed<T>;
87139

140+
/**
141+
* Transforms a length channel *y* into starting and ending position channels
142+
* *y1* and *y2* by “stacking” elements that share a given *x* position. The
143+
* starting position of each element equals the ending position of the preceding
144+
* element in the stack. Non-positive values are stacked below zero, with *y2*
145+
* below *y1*. A new *y* channel is derived that represents the midpoint between
146+
* *y1* and *y2*, for example to place a label. If not specified, the input
147+
* channel *y* defaults to the constant one. Elements can be stacked in a given
148+
* *order*. After stacking, an optional *offset* can be applied.
149+
*/
88150
export function stackY<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
89151

152+
/**
153+
* Like **stackY**, but returns the starting position *y1* as the *y* channel,
154+
* for example to position a dot at the bottom of each element of a stack.
155+
*/
90156
export function stackY1<T>(options?: T & StackOptions): Transformed<T>;
91157

158+
/**
159+
* Like **stackY**, but returns the starting position *y1* as the *y* channel,
160+
* for example to position a dot at the bottom of each element of a stack.
161+
*/
92162
export function stackY1<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;
93163

164+
/**
165+
* Like **stackY**, but returns the ending position *y2* as the *y* channel,
166+
* for example to position a dot at the top of each element of a stack.
167+
*/
94168
export function stackY2<T>(options?: T & StackOptions): Transformed<T>;
95169

170+
/**
171+
* Like **stackY**, but returns the ending position *y2* as the *y* channel,
172+
* for example to position a dot at the top of each element of a stack.
173+
*/
96174
export function stackY2<T>(stackOptions?: StackOptions, options?: T): Transformed<T>;

0 commit comments

Comments
 (0)