Skip to content

Commit

Permalink
Merge pull request #14 from 3yaa3yaa/dev
Browse files Browse the repository at this point in the history
1.4.2
  • Loading branch information
3yaa3yaa committed Oct 21, 2019
2 parents 152bb03 + 819d8b0 commit e37b72c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ Sample page -- https://3yaa3yaa.github.io/TreeMindMap-Site/
![howto](https://github.com/3yaa3yaa/TreeMindMap/blob/master/howto.png)

## Projects that uses this component

* https://github.com/3yaa3yaa/TreeMindMap-Site
* https://github.com/3yaa3yaa/TreeMindMap-Electron

## How to use this?
Use "<Map />" tag with paramters "initialState" and "stateHandler".
## How to use this component?
Use "<Map />" with parameters "initialState" and "stateHandler".
* "initialState" : The first state to be load in the mindmap
* "stateHandler" : This is triggered every time the state changed.

For example, you can specify the values as below.
https://github.com/3yaa3yaa/TreeMindMap-Electron/blob/master/app/index.js

### ES6
```
import Map from 'treemindmap'
import { Map} from 'treemindmap'
...
render(
<Map
Expand All @@ -37,3 +36,20 @@ render(
document.getElementById('root')
);
```

### ES5
```
const ReactDOM = require('react-dom');
const Render=require('treemindmap').Render;
...
Render(
container.data.value,
(state) => {
container.data.set(JSON.stringify(state));
SaveFile(container.filepath.value, container.data.value);
},
'root', /* id of DOM */
ReactDOM
)
```

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "treemindmap",
"version": "1.4.1",
"version": "1.4.2",
"description": "",
"main": "build/bundle.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/ImageMainMenu.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.ImageMainMenu {
margin-left: 10px;
margin-top:10px;
margin-top:15px;
}

.ImageMainMenu-Item {
Expand Down

0 comments on commit e37b72c

Please sign in to comment.