[Contents](index.md) 1. **Usage** 2. [Options](2.options.md) 3. [Operation](3.operation.md) 4. [Contribution](4.contribution.md) 1.1. Basic Framework === At first, 2 files (jsmind.css and jsmind.js) are required. ```html ``` add script jsmind.draggable.js for enabling drag-and-drop feature. ```html ``` The second, a div element should be in your HTML as container ```html
``` The last, show an empty mindmap: ```javascript ``` Or, show a mindmap with some topics: ```javascript ``` 1.2. Data Format === Three formats are supported by jsMind: `node-tree format`,`node-array format`,`freemind format`. jsMind can load either format below, also can export data for any format. These are simple demo for the 3 data format: A. node-tree format ```javascript var mind = { "meta":{ "name":"jsMind remote", "author":"hizzgdev@163.com", "version":"0.2" }, "format":"node_tree", "data":{"id":"root","topic":"jsMind","children":[ {"id":"easy","topic":"Easy","direction":"left","children":[ {"id":"easy1","topic":"Easy to show"}, {"id":"easy2","topic":"Easy to edit"}, {"id":"easy3","topic":"Easy to store"}, {"id":"easy4","topic":"Easy to embed"} ]}, {"id":"open","topic":"Open Source","direction":"right","children":[ {"id":"open1","topic":"on GitHub"}, {"id":"open2","topic":"BSD License"} ]}, {"id":"powerful","topic":"Powerful","direction":"right","children":[ {"id":"powerful1","topic":"Base on Javascript"}, {"id":"powerful2","topic":"Base on HTML5"}, {"id":"powerful3","topic":"Depends on you"} ]}, {"id":"other","topic":"test node","direction":"left","children":[ {"id":"other1","topic":"I'm from local variable"}, {"id":"other2","topic":"I can do everything"} ]} ]} }; ``` B. node-array format ```javascript var mind = { "meta":{ "name":"example", "author":"hizzgdev@163.com", "version":"0.2" }, "format":"node_array", "data":[ {"id":"root", "isroot":true, "topic":"jsMind"}, {"id":"easy", "parentid":"root", "topic":"Easy", "direction":"left"}, {"id":"easy1", "parentid":"easy", "topic":"Easy to show"}, {"id":"easy2", "parentid":"easy", "topic":"Easy to edit"}, {"id":"easy3", "parentid":"easy", "topic":"Easy to store"}, {"id":"easy4", "parentid":"easy", "topic":"Easy to embed"}, {"id":"open", "parentid":"root", "topic":"Open Source", "direction":"right"}, {"id":"open1", "parentid":"open", "topic":"on GitHub"}, {"id":"open2", "parentid":"open", "topic":"BSD License"}, {"id":"powerful", "parentid":"root", "topic":"Powerful", "direction":"right"}, {"id":"powerful1", "parentid":"powerful", "topic":"Base on Javascript"}, {"id":"powerful2", "parentid":"powerful", "topic":"Base on HTML5"}, {"id":"powerful3", "parentid":"powerful", "topic":"Depends on you"}, ] }; ``` C. freemind format ```javascript var mind = { "meta":{ "name":"example", "author":"hizzgdev@163.com", "version":"0.2" }, "format":"freemind", "data":" " }; ``` 1.3. Themes === 15 themes were supported in jsmind, you can preview those themes by visiting [feature-demo](http://hizzgdev.github.io/jsmind/example/2_features.html). + primary + warning + danger + success + info + greensea + nephrite + belizehole + wisteria + asphalt + orange + pumpkin + pomegranate + clouds + asbestos or, you can add your custom theme in jsmind.css. ```css /* greensea theme */ jmnodes.theme-greensea jmnode{background-color:#1abc9c;color:#fff;} jmnodes.theme-greensea jmnode:hover{background-color:#16a085;} jmnodes.theme-greensea jmnode.selected{background-color:#11f;color:#fff;} jmnodes.theme-greensea jmnode.root{} jmnodes.theme-greensea jmexpander{} jmnodes.theme-greensea jmexpander:hover{} ``` copyright notice === Reproduction and deduction are prohibited. The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.