Logical Groups

At the SVG-Open WG panel discussion, a question regarding roads was put to
the WG, wishing to somehow allow variable z-index to simulate, for instance,
a road passing over and under another road at different points. A possible
solution was floated by a WG member (maybe Jon?), that called for the
virtual linking of separate path elements, so that they could be logically
linked while retaining the painter's model rendering. This idea seemed to
satisfy people, though it was only speculative.

In a recent discussion with Jim Ley about text in SVG, he brought up the
idea of  "linking separate <text> elements into something that can be
selected as a whole, which would need some kind of read-index attribute."
This struck me as an opportunity for two-birds-with-one-stone elegance.

After some dialog, we thought up a possible mechanism that would satisfy
both these use cases: the declaration of a logical grouping of elements,
similar to <use>, that would "logically render" in the same painter's model
fashion, without changing the graphical rendering. In the case of text, this
might look like:

<logicalGroup id='myParagraph'>
   <member xlink:href='#foo'/>
   <member xlink:href='#bar'/>
   <member xlink:href='#buh'/>
</logicalGroup>

<text id='buh' x='0' y='13'>One</text>
<text id='foo' x='0' y='15'>Two</text>
<text id='bar' x='0' y='18'>Three</text>

(<member> could also simply be <use>, since the logicalGroup would not
visibly render.)

This would allow for some very interesting possibilities:
 * selection of members of the logical group for certain DOM manipulations,
such as toggling visibility, and possibly transformations
 * reading order control by virtual group, for accessibility issues
 * selection of text within virtual group as a whole, rather than just
individual text elements
 * obviation of need for metadata, in many cases

Regards-
-Doug

Received on Tuesday, 29 July 2003 17:10:09 UTC