Skip to content

Commit 0889cbf

Browse files
author
Jacco van den Berg
committed
Remove box padding from legend types
1 parent 4ee6c9e commit 0889cbf

File tree

1 file changed

+48
-53
lines changed

1 file changed

+48
-53
lines changed

src/types/index.d.ts

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/* eslint-disable @typescript-eslint/ban-types */
2-
import {DeepPartial, DistributiveArray, UnionToIntersection} from './utils.js';
2+
import { DeepPartial, DistributiveArray, UnionToIntersection } from './utils.js';
33

4-
import {TimeUnit} from '../core/core.adapters.js';
4+
import { TimeUnit } from '../core/core.adapters.js';
55
import PointElement from '../elements/element.point.js';
6-
import {EasingFunction} from '../helpers/helpers.easing.js';
7-
import {AnimationEvent} from './animation.js';
8-
import {AnyObject, EmptyObject} from './basic.js';
9-
import {Color} from './color.js';
6+
import { EasingFunction } from '../helpers/helpers.easing.js';
7+
import { AnimationEvent } from './animation.js';
8+
import { AnyObject, EmptyObject } from './basic.js';
9+
import { Color } from './color.js';
1010
import Element from '../core/core.element.js';
11-
import {ChartArea, Padding, Point} from './geometric.js';
12-
import {LayoutItem, LayoutPosition} from './layout.js';
13-
import {ColorsPluginOptions} from '../plugins/plugin.colors.js';
14-
15-
export {EasingFunction} from '../helpers/helpers.easing.js';
16-
export {default as ArcElement, ArcProps} from '../elements/element.arc.js';
17-
export {default as PointElement, PointProps} from '../elements/element.point.js';
18-
export {Animation, Animations, Animator, AnimationEvent} from './animation.js';
19-
export {Color} from './color.js';
20-
export {ChartArea, Point} from './geometric.js';
21-
export {LayoutItem, LayoutPosition} from './layout.js';
11+
import { ChartArea, Padding, Point } from './geometric.js';
12+
import { LayoutItem, LayoutPosition } from './layout.js';
13+
import { ColorsPluginOptions } from '../plugins/plugin.colors.js';
14+
15+
export { EasingFunction } from '../helpers/helpers.easing.js';
16+
export { default as ArcElement, ArcProps } from '../elements/element.arc.js';
17+
export { default as PointElement, PointProps } from '../elements/element.point.js';
18+
export { Animation, Animations, Animator, AnimationEvent } from './animation.js';
19+
export { Color } from './color.js';
20+
export { ChartArea, Point } from './geometric.js';
21+
export { LayoutItem, LayoutPosition } from './layout.js';
2222

