update at 2026-01-22 20:01:21
This commit is contained in:
@@ -18,17 +18,23 @@ const ensureTrailingSlash = (input: string): string =>
|
||||
interface SectorBuilderOptions {
|
||||
textRadialPosition?: TextRadialPosition;
|
||||
svgIconPath?: string;
|
||||
insetDistance?: number;
|
||||
}
|
||||
|
||||
export class SectorBuilder {
|
||||
private colorResolver: ColorResolver;
|
||||
private textRadialPosition: TextRadialPosition;
|
||||
private svgIconPath: string;
|
||||
private insetDistance: number;
|
||||
|
||||
constructor(colorResolver: ColorResolver, options: SectorBuilderOptions = {}) {
|
||||
this.colorResolver = colorResolver;
|
||||
this.textRadialPosition = options.textRadialPosition ?? 'middle';
|
||||
this.svgIconPath = ensureTrailingSlash(options.svgIconPath ?? 'src/assets/icons/');
|
||||
this.insetDistance =
|
||||
typeof options.insetDistance === 'number'
|
||||
? Math.max(0, options.insetDistance)
|
||||
: SECTOR_INSET_DISTANCE;
|
||||
}
|
||||
|
||||
buildLayer(layer: SectorLayerConfig, layerIndex: number): Sector[] {
|
||||
@@ -57,7 +63,7 @@ export class SectorBuilder {
|
||||
layer.rOuter,
|
||||
aStart,
|
||||
aEnd,
|
||||
SECTOR_INSET_DISTANCE
|
||||
this.insetDistance
|
||||
)
|
||||
: undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user