@libs-ui/components-draw-line 0.1.1-1

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 ADDED
@@ -0,0 +1,3 @@
1
+ # draw-line
2
+
3
+ This library was generated with [Nx](https://nx.dev).
@@ -0,0 +1,57 @@
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy } from '@angular/core';
2
+ import { IDrawLineDataInput, IMoDrawLineFunctionControl, IReachablePointRange, IViewBoxConfig } from './draw-line.interface';
3
+ import * as i0 from "@angular/core";
4
+ export * from './draw-line.interface';
5
+ export declare class LibsUiComponentsDrawLineDirective implements AfterViewInit, OnDestroy {
6
+ protected cdr: ChangeDetectorRef;
7
+ protected zone: NgZone;
8
+ protected elementRef: ElementRef<any>;
9
+ protected intervalScrollToElement?: number;
10
+ private dataDraw;
11
+ private dataReachablePointRange;
12
+ private onDrawLineEnd;
13
+ private onDestroy;
14
+ viewBoxConfig?: IViewBoxConfig;
15
+ svgElement: SVGSVGElement;
16
+ drawRectDebug?: boolean;
17
+ outDrawLineFunctionControl: EventEmitter<IMoDrawLineFunctionControl>;
18
+ outConnected: EventEmitter<{
19
+ dataLine: IDrawLineDataInput;
20
+ dataReachablePointRange: IReachablePointRange;
21
+ }>;
22
+ ngAfterViewInit(): void;
23
+ get FunctionsControl(): IMoDrawLineFunctionControl;
24
+ private setData;
25
+ setReachablePointRange(data: Array<IReachablePointRange>): void;
26
+ private removeLine;
27
+ private removeReachablePointRange;
28
+ private startProcessDataRow;
29
+ private startProcessDataReachablePointRange;
30
+ private removeElementOfPoints;
31
+ private drawLine;
32
+ private updateViewBox;
33
+ private isPointInsideSquare;
34
+ private calculatorSeparatedPoints;
35
+ private buildPathAndDraw;
36
+ private calculatorDistancePointAndCurve;
37
+ private drawRectAndInitEvent;
38
+ private drawBalancedCurve;
39
+ private drawBendBothEndsCurve;
40
+ private buildDAttributeByPointEndModeHorizontal;
41
+ private buildDAttributeByPointEndModeVertical;
42
+ private builDAttributeToString;
43
+ private updateStyleArrow;
44
+ private updateAttributeCircle;
45
+ private getDirection;
46
+ private initEvent;
47
+ private checkPointIncludeRect;
48
+ private createPathAndArrowElement;
49
+ private addCircle;
50
+ private clearCircle;
51
+ private addRect;
52
+ private clearRect;
53
+ private buildPathAndDrawSeparatedPoints;
54
+ ngOnDestroy(): void;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsDrawLineDirective, never>;
56
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LibsUiComponentsDrawLineDirective, "[LibsUiComponentsDrawLineDirective]", never, { "viewBoxConfig": { "alias": "viewBoxConfig"; "required": false; }; "svgElement": { "alias": "svgElement"; "required": false; }; "drawRectDebug": { "alias": "drawRectDebug"; "required": false; }; }, { "outDrawLineFunctionControl": "outDrawLineFunctionControl"; "outConnected": "outConnected"; }, never, never, true, never>;
57
+ }
@@ -0,0 +1,119 @@
1
+ import { Subject } from 'rxjs';
2
+ export interface IReachablePointRange {
3
+ id: string;
4
+ x: number;
5
+ y: number;
6
+ style: ICircleStyle;
7
+ idConnected?: string;
8
+ ref?: IReachablePointRange;
9
+ element?: SVGCircleElement;
10
+ onDestroyEvent?: Subject<void>;
11
+ }
12
+ export interface IViewBoxConfig {
13
+ minX?: number;
14
+ minY?: number;
15
+ width?: number;
16
+ height?: number;
17
+ ignoreViewBox?: boolean;
18
+ marginBetweenElement?: number;
19
+ }
20
+ export interface IDrawLineDataInput {
21
+ id: string;
22
+ points: IPoints;
23
+ idConnected?: string;
24
+ mode: TYPE_MODE;
25
+ lineStyle?: ILineStyle;
26
+ arrowStyle?: IArrowStyle;
27
+ ignoreDrawArrow?: boolean;
28
+ startCircle?: boolean;
29
+ startCircleStyle?: ICircleStyle;
30
+ endCircle?: boolean;
31
+ endCircleStyle?: ICircleStyle;
32
+ isRemove?: boolean;
33
+ arrowDirection?: TYPE_DIRECTION;
34
+ ref?: IDrawLineDataInput;
35
+ startEndMode?: 'right-left' | 'bottom-top' | 'bottom-left';
36
+ }
37
+ export interface ILineStyle {
38
+ stroke?: string;
39
+ strokeDasharray?: string;
40
+ strokeWidth?: string;
41
+ fill?: string;
42
+ curve?: number;
43
+ distancePoint?: number;
44
+ }
45
+ export interface IArrowStyle {
46
+ stroke?: string;
47
+ strokeWidth?: string;
48
+ width?: number;
49
+ height?: number;
50
+ fill?: string;
51
+ }
52
+ export interface ICircleStyle {
53
+ stroke?: string;
54
+ strokeWidth?: string;
55
+ fill?: string;
56
+ r?: number;
57
+ }
58
+ export interface IAttributeDOnPath {
59
+ M: IPoint;
60
+ C: Array<IPoint>;
61
+ L: IPoint;
62
+ Q: Array<IPoint>;
63
+ L2: IPoint;
64
+ Q2: Array<IPoint>;
65
+ L3: IPoint;
66
+ Q3?: Array<IPoint>;
67
+ L4?: IPoint;
68
+ Q4?: Array<IPoint>;
69
+ L5?: IPoint;
70
+ T?: IPoint;
71
+ A?: IPoint;
72
+ }
73
+ export interface IPoints {
74
+ initialized?: boolean;
75
+ obstacleRect?: Array<IRect>;
76
+ separatedPoints?: Array<IPoints>;
77
+ pathElement?: SVGPathElement;
78
+ arrowElement?: SVGPolylineElement;
79
+ circleStartElement?: SVGCircleElement;
80
+ circleEndElement?: SVGCircleElement;
81
+ onDestroyEvent?: Subject<void>;
82
+ start: IPoint;
83
+ end: IPoint;
84
+ mode?: TYPE_MODE;
85
+ id?: string;
86
+ name?: string;
87
+ }
88
+ export interface IRect {
89
+ id?: string;
90
+ x: number;
91
+ y: number;
92
+ width: number;
93
+ height: number;
94
+ gapXObstacleRect?: number;
95
+ gapYObstacleRect?: number;
96
+ }
97
+ export interface IPoint {
98
+ x: number;
99
+ y: number;
100
+ }
101
+ export type TYPE_DIRECTION = 'right' | 'left' | 'top' | 'bottom';
102
+ export type TYPE_MODE = 'quart-in' | 'vertical' | 'vertical-single-curve' | 'horizontal' | 'horizontal-single-curve';
103
+ export interface IMoDrawLineFunctionControl {
104
+ setData: (data: Array<IDrawLineDataInput>) => void;
105
+ removeLine: (id: string, points?: Array<IPoints>) => void;
106
+ setReachablePointRange: (data: Array<IReachablePointRange>) => void;
107
+ removeReachablePointRange: (ids: Array<string>) => void;
108
+ updateViewBox: (viewBoxConfig?: IViewBoxConfig) => void;
109
+ }
110
+ export interface ICoordinatesSvg {
111
+ mx?: number;
112
+ my?: number;
113
+ x1?: number;
114
+ y1?: number;
115
+ x?: number;
116
+ y?: number;
117
+ lx?: number;
118
+ ly?: number;
119
+ }