Skip to content

Commit

Permalink
refactor(axis): Clarify param and types
Browse files Browse the repository at this point in the history
Fix param type to not be optional

Ref naver#3882
  • Loading branch information
netil committed Sep 20, 2024
1 parent 705947f commit 1057b1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ChartInternal/Axis/AxisRendererHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 1057b1f

Please sign in to comment.