Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid overlapping of category labels #3

Open
hski-github opened this issue Feb 11, 2021 · 9 comments
Open

Avoid overlapping of category labels #3

hski-github opened this issue Feb 11, 2021 · 9 comments

Comments

@hski-github
Copy link
Owner

In case of limited windows size or in case of long category labels, then the labels in the Sankey diagram can overlap.

image

@hski-github hski-github changed the title Truncate long labels to avoid overlapping of labels Avoid overlapping of category labels Feb 11, 2021
@hski-github
Copy link
Owner Author

If values are very small also overlapping can occur and should be prevented.
image

@hski-github
Copy link
Owner Author

hski-github commented Apr 17, 2021

If text labels are getting long, as a standard in Spotfire the text is truncated and three dots added. "United States of America" would be then depending on the available witdth "United States of Am...".

In CSS this can be done with setting max-width: 100px; and text-overflow: ellipsis; for the three dots ..., but not sure how this works in SVG test. const ELLIPSIS = '\u2026';

@hski-github
Copy link
Owner Author

Beside avoiding overlap of labels also the color of the label could be set depending on the background like it is done in bar charts in Spotfire with white or black font-color.

image

@hski-github
Copy link
Owner Author

@hski-github
Copy link
Owner Author

Another example of misplaced label from #18

image

@f1li
Copy link

f1li commented Jun 17, 2021

Any help here Holger? I'm still having this issue and in this case I don't see any reason of this because labels are extremely shorts.

@hski-github
Copy link
Owner Author

I have done a little change regarding rendering of labels. It does not solve the general issue of overlapping labels, but might solve your special problem here. Please check out latest version from main.

@f1li
Copy link

f1li commented Jun 17, 2021

Fantastic. Now it's perfect for this issue from my side. Thanks a lot.
Now I am missing only the row tooltip formatting stuff (0 decimal digit and not 2 as is now).

@hski-github
Copy link
Owner Author

Maybe small bars should not get a label e.g. if bar height is below 1em. You would be able to see the label with tooltip.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants