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 February 2002 01:45:01 UTC