@antv/layout 1.0.0-alpha.9 → 1.0.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/README.md +223 -22
- package/dist/c1c68049e416ee50a3be.worker.js +2 -0
- package/dist/c1c68049e416ee50a3be.worker.js.map +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/esm/c1c68049e416ee50a3be.worker.js +2 -0
- package/esm/c1c68049e416ee50a3be.worker.js.map +1 -0
- package/esm/index.esm.js +1 -1
- package/esm/index.esm.js.map +1 -1
- package/lib/{Circular.d.ts → circular.d.ts} +7 -7
- package/lib/concentric.d.ts +7 -7
- package/lib/d3Force/forceInBox.d.ts +8 -8
- package/lib/d3Force/index.d.ts +21 -11
- package/lib/dagre/acyclic.d.ts +4 -0
- package/lib/dagre/add-border-segments.d.ts +2 -0
- package/lib/dagre/coordinate-system.d.ts +4 -0
- package/lib/dagre/data/list.d.ts +12 -0
- package/lib/dagre/greedy-fas.d.ts +3 -0
- package/lib/dagre/layout.d.ts +18 -0
- package/lib/dagre/nesting-graph.d.ts +8 -0
- package/lib/dagre/normalize.d.ts +5 -0
- package/lib/dagre/order/add-subgraph-constraints.d.ts +3 -0
- package/lib/dagre/order/barycenter.d.ts +14 -0
- package/lib/dagre/order/build-layer-graph.d.ts +3 -0
- package/lib/dagre/order/cross-count.d.ts +3 -0
- package/lib/dagre/order/index.d.ts +2 -0
- package/lib/dagre/order/init-data-order.d.ts +6 -0
- package/lib/dagre/order/init-order.d.ts +3 -0
- package/lib/dagre/order/resolve-conflicts.d.ts +20 -0
- package/lib/dagre/order/sort-subgraph.d.ts +7 -0
- package/lib/dagre/order/sort.d.ts +7 -0
- package/lib/dagre/parent-dummy-chains.d.ts +3 -0
- package/lib/dagre/position/bk.d.ts +25 -0
- package/lib/dagre/position/index.d.ts +7 -0
- package/lib/dagre/rank/feasible-tree.d.ts +5 -0
- package/lib/dagre/rank/index.d.ts +2 -0
- package/lib/dagre/rank/network-simplex.d.ts +16 -0
- package/lib/dagre/rank/util.d.ts +6 -0
- package/lib/dagre/util.d.ts +35 -0
- package/lib/dagre.d.ts +31 -0
- package/lib/force/index.d.ts +25 -12
- package/lib/force/types.d.ts +3 -3
- package/lib/forceAtlas2/body.d.ts +33 -0
- package/lib/forceAtlas2/index.d.ts +106 -0
- package/lib/forceAtlas2/quad.d.ts +27 -0
- package/lib/forceAtlas2/quadTree.d.ts +20 -0
- package/lib/fruchterman.d.ts +53 -0
- package/lib/grid.d.ts +7 -7
- package/lib/index.d.ts +5 -0
- package/lib/mds.d.ts +7 -7
- package/lib/radial/index.d.ts +7 -7
- package/lib/radial/{RadialNonoverlapForce.d.ts → radial-nonoverlap-force.d.ts} +1 -1
- package/lib/random.d.ts +7 -7
- package/lib/registry.d.ts +3 -3
- package/lib/supervisor.d.ts +51 -0
- package/lib/types.d.ts +137 -60
- package/lib/util/function.d.ts +7 -1
- package/lib/util/math.d.ts +1 -1
- package/lib/util/number.d.ts +0 -2
- package/lib/util/object.d.ts +5 -5
- package/lib/util/string.d.ts +0 -1
- package/lib/worker.d.ts +2 -1
- package/package.json +16 -5
- package/dist/3ba7fd533dbbec02abdf.worker.js +0 -2
- package/dist/3ba7fd533dbbec02abdf.worker.js.map +0 -1
- package/esm/3ba7fd533dbbec02abdf.worker.js +0 -2
- package/esm/3ba7fd533dbbec02abdf.worker.js.map +0 -1
- package/lib/Supervisor.d.ts +0 -65
package/lib/Supervisor.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { Graph, Node, Edge } from "@antv/graphlib";
|
|
3
|
-
import type { SyncLayout, LayoutSupervisor } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* The payload transferred from main thread to the worker.
|
|
6
|
-
*/
|
|
7
|
-
export interface Payload {
|
|
8
|
-
layout: {
|
|
9
|
-
id: string;
|
|
10
|
-
options: any;
|
|
11
|
-
};
|
|
12
|
-
nodes: Node<any>[];
|
|
13
|
-
edges: Edge<any>[];
|
|
14
|
-
}
|
|
15
|
-
export declare const SupervisorEvent: {
|
|
16
|
-
/**
|
|
17
|
-
* Get triggerred when each iteration finished.
|
|
18
|
-
*/
|
|
19
|
-
LAYOUT_ITERATION: string;
|
|
20
|
-
/**
|
|
21
|
-
* Get triggerred when layout calculation is done.
|
|
22
|
-
*/
|
|
23
|
-
LAYOUT_END: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* @example
|
|
27
|
-
* const graph = new Graph();
|
|
28
|
-
* const layout = new CircularLayout();
|
|
29
|
-
*
|
|
30
|
-
* const supervisor = new Supervisor(graph, layout, { auto: true });
|
|
31
|
-
* supervisor.start();
|
|
32
|
-
* supervisor.stop();
|
|
33
|
-
* supervisor.kill();
|
|
34
|
-
*
|
|
35
|
-
* // lifecycle
|
|
36
|
-
* supervisor.on('tick', () => {
|
|
37
|
-
* });
|
|
38
|
-
* supervisor.on('layoutend', () => {
|
|
39
|
-
* });
|
|
40
|
-
*
|
|
41
|
-
* // Re-layout when graph changed.
|
|
42
|
-
* graph.addNodes([{ id: 'node1' }, { id: 'node2' }]);
|
|
43
|
-
*
|
|
44
|
-
* // TODO: Custom layout.
|
|
45
|
-
*/
|
|
46
|
-
export declare class Supervisor extends EventEmitter implements LayoutSupervisor {
|
|
47
|
-
private graph;
|
|
48
|
-
private layout;
|
|
49
|
-
/**
|
|
50
|
-
* Internal worker.
|
|
51
|
-
*/
|
|
52
|
-
private worker;
|
|
53
|
-
/**
|
|
54
|
-
* Flag of running state.
|
|
55
|
-
*/
|
|
56
|
-
private running;
|
|
57
|
-
constructor(graph: Graph<any, any>, layout: SyncLayout<any>, options: {
|
|
58
|
-
auto: boolean;
|
|
59
|
-
});
|
|
60
|
-
spawnWorker(): void;
|
|
61
|
-
start(): this;
|
|
62
|
-
stop(): this;
|
|
63
|
-
kill(): void;
|
|
64
|
-
isRunning(): boolean;
|
|
65
|
-
}
|