Skip to content

Commit 9eb1fda

Browse files
committed
refactor: fixing lint errors
1 parent 0135c4d commit 9eb1fda

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

projects/observability/src/shared/components/donut/donut-builder.service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export class DonutBuilderService extends D3VisualizationBuilderService<
3838
private static readonly DONUT_VALUE_CLASS: string = 'donut-value';
3939
private static readonly DONUT_ARC_CLASS: string = 'donut-arc';
4040

41-
public static readonly DONUT_PADDING_PX: number = 10;
42-
public static readonly LEGEND_SIZE_MULTIPLE: number = 1.5;
41+
private static readonly DONUT_PADDING_PX: number = 10;
4342

4443
public constructor(
4544
d3: D3UtilService,
@@ -128,7 +127,7 @@ export class DonutBuilderService extends D3VisualizationBuilderService<
128127
protected decorateDimensions(calculatedDimensions: ChartDimensions): DonutDimensions {
129128
let diameter = Math.min(calculatedDimensions.visualizationWidth, calculatedDimensions.visualizationHeight);
130129

131-
diameter -= DonutBuilderService.DONUT_PADDING_PX ;
130+
diameter -= DonutBuilderService.DONUT_PADDING_PX;
132131

133132
// Reduce visualization area to diameter
134133
calculatedDimensions.visualizationWidth = diameter;

projects/observability/src/shared/components/utils/d3/d3-visualization-builder.service.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,16 @@ export abstract class D3VisualizationBuilderService<
223223
const isLegendVisible = this.isLegendVisible(config);
224224
const isTopOrBottomLegend = this.isTopOrBottomLegend(config);
225225
const isSideLegend = config.legend === LegendPosition.Right;
226-
let legendWidth = isLegendVisible ? 0
226+
let legendWidth = isLegendVisible
227+
? 0
227228
: isSideLegend
228229
? Math.min(legendRect.width, this.getMaxLegendWidth())
229230
: isTopOrBottomLegend
230231
? outerRect.width
231232
: 0;
232233

233-
let legendHeight = isLegendVisible ? 0
234+
let legendHeight = isLegendVisible
235+
? 0
234236
: isTopOrBottomLegend
235237
? Math.min(legendRect.height, this.getMaxLegendHeight())
236238
: isSideLegend
@@ -244,13 +246,13 @@ export abstract class D3VisualizationBuilderService<
244246
let vizHeight = outerRect.height - legendHeightOffset;
245247

246248
// Hide Legend if less space is available for the viz
247-
if(vizWidth <= legendWidthOffset || legendWidth <= 60) {
248-
vizWidth = outerRect.width
249+
if (vizWidth <= legendWidthOffset || legendWidth <= 60) {
250+
vizWidth = outerRect.width;
249251
legendWidth = 0;
250252
}
251253

252-
if(vizHeight <= legendHeightOffset || legendHeight <= 12) {
253-
vizHeight = outerRect.height
254+
if (vizHeight <= legendHeightOffset || legendHeight <= 12) {
255+
vizHeight = outerRect.height;
254256
legendHeight = 0;
255257
}
256258

@@ -264,7 +266,7 @@ export abstract class D3VisualizationBuilderService<
264266

265267
private isLegendVisible(config: ChartConfig): boolean {
266268
return config.legend === LegendPosition.None;
267-
}
269+
}
268270

269271
private isTopOrBottomLegend(config: ChartConfig): boolean {
270272
switch (config.legend) {

0 commit comments

Comments
 (0)