jonhoo/inferno

Force details text to be anchored to top of window

ezyang opened this issue · 4 comments

Some applications can produce very deep flamegraphs, for which vertical scrolling is needed. When this occurs, it is difficult to view the title annotations on elements, as the normal details text is no longer in the viewport. To make matters worse, the details text is most useful for small elements, which are usually the furthest away from details. Yes, we can click to zoom in, but sometimes you just want to mouse around and see what's up.

I have a hacked up one of inferno's generated flamegraph svg's with https://stackoverflow.com/questions/2192209/keep-an-svg-object-static-while-scrolling to keep the detail viewport attached. It looks quite nice. See:

image

I would like to know if you would accept a PR adding this functionality by default to inferno. If so, I'll take the time to update inferno to include these updates directly. The modifications are modest: the detail svg has to be moved to the end of the document so that it paints over all other elements, and you need some JavaScript to adjust its location when you scroll.

Yes, this seems like a useful addition! It'd be useful to see before/after though.

Err, what kind of before/after are you looking for? Before the line is not visible haha

Isn't the line shown before you start scrolling currently, or am I misremembering?

Yes, so it's at the top of the svg and when you scroll down it scrolls out of view