markmap-view 0.17.1-alpha.4 → 0.17.1-alpha.5
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/dist/browser/index.js +3 -1
- package/dist/index.js +12 -10
- package/dist/types.d.ts +2 -0
- package/package.json +3 -3
package/dist/browser/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hook as st, getId as at, debounce as lt, addClass as ct, walkTree as T, childSelector as C, noop as M } from "markmap-common";
|
|
2
2
|
import { loadCSS as Ce, loadJS as we } from "markmap-common";
|
|
3
|
-
import { scaleOrdinal as
|
|
4
|
-
const K = typeof navigator < "u" && navigator.userAgent.includes("Macintosh"), gt =
|
|
3
|
+
import { scaleOrdinal as Y, schemeCategory10 as ht, zoomTransform as A, select as dt, zoom as ut, linkHorizontal as pt, min as I, max as H, zoomIdentity as mt, minIndex as ft } from "d3";
|
|
4
|
+
const K = typeof navigator < "u" && navigator.userAgent.includes("Macintosh"), gt = Y(ht), P = {
|
|
5
5
|
autoFit: !1,
|
|
6
6
|
color: (e) => {
|
|
7
7
|
var t;
|
|
@@ -28,7 +28,7 @@ function Se(e) {
|
|
|
28
28
|
const s = i[0];
|
|
29
29
|
t.color = () => s;
|
|
30
30
|
} else if (i != null && i.length) {
|
|
31
|
-
const s =
|
|
31
|
+
const s = Y(i);
|
|
32
32
|
t.color = (l) => s(`${l.state.path}`);
|
|
33
33
|
}
|
|
34
34
|
if (o) {
|
|
@@ -46,7 +46,9 @@ function Se(e) {
|
|
|
46
46
|
"maxWidth",
|
|
47
47
|
"initialExpandLevel",
|
|
48
48
|
"fitRatio",
|
|
49
|
-
"maxInitialScale"
|
|
49
|
+
"maxInitialScale",
|
|
50
|
+
"spacingHorizontal",
|
|
51
|
+
"spacingVertical"
|
|
50
52
|
].forEach((s) => {
|
|
51
53
|
const l = n[s];
|
|
52
54
|
typeof l == "number" && (t[s] = l);
|
|
@@ -258,7 +260,7 @@ function F(e, t) {
|
|
|
258
260
|
if (i && (o.value = +o.data.value), (s = t(o.data)) && (p = s.length))
|
|
259
261
|
for (o.children = new Array(p), l = p - 1; l >= 0; --l)
|
|
260
262
|
a.push(c = o.children[l] = new N(s[l])), c.parent = o, c.depth = o.depth + 1;
|
|
261
|
-
return n.eachBefore(
|
|
263
|
+
return n.eachBefore(Vt);
|
|
262
264
|
}
|
|
263
265
|
function Ht() {
|
|
264
266
|
return F(this).eachBefore(Wt);
|
|
@@ -269,7 +271,7 @@ function Lt(e) {
|
|
|
269
271
|
function Wt(e) {
|
|
270
272
|
e.data = e.data.data;
|
|
271
273
|
}
|
|
272
|
-
function
|
|
274
|
+
function Vt(e) {
|
|
273
275
|
var t = 0;
|
|
274
276
|
do
|
|
275
277
|
e.height = t;
|
|
@@ -293,7 +295,7 @@ N.prototype = F.prototype = {
|
|
|
293
295
|
links: It,
|
|
294
296
|
copy: Ht
|
|
295
297
|
};
|
|
296
|
-
const
|
|
298
|
+
const Yt = "d3-flextree", Kt = "2.1.2", Pt = "build/d3-flextree.js", Ut = "index", Gt = {
|
|
297
299
|
name: "Chris Maloney",
|
|
298
300
|
url: "http://chrismaloney.org"
|
|
299
301
|
}, Zt = "Flexible tree layout algorithm that allows for variable node sizes.", qt = [
|
|
@@ -342,7 +344,7 @@ const Vt = "d3-flextree", Kt = "2.1.2", Pt = "build/d3-flextree.js", Ut = "index
|
|
|
342
344
|
"rollup-plugin-uglify": "^3.0.0",
|
|
343
345
|
"uglify-es": "^3.3.9"
|
|
344
346
|
}, re = {
|
|
345
|
-
name:
|
|
347
|
+
name: Yt,
|
|
346
348
|
version: Kt,
|
|
347
349
|
main: Pt,
|
|
348
350
|
module: Ut,
|
|
@@ -607,7 +609,7 @@ function W(e) {
|
|
|
607
609
|
const t = e.data;
|
|
608
610
|
return Math.max(4 - 2 * t.state.depth, 1.5);
|
|
609
611
|
}
|
|
610
|
-
function
|
|
612
|
+
function V(e, t) {
|
|
611
613
|
const n = ft(e, t);
|
|
612
614
|
return e[n];
|
|
613
615
|
}
|
|
@@ -913,7 +915,7 @@ class et {
|
|
|
913
915
|
top: 0,
|
|
914
916
|
bottom: 0,
|
|
915
917
|
...n
|
|
916
|
-
}, x = [g.left - l, c.width - g.right - p], m = [g.top - h, c.height - g.bottom - u], y = x[0] * x[1] > 0 ?
|
|
918
|
+
}, x = [g.left - l, c.width - g.right - p], m = [g.top - h, c.height - g.bottom - u], y = x[0] * x[1] > 0 ? V(x, Math.abs) / s.k : 0, f = m[0] * m[1] > 0 ? V(m, Math.abs) / s.k : 0;
|
|
917
919
|
if (y || f) {
|
|
918
920
|
const v = s.translate(y, f);
|
|
919
921
|
return this.transition(this.svg).call(this.zoom.transform, v).end().catch(M);
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-view",
|
|
3
|
-
"version": "0.17.1-alpha.
|
|
3
|
+
"version": "0.17.1-alpha.5+a813e1e",
|
|
4
4
|
"description": "View markmaps in browser",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/d3-flextree": "^2.1.1",
|
|
49
|
-
"markmap-common": "0.17.
|
|
49
|
+
"markmap-common": "0.17.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"markmap-common": "*"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a813e1efd3ad5a1f011fd71320bc36ac3e2b2402"
|
|
55
55
|
}
|