cladogram 0.5.4 → 0.5.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/bin/clado.js +5 -5
- package/docs/release.md +13 -0
- package/package.json +1 -1
- package/plugins/agent/index.js +458 -25
- package/plugins/agent/style.css +299 -8
- package/plugins/directory/capabilities.json +1 -1
- package/plugins/directory/index.js +57 -2
- package/plugins/directory/style.css +11 -0
- package/plugins/view-controls/index.js +1 -1
- package/plugins/view-controls/style.css +30 -10
- package/skills/clado/SKILL.md +17 -16
- package/src/agent/executors.js +213 -0
- package/src/agent/probe.js +176 -0
- package/src/agent/providers/anthropic.js +220 -0
- package/src/agent/providers/index.js +52 -0
- package/src/agent/providers/openai.js +146 -0
- package/src/agent/runtime.js +557 -0
- package/src/agent/sessions.js +129 -0
- package/src/html/app-css.js +62 -9
- package/src/html/canvas-chain.js +2 -1
- package/src/html/canvas-ui.css +63 -0
- package/src/html/page.js +4 -0
- package/src/html/plugin-ui.css +12 -0
- package/src/html/plugin-ui.js +8 -2
- package/src/html/runtime-api.js +136 -5
- package/src/html/runtime.js +160 -290
- package/src/html/view-registry.js +95 -0
- package/src/html/views/view-cards.js +28 -0
- package/src/html/views/view-doc.js +51 -0
- package/src/html/views/view-mindmap.js +173 -0
- package/src/server/agent.js +335 -17
- package/src/server/assets/library-canvas.js +13 -3
- package/src/server/assets/library-plugin-bridge.js +2 -2
- package/src/server/assets/library-plugins.js +2 -2
- package/src/server/assets/library.css +5 -0
- package/src/server/assets/library.html +1 -1
- package/src/server/assets/library.js +157 -20
- package/src/server/events.js +189 -0
- package/src/server/export.js +1 -1
- package/src/server/mcp.js +16 -16
- package/src/server/plugin-capabilities.js +38 -22
- package/src/server/plugin-settings.js +27 -1
- package/src/server/plugins.js +17 -4
- package/src/server/workspace.js +171 -56
- package/src/skill/install.js +1 -1
- package/src/skill/targets.js +3 -3
- package/src/util/update.js +3 -2
- package/src/workspace/service.js +23 -15
- package/src/workspace/storage.js +88 -20
- package/templates/business-flow.mdc +1 -1
- package/templates/call-chain.mdc +1 -1
- package/templates/data-design.mdc +1 -1
- package/templates/test-cases.mdc +47 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* ══ 视图插件注册表(受保护内置 clado.view.* + 外部可扩展) ══════ */
|
|
2
|
+
var CladoViewRegistry = (function () {
|
|
3
|
+
var views = Object.create(null);
|
|
4
|
+
var order = [];
|
|
5
|
+
|
|
6
|
+
function isReservedId(id) {
|
|
7
|
+
return id === 'clado' || String(id || '').indexOf('clado.') === 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function freezeMeta(def) {
|
|
11
|
+
return Object.freeze({
|
|
12
|
+
id: def.id,
|
|
13
|
+
mode: def.mode,
|
|
14
|
+
label: def.label,
|
|
15
|
+
protected: !!def.protected,
|
|
16
|
+
scope: def.scope || '#stage',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function registerBuiltIn(def) {
|
|
21
|
+
if (!def || !def.id || !def.mode || typeof def.activate !== 'function') {
|
|
22
|
+
throw new Error('内置视图定义无效');
|
|
23
|
+
}
|
|
24
|
+
var entry = Object.freeze({
|
|
25
|
+
id: def.id,
|
|
26
|
+
mode: def.mode,
|
|
27
|
+
label: def.label || def.mode,
|
|
28
|
+
protected: true,
|
|
29
|
+
scope: def.scope || '#stage',
|
|
30
|
+
activate: def.activate,
|
|
31
|
+
refresh: def.refresh || null,
|
|
32
|
+
restore: def.restore || null,
|
|
33
|
+
drawWires: def.drawWires || null,
|
|
34
|
+
});
|
|
35
|
+
if (!views[entry.mode]) order.push(entry.mode);
|
|
36
|
+
views[entry.mode] = entry;
|
|
37
|
+
return freezeMeta(entry);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function register(def) {
|
|
41
|
+
if (!def || typeof def.id !== 'string' || !def.id.trim()) {
|
|
42
|
+
throw new Error('视图插件必须提供有效的 id');
|
|
43
|
+
}
|
|
44
|
+
if (isReservedId(def.id)) {
|
|
45
|
+
throw new Error('外部视图插件不能使用保留命名空间 clado.*:' + def.id);
|
|
46
|
+
}
|
|
47
|
+
if (typeof def.mode !== 'string' || !/^[a-z0-9][a-z0-9_-]{0,39}$/.test(def.mode)) {
|
|
48
|
+
throw new Error('视图 mode 必须是小写字母/数字/短横线标识符');
|
|
49
|
+
}
|
|
50
|
+
if (views[def.mode]) {
|
|
51
|
+
throw new Error(views[def.mode].protected
|
|
52
|
+
? '不能覆盖受保护的内置视图:' + def.mode
|
|
53
|
+
: '视图 mode 已被注册:' + def.mode);
|
|
54
|
+
}
|
|
55
|
+
if (typeof def.activate !== 'function') {
|
|
56
|
+
throw new Error('视图插件必须提供 activate() 生命周期方法');
|
|
57
|
+
}
|
|
58
|
+
var entry = Object.freeze({
|
|
59
|
+
id: def.id.trim(),
|
|
60
|
+
mode: def.mode,
|
|
61
|
+
label: String(def.label || def.mode).trim().slice(0, 24),
|
|
62
|
+
protected: false,
|
|
63
|
+
scope: typeof def.scope === 'string' && def.scope ? def.scope : '#stage',
|
|
64
|
+
activate: def.activate,
|
|
65
|
+
refresh: typeof def.refresh === 'function' ? def.refresh : null,
|
|
66
|
+
restore: typeof def.restore === 'function' ? def.restore : null,
|
|
67
|
+
drawWires: typeof def.drawWires === 'function' ? def.drawWires : null,
|
|
68
|
+
});
|
|
69
|
+
order.push(entry.mode);
|
|
70
|
+
views[entry.mode] = entry;
|
|
71
|
+
document.dispatchEvent(new CustomEvent('clado:views-changed', { detail: { mode: entry.mode, id: entry.id } }));
|
|
72
|
+
return freezeMeta(entry);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function get(mode) { return views[mode] || null; }
|
|
76
|
+
function has(mode) { return !!views[mode]; }
|
|
77
|
+
function list() { return order.map(function (m) { return freezeMeta(views[m]); }); }
|
|
78
|
+
|
|
79
|
+
var publicApi = Object.freeze({
|
|
80
|
+
register: register,
|
|
81
|
+
get: function (mode) { return views[mode] ? freezeMeta(views[mode]) : null; },
|
|
82
|
+
has: has,
|
|
83
|
+
list: list,
|
|
84
|
+
});
|
|
85
|
+
try { Object.defineProperty(window, 'CladoViews', { value: publicApi, writable: false, configurable: false }); }
|
|
86
|
+
catch (e) { window.CladoViews = publicApi; }
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
registerBuiltIn: registerBuiltIn,
|
|
90
|
+
register: register,
|
|
91
|
+
get: get,
|
|
92
|
+
has: has,
|
|
93
|
+
list: list,
|
|
94
|
+
};
|
|
95
|
+
})();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* ══ 内置视图插件:clado.view.cards(卡片视图,默认) ════════════ */
|
|
2
|
+
CladoViewRegistry.registerBuiltIn({
|
|
3
|
+
id: 'clado.view.cards',
|
|
4
|
+
mode: 'cards',
|
|
5
|
+
label: '卡片',
|
|
6
|
+
scope: '#world .card',
|
|
7
|
+
activate: function () {
|
|
8
|
+
requestAnimationFrame(function () {
|
|
9
|
+
applyVisibility();
|
|
10
|
+
layout();
|
|
11
|
+
// ★ 从脑图切回来必须重新钉端口:脑图模式下卡片是 display:none,
|
|
12
|
+
// 端口的高度是量不出来的(见 placePorts 开头那段)。不重钉的话,
|
|
13
|
+
// 端口会一直赖在卡片右上角,直到你去点一次标题才归位。
|
|
14
|
+
fit(); repinPorts();
|
|
15
|
+
keepWiresAlive(1200); // 卡片和镜头都在过渡里,等它们停稳再定稿
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
refresh: function () {
|
|
19
|
+
layout();
|
|
20
|
+
fit();
|
|
21
|
+
repinPorts();
|
|
22
|
+
},
|
|
23
|
+
restore: function () {
|
|
24
|
+
applyVisibility();
|
|
25
|
+
layout();
|
|
26
|
+
},
|
|
27
|
+
drawWires: function () { drawWires(); },
|
|
28
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* ══ 内置视图插件:clado.view.doc(文档视图) ════════════════════ */
|
|
2
|
+
function renderDoc() {
|
|
3
|
+
var art = $('#article'), toc = $('#toc');
|
|
4
|
+
art.innerHTML = ''; toc.innerHTML = '<h4>大纲</h4>';
|
|
5
|
+
if (DOC.preamble) art.appendChild(mdToBody(DOC.preamble));
|
|
6
|
+
var addToc = function (label, d, path) {
|
|
7
|
+
var a = document.createElement('a');
|
|
8
|
+
a.className = 'd' + Math.min(d, 4);
|
|
9
|
+
a.href = '#';
|
|
10
|
+
a.dataset.path = path;
|
|
11
|
+
a.textContent = label;
|
|
12
|
+
toc.appendChild(a);
|
|
13
|
+
};
|
|
14
|
+
DOC.cards.forEach(function (c, ci) {
|
|
15
|
+
var sec = document.createElement('section');
|
|
16
|
+
sec.className = 'slice';
|
|
17
|
+
sec.style.setProperty('--d', 1);
|
|
18
|
+
sec.dataset.path = String(ci); sec.dataset.level = "1";
|
|
19
|
+
sec.innerHTML = '<div class="slice-head"><div class="h">' + esc(c.title) + '</div></div>';
|
|
20
|
+
if (c.md) sec.appendChild(mdToBody(c.md));
|
|
21
|
+
art.appendChild(sec);
|
|
22
|
+
addToc(c.title, 1, String(ci));
|
|
23
|
+
(function walk(nodes, prefix) {
|
|
24
|
+
(nodes || []).forEach(function (n, i) {
|
|
25
|
+
var path = prefix + '.' + i;
|
|
26
|
+
var s = document.createElement('section');
|
|
27
|
+
s.className = 'slice';
|
|
28
|
+
s.style.setProperty('--d', n.d);
|
|
29
|
+
s.dataset.path = path; s.dataset.level = String(n.d);
|
|
30
|
+
s.innerHTML = '<div class="slice-head"><div class="h">' + esc(n.title) + '</div></div>';
|
|
31
|
+
if (n.md) s.appendChild(mdToBody(n.md));
|
|
32
|
+
art.appendChild(s);
|
|
33
|
+
addToc(n.title, n.d, path);
|
|
34
|
+
walk(n.kids, path);
|
|
35
|
+
});
|
|
36
|
+
})(c.nodes, String(ci));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
CladoViewRegistry.registerBuiltIn({
|
|
41
|
+
id: 'clado.view.doc',
|
|
42
|
+
mode: 'doc',
|
|
43
|
+
label: '文档',
|
|
44
|
+
scope: '#article',
|
|
45
|
+
activate: function () {
|
|
46
|
+
renderMermaid().then(function () { canvasPlaceMediaJumps($('#article')); });
|
|
47
|
+
},
|
|
48
|
+
refresh: function () {},
|
|
49
|
+
restore: function () {},
|
|
50
|
+
drawWires: null,
|
|
51
|
+
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/* ══ 内置视图插件:clado.view.mindmap(脑图视图) ════════════════ */
|
|
2
|
+
var MIND_CARD_STATE = {};
|
|
3
|
+
function applyMindCardPlacement(el) {
|
|
4
|
+
el.dataset.layoutX = el.style.left; el.dataset.layoutY = el.style.top;
|
|
5
|
+
var state = MIND_CARD_STATE[el.dataset.contentId];
|
|
6
|
+
if (state) {
|
|
7
|
+
el.style.left = (parseFloat(el.style.left) + (state.dx || 0)) + 'px';
|
|
8
|
+
el.style.top = (parseFloat(el.style.top) + (state.dy || 0)) + 'px';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function bindMindCard(el) {
|
|
12
|
+
function state() { return MIND_CARD_STATE[el.dataset.contentId] || (MIND_CARD_STATE[el.dataset.contentId] = {}); }
|
|
13
|
+
bindCanvasCard(el, {
|
|
14
|
+
move: function (x, y) { var s = state(); s.dx = x - parseFloat(el.dataset.layoutX); s.dy = y - parseFloat(el.dataset.layoutY); },
|
|
15
|
+
resize: function (width, height) { var s = state(); s.width = width; s.height = height; },
|
|
16
|
+
redraw: function () { drawMindWires(); }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function renderMind() {
|
|
20
|
+
var mind = $('#mind');
|
|
21
|
+
$$('.mnode', mind).forEach(function (n) { n.remove(); });
|
|
22
|
+
var GX = 64, GY = 12, X0 = 40, Y0 = 40;
|
|
23
|
+
var cursor = Y0;
|
|
24
|
+
var ALL = []; // 所有节点,等宽度都量完了再统一算 left
|
|
25
|
+
// 先摆子、再回头把父摆在子的垂直中线上 —— 父先占位的话,父会挂在子树的头顶上,不是树
|
|
26
|
+
function place(nodes, depth, prefix) {
|
|
27
|
+
var out = [];
|
|
28
|
+
nodes.forEach(function (n, i) {
|
|
29
|
+
var path = prefix ? prefix + '.' + i : String(i);
|
|
30
|
+
var hasKids = !!(n.kids && n.kids.length);
|
|
31
|
+
var el = createCanvasCard(n.title, 'mnode');
|
|
32
|
+
el.dataset.path = path; el.dataset.contentId = n.card || n.id || '__document';
|
|
33
|
+
// 记下这张小卡片对应文档里的哪张卡 —— 画关系边的时候要靠它对上号
|
|
34
|
+
if (n.card) el.dataset.card = n.card;
|
|
35
|
+
if (n.md && n.md.trim()) el.classList.add('has-body');
|
|
36
|
+
$('.body', el).appendChild(mdToBody(n.md));
|
|
37
|
+
var savedSize = MIND_CARD_STATE[el.dataset.contentId];
|
|
38
|
+
if (savedSize && savedSize.width) el.style.width = savedSize.width + 'px';
|
|
39
|
+
if (savedSize && savedSize.height) el.style.height = savedSize.height + 'px';
|
|
40
|
+
mind.appendChild(el); bindMindCard(el);
|
|
41
|
+
ALL.push({ el: el, depth: depth });
|
|
42
|
+
var b = { el: el, kids: [] };
|
|
43
|
+
var from = cursor;
|
|
44
|
+
if (hasKids) {
|
|
45
|
+
b.kids = place(n.kids, depth + 1, path);
|
|
46
|
+
var f = b.kids[0].el, l = b.kids[b.kids.length - 1].el;
|
|
47
|
+
var mid = (f.offsetTop + l.offsetTop + l.offsetHeight) / 2;
|
|
48
|
+
var top = mid - el.offsetHeight / 2;
|
|
49
|
+
if (top < from) {
|
|
50
|
+
var shift = from - top;
|
|
51
|
+
(function shiftChildren(branches) {
|
|
52
|
+
branches.forEach(function (branch) {
|
|
53
|
+
branch.el.style.top = (parseFloat(branch.el.style.top) + shift) + 'px';
|
|
54
|
+
shiftChildren(branch.kids);
|
|
55
|
+
});
|
|
56
|
+
})(b.kids);
|
|
57
|
+
cursor += shift; top = from;
|
|
58
|
+
}
|
|
59
|
+
el.style.top = top + 'px';
|
|
60
|
+
} else {
|
|
61
|
+
el.style.top = cursor + 'px';
|
|
62
|
+
cursor += el.offsetHeight + GY;
|
|
63
|
+
}
|
|
64
|
+
cursor = Math.max(cursor, el.offsetTop + el.offsetHeight + GY);
|
|
65
|
+
out.push(b);
|
|
66
|
+
});
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
// 一棵树,不是好几棵:先立一个「文档」根,每张卡是它的第一层分支
|
|
70
|
+
var root = {
|
|
71
|
+
title: DOC.title || '文档', md: DOC.preamble,
|
|
72
|
+
kids: DOC.cards.map(function (c) { return { title: c.title, md: c.md, kids: c.nodes || [], card: c.id }; }),
|
|
73
|
+
};
|
|
74
|
+
var all = place([root], 0, '');
|
|
75
|
+
all.forEach(function (r) { r.el.classList.add('root'); });
|
|
76
|
+
/*
|
|
77
|
+
* 每一列取这一列最宽的那个节点当列宽,再按列累加出 x —— 宽度是内容说了算,
|
|
78
|
+
* 列里最宽的那张决定下一列从哪开始,列与列之间才不会叠在一起。
|
|
79
|
+
*/
|
|
80
|
+
var colW = [];
|
|
81
|
+
ALL.forEach(function (x) {
|
|
82
|
+
colW[x.depth] = Math.max(colW[x.depth] || 0, x.el.offsetWidth);
|
|
83
|
+
});
|
|
84
|
+
var colX = [], acc = X0;
|
|
85
|
+
for (var ci = 0; ci < colW.length; ci++) {
|
|
86
|
+
colX[ci] = acc;
|
|
87
|
+
acc += (colW[ci] || 0) + GX;
|
|
88
|
+
}
|
|
89
|
+
ALL.forEach(function (x) { x.el.style.left = colX[x.depth] + 'px'; applyMindCardPlacement(x.el); });
|
|
90
|
+
var w = 0, h = 0;
|
|
91
|
+
$$('.mnode', mind).forEach(function (n) {
|
|
92
|
+
w = Math.max(w, n.offsetLeft + n.offsetWidth);
|
|
93
|
+
h = Math.max(h, n.offsetTop + n.offsetHeight);
|
|
94
|
+
});
|
|
95
|
+
box = { w: w + X0, h: h + Y0 };
|
|
96
|
+
drawMindWires();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function drawMindWires() {
|
|
100
|
+
var mind = $('#mind');
|
|
101
|
+
/*
|
|
102
|
+
* ★ 文档里的关系边(正文里 [文字](目标) 连出来的那些)也要画在脑图上。
|
|
103
|
+
* 原来脑图只有「树」的线 —— 那是标题嵌套长出来的父子线,文档里真正
|
|
104
|
+
* 声明的边一条都没有,看着就像「脑图上没连线」。
|
|
105
|
+
* 只连线,不碰布局:脑图的坐标是 place() 摆好的,这里纯粹是照着画。
|
|
106
|
+
* 脑图里每张卡都摊成了小卡片,没有「一二三级标题」之分,所以一律浅色虚线。
|
|
107
|
+
*/
|
|
108
|
+
var nodeOf = {};
|
|
109
|
+
$$('.mnode[data-card]', mind).forEach(function (n) { nodeOf[n.dataset.card] = n; });
|
|
110
|
+
var svg = $('#mwires');
|
|
111
|
+
svg.setAttribute('width', box.w); svg.setAttribute('height', box.h);
|
|
112
|
+
svg.setAttribute('viewBox', '0 0 ' + box.w + ' ' + box.h);
|
|
113
|
+
svg.style.width = box.w + 'px'; svg.style.height = box.h + 'px';
|
|
114
|
+
var d = '';
|
|
115
|
+
DOC.edges.forEach(function (e) {
|
|
116
|
+
var A = nodeOf[e[0]], B = nodeOf[e[1]];
|
|
117
|
+
if (!A || !B) return;
|
|
118
|
+
var ax = A.offsetLeft, aw = A.offsetWidth, bx = B.offsetLeft, bw = B.offsetWidth;
|
|
119
|
+
var y1 = A.offsetTop + A.offsetHeight / 2, y2 = B.offsetTop + B.offsetHeight / 2;
|
|
120
|
+
var x1, x2, c1, c2;
|
|
121
|
+
if (Math.abs(ax - bx) < 1) {
|
|
122
|
+
/*
|
|
123
|
+
* ★ 同一列的边:卡片节点全在第一列,左右边完全重合。原来 x1 取源卡右边、
|
|
124
|
+
* x2 取目标卡左边,等于横穿整列卡片画一道弧 —— 看着就像「所有线都是从
|
|
125
|
+
* 一级那一列拉出来的」,而不是从某张卡出来。改成两头都钉在右边、向右
|
|
126
|
+
* 鼓出去再绕回来:线从哪张卡出、进哪张卡,一眼能对上。
|
|
127
|
+
*/
|
|
128
|
+
x1 = ax + aw; x2 = bx + bw;
|
|
129
|
+
var bulge = Math.max(x1, x2) + 44;
|
|
130
|
+
c1 = bulge; c2 = bulge;
|
|
131
|
+
} else if (bx < ax) { x1 = ax; x2 = bx + bw; c1 = (x1 + x2) / 2; c2 = c1; }
|
|
132
|
+
else { x1 = ax + aw; x2 = bx; c1 = (x1 + x2) / 2; c2 = c1; }
|
|
133
|
+
if (x2 === x1 && c1 === x1) return;
|
|
134
|
+
d += '<path class="edge" d="M' + x1 + ' ' + y1 + ' C' + c1 + ' ' + y1 + ' ' + c2 + ' ' + y2 + ' ' + x2 + ' ' + y2 + '"/>';
|
|
135
|
+
});
|
|
136
|
+
var byPath = {};
|
|
137
|
+
$$('.mnode', mind).forEach(function (el) { byPath[el.dataset.path] = el; });
|
|
138
|
+
Object.keys(byPath).forEach(function (path) {
|
|
139
|
+
var child = byPath[path], parent = byPath[path.slice(0, path.lastIndexOf('.'))];
|
|
140
|
+
if (!parent || !path.includes('.')) return;
|
|
141
|
+
var x1 = parent.offsetLeft + parent.offsetWidth, x2 = child.offsetLeft;
|
|
142
|
+
var input1 = $('.hbar', parent), input2 = $('.hbar', child);
|
|
143
|
+
var y1 = parent.offsetTop + input1.offsetTop + input1.offsetHeight / 2;
|
|
144
|
+
var y2 = child.offsetTop + input2.offsetTop + input2.offsetHeight / 2, mx = (x1 + x2) / 2;
|
|
145
|
+
d += '<path d="M' + x1 + ' ' + y1 + ' C' + mx + ' ' + y1 + ' ' + mx + ' ' + y2 + ' ' + x2 + ' ' + y2 + '"/>';
|
|
146
|
+
});
|
|
147
|
+
svg.innerHTML = d;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
CladoViewRegistry.registerBuiltIn({
|
|
151
|
+
id: 'clado.view.mindmap',
|
|
152
|
+
mode: 'mindmap',
|
|
153
|
+
label: '脑图',
|
|
154
|
+
scope: '#mind',
|
|
155
|
+
activate: function () {
|
|
156
|
+
// 脑图的节点位置是按「当前高度」摆的,所以图渲完必须重摆一次
|
|
157
|
+
requestAnimationFrame(function () {
|
|
158
|
+
renderMind(); fit();
|
|
159
|
+
var mm = $$('#mind .mermaid');
|
|
160
|
+
mm.forEach(function (d) { delete d.dataset.mmd; });
|
|
161
|
+
renderMermaid().then(function () { renderMind(); fit(); });
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
refresh: function () {
|
|
165
|
+
renderMind();
|
|
166
|
+
fit();
|
|
167
|
+
repinPorts();
|
|
168
|
+
},
|
|
169
|
+
restore: function () {
|
|
170
|
+
renderMind();
|
|
171
|
+
},
|
|
172
|
+
drawWires: function () { drawMindWires(); },
|
|
173
|
+
});
|