Skip to content

Commit 10f6bbd

Browse files
committed
Style setting descriptions added to .d.ts file.
1 parent 53be8e7 commit 10f6bbd

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

src/apps/weblib/js-api/vizzu.d.ts

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interface Channel {
6363
attach: string[];
6464
/** List of {@link DataSeries.name|data series names} to be removed to the
6565
* channel. */
66-
detach: string[];
66+
detach: string[];
6767
/** Specifies the range which determines how the represented data will be
6868
* scales on the channel. */
6969
range: ChannelRange;
@@ -135,104 +135,168 @@ interface Descriptor {
135135
declare namespace Styles
136136
{
137137

138+
/** Length can be set in pixels or in percentage to the element. In case of no
139+
* unit set, it defaults to pixel. */
138140
type Length = `${number}px`|`${number}%`|number;
139141

142+
/** The following CSS color formats are available: rgb, rgba, 3 and 4 channel
143+
* hexadecimal. */
140144
type Color = `#${number}`
141145
|`rgb(${number},${number},${number})`
142146
|`rgba(${number},${number},${number},${number})`;
143147

144148
interface Padding {
149+
/** Top padding of the element. */
145150
paddingTop: Length;
151+
/** Right padding of the element. */
146152
paddingRight: Length;
153+
/** Bottom padding of the element. */
147154
paddingBottom: Length;
155+
/** Left padding of the element. */
148156
paddingLeft: Length;
149157
}
150158

151159
interface Font {
160+
/** The family of the font, if not set, it inherits the root style font
161+
* family. */
152162
fontFamily: string;
163+
/** The style of the font. */
153164
fontStyle: 'normal'|'italic'|'oblique';
165+
/** The weight of the font, numbers use the same scale as CSS. */
154166
fontWeight: 'normal'|'bold'|number;
167+
/** The size of the font. Percentage values are relative to the root style
168+
* size */
155169
fontSize: Length;
156170
}
157171

158172
interface Box {
173+
/** The background color of the element. */
159174
backgroundColor: Color;
175+
/** The border color of the element. */
160176
borderColor: Color;
177+
/** The border width of the element. */
161178
borderWidth: number;
162179
}
163180

164181
interface Text {
182+
/** The color of the displayed text. */
165183
color: Color;
184+
/** The alignment of the displayed text. */
166185
textAlign: 'center'|'left'|'right';
186+
/** The background color of the displayed text. */
167187
backgroundColor: Color;
168188
overflow: 'visible'|'hidden';
189+
/** The format of the number. Only applicable for texts showing numerical
190+
* data. 'grouped' uses thousand separators, 'prefixed' uses scientific
191+
* notation. */
169192
numberFormat: 'none'|'grouped'|'prefixed';
170193
}
171194

195+
/** The following CSS like filters can be used to alter the color:
196+
*
197+
* color: overrides the color with a fix one;
198+
*
199+
* lightness: lightens or darkens the color; 0 means the original color, -1
200+
* means black, 1 means white.
201+
*
202+
* grayscale: desaturates the color. 0 means the original color, 1 means fully
203+
* desaturated.
204+
*/
172205
type ColorTransform = `color(${Color})`
173206
| `lightness(${number})`
174207
| `grayscale(${number})`;
175208

176209
interface MarkerLabel extends Label {
210+
/** The label position compared to the marker. */
177211
position: 'below'|'center'|'above';
212+
/** Transformation of the label color compared to the marker's color. */
178213
filter: ColorTransform;
214+
/** Set the order of values on the label if both continous and categorical
215+
* data present. */
179216
format: 'valueFirst'|'categoriesFirst';
180217
}
181218

182219
interface Marker {
220+
/** Width of the marker's border in pixel. */
183221
borderWidth: number;
222+
/** Opacity of the marker border. */
184223
borderOpacity: number;
185224
borderOpacityMode: 'straight'|'premultiplied';
225+
/** Opacity of the marker's fill color. */
186226
fillOpacity: number;
227+
/** Style settings for guide lines drawn for the markers. */
187228
guides: {
229+
/** The color of the guide. */
188230
color: Color;
231+
/** Line width of the guide in pixel. */
189232
lineWidth: number;
190233
};
234+
/** Style settings for the marker's label. */
191235
label: MarkerLabel;
192236
}
193237

194238
interface Axis {
239+
/** Color of the axis line. */
195240
color: Color;
241+
/** Style parameters of the axis title. */
196242
title: Label;
243+
/** Style parameters of the axis labels. */
197244
label: Label;
198245
ticks: {
246+
/** Color of the ticks on the axis. */
199247
color: Color;
248+
/** Line width of the ticks on the axis. */
200249
lineWidth: number;
250+
/** Length of the ticks on the axis. */
201251
length: Length;
252+
/** Position of the ticks on the axis in relation to the axis line. */
202253
position: 'outside'|'inside'|'center';
203254
};
204255
guides: {
256+
/** Color of the axis guides. */
205257
color: Color;
258+
/** Line width of the axis guides. */
206259
lineWidth: number;
207260
};
208261
interlacing: {
262+
/** Color of the interlacing pattern. */
209263
color: Color;
210264
};
211265
}
212266

213267
interface Plot extends Padding, Box {
268+
/** Style settings for the markers. */
214269
marker: Marker;
270+
/** Style settings for the axes. */
215271
axis: Axis;
216272
}
217273

218274
interface Legend extends Padding, Box {
275+
/** Width of the legend's boundary box. */
219276
width: Length;
277+
/** Style settings for the legend's title. */
220278
title: Label;
279+
/** Style settings for the labels on the legend. */
221280
label: Label;
222281
marker: {
282+
/** Shape of the legend marker. */
223283
type: 'circle'|'square';
284+
/** Size of the legend marker (diameter, side length). */
224285
size: Length;
225286
};
226287
}
227288

228289
type ColorStop = `${Color} ${number}`;
229290

291+
/** Color gradient is specified by a comma separated list of color and position
292+
* pairs separated by spaces, wher position is a number between 0 and 1. */
230293
type ColorGradient = ColorStop
231294
| `${ColorStop},${ColorStop}`
232295
| `${ColorStop},${ColorStop},${ColorStop}`
233296
| `${ColorStop},${ColorStop},${ColorStop},${ColorStop}`
234297
| `${ColorStop},${ColorStop},${ColorStop},${ColorStop},${ColorStop}`;
235298

299+
/** Color palette is a list of colors separated by spaces. */
236300
type ColorPalette = Color
237301
| `${Color} ${Color}`
238302
| `${Color} ${Color} ${Color}`
@@ -244,12 +308,25 @@ interface Data {
244308
colorGradient: ColorGradient;
245309
/** Sets the color palette used for categorical data on the color channel.*/
246310
colorPalette: ColorPalette;
311+
/** Lightness value associated with the minimum value of the lightness
312+
* channel range. */
247313
minLightness: number;
314+
/** Lightness value associated with the maximum value of the lightness
315+
* channel range. */
248316
maxLightness: number;
317+
/** obsolate: will be removed, factor between data value and line width. */
249318
lineWidth: number;
319+
/** Line width associated with the minimum value of the size channel range.
320+
*/
250321
lineMinWidth: number;
322+
/** Line width associated with the maximum value of the size channel range.
323+
*/
251324
lineMaxWidth: number;
325+
/** Circle radius associated with the minimum value of the size channel
326+
* range. */
252327
circleMinRadius: number;
328+
/** Circle radius associated with the maximum value of the size channel
329+
* range. */
253330
circleMaxRadius: number;
254331
barMaxPadding: number;
255332
barPaddingDecrease: number;
@@ -260,9 +337,13 @@ interface Data {
260337
type Label = Padding & Font & Text;
261338

262339
interface Chart extends Padding, Box, Font {
340+
/** Style setting for the plot area. */
263341
plot: Plot;
342+
/** Style setting for the legend. */
264343
legend: Legend;
344+
/** Style setting for the main chart title. */
265345
title: Label;
346+
/** Data series related style settings. */
266347
data: Data;
267348
}
268349

@@ -279,6 +360,8 @@ interface AnimTarget {
279360
style: Styles.Chart;
280361
}
281362

363+
/** Duration can be set in seconds or milliseconds.
364+
* In case of no unit set, it defaults to second. */
282365
type Duration = `${number}s`|`${number}ms`|number;
283366

284367
type Easing = 'none' | 'linear' | 'step-start' | 'step-end' | 'ease'

0 commit comments

Comments
 (0)