SVG authoring guidelines
July 31, 2017 · View on GitHub
- Anatomogram SVGs are edited with Inkscape and saved as Inkscape SVG in the
src/svgdirectory. - To ensure that the correct
heightandwidthare set remember to do the following before saving: go to File → Document Properties... → Page tab → Custom size, then set Units topxand click on Resize page to drawing or selection. - The SVG must follow the naming scheme
<species>[.view].svg(e.g.homo_sapiens.brain.svg). - The structure of the SVG must be as follows:
<svg ...>
<defs .../>
<sodipodi:namedview .../>
<metadata>
...
</metadata>
<g
id="LAYER_OUTLINE">
[Organism outline shapes]
</g>
<g
id="LAYER_EFO">
[Tissue shapes]
</g>
</svg>
- Both layers must be absolutely positioned, i.e. no
translate(x,y)ormatrix(a,b,c,d,x,y)in thetransformattribute (e.g.scaleis fine). - Each tissue shape is either:
- a group or basic shape (ellipse, path, etc.) with an ontology ID in its
idattribute andstyle="fill:none; stroke:none". - a
<use>tag with an ontology ID in itsidattribute and a value of one of the former tissue shapes in itsxlink:hrefattribute.
- a group or basic shape (ellipse, path, etc.) with an ontology ID in its
- If a tissue shape is a group, i.e.
<g ...></g>each of the shapes inside must have no styles at all. The appearance is determined by the attributes of the enclosing group tag. - A tissue shape cannot have another group inside. It must be formed by basic shapes only.
- A tissue shape should have a
<title>attribute with the name of the tissue. - The top
<svg ...>tag must have the attributesviewBox="0 0 [width] [height]"andpreserveAspectRatio="none". These may be added with a text editor after saving the SVG to look up theheightandwidthattributes. - The attribution icon links to
https://www.ebi.ac.uk/gxa/licence.htmland its size is[width] * φ / 10, where φ=1.618034. It will be located, in order of preference, to the bottom right, bottom centre or bottom left.