W3C

SVG Template Requirements

W3C Working Draft 23 July 2008

This version:
http://www.w3.org/TR/2007/WD-SVGTemplateReqs-20070309/
Latest version:
http://www.w3.org/TR/SVGTemplateReqs1/
Editors
Editor Name, Organization Name <editor@example.com>

Abstract

This document lists the design principles and requirements for the creation of a SVG specification related to Templates.

Status of this Document

This is a W3C Working Draft for review by W3C Members and other interested parties. It is a draft document and may be updated, replaced or made obsolete by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C Recommendations and other technical documents, including Working Drafts and Notes, can be found at http://www.w3.org/TR/

This is the first release of the SVG Template Requirements. It is expected that this document will progress through a number of working drafts, including "Last Call", before being published in final form.

This document was developed by the Scalable Vector Graphics (SVG) working group as part of the W3C Graphics Activity. The authors of this document are the SVG Working Group members.

Feedback on this document should be sent to the email list the public mailing list of the SVG Working Group (list archives). To subscribe send an email to www-svg-request@w3.org with the word subscribe in the subject line.

The latest information regarding patent disclosures related to this document is available on the Web. As of this publication, the SVG Working Group are not aware of any royalty-bearing patents they believe to be essential to SVG.

This section represents the status of this document at the time this version was published. It will become outdated if and when a new version is published. The latest status is maintained at the W3C.

Contents

1 Introduction

The SVG specification is a W3C recommendation that describes two-dimensional graphics in XML.

2 Terminology

The following key words and phrases used throughout this document are defined here for clarity. The terms Must, Should, and May are used to specify the extent to which an item is a requirement for the SVG working group in defining SVG. These recommendations should not be mistaken as a guide to implementors.

  1. 'Must' means that the item is an absolute requirement.
  2. 'Should' means that there may exist valid reasons in particular circumstances to ignore the item, but the full implications must be understood and carefully weighed before choosing a different course.
  3. 'May' means that item will be considered, but further examination is needed to determine if the item should be treated as a requirement.
  4. 'SVG' refers to SVG in general without reference to any version or profile.
  5. 'SVG 1.0' refers to the original SVG specification.
  6. 'SVG 1.1' refers to the modularized version of SVG 1.0.
  7. 'SVG 1.2' refers to the next release of SVG and is planned to reference this specification.
  8. 'SVGConnector' refers to SVG Connector, an SVG specification for connectors between shapes.

3 Usage Scenarios

The following usage scenarios illustrate some of the ways in which SVG Templates might be used for various applications.

Insert Use Case 1 Explain use case 1.

Insert Use Case 2 Explain use case 2.

4 Special Considerations for Template

Memory and processor requirements What are the requirements on memory or processing resources?

Implementation commitments How difficult, or what details are needed, for implementation?

Ease of authoring What considerations need to be borne in mind for authors?

5 Requirements

  1. General Requirements
    1. point should be reusable
    2. point should have absolute and relative positioning
    3. should consider the case of SVG in HTML
      • what happens when a connector links to an element in another namespace (e.g. an HTML 'p')? Does it draw a line? If so, where does the line start or end (e.g. in the middle of the block, or one of the corners)?
      • should connectors only work when connected to SVG-namespaced elements?
    4. Any valid SVG 1.1 Template must be a valid SVGx Template.
    5. Conformance criteria for SVGx must be produced. The criteria should be separated into sections relevant to particular application types (eg. SVG files/document fragments, SVG generators, SVG viewers, SVG printers, etc.)
    6. Software or documents must pass the relevant criteria to be able to claim conformance to the particular application type.
    7. A conformance test suite must be developed for SVGx. The test suite must be made publicly available. Conformance test suites for other uses of SVGx (e.g. prepress guidelines) may be developed.
    8. A specification referencing SVGx must declare if animations applies when a 'Template' chain is in its scope.
  2. Scripting
    1. Must include an API to allow authors to script custom routing for connectors
      • May include an interface on connector element to get active connection points, and all available nodes, along with their x and y positions.
    2. A dynamic SVGx viewer must support the SVGx scripting feature set.
  3. Animation
    1. A dynamic SVGx viewer must support animation of all properties listed as animatable.
  4. Out of Scope
    1. Specification must not include automatic positioning of nodes
      • Authors must lay out nodes manually or via script.
      • Specification should not concept of "weight" for node or connector.
    2. Specification must not include automatic routing of connector lines
      • Specification must not include ability for connectors to automatically avoid intersection with other connectors or with intervening nodes.
    3. Specification must not define automatic drag ’n’ drop of nodes
      • Authors may enable drag ’n’ drop of nodes via script.
      • Specification should not add x/y properties to compensation for transforms and viewboxes; this should be defined in a different SVG specification.

5 Design Considerations

