Hi Ortwin,


> On Sep 20, 2017, at 3:00 PM, [email protected] wrote:
> 
>> 
>> SVG is a whole lot easier to manage in JavaScript.
> 
> I'm wondering about modern myths …


Perhaps you’ve primarily used SVG to render fixed images, or if the images do 
change, the triggers come from events in 4D, not on the SVG area. In that case, 
you probably don’t notice much difference. But the SVG spec creates objects 
just like HTML does, and just like HTML, you can bind events and attributes to 
those objects, and can do some very useful interactive stuff

The 4D SVG component and the 4D language don’t have any direct way to apply 
events to individual objects in an SVG area. With Javascript, this is easy. It 
is object oriented. Each SVG object can contain its own event handlers and 
attribute data. Objects can inherit prototype traits. Objects can nest inside 
each other. The language is built for this stuff.

An example of the difference would be in an implementation of drag and drop in 
SVG. You can do it with 4D, but it takes quite a few lines of code. Its pretty 
awkward, especially if there are a lot of objects. The same problem in 
javascript is simple and elegant and fast.



Tom DeMeo
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to