2323
export interface ScriptableContext<TType extends ChartType> {
2424
active: boolean;
@@ -156,7 +156,7 @@ export interface BarControllerChartOptions {
156156
export type BarController = DatasetController
157157
export declare const BarController: ChartComponent & {
158158
prototype: BarController;
159-
new (chart: Chart, datasetIndex: number): BarController;
159+
new(chart: Chart, datasetIndex: number): BarController;
160160
};
161161

162162
export interface BubbleControllerDatasetOptions
@@ -183,7 +183,7 @@ export interface BubbleDataPoint extends Point {
183183
export type BubbleController = DatasetController
184184
export declare const BubbleController: ChartComponent & {
185185
prototype: BubbleController;
186-
new (chart: Chart, datasetIndex: number): BubbleController;
186+
new(chart: Chart, datasetIndex: number): BubbleController;
187187
};
188188

189189
export interface LineControllerDatasetOptions
@@ -229,7 +229,7 @@ export interface LineControllerChartOptions {
229229
export type LineController = DatasetController
230230
export declare const LineController: ChartComponent & {
231231
prototype: LineController;
232-
new (chart: Chart, datasetIndex: number): LineController;
232+
new(chart: Chart, datasetIndex: number): LineController;
233233
};
234234

235235
export type ScatterControllerDatasetOptions = LineControllerDatasetOptions;
@@ -241,7 +241,7 @@ export type ScatterControllerChartOptions = LineControllerChartOptions;
241241
export type ScatterController = LineController
242242
export declare const ScatterController: ChartComponent & {
243243
prototype: ScatterController;
244-
new (chart: Chart, datasetIndex: number): ScatterController;
244+
new(chart: Chart, datasetIndex: number): ScatterController;
245245
};
246246

247247
export interface DoughnutControllerDatasetOptions
@@ -349,7 +349,7 @@ export interface DoughnutController extends DatasetController {
349349

350350
export declare const DoughnutController: ChartComponent & {
351351
prototype: DoughnutController;
352-
new (chart: Chart, datasetIndex: number): DoughnutController;
352+
new(chart: Chart, datasetIndex: number): DoughnutController;
353353
};
354354

355355
export interface DoughnutMetaExtensions {
@@ -366,7 +366,7 @@ export type PieMetaExtensions = DoughnutMetaExtensions;
366366
export type PieController = DoughnutController
367367
export declare const PieController: ChartComponent & {
368368
prototype: PieController;
369-
new (chart: Chart, datasetIndex: number): PieController;
369+
new(chart: Chart, datasetIndex: number): PieController;
370370
};
371371

372372
export interface PolarAreaControllerDatasetOptions extends DoughnutControllerDatasetOptions {
@@ -394,7 +394,7 @@ export interface PolarAreaController extends DoughnutController {
394394
}
395395
export declare const PolarAreaController: ChartComponent & {
396396
prototype: PolarAreaController;
397-
new (chart: Chart, datasetIndex: number): PolarAreaController;
397+
new(chart: Chart, datasetIndex: number): PolarAreaController;
398398
};
399399

400400
export interface RadarControllerDatasetOptions
@@ -427,7 +427,7 @@ export type RadarControllerChartOptions = LineControllerChartOptions;
427427
export type RadarController = DatasetController
428428
export declare const RadarController: ChartComponent & {
429429
prototype: RadarController;
430-
new (chart: Chart, datasetIndex: number): RadarController;
430+
new(chart: Chart, datasetIndex: number): RadarController;
431431
};
432432
interface ChartMetaCommon<TElement extends Element = Element, TDatasetElement extends Element = Element> {
433433
type: string;
@@ -469,7 +469,7 @@ export type ChartMeta<
469469
TElement extends Element = Element,
470470
TDatasetElement extends Element = Element,
471471
> = DeepPartial<
472-
{ [key in ChartType]: ChartTypeRegistry[key]['metaExtensions'] }[TType]
472+
{ [key in ChartType]: ChartTypeRegistry[key]['metaExtensions'] }[TType]
473473
> & ChartMetaCommon<TElement, TDatasetElement>;
474474

475475
export interface ActiveDataPoint {
@@ -1372,7 +1372,7 @@ export interface Scale<O extends CoreScaleOptions = CoreScaleOptions> extends El
13721372
isFullSize(): boolean;
13731373
}
13741374
export declare class Scale {
1375-
constructor(cfg: {id: string, type: string, ctx: CanvasRenderingContext2D, chart: Chart});
1375+
constructor(cfg: { id: string, type: string, ctx: CanvasRenderingContext2D, chart: Chart });
13761376
}
13771377

13781378
export interface ScriptableScaleContext {
@@ -1930,13 +1930,13 @@ export interface LineOptions extends CommonElementOptions {
19301930
spanGaps: boolean | number;
19311931

19321932
segment: {
1933-
backgroundColor: Scriptable<Color|undefined, ScriptableLineSegmentContext>,
1934-
borderColor: Scriptable<Color|undefined, ScriptableLineSegmentContext>,
1935-
borderCapStyle: Scriptable<CanvasLineCap|undefined, ScriptableLineSegmentContext>;
1936-
borderDash: Scriptable<number[]|undefined, ScriptableLineSegmentContext>;
1937-
borderDashOffset: Scriptable<number|undefined, ScriptableLineSegmentContext>;
1938-
borderJoinStyle: Scriptable<CanvasLineJoin|undefined, ScriptableLineSegmentContext>;
1939-
borderWidth: Scriptable<number|undefined, ScriptableLineSegmentContext>;
1933+
backgroundColor: Scriptable<Color | undefined, ScriptableLineSegmentContext>,
1934+
borderColor: Scriptable<Color | undefined, ScriptableLineSegmentContext>,
1935+
borderCapStyle: Scriptable<CanvasLineCap | undefined, ScriptableLineSegmentContext>;
1936+
borderDash: Scriptable<number[] | undefined, ScriptableLineSegmentContext>;
1937+
borderDashOffset: Scriptable<number | undefined, ScriptableLineSegmentContext>;
1938+
borderJoinStyle: Scriptable<CanvasLineJoin | undefined, ScriptableLineSegmentContext>;
1939+
borderWidth: Scriptable<number | undefined, ScriptableLineSegmentContext>;
19401940
};
19411941
}
19421942

@@ -1962,7 +1962,7 @@ export interface LineElement<T extends LineProps = LineProps, O extends LineOpti
19621962

19631963
export declare const LineElement: ChartComponent & {
19641964
prototype: LineElement;
1965-
new (cfg: AnyObject): LineElement;
1965+
new(cfg: AnyObject): LineElement;
19661966
};
19671967

19681968
export type PointStyle =
@@ -2119,11 +2119,11 @@ export interface BarHoverOptions extends CommonHoverOptions {
21192119
export interface BarElement<
21202120
T extends BarProps = BarProps,
21212121
O extends BarOptions = BarOptions
2122-
> extends Element<T, O>, VisualElement {}
2122+
> extends Element<T, O>, VisualElement { }
21232123

21242124
export declare const BarElement: ChartComponent & {
21252125
prototype: BarElement;
2126-
new (cfg: AnyObject): BarElement;
2126+
new(cfg: AnyObject): BarElement;
21272127
};
21282128

21292129
export interface ElementOptionsByType<TType extends ChartType> {
@@ -2194,8 +2194,8 @@ export declare class BasePlatform {
21942194
updateConfig(config: ChartConfiguration | ChartConfigurationCustomTypesPerDataset): void;
21952195
}
21962196

2197-
export declare class BasicPlatform extends BasePlatform {}
2198-
export declare class DomPlatform extends BasePlatform {}
2197+
export declare class BasicPlatform extends BasePlatform { }
2198+
export declare class DomPlatform extends BasePlatform { }
21992199

22002200
export declare const Decimation: Plugin;
22012201

@@ -2405,11 +2405,6 @@ export interface LegendOptions<TType extends ChartType> {
24052405
* @default fontSize
24062406
*/
24072407
boxHeight: number;
2408-
/**
2409-
* Padding between the color box and the text
2410-
* @default 1
2411-
*/
2412-
boxPadding: number;
24132408
/**
24142409
* Color of label
24152410
* @see Defaults.color
@@ -3728,7 +3723,7 @@ export type ChartType = keyof ChartTypeRegistry;
37283723

37293724
export type ScaleOptionsByType<TScale extends ScaleType = ScaleType> =
37303725
{ [key in ScaleType]: { type: key } & ScaleTypeRegistry[key]['options'] }[TScale]
3731-
;
3726+
;
37323727

37333728
// Convenience alias for creating and manipulating scale options in user code
37343729
export type ScaleOptions<TScale extends ScaleType = ScaleType> = DeepPartial<ScaleOptionsByType<TScale>>;
@@ -3746,12 +3741,12 @@ export type ScaleChartOptions<TType extends ChartType = ChartType> = {
37463741
};
37473742

37483743
export type ChartOptions<TType extends ChartType = ChartType> = DeepPartial<
3749-
CoreChartOptions<TType> &
3750-
ElementChartOptions<TType> &
3751-
PluginChartOptions<TType> &
3752-
DatasetChartOptions<TType> &
3753-
ScaleChartOptions<TType> &
3754-
ChartTypeRegistry[TType]['chartOptions']
3744+
CoreChartOptions<TType> &
3745+
ElementChartOptions<TType> &
3746+
PluginChartOptions<TType> &
3747+
DatasetChartOptions<TType> &
3748+
ScaleChartOptions<TType> &
3749+
ChartTypeRegistry[TType]['chartOptions']
37553750
>;
37563751

37573752
export type DefaultDataPoint<TType extends ChartType> = DistributiveArray<ChartTypeRegistry[TType]['defaultDataPoint']>;
@@ -3772,14 +3767,14 @@ export type ChartDataset<
37723767
TType extends ChartType = ChartType,
37733768
TData = DefaultDataPoint<TType>
37743769
> = DeepPartial<
3775-
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
3770+
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
37763771
> & ChartDatasetProperties<TType, TData>;
37773772

37783773
export type ChartDatasetCustomTypesPerDataset<
37793774
TType extends ChartType = ChartType,
37803775
TData = DefaultDataPoint<TType>
37813776
> = DeepPartial<
3782-
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
3777+
{ [key in ChartType]: { type: key } & ChartTypeRegistry[key]['datasetOptions'] }[TType]
37833778
> & ChartDatasetPropertiesCustomTypesPerDataset<TType, TData>;
37843779

37853780
/**

0 commit comments

Comments
 (0)