markmap-view 0.15.8 → 0.15.9-alpha.0
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 +130 -81
- package/dist/constants.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +427 -407
- package/dist/types.d.ts +11 -0
- package/dist/util.d.ts +3 -0
- package/dist/view.d.ts +5 -8
- package/package.json +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -7,3 +7,14 @@ export interface IMarkmapState {
|
|
|
7
7
|
minY: number;
|
|
8
8
|
maxY: number;
|
|
9
9
|
}
|
|
10
|
+
export interface IMarkmapJSONOptions {
|
|
11
|
+
color?: string[];
|
|
12
|
+
colorFreezeLevel?: number;
|
|
13
|
+
duration?: number;
|
|
14
|
+
maxWidth?: number;
|
|
15
|
+
initialExpandLevel?: number;
|
|
16
|
+
extraJs?: string[];
|
|
17
|
+
extraCss?: string[];
|
|
18
|
+
zoom?: boolean;
|
|
19
|
+
pan?: boolean;
|
|
20
|
+
}
|
package/dist/util.d.ts
ADDED
package/dist/view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as d3 from 'd3';
|
|
2
2
|
import { FlextreeNode } from 'd3-flextree';
|
|
3
|
-
import { Hook, INode, IPureNode
|
|
3
|
+
import { Hook, IMarkmapOptions, INode, IPureNode } from 'markmap-common';
|
|
4
4
|
import { IMarkmapState } from './types';
|
|
5
5
|
export declare const globalCSS: string;
|
|
6
6
|
interface IPadding {
|
|
@@ -10,24 +10,20 @@ interface IPadding {
|
|
|
10
10
|
bottom: number;
|
|
11
11
|
}
|
|
12
12
|
type ID3SVGElement = d3.Selection<SVGElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
|
|
13
|
-
declare function createViewHooks(): {
|
|
14
|
-
transformHtml: Hook<[mm: Markmap, nodes: HTMLElement[]]>;
|
|
15
|
-
};
|
|
16
13
|
/**
|
|
17
14
|
* A global hook to refresh all markmaps when called.
|
|
18
15
|
*/
|
|
19
16
|
export declare const refreshHook: Hook<[]>;
|
|
20
|
-
export declare const defaultColorFn: d3.ScaleOrdinal<string, string, never>;
|
|
21
17
|
export declare class Markmap {
|
|
22
|
-
static defaultOptions: IMarkmapOptions;
|
|
23
18
|
options: IMarkmapOptions;
|
|
24
19
|
state: IMarkmapState;
|
|
25
20
|
svg: ID3SVGElement;
|
|
26
21
|
styleNode: d3.Selection<HTMLStyleElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
|
|
27
22
|
g: d3.Selection<SVGGElement, FlextreeNode<INode>, HTMLElement, FlextreeNode<INode>>;
|
|
28
23
|
zoom: d3.ZoomBehavior<SVGElement, FlextreeNode<INode>>;
|
|
29
|
-
viewHooks: ReturnType<typeof createViewHooks>;
|
|
30
24
|
revokers: (() => void)[];
|
|
25
|
+
private imgCache;
|
|
26
|
+
private debouncedRefresh;
|
|
31
27
|
constructor(svg: string | SVGElement | ID3SVGElement, opts?: Partial<IMarkmapOptions>);
|
|
32
28
|
getStyleContent(): string;
|
|
33
29
|
updateStyle(): void;
|
|
@@ -36,6 +32,8 @@ export declare class Markmap {
|
|
|
36
32
|
toggleNode(data: INode, recursive?: boolean): void;
|
|
37
33
|
handleClick: (e: MouseEvent, d: FlextreeNode<INode>) => void;
|
|
38
34
|
initializeData(node: INode): void;
|
|
35
|
+
private _checkImages;
|
|
36
|
+
private _loadImage;
|
|
39
37
|
setOptions(opts?: Partial<IMarkmapOptions>): void;
|
|
40
38
|
setData(data?: IPureNode | null, opts?: Partial<IMarkmapOptions>): void;
|
|
41
39
|
renderData(originData?: INode): void;
|
|
@@ -55,5 +53,4 @@ export declare class Markmap {
|
|
|
55
53
|
destroy(): void;
|
|
56
54
|
static create(svg: string | SVGElement | ID3SVGElement, opts?: Partial<IMarkmapOptions>, data?: IPureNode | null): Markmap;
|
|
57
55
|
}
|
|
58
|
-
export declare function deriveOptions(jsonOptions?: IMarkmapJSONOptions): Partial<IMarkmapOptions>;
|
|
59
56
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-view",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.9-alpha.0+9cb40e7",
|
|
4
4
|
"description": "View markmaps in browser",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/d3-flextree": "^2.1.1",
|
|
47
|
-
"markmap-common": "0.15.
|
|
47
|
+
"markmap-common": "0.15.9-alpha.0+9cb40e7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"markmap-common": "*"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "9cb40e7e9ec0aa1f25a2de6a74912cd0c21f52ed"
|
|
53
53
|
}
|