From 1057b1fb7eb7d5ba3c5b9ffaee06bffff994b891 Mon Sep 17 00:00:00 2001 From: netil Date: Fri, 20 Sep 2024 17:41:01 +0900 Subject: [PATCH] refactor(axis): Clarify param and types Fix param type to not be optional Ref #3882 --- src/ChartInternal/Axis/AxisRendererHelper.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ChartInternal/Axis/AxisRendererHelper.ts b/src/ChartInternal/Axis/AxisRendererHelper.ts index 2d0c63771..2e402b125 100644 --- a/src/ChartInternal/Axis/AxisRendererHelper.ts +++ b/src/ChartInternal/Axis/AxisRendererHelper.ts @@ -34,17 +34,17 @@ export default class AxisRendererHelper { * @returns {{w: number, h: number}} * @private */ - static getSizeFor1Char(node?) { + static getSizeFor1Char(node: d3Selection): {w: number, h: number} { // default size for one character const size = { w: 5.5, h: 11.5 }; - const text = node?.select("text"); + const text = node.select("text"); !text.empty() && text .text("0") - .call(el => { + .call((el: d3Selection) => { try { const {width, height} = el.node().getBBox();