Skip to content

Commit

Permalink
update typing of clip, allow it to be configurable in the options for…
Browse files Browse the repository at this point in the history
… typescript (#10494)
  • Loading branch information
LeeLenaleee committed Jul 20, 2022
1 parent ffa2462 commit 97351d1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/charts/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Only the `data` option needs to be specified in the dataset namespace.
| [`borderWidth`](#borderwidth) | `number`\|`object` | Yes | Yes | `0`
| [`borderRadius`](#borderradius) | `number`\|`object` | Yes | Yes | `0`
| [`categoryPercentage`](#categorypercentage) | `number` | - | - | `0.8` |
| [`clip`](#general) | `number`\|`object` | - | - |
| [`clip`](#general) | `number`\|`object`\|`false` | - | - |
| [`data`](#data-structure) | `object`\|`object[]`\| `number[]`\|`string[]` | - | - | **required**
| [`grouped`](#general) | `boolean` | - | - | `true` |
| [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes |
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/bubble.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The bubble chart allows a number of properties to be specified for each dataset.
| [`backgroundColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
| [`borderWidth`](#styling) | `number` | Yes | Yes | `3`
| [`clip`](#general) | `number`\|`object` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object`\|`false` | - | - | `undefined`
| [`data`](#data-structure) | `object[]` | - | - | **required**
| [`drawActiveElementsOnTop`](#general) | `boolean` | Yes | Yes | `true`
| [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/doughnut.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The doughnut/pie chart allows a number of properties to be specified for each da
| [`borderRadius`](#border-radius) | `number`\|`object` | Yes | Yes | `0`
| [`borderWidth`](#styling) | `number` | Yes | Yes | `2`
| [`circumference`](#general) | `number` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object`\|`false` | - | - | `undefined`
| [`data`](#data-structure) | `number[]` | - | - | **required**
| [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
| [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The line chart allows a number of properties to be specified for each dataset. T
| [`borderDashOffset`](#line-styling) | `number` | Yes | - | `0.0`
| [`borderJoinStyle`](#line-styling) | `'round'`\|`'bevel'`\|`'miter'` | Yes | - | `'miter'`
| [`borderWidth`](#line-styling) | `number` | Yes | - | `3`
| [`clip`](#general) | `number`\|`object` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object`\|`false` | - | - | `undefined`
| [`cubicInterpolationMode`](#cubicinterpolationmode) | `string` | Yes | - | `'default'`
| [`data`](#data-structure) | `object`\|`object[]`\| `number[]`\|`string[]` | - | - | **required**
| [`drawActiveElementsOnTop`](#general) | `boolean` | Yes | Yes | `true`
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/polar.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The following options can be included in a polar area chart dataset to configure
| [`borderColor`](#styling) | [`Color`](../general/colors.md) | Yes | Yes | `'#fff'`
| [`borderJoinStyle`](#styling) | `'round'`\|`'bevel'`\|`'miter'` | Yes | Yes | `undefined`
| [`borderWidth`](#styling) | `number` | Yes | Yes | `2`
| [`clip`](#general) | `number`\|`object` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object`\|`false` | - | - | `undefined`
| [`data`](#data-structure) | `number[]` | - | - | **required**
| [`hoverBackgroundColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
| [`hoverBorderColor`](#interactions) | [`Color`](../general/colors.md) | Yes | Yes | `undefined`
Expand Down
2 changes: 1 addition & 1 deletion docs/charts/radar.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ The radar chart allows a number of properties to be specified for each dataset.
| [`hoverBorderDashOffset`](#line-styling) | `number` | Yes | - | `undefined`
| [`hoverBorderJoinStyle`](#line-styling) | `'round'`\|`'bevel'`\|`'miter'` | Yes | - | `undefined`
| [`hoverBorderWidth`](#line-styling) | `number` | Yes | - | `undefined`
| [`clip`](#general) | `number`\|`object` | - | - | `undefined`
| [`clip`](#general) | `number`\|`object`\|`false` | - | - | `undefined`
| [`data`](#data-structure) | `number[]` | - | - | **required**
| [`fill`](#line-styling) | `boolean`\|`string` | Yes | - | `false`
| [`label`](#general) | `string` | - | - | `''`
Expand Down
7 changes: 6 additions & 1 deletion types/index.esm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface ControllerDatasetOptions extends ParsingOptions {
/**
* How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea. Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0}
*/
clip: number | ChartArea;
clip: number | ChartArea | false;
/**
* The label for the dataset which appears in the legend and tooltips.
*/
Expand Down Expand Up @@ -1457,6 +1457,11 @@ export interface CoreChartOptions<TType extends ChartType> extends ParsingOption
*/
indexAxis: 'x' | 'y';

/**
* How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea. Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0}
*/
clip: number | ChartArea | false;

/**
* base color
* @see Defaults.color
Expand Down

0 comments on commit 97351d1

Please sign in to comment.