lrsjng / jquery-fracs

jQuery plugin to determine the visible fractions of HTML elements.

Home Page:https://larsjung.de/jquery-fracs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility to compress the outline vertically if pages get too long?

soc opened this issue · comments

commented

First of all, thanks a lot for your outline code! (As suggested on your homepage, I bought you a beer or two. :-))

I have one question:

Currently, the height of the outline needs to be set, otherwise the outline won't work at all. (If I remove height from the canvas, I get height=NaN in the browser.)

Because I want to use outline on documents which are pretty long, I'd like the outline to always use both the given width and make full usage of the available height.

Currently, this doesn't really work great, due to multiple issues:

  • The outline is scaled in both dimensions to fit into the given height, causing the width to also be reduced proportionally. In my case, this looks pretty bad, because the outlines of different chapters jump in size.
  • Additionally, if I reduce height below the value set on canvas, I can't scroll to the lower parts of the document anymore.

Here is an example chapter were everything works just fine, because it's quite short: http://oxnrtr.de/scala-spec/01-lexical-syntax.html
Here is a larger example chapter which displays the issues I mentioned: http://oxnrtr.de/scala-spec/03-types.html

Would it be possible to have an outline mode where

  • the outline always takes up the available vertical space?
  • the scaling of the outline is applied only in the vertical direction, so that the width stays always the same?
commented

I did some preliminary work here: https://github.com/soc/jquery-fracs/compare/topic/nicer-scaling?expand=1

Code is probably not that great, I'm not good in using untyped languages, but maybe it's useful.