On Mar 16, 2015, at 7:13 PM, Richard Hipp <d...@sqlite.org> wrote:
> 
> On 3/16/15, Warren Young <w...@etr-usa.com> wrote:
>> 
>> There are at least three ways to create the timeline without Javascript.
>> 
>> 1. Build the timeline as a dynamic PNG on the server side
> 
> The main difficulty is knowing where to put each node of the graph,
> since the vertical space between nodes depends on how long the
> check-in comment is and how it wraps.

Yes, I see what you mean.

However, I think you can just piece the graph together one row at a time.  HTML 
has several facilities for stretching graphic elements over the width or height 
of a <td>, for example.

Pseudocode:

  <td style=“background-image:url(‘row3523.png’); height: 100%”
      valign=top align=center>
    <img src=“box.png” onclick=“javascript:toggleSelection(this)"><br>
    <img src=“arrowhead.png”>
  </td>

The row PNG would have the lines, and the box and arrowhead PNGs would overlay 
it, hiding the fact that the line extends underneath.

> I didn't get far enough down this path to investigate the second
> potential problem:  limits on the sizes of GIF/PNG files.

PNG dimensions actually go to 2^31 px, but that’s academic, since drawing it 
all in a single PNG isn’t a good idea.

The same is true of the canvas and SVG options: you’d want to draw the graph 
piece-by-piece in the timelineGraph td elements.

> Or would it be
> necessary to bring the image up into segments, with a separate server
> round-trip and CGI-process invocation for each chunk?

That’s one of several advantages to the canvas and SVG options: you can put the 
code inline within the <td> element.

The only advantage to the PNG option is that you can avoid HTML5 and can run on 
half-baked browsers like Dillo, but that’s chasing a sub-1% slice of the user 
base.

> Is it wrong to think that any browser that does not support JS
> probably also does not support SVG?

JS and SVG are orthogonal.  You can have a browser with any of the four 
combinations of this pair of features.

You'll probably want to tie some JS to the SVG for the clickable boxes, but 
that’s no different from the current situation.

> I've never worked with SVG, so I
> don't know its limitations and capabilities.

Well, put it this way: SVG is the native file format for Inkscape, which 
manages to compete fairly well with Adobe Illustrator.

> Can it create the very
> tall graphics required by the Fossil timeline?

SVG is a vector drawing format.  It can be used to create mile-high drawings at 
1200 dpi, if you cared to.

>> 3. Generate the timeline via <canvas>.
> 
> That also requires JS, no?

Yes.  If you went this route, I think you’d want to let the browser lay out the 
<table>, then go in and draw each <td><canvas id=“row3987”></td> cell one at a 
time.

> the canvas is limited in size to 32768 pixels high

Just so it’s clear, a <canvas>-per-<td> model makes that limit irrelevant.

Well, I suppose it prevents you from writing a fanfic take-off on the Epic of 
Gilgamesh in a Fossil checkin comment, but you deserve what you get if you do 
such a thing.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to