@plait/graph-viz 0.91.0 → 0.92.0-next.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/index.d.ts CHANGED
@@ -1,5 +1,114 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@plait/graph-viz" />
5
- export * from './public-api';
1
+ import { Options } from 'roughjs/bin/core';
2
+ import { GeneratorExtraData, RenderComponentRef } from '@plait/common';
3
+ import { Point, PlaitBoard, PlaitElement } from '@plait/core';
4
+ import * as _plait_graph_viz from '@plait/graph-viz';
5
+
6
+ declare const DEFAULT_EDGE_STYLES: Options;
7
+ declare const DEFAULT_NODE_SIZE = 30;
8
+ declare const DEFAULT_ACTIVE_NODE_SIZE_MULTIPLIER = 1.2;
9
+ declare const DEFAULT_ACTIVE_WAVE_NODE_SIZE_MULTIPLIER = 1.5;
10
+ declare const DEFAULT_NODE_LABEL_MARGIN_TOP = 4;
11
+ declare const DEFAULT_NODE_LABEL_FONT_SIZE = 12;
12
+ declare const DEFAULT_NODE_LABEL_WIDTH = 72;
13
+ declare const DEFAULT_NODE_LABEL_HEIGHT = 22;
14
+ declare const DEFAULT_NODE_LABEL_STYLE = "user-select:none;max-width:72px;text-align:center;line-height:22px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;";
15
+ declare const NODE_LABEL_CLASS_NAME = "force-atlas-node-label";
16
+ declare const SECOND_DEPTH_NODE_ALPHA = 0.5;
17
+ declare const SECOND_DEPTH_LINE_ALPHA = 0.5;
18
+ declare const ACTIVE_BACKGROUND_NODE_ALPHA = 0.1;
19
+ declare const NODE_ICON_CLASS_NAME = "force-atlas-node-icon";
20
+ declare const ACTIVE_NODE_ICON_CLASS_NAME = "force-atlas-node-icon-active";
21
+ declare const NODE_ICON_FONT_SIZE = 16;
22
+ declare const ACTIVE_NODE_ICON_FONT_SIZE = 18;
23
+ declare const DEFAULT_NODE_BACKGROUND_COLOR = "#9c9cfb";
24
+ declare const DEFAULT_NODE_ICON_COLOR = "#fff";
25
+ declare const DEFAULT_NODE_STYLES: Options;
26
+ declare const DEFAULT_NODE_SCALING_RATIO = 20;
27
+ declare const DEFAULT_LINE_STYLES: {
28
+ color: {
29
+ 0: string;
30
+ 1: string;
31
+ 2: string;
32
+ };
33
+ opacity: {
34
+ 0: number;
35
+ 1: number;
36
+ 2: number;
37
+ };
38
+ };
39
+ declare const DEFAULT_EDGE_PARTICLE_SIZE = 4;
40
+
41
+ declare enum EdgeDirection {
42
+ IN = 0,
43
+ OUT = 1,
44
+ NONE = 2
45
+ }
46
+ interface NodeStyles {
47
+ stroke?: string;
48
+ strokeWidth?: number;
49
+ fill?: string;
50
+ fillStyle?: string;
51
+ activeStroke?: string;
52
+ activeFill?: string;
53
+ borderRadius?: number;
54
+ hoverStroke?: string;
55
+ }
56
+ interface EdgeGeneratorData extends GeneratorExtraData {
57
+ startPoint: Point;
58
+ endPoint: Point;
59
+ isSourceActive: boolean;
60
+ isTargetActive: boolean;
61
+ direction: EdgeDirection;
62
+ isTargetSelf?: boolean;
63
+ }
64
+ interface NodeGeneratorData extends GeneratorExtraData {
65
+ isActive: boolean;
66
+ opacity: number;
67
+ }
68
+ interface NodeIconItem {
69
+ name: string;
70
+ fontSize?: number;
71
+ color?: string;
72
+ }
73
+
74
+ declare const withForceAtlas: (board: PlaitBoard) => PlaitBoard & _plait_graph_viz.ForceAtlasNodeIconBoard;
75
+
76
+ interface ForceAtlasNodeElement extends PlaitElement {
77
+ label: string;
78
+ icon: string | NodeIconItem;
79
+ size?: number;
80
+ isActive?: boolean;
81
+ }
82
+ interface ForceAtlasEdgeElement extends PlaitElement {
83
+ source: string;
84
+ target: string;
85
+ }
86
+ interface ForceAtlasElement extends PlaitElement {
87
+ children: (ForceAtlasNodeElement | ForceAtlasEdgeElement)[];
88
+ }
89
+ declare const ForceAtlasElement: {
90
+ isForceAtlas: (value: any) => boolean;
91
+ isForceAtlasNodeElement: (value: any) => value is ForceAtlasNodeElement;
92
+ isForceAtlasEdgeElement: (value: any) => value is ForceAtlasEdgeElement;
93
+ };
94
+
95
+ interface ForceAtlasNodeIconBoard {
96
+ renderNodeIcon: (container: Element | DocumentFragment, props: NodeIconProps) => RenderComponentRef<NodeIconProps>;
97
+ }
98
+ declare const withNodeIcon: <T extends PlaitBoard = PlaitBoard>(board: T) => T & ForceAtlasNodeIconBoard;
99
+ interface NodeIconProps {
100
+ board: PlaitBoard;
101
+ iconItem: NodeIconItem;
102
+ element: ForceAtlasNodeElement;
103
+ }
104
+
105
+ declare abstract class ForceAtlasNodeIconBaseComponent {
106
+ iconItem: NodeIconItem;
107
+ board: PlaitBoard;
108
+ element: ForceAtlasNodeElement;
109
+ abstract nativeElement(): HTMLElement;
110
+ initialize(): void;
111
+ }
112
+
113
+ export { ACTIVE_BACKGROUND_NODE_ALPHA, ACTIVE_NODE_ICON_CLASS_NAME, ACTIVE_NODE_ICON_FONT_SIZE, DEFAULT_ACTIVE_NODE_SIZE_MULTIPLIER, DEFAULT_ACTIVE_WAVE_NODE_SIZE_MULTIPLIER, DEFAULT_EDGE_PARTICLE_SIZE, DEFAULT_EDGE_STYLES, DEFAULT_LINE_STYLES, DEFAULT_NODE_BACKGROUND_COLOR, DEFAULT_NODE_ICON_COLOR, DEFAULT_NODE_LABEL_FONT_SIZE, DEFAULT_NODE_LABEL_HEIGHT, DEFAULT_NODE_LABEL_MARGIN_TOP, DEFAULT_NODE_LABEL_STYLE, DEFAULT_NODE_LABEL_WIDTH, DEFAULT_NODE_SCALING_RATIO, DEFAULT_NODE_SIZE, DEFAULT_NODE_STYLES, EdgeDirection, ForceAtlasElement, ForceAtlasNodeIconBaseComponent, NODE_ICON_CLASS_NAME, NODE_ICON_FONT_SIZE, NODE_LABEL_CLASS_NAME, SECOND_DEPTH_LINE_ALPHA, SECOND_DEPTH_NODE_ALPHA, withForceAtlas, withNodeIcon };
114
+ export type { EdgeGeneratorData, ForceAtlasEdgeElement, ForceAtlasNodeElement, ForceAtlasNodeIconBoard, NodeGeneratorData, NodeIconItem, NodeIconProps, NodeStyles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/graph-viz",
3
- "version": "0.91.0",
3
+ "version": "0.92.0-next.0",
4
4
  "peerDependencies": {
5
5
  "graphology": "^0.25.4",
6
6
  "graphology-layout": "^0.6.1",
@@ -1,2 +0,0 @@
1
- import { Options } from 'roughjs/bin/core';
2
- export declare const DEFAULT_STYLES: Options;
@@ -1,35 +0,0 @@
1
- import { Options } from 'roughjs/bin/core';
2
- export declare const DEFAULT_EDGE_STYLES: Options;
3
- export declare const DEFAULT_NODE_SIZE = 30;
4
- export declare const DEFAULT_ACTIVE_NODE_SIZE_MULTIPLIER = 1.2;
5
- export declare const DEFAULT_ACTIVE_WAVE_NODE_SIZE_MULTIPLIER = 1.5;
6
- export declare const DEFAULT_NODE_LABEL_MARGIN_TOP = 4;
7
- export declare const DEFAULT_NODE_LABEL_FONT_SIZE = 12;
8
- export declare const DEFAULT_NODE_LABEL_WIDTH = 72;
9
- export declare const DEFAULT_NODE_LABEL_HEIGHT = 22;
10
- export declare const DEFAULT_NODE_LABEL_STYLE = "user-select:none;max-width:72px;text-align:center;line-height:22px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;";
11
- export declare const NODE_LABEL_CLASS_NAME = "force-atlas-node-label";
12
- export declare const SECOND_DEPTH_NODE_ALPHA = 0.5;
13
- export declare const SECOND_DEPTH_LINE_ALPHA = 0.5;
14
- export declare const ACTIVE_BACKGROUND_NODE_ALPHA = 0.1;
15
- export declare const NODE_ICON_CLASS_NAME = "force-atlas-node-icon";
16
- export declare const ACTIVE_NODE_ICON_CLASS_NAME = "force-atlas-node-icon-active";
17
- export declare const NODE_ICON_FONT_SIZE = 16;
18
- export declare const ACTIVE_NODE_ICON_FONT_SIZE = 18;
19
- export declare const DEFAULT_NODE_BACKGROUND_COLOR = "#9c9cfb";
20
- export declare const DEFAULT_NODE_ICON_COLOR = "#fff";
21
- export declare const DEFAULT_NODE_STYLES: Options;
22
- export declare const DEFAULT_NODE_SCALING_RATIO = 20;
23
- export declare const DEFAULT_LINE_STYLES: {
24
- color: {
25
- 0: string;
26
- 1: string;
27
- 2: string;
28
- };
29
- opacity: {
30
- 0: number;
31
- 1: number;
32
- 2: number;
33
- };
34
- };
35
- export declare const DEFAULT_EDGE_PARTICLE_SIZE = 4;
@@ -1,10 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { ForceAtlasNodeElement } from '../../interfaces/element';
3
- import { NodeIconItem } from '../types';
4
- export declare abstract class ForceAtlasNodeIconBaseComponent {
5
- iconItem: NodeIconItem;
6
- board: PlaitBoard;
7
- element: ForceAtlasNodeElement;
8
- abstract nativeElement(): HTMLElement;
9
- initialize(): void;
10
- }
@@ -1,15 +0,0 @@
1
- import { CommonElementFlavour } from '@plait/common';
2
- import { OnContextChanged, PlaitBoard, PlaitPluginElementContext } from '@plait/core';
3
- import Graph from 'graphology';
4
- import { ForceAtlasEdgeElement } from '../interfaces';
5
- import { ForceAtlasEdgeGenerator } from './generators/edge.generator';
6
- export declare class ForceAtlasEdgeFlavour extends CommonElementFlavour<ForceAtlasEdgeElement, PlaitBoard> implements OnContextChanged<ForceAtlasEdgeElement, PlaitBoard> {
7
- graph: Graph<Node>;
8
- edgeGenerator: ForceAtlasEdgeGenerator;
9
- constructor();
10
- initializeGenerator(): void;
11
- initialize(): void;
12
- onContextChanged(value: PlaitPluginElementContext<ForceAtlasEdgeElement, PlaitBoard>, previous: PlaitPluginElementContext<ForceAtlasEdgeElement, PlaitBoard>): void;
13
- updateText(previousElement: ForceAtlasEdgeElement, currentElement: ForceAtlasEdgeElement): void;
14
- destroy(): void;
15
- }
@@ -1,13 +0,0 @@
1
- import { CommonElementFlavour } from '@plait/common';
2
- import { OnContextChanged, PlaitBoard, PlaitPluginElementContext } from '@plait/core';
3
- import Graph from 'graphology';
4
- import { ForceAtlasElement, ForceAtlasNodeElement } from '../interfaces';
5
- export declare class ForceAtlasFlavour extends CommonElementFlavour<ForceAtlasElement, PlaitBoard> implements OnContextChanged<ForceAtlasElement, PlaitBoard> {
6
- graph: Graph<ForceAtlasNodeElement>;
7
- constructor();
8
- initializeGraph(): void;
9
- initialize(): void;
10
- onContextChanged(value: PlaitPluginElementContext<ForceAtlasElement, PlaitBoard>, previous: PlaitPluginElementContext<ForceAtlasElement, PlaitBoard>): void;
11
- updateText(previousElement: ForceAtlasElement, currentElement: ForceAtlasElement): void;
12
- destroy(): void;
13
- }
@@ -1,15 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { Generator } from '@plait/common';
3
- import { ForceAtlasEdgeElement } from '../../interfaces';
4
- import { EdgeGeneratorData } from '../types';
5
- export declare class ForceAtlasEdgeGenerator extends Generator<ForceAtlasEdgeElement, EdgeGeneratorData> {
6
- static key: string;
7
- particleAnimation?: {
8
- stop: () => void;
9
- start: () => void;
10
- };
11
- constructor(board: PlaitBoard);
12
- canDraw(element: ForceAtlasEdgeElement): boolean;
13
- draw(element: ForceAtlasEdgeElement, data: EdgeGeneratorData): SVGGElement;
14
- destroy(): void;
15
- }
@@ -1,15 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { Generator, RenderComponentRef } from '@plait/common';
3
- import { ForceAtlasNodeElement } from '../../interfaces';
4
- import { NodeGeneratorData } from '../types';
5
- import { NodeIconProps } from '../with-node-icon';
6
- export declare class ForceAtlasNodeGenerator extends Generator<ForceAtlasNodeElement, NodeGeneratorData> {
7
- static key: string;
8
- constructor(board: PlaitBoard);
9
- canDraw(element: ForceAtlasNodeElement): boolean;
10
- draw(element: ForceAtlasNodeElement, data: NodeGeneratorData): SVGGElement;
11
- drawIcon(element: ForceAtlasNodeElement, data: NodeGeneratorData): {
12
- ref: RenderComponentRef<NodeIconProps>;
13
- iconG: SVGGElement;
14
- };
15
- }
@@ -1,15 +0,0 @@
1
- import { CommonElementFlavour } from '@plait/common';
2
- import { OnContextChanged, PlaitBoard, PlaitPluginElementContext } from '@plait/core';
3
- import Graph from 'graphology';
4
- import { ForceAtlasNodeElement } from '../interfaces';
5
- import { ForceAtlasNodeGenerator } from './generators/node.generator';
6
- export declare class ForceAtlasNodeFlavour extends CommonElementFlavour<ForceAtlasNodeElement, PlaitBoard> implements OnContextChanged<ForceAtlasNodeElement, PlaitBoard> {
7
- graph: Graph<Node>;
8
- nodeGenerator: ForceAtlasNodeGenerator;
9
- constructor();
10
- initializeGenerator(): void;
11
- initialize(): void;
12
- onContextChanged(value: PlaitPluginElementContext<ForceAtlasNodeElement, PlaitBoard>, previous: PlaitPluginElementContext<ForceAtlasNodeElement, PlaitBoard>): void;
13
- updateText(previousElement: ForceAtlasNodeElement, currentElement: ForceAtlasNodeElement): void;
14
- destroy(): void;
15
- }
@@ -1,34 +0,0 @@
1
- import { GeneratorExtraData } from '@plait/common';
2
- import { Point } from '@plait/core';
3
- export declare enum EdgeDirection {
4
- IN = 0,
5
- OUT = 1,
6
- NONE = 2
7
- }
8
- export interface NodeStyles {
9
- stroke?: string;
10
- strokeWidth?: number;
11
- fill?: string;
12
- fillStyle?: string;
13
- activeStroke?: string;
14
- activeFill?: string;
15
- borderRadius?: number;
16
- hoverStroke?: string;
17
- }
18
- export interface EdgeGeneratorData extends GeneratorExtraData {
19
- startPoint: Point;
20
- endPoint: Point;
21
- isSourceActive: boolean;
22
- isTargetActive: boolean;
23
- direction: EdgeDirection;
24
- isTargetSelf?: boolean;
25
- }
26
- export interface NodeGeneratorData extends GeneratorExtraData {
27
- isActive: boolean;
28
- opacity: number;
29
- }
30
- export interface NodeIconItem {
31
- name: string;
32
- fontSize?: number;
33
- color?: string;
34
- }
@@ -1,13 +0,0 @@
1
- import { EdgeDirection } from '../types';
2
- import { PlaitBoard, Point } from '@plait/core';
3
- import { ForceAtlasNodeElement } from '../../interfaces';
4
- export declare function drawNode(board: PlaitBoard, node: ForceAtlasNodeElement, point: Point, options: {
5
- iconG?: SVGGElement;
6
- isActive: boolean;
7
- opacity?: number;
8
- }): SVGGElement;
9
- export declare function drawEdge(startPoint: Point, endPoint: Point, direction: EdgeDirection, isMutual: boolean, isTargetSelf?: boolean): {
10
- g: SVGGElement;
11
- path: SVGPathElement;
12
- };
13
- export declare function drawParticle(board: PlaitBoard, startPoint: Point, direction: EdgeDirection): SVGGElement;
@@ -1,14 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { ForceAtlasEdgeElement, ForceAtlasElement } from '../../interfaces';
3
- import { EdgeDirection, EdgeGeneratorData } from '../types';
4
- import { ForceAtlasEdgeGenerator } from '../generators/edge.generator';
5
- export declare function getEdges(forceAtlasElement: ForceAtlasElement, andCallBack?: (edge: ForceAtlasEdgeElement) => boolean): ForceAtlasEdgeElement[];
6
- export declare function getEdgeById(id: string, forceAtlasElement: ForceAtlasElement): ForceAtlasEdgeElement;
7
- export declare function getEdgesInSourceOrTarget(id: string, forceAtlasElement: ForceAtlasElement): ForceAtlasEdgeElement[];
8
- export declare function getEdgeGenerator(edge: ForceAtlasEdgeElement): ForceAtlasEdgeGenerator;
9
- export declare function getEdgeDirection(isSourceActive: boolean, isTargetActive: boolean): EdgeDirection;
10
- export declare function getEdgeGeneratorData(edge: ForceAtlasEdgeElement, board: PlaitBoard): EdgeGeneratorData;
11
- export declare function playEdgeParticleAnimate(path: SVGPathElement, pointG: SVGGElement): {
12
- stop: () => void;
13
- start: () => void;
14
- };
@@ -1,15 +0,0 @@
1
- import { Point } from '@plait/core';
2
- import { ForceAtlasElement, ForceAtlasNodeElement } from '../../interfaces';
3
- import { ForceAtlasNodeGenerator } from '../generators/node.generator';
4
- export declare function getNodes(forceAtlasElement: ForceAtlasElement, andBack?: (edge: ForceAtlasNodeElement) => boolean): ForceAtlasNodeElement[];
5
- export declare function getNodeById(id: string, forceAtlasElement: ForceAtlasElement): ForceAtlasNodeElement;
6
- export declare function getIsNodeActive(id: string, selectElements: ForceAtlasNodeElement[]): boolean;
7
- export declare function isHitNode(node: ForceAtlasNodeElement, point: [Point, Point]): boolean;
8
- export declare function getAssociatedNodesById(id: string, forceAtlasElement: ForceAtlasElement): ForceAtlasNodeElement[];
9
- export declare function getNodeGenerator(node: ForceAtlasNodeElement): ForceAtlasNodeGenerator;
10
- export declare function isFirstDepthNode(currentNodeId: string, activeNodeId: string, forceAtlasElement: ForceAtlasElement): boolean;
11
- export declare function getNodeIcon(node: ForceAtlasNodeElement): {
12
- name: string;
13
- fontSize: number;
14
- color: string;
15
- };
@@ -1,2 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- export declare const withForceAtlas: (board: PlaitBoard) => PlaitBoard & import("./with-node-icon").ForceAtlasNodeIconBoard;
@@ -1,13 +0,0 @@
1
- import { PlaitBoard } from '@plait/core';
2
- import { ForceAtlasNodeElement } from '../interfaces/element';
3
- import { RenderComponentRef } from '@plait/common';
4
- import { NodeIconItem } from './types';
5
- export interface ForceAtlasNodeIconBoard {
6
- renderNodeIcon: (container: Element | DocumentFragment, props: NodeIconProps) => RenderComponentRef<NodeIconProps>;
7
- }
8
- export declare const withNodeIcon: <T extends PlaitBoard = PlaitBoard>(board: T) => T & ForceAtlasNodeIconBoard;
9
- export interface NodeIconProps {
10
- board: PlaitBoard;
11
- iconItem: NodeIconItem;
12
- element: ForceAtlasNodeElement;
13
- }
@@ -1,20 +0,0 @@
1
- import { PlaitElement } from '@plait/core';
2
- import { NodeIconItem } from '../force-atlas/types';
3
- export interface ForceAtlasNodeElement extends PlaitElement {
4
- label: string;
5
- icon: string | NodeIconItem;
6
- size?: number;
7
- isActive?: boolean;
8
- }
9
- export interface ForceAtlasEdgeElement extends PlaitElement {
10
- source: string;
11
- target: string;
12
- }
13
- export interface ForceAtlasElement extends PlaitElement {
14
- children: (ForceAtlasNodeElement | ForceAtlasEdgeElement)[];
15
- }
16
- export declare const ForceAtlasElement: {
17
- isForceAtlas: (value: any) => boolean;
18
- isForceAtlasNodeElement: (value: any) => value is ForceAtlasNodeElement;
19
- isForceAtlasEdgeElement: (value: any) => value is ForceAtlasEdgeElement;
20
- };
@@ -1 +0,0 @@
1
- export * from './element';
@@ -1,42 +0,0 @@
1
- export type ArrowOptions = {
2
- bow?: number;
3
- stretchMin?: number;
4
- stretchMax?: number;
5
- stretch?: number;
6
- padStart?: number;
7
- padEnd?: number;
8
- flip?: boolean;
9
- straights?: boolean;
10
- };
11
- /**
12
- * getArrow
13
- * Get the points for a linking line between two points.
14
- * @description Draw an arrow between two points.
15
- * @param x0 The x position of the "from" point.
16
- * @param y0 The y position of the "from" point.
17
- * @param x1 The x position of the "to" point.
18
- * @param y1 The y position of the "to" point.
19
- * @param options Additional options for computing the line.
20
- * @returns [sx, sy, cx, cy, e1, e2, ae, as, ac]
21
- * @example
22
- * const arrow = getArrow(0, 0, 100, 200, {
23
- bow: 0
24
- stretch: .5
25
- stretchMin: 0
26
- stretchMax: 420
27
- padStart: 0
28
- padEnd: 0
29
- flip: false
30
- straights: true
31
- * })
32
- *
33
- * const [
34
- * startX, startY,
35
- * controlX, controlY,
36
- * endX, endY,
37
- * endAngle,
38
- * startAngle,
39
- * controlAngle
40
- * ] = arrow
41
- */
42
- export default function getArrow(x0: number, y0: number, x1: number, y1: number, options?: ArrowOptions): number[];
@@ -1,55 +0,0 @@
1
- /**
2
- * Modulate a value between two ranges.
3
- * @param value
4
- * @param rangeA from [low, high]
5
- * @param rangeB to [low, high]
6
- * @param clamp
7
- */
8
- export declare function modulate(value: number, rangeA: number[], rangeB: number[], clamp?: boolean): number;
9
- /**
10
- * Rotate a point around a center.
11
- * @param x The x-axis coordinate of the point.
12
- * @param y The y-axis coordinate of the point.
13
- * @param cx The x-axis coordinate of the point to rotate round.
14
- * @param cy The y-axis coordinate of the point to rotate round.
15
- * @param angle The distance (in radians) to rotate.
16
- */
17
- export declare function rotatePoint(x: number, y: number, cx: number, cy: number, angle: number): number[];
18
- /**
19
- * Get the distance between two points.
20
- * @param x0 The x-axis coordinate of the first point.
21
- * @param y0 The y-axis coordinate of the first point.
22
- * @param x1 The x-axis coordinate of the second point.
23
- * @param y1 The y-axis coordinate of the second point.
24
- */
25
- export declare function getDistance(x0: number, y0: number, x1: number, y1: number): number;
26
- /**
27
- * Get an angle (radians) between two points.
28
- * @param x0 The x-axis coordinate of the first point.
29
- * @param y0 The y-axis coordinate of the first point.
30
- * @param x1 The x-axis coordinate of the second point.
31
- * @param y1 The y-axis coordinate of the second point.
32
- */
33
- export declare function getAngle(x0: number, y0: number, x1: number, y1: number): number;
34
- /**
35
- * Move a point in an angle by a distance.
36
- * @param x0
37
- * @param y0
38
- * @param a angle (radians)
39
- * @param d distance
40
- */
41
- export declare function projectPoint(x0: number, y0: number, a: number, d: number): number[];
42
- /**
43
- * Get the sector of an angle (e.g. quadrant, octant)
44
- * @param a The angle to check.
45
- * @param s The number of sectors to check.
46
- */
47
- export declare function getSector(a: number, s?: number): number;
48
- /**
49
- * Get a normal value representing how close two points are from being at a 45 degree angle.
50
- * @param x0 The x-axis coordinate of the first point.
51
- * @param y0 The y-axis coordinate of the first point.
52
- * @param x1 The x-axis coordinate of the second point.
53
- * @param y1 The y-axis coordinate of the second point.
54
- */
55
- export declare function getAngliness(x0: number, y0: number, x1: number, y1: number): number;
package/public-api.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './force-atlas/constants';
2
- export * from './force-atlas/types';
3
- export * from './force-atlas/with-force-atlas';
4
- export * from './force-atlas/with-node-icon';
5
- export * from './interfaces/index';
6
- export * from './force-atlas/core/node-icon-base.component';