FIX: Percentage Text is cutoff (this removes transition as well)

This commit is contained in:
GithubAnon0000 2025-04-27 18:24:09 +02:00
parent 472fd75092
commit 0b7140504e

View file

@ -130,8 +130,7 @@ export function renderButtons(
.domain(["learning", "young", "mature"])
.range([bounds.marginLeft, bounds.width - bounds.marginRight]);
svg.select<SVGGElement>(".x-ticks")
.call((selection) =>
selection.transition(trans).call(
.call(
axisBottom(xGroup)
.tickFormat(
((d: GroupKind) => {
@ -153,11 +152,8 @@ export function renderButtons(
)
.tickSizeOuter(0),
)
)
.attr("direction", "ltr");
// Add a timeout to ensure that the text elements are populated
setTimeout(() => {
svg.select<SVGGElement>(".x-ticks").selectAll<SVGTextElement, GroupKind>("text")
.each(function(this: SVGTextElement, d: GroupKind) {
if (!(this instanceof SVGElement)) {
@ -181,7 +177,6 @@ export function renderButtons(
this.appendChild(tspan);
this.appendChild(tspan2);
});
}, 0);
const xButton = scaleBand()
.domain(["1", "2", "3", "4"])