grafana / grafana-polystat-panel

D3-Based hexagon layout multi-stat panel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problematic rendering behavior; an ellipsis is added to the labels and squares are not centered

ultima-originem opened this issue · comments

Please consider the following 2 screenshots.
image

image

In the first screenshot the squares are centered in the panel and the top text is readable. The name labels are truncated by an ellipsis though this seems unnecessary given the available space.
In the second screenshot the squares are no longer centered in the panel and the top text is not readable. The name labels are fully visible but too small.

I have not succeeded in finding a combination of settings and panel size that results in proper rendering.

I'm using Polystat 2.1.3 in Grafana version 10.1.2 running on Ubuntu and rendered in Firefox 118.0.1 in Windows 10.

Is this known behavior? Are there workarounds?

The second row rendering is definitely a bug. it should be aligned/centered to fill the space.
The extra ellipses are also a bug, that should only apply to names that cannot be fully displayed.

The font size issue is the default behavior.

The auto-sizing font setting uses the "longest" name in the list to find a font size that is readable, and it is applied to all polygons, regardless of how short those names are, or up to the ellipses limit, whichever is smaller.

The ellipses occur when the name exceeds the default limit, but should only be displayed where appropriate.

We could make this size the font per polygon, but the result ends up looking odd, as some will have very large fonts and others small fonts. The same applies for animated composites, the metric name that is longest is used to determine the font size.

In the second screenshot the squares are no longer centered in the panel and the top text is not readable. The name labels are fully visible but too small.

I am able to reproduce it now, no need to share a panel/dashboard.

@briangann wrote:

> The font size issue is the default behavior.
> 
> The auto-sizing font setting uses the "longest" name in the list to find a font size that is readable, and it is applied to all polygons, regardless of how short those names are, or up to the ellipses limit, whichever is smaller.

I'm using a global alias in this panel. As an experiment I removed the regex and it turns out the font size used - which is too small - is the exact same size as in the original second screenshot. My hypothesis is that the code computes the string length of the original strings before the regex is applied.
image

@briangann Thanks! Problem solved.

image

great to hear, thanks for confirming it is working!