@net7/components 4.0.0 → 4.0.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/esm2020/lib/components/bubble-chart/bubble-chart.mjs +148 -134
- package/esm2020/lib/components/bubble-chart/bubble-chart.mock.mjs +416 -3440
- package/esm2020/lib/components/input-text/input-text.mjs +3 -3
- package/esm2020/lib/components/input-text/input-text.mock.mjs +3 -2
- package/fesm2015/net7-components.mjs +547 -3573
- package/fesm2015/net7-components.mjs.map +1 -1
- package/fesm2020/net7-components.mjs +546 -3573
- package/fesm2020/net7-components.mjs.map +1 -1
- package/lib/components/bubble-chart/bubble-chart.d.ts +59 -17
- package/package.json +1 -1
|
@@ -1,5 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bubble chart is drawn using d3js, a library to create and update anything in svg.
|
|
3
|
+
*
|
|
4
|
+
* LEGEND:
|
|
5
|
+
* - svg -> the canvas/<svg> element where everything will be drawn on (appended).
|
|
6
|
+
* - g -> <g> is a group of svg elements.
|
|
7
|
+
* - leaf -> this is the svg circle, the bubble.
|
|
8
|
+
* - text -> this is all the text inside the circle.
|
|
9
|
+
* - tspan -> this is just one line of text.
|
|
10
|
+
*
|
|
11
|
+
* What are "join, enter, update, exit?"
|
|
12
|
+
* https://observablehq.com/@d3/learn-d3-joins?collection=@d3/learn-d3
|
|
13
|
+
* https://observablehq.com/@thetylerwolf/day-18-join-enter-update-exit
|
|
14
|
+
*
|
|
15
|
+
* Each line can have a different width, but all of the text inside a circle
|
|
16
|
+
* needs to be scaled by a constant factor.
|
|
17
|
+
* https://observablehq.com/@mbostock/fit-text-to-circle
|
|
18
|
+
*/
|
|
1
19
|
import { AfterContentChecked } from '@angular/core';
|
|
2
20
|
import * as i0 from "@angular/core";
|
|
21
|
+
/**
|
|
22
|
+
* Interface for D3Chart's "data"
|
|
23
|
+
*
|
|
24
|
+
* @property entity (required)
|
|
25
|
+
* - id (required)
|
|
26
|
+
* - label (optional)
|
|
27
|
+
* - typeOfEntity (optional)
|
|
28
|
+
* @property count (required)
|
|
29
|
+
*/
|
|
30
|
+
export interface BubbleChartDataItem {
|
|
31
|
+
entity: {
|
|
32
|
+
id: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
typeOfEntity?: string;
|
|
35
|
+
};
|
|
36
|
+
count: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Interface for a Circle's node data
|
|
40
|
+
*/
|
|
41
|
+
export interface CircleNode {
|
|
42
|
+
clipUid: string;
|
|
43
|
+
data: BubbleChartDataItem;
|
|
44
|
+
depth: number;
|
|
45
|
+
height: number;
|
|
46
|
+
leafUid: string;
|
|
47
|
+
parent: Node;
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
r: number;
|
|
51
|
+
value: number;
|
|
52
|
+
/** Dynamic data for internal logic */
|
|
53
|
+
_meta?: any;
|
|
54
|
+
}
|
|
3
55
|
/**
|
|
4
56
|
* Interface for BubbleChartComponent's "data"
|
|
5
57
|
*
|
|
@@ -78,23 +130,6 @@ export interface BubbleChartData {
|
|
|
78
130
|
*/
|
|
79
131
|
setDraw?: any;
|
|
80
132
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Interface for D3Chart's "data"
|
|
83
|
-
*
|
|
84
|
-
* @property entity (required)
|
|
85
|
-
* - id (required)
|
|
86
|
-
* - label (optional)
|
|
87
|
-
* - typeOfEntity (optional)
|
|
88
|
-
* @property count (required)
|
|
89
|
-
*/
|
|
90
|
-
export interface BubbleChartDataItem {
|
|
91
|
-
entity: {
|
|
92
|
-
id: string;
|
|
93
|
-
label?: string;
|
|
94
|
-
typeOfEntity?: string;
|
|
95
|
-
};
|
|
96
|
-
count: number;
|
|
97
|
-
}
|
|
98
133
|
export declare class BubbleChartComponent implements AfterContentChecked {
|
|
99
134
|
data: BubbleChartData;
|
|
100
135
|
emit: any;
|
|
@@ -102,6 +137,13 @@ export declare class BubbleChartComponent implements AfterContentChecked {
|
|
|
102
137
|
private _loaded;
|
|
103
138
|
ngAfterContentChecked(): void;
|
|
104
139
|
onClick(payload: any): void;
|
|
140
|
+
/**
|
|
141
|
+
* Reference for much of the new text scaling code comes from:
|
|
142
|
+
* https://observablehq.com/@mbostock/fit-text-to-circle
|
|
143
|
+
*/
|
|
144
|
+
measureWidth: (text: any) => number;
|
|
145
|
+
isValidNumber: (value: any) => boolean;
|
|
146
|
+
removeUnneededNodes(svg: any): void;
|
|
105
147
|
draw: () => void;
|
|
106
148
|
static ɵfac: i0.ɵɵFactoryDeclaration<BubbleChartComponent, never>;
|
|
107
149
|
static ɵcmp: i0.ɵɵComponentDeclaration<BubbleChartComponent, "n7-bubble-chart", never, { "data": "data"; "emit": "emit"; }, {}, never, never, false>;
|