RE: Connecting elements using lines/paths

Erik wrote suggesting that SVG was missing features as a modeling
language for ontologies, etc., specifically the ability to represent
connections between shapes.

SVG is a vector graphics language, not a modeling language. SVG is about
defining and rendering 2D graphics on a variety of devices, with support
for animation and user interactivity. A modeling language is so much
more. A modeling tool could use SVG for rendering the model to a screen
or printer but there is much more to modeling languages and tools.

In the case of supporting connections between objects, a modeling
language and its tools (e.g., Rational Rose, Visio, etc.) has features
for specifying whether connections are allowed to intersect other
connections or objects, and if not, more features governing the routing
of connections to produce an acceptable result. If you think these
routing issues are easy, try laying out an integrated circuit. It is
very easy to define a routing problem that is over constrained (i.e.,
cannot be laid out). In other words, adding this feature is not a
trivial matter.

Here's the crux of the biscuit: would this proposed connection feature
be something that all SVG implementations should be required to
implement? I think you will find that this request is not consistent
with the goals and objectives of the SVG specification (read "feature
creep"), so SVG vendors and other W3C members would probably not support
it as part of SVG.

That's not to say that modeling languages are irrelevant or anything of
the sort. But you will have a seriously compromised design if you think
you will be able to use SVG as a modeling language. Create or find
(e.g., look up XMI) a modeling language. Use SVG as the rendering
engine. Consider using XSLT to transform your modeling language
documents to SVG.

Cheers,
Stuart Celarier
stuart@ferncrk.com, www.ferncrk.com


-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Kim Marriott
Sent: Tuesday, February 12, 2002 22:45
To: Erik Hellman; www-svg@w3.org
Subject: Re: Connecting elements using lines/paths

on 8/2/02 8:15 PM, Erik Hellman at Erik.Hellman@apollo.nu wrote:

> Hi,
> 
> I am looking at using SVG as a modelling language for ontologies, UML,
RDBMS
> etc. There, in my point of view, seems to be a feature missing in the
current
> specification. Is it possible to define two elements, like two
rectangulars,
> and then define a line or a path connecting them. This way it would be
> possible to change one of the rectangulars without having to redefine
the
> coordinates for the line/path. This could perhaps be done by
specifying the
> end coordinates for the line as a reference to a point within the
> rectangulars. Maybe one could define "connection points" for every
shape in
> SVG?
> 
> Has anyone thought of this or is it outside the goal of SVG?
> 
> regards,
> Erik Hellman
> 
> 

One possible way of approaching this is to use constraints to specify
geometric relationships between objects and their attributes.
Constraints
also allow you to model more complex adaptation such as differential
scaling
and interaction such as semantic zooming. Take a look at the following
if
you are interested:

    G. Badros, J. Tirtowidjojo, K. Marriott, B. Meyer, W. Portnoy, and
    A. Borning. A constraint extension to scalable vector graphics.  In
    WWW-10,  May 2001.
    http://www.csse.monash.edu.au/~marriott/papers/csvg-btmmb.pdf

    K. Marriott, B. Meyer, and L. Tardif. Fast and efficient client-side
    adaptivity for SVG. To appear in WWW 2002 May 2002.
    http://www.csse.monash.edu.au/~marriott/papers/csvg-mmt.pdf

The one-way constraints approach suggested in the second paper
essentially
allows you to assign expressions to attributes of the document elements.
Computation of the attribute's value is delayed until display time at
which
time this expression is evaluated on the client side.  The expression
may
refer to attributes of other elements and also to properties of the
display
environment such as browser width and height. And as you suggest you can
use
this to easily specify the end coordinates of a line in terms of the
rectangles' coordinates:

  <rect id="b1" ... />
  <rect id="b2" ... />

  <line 
        x1="url(#b1)_x + url(#b1)_width/2"
        y1="url(#b1)_y + url(#b1)_height/2"
        x2="url(#b2)_x - url(#b1)_width/2"
        y2="url(#b1)_y + url(#b1)_height/2" />


I believe that constraints are on the ``to be discussed'' list for SVG
2.0

Cheers

Kim

---------------------------------------------------------------------
A/Prof Kim Marriott
School of Computer Science & Software Engineering
Monash University, Clayton, Vic 3168, Australia
Ph: ++61 (3) 9905-5525, Fax: ++61 (3) 9905-5146
Email: Kim.Marriott@infotech.monash.edu.au

Received on Wednesday, 13 March 2002 14:04:32 UTC