Skip to content

Commit

Permalink
Cleanup, update docs and types
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Jul 10, 2021
1 parent 330b62b commit f634965
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/axes/cartesian/_common.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Namespace: `options.scales[scaleId]`
| `bounds` | `string` | `'ticks'` | Determines the scale bounds. [more...](./index.md#scale-bounds)
| `position` | `string` | | Position of the axis. [more...](./index.md#axis-position)
| `stack` | `string` | | Stack group. Axes at the same `position` with same `stack` are stacked.
| `stackWeight` | `number` | 1 | Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group.
| `axis` | `string` | | Which type of axis this is. Possible values are: `'x'`, `'y'`. If not set, this is inferred from the first character of the ID which should be `'x'` or `'y'`.
| `offset` | `boolean` | `false` | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to `true` for a bar chart by default.
| `title` | `object` | | Scale title configuration. [more...](../labelling.md#scale-title-configuration)
3 changes: 1 addition & 2 deletions src/core/core.layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ function buildLayoutBoxes(boxes) {
rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),
chartArea: filterByPosition(layoutBoxes, 'chartArea'),
vertical: left.concat(right).concat(centerVertical),
horizontal: top.concat(bottom).concat(centerHorizontal),
all: layoutBoxes
horizontal: top.concat(bottom).concat(centerHorizontal)
};
}

Expand Down
12 changes: 12 additions & 0 deletions types/index.esm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2829,6 +2829,18 @@ export interface CartesianScaleOptions extends CoreScaleOptions {
* Position of the axis.
*/
position: 'left' | 'top' | 'right' | 'bottom' | 'center' | { [scale: string]: number };

/**
* Stack group. Axes at the same `position` with same `stack` are stacked.
*/
stack?: string;

/**
* Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group.
* @default 1
*/
stackWeight?: number;

/**
* Which type of axis this is. Possible values are: 'x', 'y'. If not set, this is inferred from the first character of the ID which should be 'x' or 'y'.
*/
Expand Down

0 comments on commit f634965

Please sign in to comment.