A collection of functions that exports various file formats
Methods
# (static) png(container_id)
Downloads / saves a png file with the contents of a container
Note: all of the graphics made with this library create SVG elements, so just pass the same ID that you used to create the graphic in the first place
Parameters:
Name | Type | Description |
---|---|---|
container_id |
String | The ID of a container that has one or more SVG elements in it. |
Example
<script src="edo.js"></script>
<script src="raphael.min.js"></script>
<div id="container" style="width:900px;height:600px; margin:0 auto;"></div>
<script>
let edo = new EDO()
//Create a necklace graphic
edo.show.necklace('container', [0,2,4,5,7,9,11])
//Save the graphic
edo.export.png('container') //downloads the necklace
</script>
# (static) svg(container_id)
Downloads / saves an SVG file with the contents of a container
Note: all of the graphics made with this library create SVG elements, so just pass the same ID that you used to create the graphic in the first place
Parameters:
Name | Type | Description |
---|---|---|
container_id |
String | The ID of a container that has one or more SVG elements in it. |
Example
let edo = new EDO()
//Create a necklace graphic
edo.show.necklace('container', [0,2,4,5,7,9,11])
//Save the graphic
edo.export.svg('container') //downloads the necklace