Skip to content

Commit

Permalink
init checkin, work remains on radialLinear
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcnulty committed Oct 27, 2022
1 parent 0b54338 commit 9b618fb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,9 @@ export default class Scale extends Element {
if (area) {
unclipArea(ctx);
}

return items;

}

/**
Expand Down
1 change: 1 addition & 0 deletions src/scales/scale.radialLinear.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ export default class RadialLinearScale extends LinearScaleBase {
});

ctx.restore();
return [];
}

/**
Expand Down
34 changes: 33 additions & 1 deletion types/helpers/helpers.canvas.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PointStyle } from '..';
import { PointStyle, Scriptable, ScriptableScaleContext } from '..';
import { Color } from '../color';
import { ChartArea, RoundedRect } from '../geometric';
import { CanvasFontSpec } from './helpers.options';
Expand Down Expand Up @@ -89,6 +89,38 @@ export interface RenderTextOpts {
* Underline the text
*/
underline?: boolean;

/**
* Dimensions for drawing the label backdrop
*/
backdrop?: BackdropDimensions;
}

export interface BackdropDimensions {
/**
* Left position of backdrop as pixel
*/
left: number;

/**
* Top position of backdrop as pixel
*/
top: number;

/**
* Width of backdrop in pixels
*/
width: number;

/**
* Height of backdrop in pixels
*/
height: number;

/**
* Color of label backdrops.
*/
color: Scriptable<Color, ScriptableScaleContext>;
}

export function renderText(
Expand Down
3 changes: 2 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Color } from './color';
import Element from '../src/core/core.element';
import { ChartArea, Padding, Point } from './geometric';
import { LayoutItem, LayoutPosition } from './layout';
import { RenderTextOpts } from './helpers';

export { EasingFunction } from '../src/helpers/helpers.easing';
export { default as ArcElement, ArcProps } from '../src/elements/element.arc';
Expand Down Expand Up @@ -1247,7 +1248,7 @@ export interface Scale<O extends CoreScaleOptions = CoreScaleOptions> extends El
getMatchingVisibleMetas(type?: string): ChartMeta[];

drawTitle(chartArea: ChartArea): void;
drawLabels(chartArea: ChartArea): void;
drawLabels(chartArea: ChartArea): RenderTextOpts;
drawGrid(chartArea: ChartArea): void;

/**
Expand Down

0 comments on commit 9b618fb

Please sign in to comment.