0

I am actually working on a tool to create new charts in a webbrowser an at the moement i am searching for a way to save my charts (which are differen SVGs) in a file, store it in a MySQL Database (MariaDB) and load it back in the browser to rework the whole diagram. But step by step: First, i am searching for a way to save those elements to a file. I thought about saving it into XML but i have no idea how i should go on that. Does someone have some ideas for me? Would apreshiate every helpfull comments i realy stuck at the moment.

Thanks to all!

1 Answers1

2

is your diagram joint js diagram ? If so, serialize to tojson or load from json is piece of cake:

to json: graph.toJSON()

import: graph.fromJSON(JSON.parse(jsonString))

for more info: http://resources.jointjs.com/docs/jointjs/v1.0/joint.html#dia.Graph.prototype.fromJSON

convert json to xml shouldn't be a problem either.

vt.
  • 1,398
  • 7
  • 15