omeka-s-modules / Datavis

GNU General Public License v3.0
2 stars 1 forks source link

Text size is relative to diagram width #19

Open allanaaa opened 6 months ago

allanaaa commented 6 months ago

With hardcoded font-size and step in the diagram settings, should I be seeing the text change size when the diagram is resized?

Screenshot 2024-01-03 at 12 46 32 Screenshot 2024-01-03 at 12 50 34

We should probably change the interface label and add help text to explain more clearly how things will be rendered. I can't quite figure out why this is happening myself, so maybe you can help me out.

jimsafley commented 6 months ago

"Label font size" is the value of the font-size attribute of the label. It resolves to pixels, I think. "Space between labels" (step) is used to calculate the total height of the diagram (number of nodes * step). I'm not sure why changing the width of the canvas changes the relative size of the font and step, but that's why I've not included specific measurements. I hope users will see them as a way to fine-tune the space between nodes relative to the overall canvas size.

jimsafley commented 6 months ago

After some investigation I've determined that the diagram (including font size) scales to the size of its container via max-width: 100%. Otherwise the the diagram would overflow into the surrounding content, which is something to avoid when placed on a page, especially in grid layout. We could tell the user to account for this when placing an arc (or any diagram for that matter) on a page.

To make the "Label font size" more user friendly, I've opted for the absolute size keywords (e.g. small, medium, large) over an ambiguous numerical value. I'm not sure how to make the "Space between labels" field any more concrete, but I expect users will intuit its purpose and tweak the number.