kitchensjn / tskit_arg_visualizer

Interactive visualization method for ancestral recombination graphs
MIT License
11 stars 3 forks source link

Margins issue: X-axis labels cut off in online notebooks #62

Closed hyanwong closed 12 months ago

hyanwong commented 1 year ago

When embedding a viz in a JupyterBook notebook (and presumably in other versions of Jupyter Notebooks), there is a lot of whitespace around the plot, but even so, something is cutting off the X axis labels:

Screenshot 2023-11-09 at 13 34 01

It would be nice to be able to specify smaller margins but not cut off labels. I guess the margin thing might be some setting in the notebook display rather than the visualizer itself.

kitchensjn commented 12 months ago

This should actually be fixed by the latest commit (ff4963d). I had some bad styling on the HTML SVG object (padding-top: 10px) that was shifting the visualization down but then not resizing the SVG bounds accordingly. I've removed that padding as it wasn't really needed with the rest of the whitespace.

hyanwong commented 12 months ago

Yep, thanks. I can confirm that this is fixed. Is there a way to remove the extra white margin around the plot (e.g. at the bottom) too?

Screenshot 2023-11-09 at 16 17 31
kitchensjn commented 12 months ago

There's padding on the d3arg class div which contains everything; this could be decreased or removed entirely. Right now the padding is used to center the figure within the whitespace when the controls dashboard isn't visible. If you completely remove the padding on the d3arg class, it will look like there's extra whitespace at the top since the controls dashboard is hidden there.