Skip to content

Commit

Permalink
Ensure counter widget is not compressed in query preview tabs
Browse files Browse the repository at this point in the history
Also bump minimum counter font size to 14
  • Loading branch information
eradman committed Oct 15, 2023
1 parent f2e420d commit 1a3d0de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions viz-lib/src/visualizations/counter/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function getCounterStyles(scale: any) {
function getCounterScale(container: any) {
// size of font in base container
// children use a relative font size (em)
if (container.closest('.visualization-preview')) {
if (container.closest('.visualization-preview') || container.closest('.ant-tabs-tabpane')) {
return "60";
}
const fontSize = container.clientHeight / 4.5;
return fontSize > 60 ? "60" : fontSize < 12 ? "12" : fontSize.toFixed();
return fontSize > 60 ? "60" : fontSize < 14 ? "14" : fontSize.toFixed();
}

export default function Renderer({ data, options, visualizationName }: any) {
Expand Down

0 comments on commit 1a3d0de

Please sign in to comment.