Translations
English
French
Spanish

# Draggable school toolkit

## How to add a new tool

The JavaScript class GeomToolFromFile allows one to insert objects defined in SVG files. Example:

    	let p = new GeomPaper("canvas_container1", 1000, 600);
    	let o3 = new GeomToolFromFile(
    	  p, "equerre01",
    	  "/usr/share/javascript/schoolkit/equerre01.svg",
    	  new DOMPoint(300,150),
    	  1);

The SVG file must contain

- A <g> group element with an attribute id="layer1"; this group must then contain:
- A <circle> circle element whose center, defined by the attributes cx and cy will be the center of rotation for the geometric tool; this circle must have the attribute id="centre";
- A random graphic element, with the attribute id="rotation_handle"; it should not overlap the central point, because it will be used to control the rotation upon dragging;
- A random graphic element, with the attribute id="translation_handle" which will be used to control the translation upon dragging;
- And any number of other graphic elements appended to the main group.

## Demo