Why include connectors in SVG?
Connectors have been on the list of requirements from the beginning of SVG, with Web Schematics, by David Duce and Bob Hopgood in 1998, which was one of the original input proposals for SVG. Despite the large number and wide variety of real-world use cases that graphs solve, there have been no real common standard for graphs, and existing standards don't have a visual representation. The lack of connectors harms accessibility, since connections depicted today are merely visual, not semantic or logical. Finally, the introduction of connectors may help adoption of SVG for common users.
Isn't this too high-level for SVG?
SVG has always resisted pressure to include "high-level" controls, such as form controls, and also specialized preset content such as a symbol library. However, it has always included high-level functionality such as hyperlinks and declarative animation. The specific set of features chosen for the Connector functionality was chosen for its relatively low implementation burden, general applicability, relative value for authors of SVG, and extensibility. HTML provides form controls, such as buttons, option selectors, checkboxes, and so forth; it also includes tables, for the organization and layout of data. SVG Connectors are intended to fill the equivalent graphical niche in SVG.
Is there author or user demand for such features?
Yes. Most graphical authoring tools (including Inkscape) supply some sort of dynamic connector line, and there are several applications dedicated to that specific purpose. There are also many applications that generate visual output from logical graphs. Common SVG script libraries such as Raphäel include simple connectors, and these are commonly used as part of navigation controls.
Is this compatible with existing authoring tools and technologies?
Yes. Because SVG Connectors defines a high-level abstraction and allows for customized
Isn't there a risk that this will be too powerful or not powerful enough to solve real-world problems?
Is the connector element, and the automatic line updating, subject to misuse or abuse?
Not really. A connector is a general concept, meant to indicate any kind of connection between two shapes or objects. Any use of a connector is appropriate, because it will necessarily indicate a relationship between those two things; a wide variety of uses is encouraged. Obviously, any additional semantic data, such as RDFa markup or titles, should be used appropriately as well. For large sets of data, with many connectors, there may be a performance cost, however, so connectors should be used with that in mind.
?
Shouldn't the semantics and behavior be separated?
There is a well-established web-language design principle against the use of "invisible metadata"—that is, metadata that is not presented to the majority of users; for example, ... . Separating the relationship of two objects from its visual representation means that it is less usable by most users, and that the metadata is less likely to be maintained in a consistent and correct way; equally, a simple visual line between two shapes cannot reliably be assumed to imply a connection. The visual, semantic, and behavioral aspects to the connector encourage the proper use of the format, rewarding authors for making their content accessible and reusable.
Why not simply add a 'connector' role to other shapes, such as the 'path' element? Why introduce a new element?
The 'role' attribute was not designed to change the behavior of an element
What are the performance costs? Will this require tracking dependency chains?
Yes, each connector must reflect the current position of each of its nodes, and the ports within that node. Until we have native implementations, and examples and tests of documents with a range of numbers of connectors, the precise performance costs are not clear. Early experiments with relatively simple examples in a javascript prototype did not seem to suffer from performance issues or excessive memory usage.
Can the 'point' element be used for other purposes?
Yes. The 'point' element is intended as a general-purpose element, and can be used without the 'connector' element for any desired reason, such as a point of interest on a map, or an animated reference point for layout. It is introduced in this specification merely for convenience.
Why not rely on a script library? Why put this in SVG?
What about existing modern and legacy SVG user agents which don't support connectors? How will they treat an SVG file which uses them?

7 References

SVG 1.1
Scalable Vector Graphics (SVG) 1.1 Specification, Jon Ferraiolo, Jun Fujisawa, Dean Jackson, editors, W3C, 14 January 2003 (Recommendation). See http://www.w3.org/TR/SVG11/
SVG 1.1/1.2/2.0 Requirements
SVG 1.1/1.2/2.0 Requirements Document, Dean Jackson, editor, W3C, 22 April 2002. See http://www.w3.org/TR/SVG2Reqs/
Mobile SVG Profiles
Mobile SVG Profiles: SVG Tiny and SVG Basic, Tolga Capin, editor, W3C, 14 January 2003 (Recommendation). See http://www.w3.org/TR/SVGMobile

8 Author List

The authors of this specification are the participants of the W3C SVG Working Group.

Authors:

