Skip to content
Giorgio Caviglia edited this page Apr 9, 2014 · 12 revisions

This page aims at collecting some basic principles behind the creation of new charts and models.

##Charts

Use only SVG Elements

Since the main goal of RAW is to create visualization easily editable using vector graphic tools (e.g. Adobe Illustrator, Inkscape,...), charts must use only SVG elements.

Define Styles in the Chart (No External CSS)

Moreover, in order to include all the styles within the SVG code and allow the users to export exactly what they are looking at in RAW, external CSS styles cannot be used. Every style or attribute declaration has to be explicitly defined in the draw function (i.e. through .style or .attr D3's operators).

Avoid Enter-Update-Exit Pattern

D3's enter-update-exit pattern does not make too much sense within RAW's charts, since the SVG will be cleaned every time before calling the drawing function. Since RAW is meant to be a tool for the production of static (data do not change in RAW), non-interactive visualizations, to be elaborated using vector-graphics tools, this should not be perceived as a limitation, but, at the contrary, as a way to simplify charts' drawing code.