From df8f221745eba0865b43ec156d3d7181e829d3d1 Mon Sep 17 00:00:00 2001 From: hizzgdev Date: Sun, 23 Jun 2024 04:15:35 +0800 Subject: [PATCH] add more docs --- .../advanced/{appearence.md => appearance.md} | 0 docs2/en/options/index.md | 2 +- docs2/en/options/option.view.line_color.md | 64 +++++++++++++++++++ .../advanced/{appearence.md => appearance.md} | 0 docs2/zh/options/index.md | 2 +- docs2/zh/options/option.view.line_color.md | 62 ++++++++++++++++++ 6 files changed, 128 insertions(+), 2 deletions(-) rename docs2/en/advanced/{appearence.md => appearance.md} (100%) create mode 100644 docs2/en/options/option.view.line_color.md rename docs2/zh/advanced/{appearence.md => appearance.md} (100%) create mode 100644 docs2/zh/options/option.view.line_color.md diff --git a/docs2/en/advanced/appearence.md b/docs2/en/advanced/appearance.md similarity index 100% rename from docs2/en/advanced/appearence.md rename to docs2/en/advanced/appearance.md diff --git a/docs2/en/options/index.md b/docs2/en/options/index.md index da7c1a02..0b2dbd1a 100644 --- a/docs2/en/options/index.md +++ b/docs2/en/options/index.md @@ -25,7 +25,7 @@ jsMind provides various options to customize the behavior and appearance of mind | expander_style | string | 'char' | Style of the child node expander (Since 0.7.8) | [Details](option.view.expander_style.md) | | hide_scrollbars_when_draggable | bool | false | Whether to hide scrollbars when draggable is true | [Details](option.view.hide_scrollbars_when_draggable.md) | | hmargin | number | Container's width | Minimum horizontal distance between the mind map and the container's outer frame (in pixels) | [Details](option.view.hmargin.vmargin.md) | -| line_color | string | '#555' | Color of the lines | [Details](option.view.line_color.md) | +| line_color | string | '#555' | The color of the mind map lines (HTML color notation) | [Details](option.view.line_color.md) | | line_style | string | 'curved' | Style of the lines, straight or curved | [Details](option.view.line_style.md) | | line_width | number | 2 | Width of the lines | [Details](option.view.line_width.md) | | node_overflow | string | 'hidden' | Style when node text is too long (Since 0.5.3) | [Details](option.view.node_overflow.md) | diff --git a/docs2/en/options/option.view.line_color.md b/docs2/en/options/option.view.line_color.md new file mode 100644 index 00000000..9cf532bc --- /dev/null +++ b/docs2/en/options/option.view.line_color.md @@ -0,0 +1,64 @@ +# line_color Option + +| Option Name | Data Type | Default Value | Description | +| --- | --- | --- | --- | +| line_color | string | #555 | The color of the mind map lines (HTML color notation) | + +## Option Description + +The `line_color` option is used to set the color of the lines connecting the nodes in the mind map. This option allows users to customize the appearance of the mind map to better suit individual or team needs. It is important to note that if a node has `data.leading-line-color` set, this option will be overridden. Additionally, the behavior of `line_color` can also be overridden by `custom_line_render`. + +## Usage Example + +Below is an example of setting the `line_color` option: + +```javascript +var options = { + container: 'jsmind_container', + editable: true, + theme: 'primary', + mode: 'full', + support_html: true, + view: { + line_color: '#FF0000', // Set the line color to red + hmargin: 100, + vmargin: 50 + } +}; +``` + +In the example above, the `line_color` option is set to red (#FF0000). This setting will affect the color of the lines connecting the nodes in the mind map. + +line_color:#FF0000 + +## Related Options and Settings + +### leading-line-color + +If a node has `leading-line-color` attribute, the line color for that node to its parent will override the `line_color` option. For example: + +```javascript +var mind = { + "meta": { + "name": "example", + "author": "hizzgdev", + "version": "0.2" + }, + "format": "node_array", + "data": [ + {"id": "root", "isroot": true, "topic": "jsMind Example"}, + {"id": "sub1", "parentid": "root", "topic": "Sub Node 1", "leading-line-color": "#00FF00"}, + {"id": "sub2", "parentid": "root", "topic": "Sub Node 2"} + ] +}; +``` + +In the example above, the line color for node `sub1` will be set to green (#00FF00) instead of the color set in the `line_color` option. + +For more information, please refer to the document: [appearance](../advanced/appearance.md). + +### custom_line_render + +The `custom_line_render` option allows users to customize the rendering method of the mind map lines. With this option, users can have full control over the drawing process of the lines. + +For more information, please refer to the [custom_line_render option](option.view.custom_line_render.md). \ No newline at end of file diff --git a/docs2/zh/advanced/appearence.md b/docs2/zh/advanced/appearance.md similarity index 100% rename from docs2/zh/advanced/appearence.md rename to docs2/zh/advanced/appearance.md diff --git a/docs2/zh/options/index.md b/docs2/zh/options/index.md index 1e634c9f..182a56cb 100644 --- a/docs2/zh/options/index.md +++ b/docs2/zh/options/index.md @@ -25,7 +25,7 @@ jsMind 提供了多种选项来定制思维导图的行为和外观。 | expander_style | string | 'char' | 子节点展开器的样式(从 0.7.8 版本开始支持) | [详情](option.view.expander_style.md) | | hide_scrollbars_when_draggable | bool | false | 当 draggable 为 true 时是否隐藏滚动条 | [详情](option.view.hide_scrollbars_when_draggable.md) | | hmargin | number | 容器的宽度 | 思维导图距容器外框的最小水平距离(像素) | [详情](option.view.hmargin.vmargin.md) | -| line_color | string | '#555' | 线条颜色 | [详情](option.view.line_color.md) | +| line_color | string | '#555' | 思维导图线条的颜色(HTML颜色表示方法) | [详情](option.view.line_color.md) | | line_style | string | 'curved' | 线条样式,直线或曲线 | [详情](option.view.line_style.md) | | line_width | number | 2 | 线条宽度 | [详情](option.view.line_width.md) | | node_overflow | string | 'hidden' | 节点文本过长时的样式(从 0.5.3 版本开始支持) | [详情](option.view.node_overflow.md) | diff --git a/docs2/zh/options/option.view.line_color.md b/docs2/zh/options/option.view.line_color.md new file mode 100644 index 00000000..5b14d39b --- /dev/null +++ b/docs2/zh/options/option.view.line_color.md @@ -0,0 +1,62 @@ +# line_color 选项 + +| 选项名 | 数据类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| line_color | string | #555 | 思维导图线条的颜色(HTML颜色表示方法) | + +## 选项说明 + +`line_color` 选项用于设置思维导图中各节点之间连线的颜色。此选项可以帮助用户自定义思维导图的外观,使其更符合个人或团队的需求。需要注意的是,如果一个节点设置了 `data.leading-line-color`,此选项将会被覆盖。此外,`line_color` 的行为也可以被 `custom_line_render` 所覆盖。 + +## 使用示例 + +以下是一个设置 `line_color` 选项的示例: + +```javascript +var options = { + container: 'jsmind_container', + editable: true, + theme: 'primary', + mode: 'full', + support_html: true, + view: { + line_color: '#FF0000', // 设置线条颜色为红色 + } +}; +``` + +在上述示例中,`line_color` 选项被设置为红色(#FF0000)。这个设置将影响思维导图中各节点之间连线的颜色。 + +line_color:#FF0000 + + +## 相关选项和设置 + +### leading-line-color + +如果一个节点设置了 `leading-line-color`,则该节点与其父节点的连线颜色将会覆盖 `line_color` 选项的设置。例如: + +```javascript +var mind = { + "meta": { + "name": "example", + "author": "hizzgdev", + "version": "0.2" + }, + "format": "node_array", + "data": [ + {"id": "root", "isroot": true, "topic": "jsMind Example"}, + {"id": "sub1", "parentid": "root", "topic": "Sub Node 1", "leading-line-color": "#00FF00"}, + {"id": "sub2", "parentid": "root", "topic": "Sub Node 2"} + ] +}; +``` + +在上述示例中,节点 `sub1` 的连线颜色将会被设置为绿色(#00FF00),而不是 `line_color` 选项中设置的颜色。 +更多信息请参考文档: [外观](../advanced/appearance.md)。 + +### custom_line_render + +`custom_line_render` 选项允许用户自定义思维导图线条的渲染方法。通过此选项,用户可以完全控制线条的绘制过程。 + +更多信息请参考 [custom_line_render 选项](option.view.custom_line_render.md)。