9 Notes

  Connectors

  DS: we have in the past talked about this
  ... i want to briefly go over some use cases for connectors
  ... and details
  ... we've avoided connectors because you can graphically represent something connecting something else
  ... but it doesn't have a logical connection
  ... there are a lot of use cases for things that are logically connected
  ... circuit diagrams, flow chart diagrams, any kind of node-edge graph
  ... we've avoided them in the same way as avoiding default symbols
  ... so connectors could also be used for representing roads, or any kinds of routes through some thing
  ... i think the class of uses for these things is large

  ED: xlink:href on every element?

  DS: there are a number of approaches
  ... i think the basic idea is that there are two aspects to it
  ... one, a logical connection, between two elements which represent two different objects
  ... and one is a physical connection
  ... an obvious thing people would like to do is [draws on board]
  ... [two circles connected by a line, moving one circle should make the line follow it]
  ... that could be done in the very simplest case, but i don't think people are going to want  
      to do something where the line has to wrap around another shape, for example
  ... implementors aren't going to want to solve that case
  ... edge routing
  ... but i think there is still a lot of utility in straight line connections
  ... in the future, potentially allowing the author to say "go through this point" when routing

  CL: this needs to be a new curve type?

  DS: could be just straight lines
  ... solve many use cases, not all

  CL: curves that pass through particular points we've come up against before, so perhaps we want to add them

  DS: making a rendering element is one aspect of the problem
  ... making a logical one is another aspect
  ... so are these connections directed, undirected?
  ... that's part of the logical aspect of it
  ... another part is "what is the relationship itself"
  ... e.g. does that mean parent--child relationship, or what
  ... that might be represented as a form of metadata, like rdf
  ... or it might be, for a UI, some textual equivalent of that equivalent
  ... if i'm following a map, so you walk from the subway stop to the building
  ... maybe the metadata is "walk from from subway stop to building"
  ... how would you express that? maybe you'd have a <title> element
  ... how do you represent the connector
  ... i'm positing that we need a 'connector' element
  ... what characterstics does it have?
  ... it has a from and a to
  ... so a connector, as i see it, is a special form of path that doesn't have a fill
  ... what i'm thinking is that it would take path syntax so that if you wanted to do your own routing, 
      you could say this is what it looks like
  ... another way i thought of doing this would be to have role="connector" on a path
  ... and that would mean logically that it is a connector
  ... if connector weren't implemented, you could represent it as a path
  ... what is the role of a connector? either as a separate element or a path
  ... it's to present to a user to go from one thing to another
  ... pretend we are in a flow chart, and we're navigating around it

  [draws on board]

  scribe: if you're in one node, and you want to navigate to another node that is connected from that one
  ... the tilte of connectors could be read out, for example
  ... and the user could choose
  ... or maybe it's a popup that lets the user see what the relationship is
  ... in terms of navigating documents in a logical order, a blind person could query the connector to find out where it's going
  ... so they could step through a complex diagram
  ... one use case i've seen for this is that they wanted to have all of their wiring diagrams for cars as svg files
  ... apparently in japan, wiring diagrams for cars are done in svg
  ... so when a mechanic is trying to sort out "is this circuit live or not", we set up a little animation 
      to show them if they clicked a button which connectors are active
  ... so in this scenario you might write a state machine and enable/disable certain connectors
  ... it would be an accessible way to present these diagrams
  ... right now, if i were navigating these elements, in 1.2T we could use the nav-* properties
  ... but they only solve a physical case
  ... with the connectors they define implicit navigation options
  ... maybe its role would indicate the direction of the connector
  ... so there's also a visual aspect of the problem
  ... we should reuse existing path syntax, so if a person wants to do custom routing they can
  ... failing that, it would just be a direct line
  ... but when they use a direct line, dragging this element, the line would follow
  ... so either you would take advantage of the auto routing, which would be a straight line in the first version, 
      or you would write your own path
  ... but you always get the logical connection
  ... in later versions you could provide some way to tell it to do routing
  ... there are two problems with diagrams like this
  ... one is the line routing
  ... the second is the node placement
  ... we're also not going to solve that, unless it gets solved in the bounds of some layout algorithm
  ... e.g. cameron's layout might take care of that

  CL: you're not just going to point at an object, but then you to say i'm going from this point to this other point

  AG: you could specify the endpoints as bounding box percentages

  DS: i'm not sure that's going be satisfying
  ... e.g. on a diamond shape, you don't want connecting lines going to one of its sides
  ... so not necessarily the shortest path
  ... we've already thought of the idea of svg point elements
  ... it could act as an anchor point
  ... so what if we defined the anchor points of children of the element

  AG: how do you associate the connectors with an object?
  ... i was thinking they might be a child

  DS: can't be a child of two elements though
  ... they can be in their own block somewhere
  ... you can name the point you want to connect to
  ... the default might be to choose the shortest path between the possible anchor points on the shapes
  ... you could name these anchors and identify them explicitly

  AG: could you have free floating svg:points?

  DS: in future versions

  AG: many-to-many connections?

  DS: no, just one-to-one connections

  CM: i wonder if you ever want navigation that is different from what the connections indicate

   as far as semantics of relationships, you should be able to extract a triple from this diagram

   as far as navigation goes, they don't ahve to render, might be a better way to define meaningful navigation with titles/descs

   rather than using nav-next/-prev attributes

  RESOLUTION: We'll consider the connector proposal

   ACTION: Doug to write up the connector proposal [recorded in http://www.w3.org/2009/09/30-svg-minutes.html#action04]

   Created ACTION-2681 - Write up the connector proposal [on Doug Schepers - due 2009-10-08].