Javascriptで簡単にMindmapを作成 jsMind


Javascriptで簡単にMindmapを作成できるjsMindの導入メモ


各種情報

各種GitHub等の情報はこちら

jsMind

jsMind - GitHub

jsMind - Document

jsMind - Demo


サンプル

サンプルコード

<link type="text/css" rel="stylesheet" href="/jsmind/style/jsmind.css" />
<script type="text/javascript" src="/jsmind/js/jsmind.js"></script>
<script type="text/javascript" src="/js/jsmind.draggable.js"></script>
<div id="jsmind_container" style="width:100%;height:500px;"></div>
<script type="text/javascript">
    function load_jsmind(){
        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"}
                ]}
            ]}
        };
        var options = {
            container:'jsmind_container',
            editable:true,
            theme:'primary'
        }
        var jm = jsMind.show(options,mind);
        // jm.set_readonly(true);
        // var mind_data = jm.get_data();
        // alert(mind_data);
        jm.add_node("sub2","sub23", "new node", {"background-color":"red"});
        jm.set_node_color('sub21', 'green', '#ccc');
    }
    load_jsmind();
</script>

サンプルコード結果


公式の情報を見るとマインドマップの画像をダウンロード出来たり、FreeMindのデータを使用してマインドマップを出すことが可能なようです。

各種、オプションを指定して色や編集の可否の設定が可能になっています。


0 件のコメント :

コメントを投稿