
15. Editing SVG graphics
Amaya enables you to include vector graphics in web pages, following the Scalable Vector Graphics
(SVG) specification. The goal is not create all SVG elements and attributes, but to implement a subset of
the language that is sufficient for the drawings that scientific authors include in their documents.
Amaya handles SVG elements as structured components, in the same way as HTML elements.
Therefore, you can manipulate SVG graphics in the structure view as you manipulate other parts of
HTML documents.
All editing commands provided by Amaya for handling text are also available for handling graphics.
Warning: SVG authoring is under development. You may find bugs and the user interface may
change in the future.
15.1. Creating graphics
To draw graphics, you need a SVG canvas. The canvas can be either the document itself or a <svg>
element inside a XML document. A SVG document is created by the File->New->New Drawing
command. A tab of the Elements tool allows you to create a SVG canvas and graphic components inside
a XML document.
When the user asks the creation of a SVG canvas into a XML document, Amaya looks for a place around
the insert point where such a <svg> element can be inserted. The element is created with a default width
and height. Later, when the SVG canvas is selected, the user can resize it.
If the user tries to create a graphics outside a SVG canvas, a <svg> element is automatically generated to
include the new graphic component.
When the user clicks within a SVG canvas, the SVG tool is presented and the user can create graphic
components:
• connectors: line, simple or double arrow, zigzag.
• text, embedded HTML fragment (foreignObject), mathematic formula, image.
• basic shapes: square, rectangle (optionally with rounded corners), diamond, parallelogram,
trapezium, triangles, circle, ellipse.
• polygon, polyline, open and close Bézier curves.
• regular polygons: pentagon, hexagon, heptagon, octagon, various stars
• 3D objects: cube, parallelepiped, cylinder, octahedron, pyramid.
• special symbols for electronics, chemistry, etc.
In formatted view, the position and size of all these created components are indicated by direct
interaction:
• For connectors (except for lines), basic shapes and 3D objects, you first select the position of
the left corner by pressing the left mouse button. While holding down the button (drag), move
the mouse to the position of the opposite corner, then release the button.
• For text and foreignObject, click on the position where you want to insert the element.
• For polygon and polyline, you click to generate a point at the corresponding position with the
left mouse button. To indicate the last point, use a double-click. A right click or a Esc stops the
interaction without an additional point.
15. Editing SVG graphics
49
Commenti su questo manuale