zhangnaisong
2024-03-23 4532b321444257453a86c0f5289a3a5f576db71e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
 * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing
 *       the tree.
 */
import * as layout from '../../util/layout.js';
import { TreeNode } from '../../data/Tree.js';
import TreeSeriesModel from './TreeSeries.js';
import ExtensionAPI from '../../core/ExtensionAPI.js';
interface HierNode {
    defaultAncestor: TreeLayoutNode;
    ancestor: TreeLayoutNode;
    prelim: number;
    modifier: number;
    change: number;
    shift: number;
    i: number;
    thread: TreeLayoutNode;
}
export interface TreeLayoutNode extends TreeNode {
    parentNode: TreeLayoutNode;
    hierNode: HierNode;
    children: TreeLayoutNode[];
}
/**
 * Initialize all computational message for following algorithm.
 */
export declare function init(inRoot: TreeNode): void;
/**
 * The implementation of this function was originally copied from "d3.js"
 * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
 * with some modifications made for this program.
 * See the license statement at the head of this file.
 *
 * Computes a preliminary x coordinate for node. Before that, this function is
 * applied recursively to the children of node, as well as the function
 * apportion(). After spacing out the children by calling executeShifts(), the
 * node is placed to the midpoint of its outermost children.
 */
export declare function firstWalk(node: TreeLayoutNode, separation: SeparationFunc): void;
/**
 * The implementation of this function was originally copied from "d3.js"
 * <https://github.com/d3/d3-hierarchy/blob/4c1f038f2725d6eae2e49b61d01456400694bac4/src/tree.js>
 * with some modifications made for this program.
 * See the license statement at the head of this file.
 *
 * Computes all real x-coordinates by summing up the modifiers recursively.
 */
export declare function secondWalk(node: TreeLayoutNode): void;
export declare function separation(cb?: SeparationFunc): SeparationFunc;
/**
 * Transform the common coordinate to radial coordinate.
 */
export declare function radialCoordinate(rad: number, r: number): {
    x: number;
    y: number;
};
/**
 * Get the layout position of the whole view.
 */
export declare function getViewRect(seriesModel: TreeSeriesModel, api: ExtensionAPI): layout.LayoutRect;
interface SeparationFunc {
    (node1: TreeLayoutNode, node2: TreeLayoutNode): number;
}
export {};