micmro / PerfCascade

Responsive, SVG based HAR waterfall viewer
https://micmro.github.io/PerfCascade
MIT License
276 stars 51 forks source link

Marker is rendered outside of view #272

Closed JonathanWylie closed 3 years ago

JonathanWylie commented 3 years ago

The problem arises when there are two marking close together, or maybe even with the same value. This can happen for example if first contentful paint is the same as the largest contentful paint. In such a case the second marking is plotted to the right of the first, and a diagonal line is added to point back to the correct time. If these markings are being added right at the end of the view, then the second one can be plotted at x > 100%. The cause of this is that 100% of the view is determined by the duration of the har, so no extra space is left for any labels. I attach an example har file, exhibiting this problem example.zip We could try to plot it before, instead of after in such a case. Which works for my example, but does not work generally, as there may not be space before either, unless you start going back through the markings moving them back to make space.

micmro commented 3 years ago

@JonathanWylie can you check if PR #275 addresses your problem?

micmro commented 3 years ago

Released with 2.8.0

JonathanWylie commented 3 years ago

@micmro sorry I didn't respond quickly. Yes your fix handles the problem I was having, although as you say there are other edge cases which your fix does not handle. If I get time, I will have a go at a more general solution.