Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Creating a timeline

1 view
Skip to first unread message

Christoph M. Becker

unread,
Feb 21, 2015, 8:07:09 AM2/21/15
to
Thomas 'PointedEars' Lahn wrote:

> JFTR (CMIIW):
>
> Basic SVG images (as a template for more complex ones) can be created either
> with a text editor or a graphics editor. Canvas images must be created
> using a text editor; it is turtle graphics without vectors: you have to put
> down, move, and raise the pen manually, so to speak, and the image does not
> exist before the script has been executed.

Using canvas is not like turtle graphics (even though one could emulate
turtle graphics). Actually, many of its primitive operations are
somewhat similar to SVG.

> Canvas is at the core a proprietary technology; SVG has been a W3C standard
> from the beginning.

Canvas is part of the W3C HTML5 recommendation[1].

[1] <https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API>

[Xpost and F'up2 comp.infosystems.www.authoring.html]

--
Christoph M. Becker

Christoph M. Becker

unread,
Feb 21, 2015, 8:11:32 AM2/21/15
to
tlvp wrote:

> On Fri, 20 Feb 2015 22:18:34 +0100, Thomas 'PointedEars' Lahn wrote:
>
>> SVG has been a W3C standard
>> from the beginning.
>
> Which browsers currently render it correctly? (A few years ago the answer
> was: few if any. In particular IE (or was it FF?) did it only with an Adobe
> add-on. Things may be better nowadays, though if only Opera supports it,
> and maybe SVGweb, I'd say SVG's not really ready for the web just yet.)

Support for SVG is quite good nowadays, see
<http://caniuse.com/#search=svg>.

Thomas 'PointedEars' Lahn

unread,
Feb 21, 2015, 10:43:05 AM2/21/15
to
Christoph M. Becker wrote:

> Thomas 'PointedEars' Lahn wrote:
>> JFTR (CMIIW):
>> Basic SVG images (as a template for more complex ones) can be created
>> either with a text editor or a graphics editor. Canvas images must be
>> created using a text editor; it is turtle graphics without vectors: you
>> have to put down, move, and raise the pen manually, so to speak, and the
>> image does not exist before the script has been executed.
>
> Using canvas is not like turtle graphics (even though one could emulate
> turtle graphics). Actually, many of its primitive operations are
> somewhat similar to SVG.

Pardon? When I read

var canvas = document.getElementById("my-canvas");
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.strokeStyle = "green"
ctx.moveTo(100, 100);
ctx.lineTo(200, 200);
ctx.stroke();

I sense a lot of turtle graphics:

1. Select the green pen
2. Move the pen to 100, 100
3. Put down the pen
4. Move the pen to 200, 200
5. Raise the pen

Not exactly equivalent per step, but essentially what is happening.
beginPath() does not return a reference to a path object (which would be
equivalent to SVG), and there is no line object that you can manipulate
afterwards.

If you want the line just drawn to be elsewhere, you need to erase the line
(with .clearRect(), to avoid bleeding) and draw a new one (the general
recommendation is to clear the entire canvas this way). If you want the
line to be red instead of green, you need to paint a red line on top of the
green one and may still face bleeding (therefore, same recommendation in
this case).

Not so with SVG where you just change the coordinates or the color
properties of the element object:

var line = document.getElementById("my-line");

for (var coords = ["x1", "y1", "x2", "y2"], i = coords.length; i--;)
{
line[coords[i]].baseVal.value += 100;
}

line.style.stroke = "red";

>> Canvas is at the core a proprietary technology; SVG has been a W3C
>> standard from the beginning.
>
> Canvas is part of the W3C HTML5 recommendation[1].

No, the “canvas” *element* is, by virtue of the W3C now mostly copying
WHATWG specifications these days, whereas the WHATWG is dedicated to
“standardize” a careful selection of proprietary behavior (namely, that of
the browsers produced by the vendors who employ the WHATWG core members:
Apple, the Mozilla Foundation, and Opera Software [2]). But that is beside
the point.

[2] <https://wiki.whatwg.org/wiki/FAQ#What_is_the_WHATWG.3F>

> [1] <https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API>

There is nothing there that indicates that the Canvas *API* (the “core”
I wrote about) would not be proprietary.

> [Xpost and F'up2 comp.infosystems.www.authoring.html]

Does not belong there. X-Post and F'up2 .misc.


PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

tlvp

unread,
Feb 22, 2015, 12:50:35 AM2/22/15
to
On Sat, 21 Feb 2015 14:11:42 +0100, Christoph M. Becker wrote:

> tlvp wrote:
>
>> On Fri, 20 Feb 2015 22:18:34 +0100, Thomas 'PointedEars' Lahn wrote:
>>
>>> SVG has been a W3C standard
>>> from the beginning.
>>
>> Which browsers currently render it correctly?
>
> Support for SVG is quite good nowadays, see
> <http://caniuse.com/#search=svg>.

Better now than was the case up through most of 2014, I see, now that
Firefox (with v. 34 of 12/2014) and Android (with the recent v. 4.4) have
joined Chrome, but "quite good"? OK, I won't argue :-) . Certainly "getting
better" I can agree more easily, in any event.

> [Xpost and F'up2 comp.infosystems.www.authoring.html]

Done. Thanks for the Can_I_Use link. And cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.

Jonathan N. Little

unread,
Feb 22, 2015, 9:04:28 AM2/22/15
to
tlvp wrote:
> On Sat, 21 Feb 2015 14:11:42 +0100, Christoph M. Becker wrote:
>
>> tlvp wrote:
>>
>>> On Fri, 20 Feb 2015 22:18:34 +0100, Thomas 'PointedEars' Lahn wrote:
>>>
>>>> SVG has been a W3C standard
>>>> from the beginning.
>>>
>>> Which browsers currently render it correctly?
>>
>> Support for SVG is quite good nowadays, see
>> <http://caniuse.com/#search=svg>.
>
> Better now than was the case up through most of 2014, I see, now that
> Firefox (with v. 34 of 12/2014) and Android (with the recent v. 4.4) have
> joined Chrome, but "quite good"? OK, I won't argue :-) . Certainly "getting
> better" I can agree more easily, in any event.

That table is not very accurate. I just installed Firefox 3.0.1 vintage
2008 on an XP VM and it displays SVG's just fine. Old Mozilla browser
1.0 does not but that is much older predecessor.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

John W Kennedy

unread,
Feb 22, 2015, 10:23:15 AM2/22/15
to
Safari.

--
John W Kennedy
"The grand art mastered the thudding hammer of Thor
And the heart of our lord Taliessin determined the war."
-- Charles Williams. "Mount Badon"

Christoph M. Becker

unread,
Feb 22, 2015, 11:42:53 AM2/22/15
to
Jonathan N. Little wrote:

>> On Sat, 21 Feb 2015 14:11:42 +0100, Christoph M. Becker wrote:
>>
>>> Support for SVG is quite good nowadays, see
>>> <http://caniuse.com/#search=svg>.
>
> That table is not very accurate. I just installed Firefox 3.0.1 vintage
> 2008 on an XP VM and it displays SVG's just fine. Old Mozilla browser
> 1.0 does not but that is much older predecessor.

The table doesn't say otherwise.

--
Christoph M. Becker


Jonathan N. Little

unread,
Feb 22, 2015, 2:50:22 PM2/22/15
to
True, but does imply it since only starts listing for FF at 34 but where
does list earlier versions of other browsers. tlvp got that implication.

Christoph M. Becker

unread,
Feb 22, 2015, 2:56:40 PM2/22/15
to
Jonathan N. Little wrote:

> Christoph M. Becker wrote:
>> Jonathan N. Little wrote:
>>
>>>> On Sat, 21 Feb 2015 14:11:42 +0100, Christoph M. Becker wrote:
>>>>
>>>>> Support for SVG is quite good nowadays, see
>>>>> <http://caniuse.com/#search=svg>.
>>>
>>> That table is not very accurate. I just installed Firefox 3.0.1 vintage
>>> 2008 on an XP VM and it displays SVG's just fine. Old Mozilla browser
>>> 1.0 does not but that is much older predecessor.
>>
>> The table doesn't say otherwise.
>>
>
> True, but does imply it since only starts listing for FF at 34 but where
> does list earlier versions of other browsers. tlvp got that implication.

The default view mode of the table is "aligned to current browsers".
There are buttons directly above the table to change that; try "Show all".

--
Christoph M. Becker


0 new messages