Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] update docs for the new options #532

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/en/2.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ These options are described in more detail below.
> * `hidden` - Hide part of them to maintain the overall readability of the mind map [default]
> * `wrap` - Wrap the text to display the entire content

**view.zoom** : (object) zoom setting (since 0.6.3)
> * min - minimum zoom ratio,default 0.5
> * max - maximum zoom ratio, default 2.1
> * step - interval of zoom ratio, default 0.1

**view.custom_node_render** : (function) custom rendering method for node (since 0.7.6)

> The option can be used to change the default rendering logic of jsMind. The value of this option is a function, whose signature is `function (jm, element, node): boolean`. Its return value is used to indicate whether the node has been rendered. If it returns `true`, jsMind won't render the node again, otherwise, jsMind will render the node in the default way.

**layout.hspace** : horizontal distance (pixels) between (number) nodes
**layout.vspace** : vertical spacing (pixels) between (number) nodes

Expand Down
15 changes: 15 additions & 0 deletions docs/zh/2.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ options = {
draggable: false, // 当容器不能完全容纳思维导图时,是否允许拖动画布代替鼠标滚动
hide_scrollbars_when_draggable: false, // 当设置 draggable = true 时,是否隐藏滚动条
node_overflow: 'hidden' // 节点文本过长时的样式
zoom: { // 配置缩放
min: 0.5, // 最小的缩放比例
max: 2.1, // 最大的缩放比例
step: 0.1, // 缩放比例间隔
},
custom_node_render: null, // 自定义的节点渲染方法
},
layout:{
hspace:30, // 节点之间的水平间距
Expand Down Expand Up @@ -150,6 +156,15 @@ options = {
> * `hidden` - 隐藏部分文本以保持脑图的整体易读性 [默认值]
> * `wrap` - 对文本进行换行,以展示全部文本内容

**view.zoom** : (object) 脑图缩放配置 (0.6.3 及以上版本支持)
> * min - 最小的缩放比例,默认 0.5
> * max - 最大的缩放比例,默认 2.1
> * step - 缩放比例间隔,默认 0.1

**view.custom_node_render** : (function) 脑图节点的自定义渲染方法 (0.7.6 及以上版本支持)

> 此选项可用于修改 jsMind 默认的渲染逻辑,此参数为一个 javascript 方法,其方法签名为 `function (jm, element, node): boolean `。其返回值用于表示是否已经对此节点进行了渲染,如果返回 `true`, jsMind 将不会再次渲染此节点;如果返回 false, jsMind 将使用默认渲染逻辑对此节点进行渲染。

**layout.hspace** : (number) 节点之间的水平间距(像素)
**layout.vspace** : (number) 节点之间的垂直间距(像素)

Expand Down