SiLeBAT / fcl-client

Web app for analyzing food delivery networks
https://silebat.github.io/fcl-client/
GNU General Public License v3.0
7 stars 2 forks source link

Station property dialogue: Fit text length of deliveries to boxes #804

Open bfrgottscma opened 3 months ago

bfrgottscma commented 3 months ago

Sometimes, the names of deliveries are too long to fit in the delivery text box in the station property dialogue (see Example data set, Station properties of Case 4).

Delivery boxes.png

However, as a user, I do not want the text in the delivery boxes running over the margins of the respective text boxes since this looks buggy. Please fit the text length to the boxes (e.g. by adding a line break and another line of text in the box).

Think of Tests

Additional context

j-hha commented 5 days ago

Debugging notes:

Examples Example textLength (effect is less visible when the overflow isn't quite that large):

Screenshot 2024-11-25 at 15 14 39

Support: https://caniuse.com/?search=textLength

Example foreignObject:

Screenshot 2024-11-25 at 15 12 33

Support: https://caniuse.com/?search=foreignObject

Example line + text path: Image

Conclusion I am in favour of using foreignObject.

ruegenbfr commented 4 days ago

Currently the node boxes have a fixed horizontal size. (200px).

Another option could be to measure the required space. And to adapt the box size up to a certain horizontal limit. This approach could be combined with the foreignObject approach. The foreignObject solution could be combined with a tooltip showing the complete node content.

In my eyes: The fastest and nice solution would be the foreignObject approach. An easy addon would be the tooltip to compensate for the clippings. A bit more expensive solution but more tidy solution would be to adapt the box sizes.

j-hha commented 4 days ago

@bfrgottscma we're assigning this to you for a decision on how to proceed

bfrgottscma commented 3 days ago

Go for the dots and the tool-tip.

afalenski commented 1 day ago

I just read this ticket by chance. Great that you like the 3-dot solution. This morning I also thought about this and the functionality adds to readability, see #942.