RFR: 6682: Flamegraph gets cutoff when resized horizontally to increase the width
mwengner at openjdk.java.net
Fri Jan 31 17:31:13 UTC 2020
On Fri, 31 Jan 2020 16:32:40 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:
> This PR addresses JMC-6682 [](https://bugs.openjdk.java.net/browse/JMC-6682), in which the flamegraph can be cutoff when resizing to increase the width.
> The issue is that the `d3-flame-graph` `width()` function updates the labels, but not the overall `svg` width. As a result, increasing the width of the container will cause the graph dimensions to increase, but the `svg width` stays the same as its initialized value, so clipping can occur. I've raised this as an issue in the upstream repo [](https://github.com/spiermar/d3-flame-graph/issues/146), but altering the width can be done via `css`. If the `svg width` is set to `100%`, then it will fill the `chart` div, and the flamegraph will be displayed in its entirety. This width change also removes excess whitespace that results from resizing the chart smaller, and centers the chart in the view. I included a `css` file for the width value, because placing it in the template html was causing Eclipse to error when reading the html. Does the css file require a license header? I can add one if so.
> There are also two other changes here, but I can remove this if desired. The first being that Eclipse kept throwing NPEs when trying to open `flameviewColoring.js`, because it couldn't find the file unless the path wasn't specified to be `src/main/js/[..]`. The second is that the chart container was a SWT `SashForm`, but this could have been a `Composite` because we aren't doing anything with the sash (unless that was a future usage type of thing).
>  https://bugs.openjdk.java.net/browse/JMC-6682
>  https://github.com/spiermar/d3-flame-graph/issues/146
I've fixed in my PR 6677 too, I didn't know about this ticket, what do we do ?
More information about the jmc-dev