Doc: update
This commit is contained in:
parent
6a4e87af7b
commit
1083138d8c
@ -5,6 +5,9 @@
|
|||||||
<p>Fix:</p>
|
<p>Fix:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>1.Fix the issue where the style of the collapsed nodes remains unchanged when switching themes;</p>
|
<p>1.Fix the issue where the style of the collapsed nodes remains unchanged when switching themes;</p>
|
||||||
|
<p>2.Fix the issue of losing the new text style when switching themes for text wrapping;</p>
|
||||||
|
<p>3.Fix the issue where the style of the newline text remains unchanged when switching themes;</p>
|
||||||
|
<p>4.Fixed the issue of adding mathematical formulas to nodes and not changing the text style when switching themes;</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>New:</p>
|
<p>New:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -18,6 +21,8 @@
|
|||||||
<p>1.The outline supports pressing Shift+Tab to move nodes up one level;</p>
|
<p>1.The outline supports pressing Shift+Tab to move nodes up one level;</p>
|
||||||
<p>2.Support setting the position of node arrow display;</p>
|
<p>2.Support setting the position of node arrow display;</p>
|
||||||
<p>3.Support setting the starting position of root node connections;</p>
|
<p>3.Support setting the starting position of root node connections;</p>
|
||||||
|
<p>4.Add two new themes;</p>
|
||||||
|
<p>5.Fix the issue of text wrapping not taking effect in the outline and displaying the br tag;</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h2>0.9.5</h2>
|
<h2>0.9.5</h2>
|
||||||
<p>Fix:</p>
|
<p>Fix:</p>
|
||||||
|
|||||||
@ -389,6 +389,19 @@ and copying the <code>data</code> of the data object, example:</p>
|
|||||||
<p>v0.9.3+</p>
|
<p>v0.9.3+</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.</p>
|
<p>Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.</p>
|
||||||
|
<h4>removeHtmlNodeByClass(html, selector)</h4>
|
||||||
|
<blockquote>
|
||||||
|
<p>v0.9.6+</p>
|
||||||
|
</blockquote>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p><code>html</code>:html string</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p><code>selector</code>:Node selectors, such as class selectors and id selectors</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>Remove the node of the specified selector from the specified HTML string, and then return the processed HTML string.</p>
|
||||||
<h2>Simulate CSS background in Canvas</h2>
|
<h2>Simulate CSS background in Canvas</h2>
|
||||||
<p>Import:</p>
|
<p>Import:</p>
|
||||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
>
|
>
|
||||||
> 3.Mac 双指触摸事件移动画布增加一点灵敏度;
|
> 3.Mac 双指触摸事件移动画布增加一点灵敏度;
|
||||||
>
|
>
|
||||||
> 4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;
|
> 4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;
|
||||||
|
|
||||||
Demo:
|
Demo:
|
||||||
|
|
||||||
|
|||||||
@ -5,19 +5,24 @@
|
|||||||
<p>修复:</p>
|
<p>修复:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>1.修复切换主题时,被收起的节点样式没有改变的问题;</p>
|
<p>1.修复切换主题时,被收起的节点样式没有改变的问题;</p>
|
||||||
|
<p>2.修复切换主题后进行文本换行时,新换行的文本样式会丢失的问题;</p>
|
||||||
|
<p>3.修复切换主题时,换行的文本样式没有改变的问题;</p>
|
||||||
|
<p>4.修复添加了数学公式的节点,切换主题时文本样式没有改变的问题;</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>新增:</p>
|
<p>新增:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>1.主题新增字段,用于设置节点连线箭头的显示位置,头部或者尾部;</p>
|
<p>1.主题新增字段,用于设置节点连线箭头的显示位置,头部或者尾部;</p>
|
||||||
<p>2.主题新增字段,用于设置曲线连接时,根节点连线的起始位置;</p>
|
<p>2.主题新增字段,用于设置曲线连接时,根节点连线的起始位置;</p>
|
||||||
<p>3.Mac 双指触摸事件移动画布增加一点灵敏度;</p>
|
<p>3.Mac 双指触摸事件移动画布增加一点灵敏度;</p>
|
||||||
<p>4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;</p>
|
<p>4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Demo:</p>
|
<p>Demo:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>1.大纲支持按 Shift+Tab 键将节点上移一个层级;</p>
|
<p>1.大纲支持按 Shift+Tab 键将节点上移一个层级;</p>
|
||||||
<p>2.支持设置节点箭头显示的位置;</p>
|
<p>2.支持设置节点箭头显示的位置;</p>
|
||||||
<p>3.支持设置根节点连线的起始位置;</p>
|
<p>3.支持设置根节点连线的起始位置;</p>
|
||||||
|
<p>4.新增两个主题;</p>
|
||||||
|
<p>5.修复大纲中文本换行不生效,显示br标签的问题;</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h2>0.9.5</h2>
|
<h2>0.9.5</h2>
|
||||||
<p>修复:</p>
|
<p>修复:</p>
|
||||||
|
|||||||
@ -25,7 +25,15 @@
|
|||||||
<p><code>layerIndex</code>:节点层级</p>
|
<p><code>layerIndex</code>:节点层级</p>
|
||||||
<p><code>index</code>:节点在同级节点里的索引</p>
|
<p><code>index</code>:节点在同级节点里的索引</p>
|
||||||
<p>示例:</p>
|
<p>示例:</p>
|
||||||
<pre class="hljs"><code>walk(tree, <span class="hljs-literal">null</span>, <span class="hljs-function">() =></span> {}, <span class="hljs-function">() =></span> {}, <span class="hljs-literal">false</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>)
|
<pre class="hljs"><code>walk(
|
||||||
|
tree,
|
||||||
|
<span class="hljs-literal">null</span>,
|
||||||
|
<span class="hljs-function">() =></span> {},
|
||||||
|
<span class="hljs-function">() =></span> {},
|
||||||
|
<span class="hljs-literal">false</span>,
|
||||||
|
<span class="hljs-number">0</span>,
|
||||||
|
<span class="hljs-number">0</span>
|
||||||
|
)
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h4>bfsWalk(root, callback)</h4>
|
<h4>bfsWalk(root, callback)</h4>
|
||||||
<p>广度优先遍历树</p>
|
<p>广度优先遍历树</p>
|
||||||
@ -89,7 +97,9 @@
|
|||||||
<p>v0.3.4+</p>
|
<p>v0.3.4+</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>测量文本的宽高,返回值:</p>
|
<p>测量文本的宽高,返回值:</p>
|
||||||
<pre class="hljs"><code>{ width, height }
|
<pre class="hljs"><code>{
|
||||||
|
width, height
|
||||||
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h4>getTextFromHtml(html)</h4>
|
<h4>getTextFromHtml(html)</h4>
|
||||||
<p>提取 html 字符串里的纯文本内容。</p>
|
<p>提取 html 字符串里的纯文本内容。</p>
|
||||||
@ -117,8 +127,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<p>获取图片的大小。返回:</p>
|
<p>获取图片的大小。返回:</p>
|
||||||
<pre class="hljs"><code>{
|
<pre class="hljs"><code>{
|
||||||
width,
|
width, height
|
||||||
height
|
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h4>loadImage(imgFile)</h4>
|
<h4>loadImage(imgFile)</h4>
|
||||||
@ -314,8 +323,7 @@
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<p>从用户剪贴板中读取文字和图片,返回:</p>
|
<p>从用户剪贴板中读取文字和图片,返回:</p>
|
||||||
<pre class="hljs"><code>{
|
<pre class="hljs"><code>{
|
||||||
text,
|
text, img
|
||||||
img
|
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h4>removeFromParentNodeData(node)</h4>
|
<h4>removeFromParentNodeData(node)</h4>
|
||||||
@ -384,6 +392,19 @@
|
|||||||
<p>v0.9.3+</p>
|
<p>v0.9.3+</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>将平级对象转树结构。transformTreeDataToObject 方法的反向操作。</p>
|
<p>将平级对象转树结构。transformTreeDataToObject 方法的反向操作。</p>
|
||||||
|
<h4>removeHtmlNodeByClass(html, selector)</h4>
|
||||||
|
<blockquote>
|
||||||
|
<p>v0.9.6+</p>
|
||||||
|
</blockquote>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p><code>html</code>:html 字符串</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p><code>selector</code>:节点选择器,比如类选择器,id 选择器</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>去除指定 html 字符串中指定选择器的节点,然后返回处理后的 html 字符串。</p>
|
||||||
<h2>在 canvas 中模拟 css 的背景属性</h2>
|
<h2>在 canvas 中模拟 css 的背景属性</h2>
|
||||||
<p>引入:</p>
|
<p>引入:</p>
|
||||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
||||||
@ -395,17 +416,24 @@
|
|||||||
<span class="hljs-keyword">let</span> canvas = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'canvas'</span>)
|
<span class="hljs-keyword">let</span> canvas = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'canvas'</span>)
|
||||||
canvas.width = width
|
canvas.width = width
|
||||||
canvas.height = height
|
canvas.height = height
|
||||||
drawBackgroundImageToCanvas(ctx, width, height, img, {
|
drawBackgroundImageToCanvas(
|
||||||
|
ctx,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
img,
|
||||||
|
{
|
||||||
<span class="hljs-attr">backgroundRepeat</span>: <span class="hljs-string">'repeat-y'</span>,
|
<span class="hljs-attr">backgroundRepeat</span>: <span class="hljs-string">'repeat-y'</span>,
|
||||||
<span class="hljs-attr">backgroundSize</span>: <span class="hljs-string">'60%'</span>,
|
<span class="hljs-attr">backgroundSize</span>: <span class="hljs-string">'60%'</span>,
|
||||||
<span class="hljs-attr">backgroundPosition</span>: <span class="hljs-string">'center center'</span>
|
<span class="hljs-attr">backgroundPosition</span>: <span class="hljs-string">'center center'</span>
|
||||||
}, <span class="hljs-function">(<span class="hljs-params">err</span>) =></span> {
|
},
|
||||||
|
<span class="hljs-function"><span class="hljs-params">err</span> =></span> {
|
||||||
<span class="hljs-keyword">if</span> (err) {
|
<span class="hljs-keyword">if</span> (err) {
|
||||||
<span class="hljs-comment">// 失败</span>
|
<span class="hljs-comment">// 失败</span>
|
||||||
} <span class="hljs-keyword">else</span> {
|
} <span class="hljs-keyword">else</span> {
|
||||||
<span class="hljs-comment">// 成功</span>
|
<span class="hljs-comment">// 成功</span>
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2>LRU 缓存类</h2>
|
<h2>LRU 缓存类</h2>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user