graphein 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +23 -0
- package/dist/index.js +450 -102
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1371,6 +1371,12 @@ interface BarSpec extends BaseSpec {
|
|
|
1371
1371
|
x: FieldDef;
|
|
1372
1372
|
y: FieldDef;
|
|
1373
1373
|
};
|
|
1374
|
+
/**
|
|
1375
|
+
* Bar direction. `'vertical'` (default) draws columns growing up from the
|
|
1376
|
+
* x-axis; `'horizontal'` draws bars growing rightward from the y-axis, with the
|
|
1377
|
+
* `x` categories listed down the left — ideal when category names are long.
|
|
1378
|
+
* The `encoding` is unchanged either way (`x` = category, `y` = value).
|
|
1379
|
+
*/
|
|
1374
1380
|
orientation?: 'vertical' | 'horizontal';
|
|
1375
1381
|
/** Stack series (default false). */
|
|
1376
1382
|
stack?: boolean;
|
|
@@ -3100,6 +3106,23 @@ interface CartesianModel {
|
|
|
3100
3106
|
series: ResolvedSeries[];
|
|
3101
3107
|
seriesField?: string;
|
|
3102
3108
|
stacked: boolean;
|
|
3109
|
+
/**
|
|
3110
|
+
* Bar orientation. Only `bar` ever sets `'horizontal'`; every other chart is
|
|
3111
|
+
* `'vertical'`. In horizontal mode the `x` (category/band) axis runs vertically
|
|
3112
|
+
* and the `y` (value) axis runs horizontally — so `x.pixel`/`x.bandwidth` are
|
|
3113
|
+
* vertical extents and `y.pixel`/`y.baseline` are horizontal ones. Consumers map
|
|
3114
|
+
* an (category-axis, value-axis) pixel pair to screen coords via {@link project}.
|
|
3115
|
+
*/
|
|
3116
|
+
orientation: 'vertical' | 'horizontal';
|
|
3117
|
+
/**
|
|
3118
|
+
* Map a (category-axis pixel, value-axis pixel) pair to screen `{x, y}`,
|
|
3119
|
+
* accounting for orientation. Vertical is the identity; horizontal swaps the
|
|
3120
|
+
* pair (value → screen x, category → screen y).
|
|
3121
|
+
*/
|
|
3122
|
+
project(catPixel: number, valPixel: number): {
|
|
3123
|
+
x: number;
|
|
3124
|
+
y: number;
|
|
3125
|
+
};
|
|
3103
3126
|
xTicks: Tick[];
|
|
3104
3127
|
yTicks: Tick[];
|
|
3105
3128
|
colorOf(key: string): string;
|