1- ![ mindelixir logo ] ( https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo .png )
1+ < p align = " center " >< a href = " mind-elixir.com " target = " _blank " rel = " noopener noreferrer " >< img width = " 150 " src = " https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2 .png " alt = " mindelixir logo2 " ></ a ></ p >
22
3- <p >
3+ <p align = " center " >
44 <a href =" https://www.npmjs.com/package/mind-elixir " >
55 <img src="https://img.shields.io/npm/v/mind-elixir" alt="version">
66 </a >
2020
2121Mind elixir is a free open source mind map core.
2222
23+ - Zero dependency
2324- High performance
2425- Lightweight
2526- Framework agnostic
2627- Pluginable
2728- Build-in drag and drop / node edit plugin
29+ - Styling your node with CSS
2830
2931<details >
3032<summary >Table of Contents</summary >
@@ -46,6 +48,7 @@ Mind elixir is a free open source mind map core.
4648 - [ Event Handling] ( #event-handling )
4749 - [ Data Export And Import] ( #data-export-and-import )
4850 - [ Operation Guards] ( #operation-guards )
51+ - [ Theme] ( #theme )
4952- [ Not only core] ( #not-only-core )
5053
5154</details >
@@ -66,11 +69,11 @@ https://mind-elixir.com/
6669
6770https://codepen.io/ssshooter/pen/GVQRYK
6871
69- #### Use with React
72+ #### Use with React
7073
7174https://codesandbox.io/s/mind-elixir-react-9sisb
7275
73- #### Use with Vue
76+ #### Use with Vue
7477
7578https://codesandbox.io/s/mind-elixir-vue-nqjjl
7679
@@ -128,9 +131,9 @@ let options = {
128131 keypress: true , // default true
129132 locale: ' en' , // [zh_CN,zh_TW,en,ja,pt,ru] waiting for PRs
130133 overflowHidden: false , // default false
131- primaryLinkStyle : 2 , // [1,2] default 1
132- primaryNodeVerticalGap : 15 , // default 25
133- primaryNodeHorizontalGap : 15 , // default 65
134+ mainLinkStyle : 2 , // [1,2] default 1
135+ mainNodeVerticalGap : 15 , // default 25
136+ mainNodeHorizontalGap : 15 , // default 65
134137 contextMenuOption: {
135138 focus: true ,
136139 link: true ,
@@ -162,7 +165,7 @@ mind.install(plugin) // install your plugin
162165// create new map data
163166const data = MindElixir .new (' new topic' )
164167// or `example`
165- // or the data return from `.getAllData ()`
168+ // or the data return from `.getData ()`
166169mind .init (data)
167170
168171// get a node
@@ -173,7 +176,7 @@ E('node-id')
173176
174177``` javascript
175178// whole node data structure up to now
176- nodeData = {
179+ const nodeData = {
177180 topic: ' node topic' ,
178181 id: ' bd1c24420cd2c2f5' ,
179182 style: { fontSize: ' 32' , color: ' #3298db' , background: ' #ecf0f1' },
@@ -182,10 +185,10 @@ nodeData = {
182185 icons: [' 😀' ],
183186 hyperLink: ' https://github.com/ssshooter/mind-elixir-core' ,
184187 image: {
185- url: ' https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo .png' , // required
188+ url: ' https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2 .png' , // required
186189 // you need to query the height and width of the image and calculate the appropriate value to display the image
187190 height: 90 , // required
188- width: 300 , // required
191+ width: 90 , // required
189192 },
190193 children: [
191194 {
@@ -227,9 +230,9 @@ mind.bus.addListener('expandNode', node => {
227230
228231``` javascript
229232// data export
230- const data = mind .getAllData () // javascript object, see src/example.js
231- mind .getAllDataString () // stringify object
232- mind .getAllDataMd () // markdown
233+ const data = mind .getData () // javascript object, see src/example.js
234+ mind .getDataString () // stringify object
235+ mind .getDataMd () // markdown
233236
234237// data import
235238// initiate
@@ -263,6 +266,28 @@ let mind = new MindElixir({
263266})
264267```
265268
269+ ## Theme
270+
271+ ``` javascript
272+ const options = {
273+ // ...
274+ theme: {
275+ name: ' Dark' ,
276+ // main lines color palette
277+ palette: [' #848FA0' , ' #748BE9' , ' #D2F9FE' , ' #4145A5' , ' #789AFA' , ' #706CF4' , ' #EF987F' , ' #775DD5' , ' #FCEECF' , ' #DA7FBC' ],
278+ // overwrite css variables
279+ cssVar: {
280+ ' --main-color' : ' #ffffff' ,
281+ ' --main-bgcolor' : ' #4c4f69' ,
282+ ' --color' : ' #cccccc' ,
283+ ' --bgcolor' : ' #252526' ,
284+ },
285+ // all variables see /src/index.less
286+ },
287+ // ...
288+ }
289+ ```
290+
266291## Not only core
267292
268293- [ @mind-elixir/export-xmind ] ( https://github.com/ssshooter/export-xmind )
0 commit comments