a constraint extension to scalable vector graphics greg j. badros jojada j. tirtowidjojo kim...

22
A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowid jojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong Kong. ACM

Upload: vivian-hutchinson

Post on 03-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

A Constraint Extension to Scalable Vector Graphics

Greg J. Badros Jojada J. Tirtowidjojo

Kim Marriott Bernd Meyer

Will Portnoy Alan Borning

May 1-5,2001,Hong Kong. ACM

Page 2: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

Introduction

• SVG is not enough

• SVG background• CSVG(constraint scalable vector graphic)

• Implementation

• Performance

• Conclusion

• Future work

Page 3: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

SVG is not enough

• It does not provide for flexible layout given different viewer and browser capabilities,such as screen format and font preferences.

– EX. Format.Xrignt + horiz_spacing <= DataFormat.Xleft

– Example

Page 4: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

SVG is not enough(Cont.)

• Interactive manipulation– Semantic zooming (Example)

– Differential scaling– Semantic preserving manipulation(Example)

• Animation– We can also make these properties

dependent on a timer variable.

Page 5: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

SVG is not enough(Cont.)

• Extending SVG—main technical contribution:– A motivation for using constraints and alternative

layouts for a wide class of SVG diagrams

– A description of Constraint Scalable Vector Graphics as an extension of SVG

– A prototype implementation of a CSVG viewer based on the CSIRO SVG viewer

Page 6: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

SVG BACKGROUND

• Basic:– < rect x=“20” y=“10” width=“10” height=“5”/>– < path d=“M 20 10 L 30 10 L 30 15 L 20 15 Z”/>

• Animate:– < rect x=“20” y=“10” width=“10” height=“5”/>

< animate atrributeName=“x” atrributeType=“XML”

begin=“0s” dur=“0s” fill=“freeze” from=“20” to=“120” />

• Example

Page 7: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

CSVG(constraint scalable vector graphic)

• Four extensions to the SVG language:– We store all SVG standard element attributes in

predefined constraint variables and support identifier in addition to literal.

• < rect id=“rectA” x=“20” y=“10” width=“square_edge” height=“square_edge” rx=“5” ry=“5”/

>– Six predefined variable based on it’s id : rectA_x; rectA_y;

rectA_width; rectA_height; rectA_rx; rectA_ry

• Constraint variables may also be declared explicitly by using a new var element.

Page 8: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

CSVG (Cont.)

– Add another new element type called constraint

• Require attribute rule• Optional attribute strength

• < constraint rule=“square_edge >=50”

strength=“strong” />

< rect id=“rectA” x=“20” y=“10” width=“square_edge” height=“square_edg

e” />

Page 9: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

CSVG (Cont.)

– Add several built-in read-only constraint variables.

• Viewport_width• Viewport_height

Page 10: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

CSVG (Cont.)

– Added alternate layouts for groups of SVG elements.

• docase• gcase

• Example• Layout example(109 constraints)• Interactive example(185 constraints)• Animation example(30 constraints)

Page 11: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

Implementation

• CSVG DTD– Children of SVG group elements(svg ,g),

add elements:• Var• Constraint• Docase

• Constraint Solving engine

• Architecture of implementation

Page 12: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

PERFORMANCE

• Class hierarchy example– 266ms

• Abacus example – 485ms– Moving a bead — 16ms

• Machine:– Pentium II 450MHz – Java 1.2 with the Hotspot virtual machine

Page 13: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

CONCLUSION

• Constraint-based graphics documents are difficult to author

• No authoring environments for generating CSVG

Page 14: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong

FUTURE WORK

• Could support referencing other elements’ attributes directly.

• To better describe the semantics of SVG in terms of constraints and constraint hierarchy theory.

Page 15: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 16: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 17: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 18: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 19: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 20: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 21: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong
Page 22: A Constraint Extension to Scalable Vector Graphics Greg J. Badros Jojada J. Tirtowidjojo Kim Marriott Bernd Meyer Will Portnoy Alan Borning May 1-5,2001,Hong