Hi Tomas,

> as a proof of concept, I have implemented your zapper demo using svg and
> without any javascript, see http://logand.com:2234/

Very nice indeed! SVG is a good alternative to Canvas, it seems.


> 1) It uses svg instead of canvas, meaning that:
> 
>   - There is no javascript required for drawing stuff.  The same
>     approach to generating html can be used to generate svg.
> 
>   - It's easy to define parts of the picture to be clickable, so if you
>     click on a point in the graph, the text clicked will be updated with
>     the y axis value, as an example.  Also it displays a buuble if you
>     leave cursor above a point.
> 
>   - svg used to be slow, broken and non-portable across browsers a few
>     years ago but these days, it's rather good for many use-cases.
>     There are still some things broken on some browsers, but it's
>     getting steadily better.
> 
>   - Graphics transformation can be easily specified in svg, so there is
>     no need to do "complicated" coordinate calculations. e.g.
> 
>     <g transform="translate(0 300) scale(1 -1) translate(0.5 150.5)">
> 
>     changes the orientation and origin of the coordinate system, and
>     also moves the centres of lines a bit so that 1px lines are sharp
>     (which is what you discussed with Jon I guess, and which your
>     example doesn't do for the horizontal axis I think).
> 
> 2) The example doesn't use any javascript meaning that the maximum
>    refresh speed is 1s.  This is good enough for many use-cases.  If
>    not, a bit of javascript can be added in a similar way like the
>    current picolisp refresh is implemented.  As you mentioned, something
>    like the +Auto class.
> 
>    If the automatic refresh is not desirable for the whole page, the
>    whole svg graph could be put into an iframe which would refresh, but
>    the surounding html would stay.  But it's not critical for this demo.

This makes a lot of sense. Thanks!

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to