ngx-deebodata 0.0.2 → 0.0.3
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/fesm2022/ngx-deebodata.mjs +6863 -0
- package/fesm2022/ngx-deebodata.mjs.map +1 -0
- package/package.json +35 -16
- package/types/ngx-deebodata.d.ts +439 -0
- package/ng-package.json +0 -7
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.css +0 -156
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.html +0 -29
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/bar-graph-component/bar-graph-component.ts +0 -286
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.css +0 -27
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.html +0 -53
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.spec.ts +0 -23
- package/src/lib/data-table/charts/charts-and-graphs/charts-and-graphs.ts +0 -214
- package/src/lib/data-table/charts/column-chart/column-chart.css +0 -19
- package/src/lib/data-table/charts/column-chart/column-chart.html +0 -47
- package/src/lib/data-table/charts/column-chart/column-chart.spec.ts +0 -23
- package/src/lib/data-table/charts/column-chart/column-chart.ts +0 -178
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.css +0 -33
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.html +0 -59
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/line-graph-component/line-graph-component.ts +0 -661
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.css +0 -61
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.html +0 -27
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.spec.ts +0 -23
- package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.ts +0 -210
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.css +0 -0
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.html +0 -15
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.spec.ts +0 -23
- package/src/lib/data-table/charts/pie-graph-component/pie-graph-component.ts +0 -197
- package/src/lib/data-table/data-table-module/data-cell/data-cell.css +0 -0
- package/src/lib/data-table/data-table-module/data-cell/data-cell.html +0 -6
- package/src/lib/data-table/data-table-module/data-cell/data-cell.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-cell/data-cell.ts +0 -271
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.css +0 -25
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.html +0 -55
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-table-header/data-table-header.ts +0 -261
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.css +0 -69
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.html +0 -24
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/data-table-paginator/data-table-paginator.ts +0 -125
- package/src/lib/data-table/data-table-module/export-component/export-component.css +0 -91
- package/src/lib/data-table/data-table-module/export-component/export-component.html +0 -16
- package/src/lib/data-table/data-table-module/export-component/export-component.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/export-component/export-component.ts +0 -206
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.css +0 -91
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.html +0 -193
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/ngx-deebodata/ngx-deebodata.ts +0 -2226
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.css +0 -14
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.html +0 -27
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/row-group-menu/row-group-menu.ts +0 -58
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.css +0 -23
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.html +0 -48
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.spec.ts +0 -23
- package/src/lib/data-table/data-table-module/row-group-panel/row-group-panel.ts +0 -599
- package/src/lib/data-table/data-table-module/worker.worker.ts +0 -44
- package/src/lib/interfaces/cell-edit.ts +0 -5
- package/src/lib/interfaces/column-header.ts +0 -10
- package/src/lib/interfaces/column-styles.ts +0 -14
- package/src/lib/interfaces/column-symbol.ts +0 -4
- package/src/lib/interfaces/data-cell.ts +0 -14
- package/src/lib/interfaces/data-row.ts +0 -11
- package/src/lib/interfaces/row-number.ts +0 -4
- package/src/lib/services/common-service.spec.ts +0 -16
- package/src/lib/services/common-service.ts +0 -336
- package/src/lib/services/data-table-service.spec.ts +0 -16
- package/src/lib/services/data-table-service.ts +0 -597
- package/src/lib/services/table-drag-service.spec.ts +0 -16
- package/src/lib/services/table-drag-service.ts +0 -347
- package/src/lib/styles.css +0 -1065
- package/src/public-api.ts +0 -8
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
:host{
|
|
2
|
-
--accent-color:rgb(50, 50, 50);
|
|
3
|
-
--grid-color:rgb(199, 199, 199);
|
|
4
|
-
--pad-left-base: 33px;
|
|
5
|
-
--row-num-width: 75px;
|
|
6
|
-
--reg-font-size: 17px
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.num-col-val-dist-cont{
|
|
10
|
-
height: 36px;
|
|
11
|
-
margin: 17px 0;
|
|
12
|
-
position: relative;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
padding: 0 !important;
|
|
15
|
-
border-bottom: 1px solid var(--grid-color);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.num-col-val-dist-bar{
|
|
19
|
-
top: 6px;
|
|
20
|
-
bottom: 0;
|
|
21
|
-
width: 12px;
|
|
22
|
-
opacity: 0.1;
|
|
23
|
-
height: 30px;
|
|
24
|
-
position: absolute;
|
|
25
|
-
padding: 0 !important;
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
background: var(--accent-color);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.num-col-avg-dist-bar{
|
|
31
|
-
top: 3px;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
width: 1px !important;
|
|
34
|
-
position: absolute;
|
|
35
|
-
padding: 0 !important;
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
background: #00a8f3;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.num-col-avg-dist-bar::before{
|
|
41
|
-
display: block;
|
|
42
|
-
content: "Avg.";
|
|
43
|
-
font-size: small;
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
margin: -15px 0 0 -9px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.num-col-val-dist-bar:hover{
|
|
49
|
-
opacity: 1;
|
|
50
|
-
z-index: 2;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.num-col-val-dist-bar:hover::before, .num-col-avg-dist-bar:hover::before{
|
|
54
|
-
display: block;
|
|
55
|
-
font-size: small;
|
|
56
|
-
margin: -15px 0 0 -5px;
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
background: white;
|
|
59
|
-
padding: 2px;
|
|
60
|
-
content: attr(data-number);
|
|
61
|
-
}
|
package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.html
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<div #numColDistContainer class="num-col-val-dist-cont">
|
|
2
|
-
@for(nm of nmrksVdn; track nm){
|
|
3
|
-
<div class="vd-n-marker" [attr.data-value]="nm.value" [style.left]="nm.left">
|
|
4
|
-
{{nm.value}}
|
|
5
|
-
</div>
|
|
6
|
-
}
|
|
7
|
-
@for(nm of nmrksVdnH(); track nm){
|
|
8
|
-
<div class="vd-n-marker-h" [attr.data-value]="nm.value" [attr.data-perc]="nm.percent" [style.left]="nm.left">
|
|
9
|
-
{{nm.value}}
|
|
10
|
-
</div>
|
|
11
|
-
}
|
|
12
|
-
@for(nb of nColValBars(); track nb){
|
|
13
|
-
<div class="num-col-val-dist-bar" [attr.data-number]="nb.number"
|
|
14
|
-
(mouseenter)="matchVdBarToStat('insField' + common.elifyCol(column), nb.stat)" (mouseleave)="killAllVdHighlights()"
|
|
15
|
-
[ngStyle]="{ 'left': nb.left, 'background': (nb.background || 'rgb(50, 50, 50)') }"></div>
|
|
16
|
-
}
|
|
17
|
-
@if(avgColValBar){
|
|
18
|
-
<div class="num-col-avg-dist-bar" [style.left]="avgColValBar.left" [attr.data-number]="avgColValBar.number"
|
|
19
|
-
(mouseenter)="matchVdBarToStat('insField' + common.elifyCol(column), avgColValBar.number)" (mouseleave)="killAllVdHighlights()">
|
|
20
|
-
</div>
|
|
21
|
-
}
|
|
22
|
-
</div>
|
|
23
|
-
@if(dataTableService.dataFilSrtTracker[column]['colCellSymbol']){
|
|
24
|
-
<div class="center heavy pad-top-ten">
|
|
25
|
-
{{"("+dataTableService.dataFilSrtTracker[column]['colCellSymbol']+")"}}
|
|
26
|
-
</div>
|
|
27
|
-
}
|
package/src/lib/data-table/charts/num-value-distro-component/num-value-distro-component.spec.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { NumValueDistroComponent } from './num-value-distro-component';
|
|
4
|
-
|
|
5
|
-
describe('NumValueDistroComponent', () => {
|
|
6
|
-
let component: NumValueDistroComponent;
|
|
7
|
-
let fixture: ComponentFixture<NumValueDistroComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [NumValueDistroComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(NumValueDistroComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, Input, NgZone, Output, signal, ViewChild } from '@angular/core';
|
|
2
|
-
import { CommonService } from '../../../services/common-service';
|
|
3
|
-
import { DataTableService } from '../../../services/data-table-service';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-num-value-distro-component',
|
|
8
|
-
imports: [CommonModule],
|
|
9
|
-
templateUrl: './num-value-distro-component.html',
|
|
10
|
-
styleUrls: ['./num-value-distro-component.css', '../../../styles.css']
|
|
11
|
-
})
|
|
12
|
-
export class NumValueDistroComponent {
|
|
13
|
-
|
|
14
|
-
nmrksVdn: any[] = []
|
|
15
|
-
nmrksVdnH = signal<any[]>([])
|
|
16
|
-
nColValBars = signal<any[]>([])
|
|
17
|
-
avgColValBar: any = null
|
|
18
|
-
naddedtks: any = []
|
|
19
|
-
@Input() title: string = ""
|
|
20
|
-
@Input() column: string = ""
|
|
21
|
-
@Input() average: number = 0
|
|
22
|
-
@Input() originalArr: number[] = []
|
|
23
|
-
@Output("done") doneLoading: EventEmitter<string> = new EventEmitter()
|
|
24
|
-
@ViewChild("numColDistContainer", { static: true }) numColDistContainerEl!: ElementRef<HTMLElement>;
|
|
25
|
-
|
|
26
|
-
constructor(public common: CommonService,
|
|
27
|
-
public dataTableService: DataTableService,
|
|
28
|
-
private _zone: NgZone,)
|
|
29
|
-
{}
|
|
30
|
-
|
|
31
|
-
ngOnInit() {
|
|
32
|
-
this.showNumColValDist(this.common.elifyCol(this.column), this.title, this.average)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
showNumColValDist(elIdCol: any, title: any, avg: any) {//will be only numbers
|
|
36
|
-
try{
|
|
37
|
-
const numArr = this.originalArr.sort( (a: number, b: number) => a - b );
|
|
38
|
-
const nlen = numArr.length;
|
|
39
|
-
const nmmin = numArr[0]
|
|
40
|
-
const nmmax = numArr[(nlen-1)]
|
|
41
|
-
const nmrange = nmmax - nmmin;
|
|
42
|
-
const nqtrdts = (nmrange/4) + nmmin
|
|
43
|
-
const nhalfdts = (nmrange/2) + nmmin
|
|
44
|
-
const nthrqtrdts = (nmrange*0.75) + nmmin
|
|
45
|
-
const nokTickVal = [nmmin, nqtrdts, nhalfdts, nthrqtrdts, nmmax]
|
|
46
|
-
const ntklen = nokTickVal.length
|
|
47
|
-
let nadded = []
|
|
48
|
-
let t = 0
|
|
49
|
-
const maxDigs = nmrange > 3 ? 0 : 2;
|
|
50
|
-
const whiteTxt = ["white", "#FFFFFF", "#ffffff", "rgb(255, 255, 255)", "rgb(255,255,255)"];
|
|
51
|
-
for(t; t < ntklen; t++){
|
|
52
|
-
const ntkval = nokTickVal[t]?.toLocaleString(undefined, {maximumFractionDigits: maxDigs});
|
|
53
|
-
if(!ntkval || this.naddedtks.indexOf(ntkval) > -1 || ntkval === "NaN")
|
|
54
|
-
continue
|
|
55
|
-
this.nmrksVdn.push({value: ntkval})
|
|
56
|
-
this.naddedtks.push(ntkval)
|
|
57
|
-
}
|
|
58
|
-
let h = 0
|
|
59
|
-
let nHmck: any[] = []
|
|
60
|
-
for(h; h < nlen; h++){//not seen but heard
|
|
61
|
-
const unum = numArr[h]
|
|
62
|
-
const usenval = unum?.toLocaleString(undefined, {maximumFractionDigits: maxDigs});
|
|
63
|
-
if(nadded.indexOf(usenval) > -1)
|
|
64
|
-
continue
|
|
65
|
-
let pct = ((unum-nmmin) / nmrange)
|
|
66
|
-
if(isNaN(pct))
|
|
67
|
-
pct = 0
|
|
68
|
-
nHmck.push({ value: usenval, percent: pct.toFixed(2) })
|
|
69
|
-
nadded.push(usenval)
|
|
70
|
-
}
|
|
71
|
-
/*avg marker*/
|
|
72
|
-
if(avg && typeof avg === "number"){
|
|
73
|
-
let pct = ((avg-nmmin) / nmrange)
|
|
74
|
-
if(isNaN(pct))
|
|
75
|
-
pct = 0
|
|
76
|
-
const usenval = avg.toLocaleString(undefined, {maximumFractionDigits: maxDigs});
|
|
77
|
-
nHmck.push({ value: usenval, percent: pct.toFixed(2) })
|
|
78
|
-
nadded.push(usenval)
|
|
79
|
-
}
|
|
80
|
-
/*avg marker*/
|
|
81
|
-
this.nmrksVdnH.set([...nHmck])
|
|
82
|
-
if(!this.naddedtks.length)
|
|
83
|
-
return;
|
|
84
|
-
setTimeout( () => {
|
|
85
|
-
try{
|
|
86
|
-
let r =0
|
|
87
|
-
let hd =0
|
|
88
|
-
const halfPlot = 6
|
|
89
|
-
const pbds = this.numColDistContainerEl.nativeElement.getBoundingClientRect()
|
|
90
|
-
const outParId = ("insField" + elIdCol)
|
|
91
|
-
const mrks = document.querySelectorAll("#" + outParId + " .vd-n-marker")
|
|
92
|
-
const mrlen = this.nmrksVdn.length
|
|
93
|
-
const hmrlen = this.nmrksVdnH().length
|
|
94
|
-
const lastdtdv = mrks[mrlen-1].getBoundingClientRect()
|
|
95
|
-
const space = (pbds.right - (lastdtdv.right)) - halfPlot
|
|
96
|
-
const divby = Math.max(1, (mrlen-1))
|
|
97
|
-
const mrrgt = (Math.ceil(space/divby))//divide space up by count-1 because last gets no marg right
|
|
98
|
-
for(r; r < mrlen; r++)
|
|
99
|
-
this.nmrksVdn[r].left = Math.floor((mrrgt*r)) + "px";
|
|
100
|
-
setTimeout( () => {
|
|
101
|
-
const xrange = Math.min((mrks[mrlen-1].getBoundingClientRect().right - pbds.left) - (Math.ceil(lastdtdv.width/2)+halfPlot+1))
|
|
102
|
-
for(hd; hd < hmrlen; hd++){
|
|
103
|
-
const hmrk = nHmck[hd]
|
|
104
|
-
const per = hmrk.percent
|
|
105
|
-
nHmck[hd].left = (Math.floor(parseFloat(per)*xrange)) + "px";
|
|
106
|
-
}
|
|
107
|
-
this.nmrksVdnH.set([...nHmck])
|
|
108
|
-
let mrkbds = mrks[0].getBoundingClientRect()
|
|
109
|
-
const findNLft = (val: any, avg: boolean) => {
|
|
110
|
-
let q = 0; let k = 0
|
|
111
|
-
for(q; q < mrlen; q++){
|
|
112
|
-
try{
|
|
113
|
-
const mrk = this.nmrksVdn[q]
|
|
114
|
-
const mrkEl = mrks[q]
|
|
115
|
-
mrkbds = mrkEl.getBoundingClientRect()
|
|
116
|
-
const dttxt = mrk.value
|
|
117
|
-
let toadd = 0
|
|
118
|
-
if(avg)
|
|
119
|
-
toadd -= halfPlot
|
|
120
|
-
if(val === dttxt)
|
|
121
|
-
return (parseInt(mrk.left.replace(/[ ]?(px|\%)/g, ""))) + (((mrkbds.width/2)-halfPlot)-toadd)
|
|
122
|
-
}catch(e){ }
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
for(k; k < hmrlen; k++){
|
|
126
|
-
try{
|
|
127
|
-
const hmrk = this.nmrksVdnH()[k]
|
|
128
|
-
const dttxt = hmrk.value
|
|
129
|
-
let toadd = 0;
|
|
130
|
-
if(avg)
|
|
131
|
-
toadd -= halfPlot
|
|
132
|
-
if(val === dttxt)
|
|
133
|
-
return (parseInt(hmrk.left.replace(/[ ]?(px|\%)/g, ""))) - toadd
|
|
134
|
-
}catch(e){ }
|
|
135
|
-
}
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
let i = 0;
|
|
140
|
-
let minL = 0
|
|
141
|
-
let nvBars: any[] = []
|
|
142
|
-
const maxLft = Math.floor((pbds.right - mrks[0].getBoundingClientRect().left) - Math.ceil((lastdtdv.width/2)+1))
|
|
143
|
-
for(i; i < nlen; i++){
|
|
144
|
-
const usennum = numArr[i]?.toLocaleString(undefined, {maximumFractionDigits: maxDigs})
|
|
145
|
-
const plft = findNLft(usennum, false)
|
|
146
|
-
if((plft && plft !== 0) && !isNaN(plft)){
|
|
147
|
-
const nBar: any = { number: "", left: "", background: "", stat: "" }
|
|
148
|
-
const dmn = Math.max(Math.ceil(plft), minL)
|
|
149
|
-
if(i === (nlen-1))
|
|
150
|
-
nBar.left = (dmn + "px");
|
|
151
|
-
else
|
|
152
|
-
nBar.left = Math.min(dmn, maxLft) + "px";
|
|
153
|
-
nBar.number = usennum
|
|
154
|
-
nvBars.push(nBar)
|
|
155
|
-
if(this.dataTableService.themeColor1 && whiteTxt.indexOf(this.dataTableService.themeColor1) < 0)
|
|
156
|
-
nBar.background = this.dataTableService.themeColor1
|
|
157
|
-
if(i === 0 || i === (nlen-1))
|
|
158
|
-
nBar.stat = ((i === 0) ? "min" : "max")
|
|
159
|
-
if(i === 0)//don't let anything lay before it
|
|
160
|
-
minL = Math.ceil(Math.min(dmn, maxLft) + 1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
this.nColValBars.set([...nvBars])
|
|
164
|
-
|
|
165
|
-
/*avg marker*/
|
|
166
|
-
if(avg && typeof avg === "number"){
|
|
167
|
-
const useavg = avg.toLocaleString(undefined, {maximumFractionDigits: maxDigs})
|
|
168
|
-
const aplft = findNLft(useavg, true)
|
|
169
|
-
if((aplft && aplft !== 0) && !isNaN(aplft))
|
|
170
|
-
this._zone.run( () => { this.avgColValBar = { number: useavg, left: (Math.floor(aplft) + "px") } } )
|
|
171
|
-
}
|
|
172
|
-
/*avg marker */
|
|
173
|
-
this.doneLoading.emit(title?.replace(/Building /g, "").replace(/distribution\.\.\./g, "distribution"))
|
|
174
|
-
}, 250)
|
|
175
|
-
}catch(e){ }
|
|
176
|
-
}, 250)
|
|
177
|
-
} catch(e){ }
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
matchVdBarToStat(parent: string, stat: string) {
|
|
181
|
-
try{
|
|
182
|
-
let elIdCol = ""
|
|
183
|
-
let selOrFil = ""
|
|
184
|
-
if(stat){
|
|
185
|
-
const useStat = /(min|max)/g.test(stat) ? stat : "avg";
|
|
186
|
-
if(parent && useStat){
|
|
187
|
-
const parts = parent.split("insField");
|
|
188
|
-
if(parts.length === 1)
|
|
189
|
-
elIdCol = parts[0]
|
|
190
|
-
if(parts.length === 2){
|
|
191
|
-
selOrFil = parts[0] || "";
|
|
192
|
-
elIdCol = parts[1]
|
|
193
|
-
}
|
|
194
|
-
const matchEl = document.querySelector("#" + useStat + selOrFil + this.common.elifyCol(this.column))?.lastElementChild
|
|
195
|
-
if(matchEl)
|
|
196
|
-
matchEl.classList.add("save-hilite")
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} catch(e){}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
killAllVdHighlights() {
|
|
203
|
-
try{
|
|
204
|
-
const els = document.querySelectorAll(".insight-field .save-hilite")
|
|
205
|
-
const len = els.length
|
|
206
|
-
for(var i = (len-1); i >= 0; i--)
|
|
207
|
-
els[i].classList.remove("save-hilite")
|
|
208
|
-
}catch(e){}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<div #pieParent class="center relly pad-top-thirty">
|
|
2
|
-
<canvas #pieCanvas></canvas>
|
|
3
|
-
@if(!shouldUncover()){<div #pieLayover class="pie-layover"></div>}
|
|
4
|
-
</div>
|
|
5
|
-
<div class="chart-label-cont">
|
|
6
|
-
@for(lbl of pieLbls; track lbl){
|
|
7
|
-
<div class="pie-piece-label">
|
|
8
|
-
<span [attr.data-percent]="lbl.percent">{{lbl.text}}</span>
|
|
9
|
-
<label class="pie-piece-label-sq" [style.background]="lbl.background"></label>
|
|
10
|
-
</div>
|
|
11
|
-
}
|
|
12
|
-
</div>
|
|
13
|
-
@for(rm of rmNotes; track rm; let i = $index){
|
|
14
|
-
<div [innerHTML]="rm" [ngClass]="{ 'pad-top-thirty': i === 0, 'pad-top-ten': i !== 0, 'small-text': true }"></div>
|
|
15
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { PieGraphComponent } from './pie-graph-component';
|
|
4
|
-
|
|
5
|
-
describe('PieGraphComponent', () => {
|
|
6
|
-
let component: PieGraphComponent;
|
|
7
|
-
let fixture: ComponentFixture<PieGraphComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [PieGraphComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(PieGraphComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { Component, Input, ViewChild, ElementRef, HostListener } from '@angular/core';
|
|
2
|
-
import { CommonService } from '../../../services/common-service';
|
|
3
|
-
import { DataTableService } from '../../../services/data-table-service';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-pie-graph-component',
|
|
8
|
-
imports: [CommonModule],
|
|
9
|
-
templateUrl: './pie-graph-component.html',
|
|
10
|
-
styleUrls: ['./pie-graph-component.css', '../../../styles.css']
|
|
11
|
-
})
|
|
12
|
-
export class PieGraphComponent {
|
|
13
|
-
|
|
14
|
-
@HostListener('window:resize', ['$event'])
|
|
15
|
-
onWindowResize(e: Event) {
|
|
16
|
-
if(!this.shouldUncover())
|
|
17
|
-
this.cleanUpPieLayovers()
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
rmNotes: any[] = []
|
|
21
|
-
pieLbls: any[] = []
|
|
22
|
-
@Input() data: any = null
|
|
23
|
-
@Input() column: string = ""
|
|
24
|
-
@Input() uncoverPie: boolean|string[] = false
|
|
25
|
-
@ViewChild("pieParent", { static: true }) pieParent!: ElementRef<HTMLElement>;
|
|
26
|
-
@ViewChild("pieCanvas", { static: true }) pieCanvas!: ElementRef<HTMLElement>;
|
|
27
|
-
@ViewChild("pieLayover") pieLayover!: ElementRef<HTMLElement>;
|
|
28
|
-
|
|
29
|
-
constructor(public common: CommonService,
|
|
30
|
-
public dataTableService: DataTableService,)
|
|
31
|
-
{}
|
|
32
|
-
|
|
33
|
-
ngAfterViewInit() {
|
|
34
|
-
setTimeout( () => { this.buildPieGraphFromColVals(this.data.counts, this.data.type) })
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
ngAfterContentInit() {
|
|
38
|
-
if(!this.shouldUncover())
|
|
39
|
-
setTimeout( () => { this.cleanUpPieLayovers() }, 50)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
shouldUncover(): boolean {
|
|
43
|
-
try{
|
|
44
|
-
if(this.uncoverPie === true)
|
|
45
|
-
return true
|
|
46
|
-
if(typeof this.uncoverPie === "object" && this.uncoverPie.indexOf(this.column) > -1)
|
|
47
|
-
return true;
|
|
48
|
-
return false;
|
|
49
|
-
}catch(e){
|
|
50
|
-
return false
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//pie graph
|
|
55
|
-
cleanUpPieLayovers() {
|
|
56
|
-
try{
|
|
57
|
-
const can: HTMLCanvasElement = <HTMLCanvasElement>this.pieCanvas.nativeElement
|
|
58
|
-
const par = this.pieParent.nativeElement
|
|
59
|
-
const lay = this.pieLayover?.nativeElement
|
|
60
|
-
const cwid = can.width
|
|
61
|
-
const pbds = par.getBoundingClientRect()
|
|
62
|
-
const cbds = can.getBoundingClientRect()
|
|
63
|
-
const lbds = lay.getBoundingClientRect()
|
|
64
|
-
const cleft = (cbds.left - pbds.left)
|
|
65
|
-
const diff = cwid-lbds.width
|
|
66
|
-
lay.style.left = (cleft + (diff/2)) + "px"
|
|
67
|
-
}catch(e){}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
buildPieGraphFromColVals(counts: any, type: any) {
|
|
71
|
-
let data = []
|
|
72
|
-
let odiv: HTMLDivElement|null = null;
|
|
73
|
-
const div: HTMLDivElement = <HTMLDivElement>this.pieParent.nativeElement
|
|
74
|
-
if(!this.shouldUncover())
|
|
75
|
-
odiv = <HTMLDivElement>this.pieLayover.nativeElement
|
|
76
|
-
const canvas: HTMLCanvasElement = <HTMLCanvasElement>this.pieCanvas.nativeElement;
|
|
77
|
-
const ctx = canvas.getContext("2d");
|
|
78
|
-
const whiteTxt = ["white", "#FFFFFF", "#ffffff", "rgb(255, 255, 255)", "rgb(255,255,255)"];
|
|
79
|
-
if(ctx){
|
|
80
|
-
const dbds = div.getBoundingClientRect()
|
|
81
|
-
const cwid = dbds.width
|
|
82
|
-
const canWid = Math.floor(cwid/3)
|
|
83
|
-
canvas.width = canWid;
|
|
84
|
-
canvas.height = canWid;
|
|
85
|
-
const cBds = canvas.getBoundingClientRect()
|
|
86
|
-
const oWid = Math.floor(cwid/3.8)
|
|
87
|
-
if(odiv){
|
|
88
|
-
odiv.style.width = oWid + "px"
|
|
89
|
-
odiv.style.height = oWid + "px"
|
|
90
|
-
const diff = cBds.width-oWid
|
|
91
|
-
odiv.style.top = Math.floor((cBds.top-dbds.top) + (diff/2)) + "px";
|
|
92
|
-
odiv.style.left = Math.floor((cBds.left-dbds.left) + (diff/2)) + "px";
|
|
93
|
-
}
|
|
94
|
-
const props = Object.keys(counts)
|
|
95
|
-
let colors = ["forestgreen", "crimson", "orange", "blue", "turquoise", "brown", "hotpink", "goldenrod", "purple", "olive", "steelblue", "black",
|
|
96
|
-
"violet", "teal", "gray", "navy", "tan", "indigo"]
|
|
97
|
-
if(this.dataTableService.pieGraphColors.length)
|
|
98
|
-
colors = [...this.dataTableService.pieGraphColors]
|
|
99
|
-
const na = "n_a"
|
|
100
|
-
const oth = "Other"
|
|
101
|
-
const dTotal = counts[this.dataTableService.deboTotal]
|
|
102
|
-
if(props.length >= 5){
|
|
103
|
-
const totalSansEmp = counts[na] ? (dTotal - counts[na]) : dTotal
|
|
104
|
-
for(const prop in counts){//first alter small percents to other
|
|
105
|
-
if(prop === this.dataTableService.deboTotal || prop === oth)
|
|
106
|
-
continue
|
|
107
|
-
const percent = Math.ceil((counts[prop]/totalSansEmp)*100)
|
|
108
|
-
if(percent < 5){
|
|
109
|
-
if(!counts[oth] || typeof counts[oth] === "undefined")
|
|
110
|
-
counts[oth] = counts[prop]
|
|
111
|
-
else
|
|
112
|
-
counts[oth] += counts[prop]
|
|
113
|
-
delete counts[prop]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if(counts[oth])
|
|
119
|
-
props.push(oth)
|
|
120
|
-
|
|
121
|
-
const isBool = type === "boolean" ? true : false;
|
|
122
|
-
if(isBool || props.filter( (p) => p != this.dataTableService.deboTotal ).length < 3)
|
|
123
|
-
colors = [(this.dataTableService.themeColor1 && whiteTxt.indexOf(this.dataTableService.themeColor1) < 0) ? this.dataTableService.themeColor1 : "#00a8f3",
|
|
124
|
-
(this.dataTableService.themeColor2 || "black")]
|
|
125
|
-
const numNa = counts[na]
|
|
126
|
-
const rmNaPer = 65
|
|
127
|
-
const perNa = numNa ? ((numNa/dTotal)*100) : 0
|
|
128
|
-
const useTotal = (!isBool && numNa && (perNa > rmNaPer)) ? (dTotal-numNa) : dTotal
|
|
129
|
-
for(const prop in counts){
|
|
130
|
-
if(prop === this.dataTableService.deboTotal)
|
|
131
|
-
continue
|
|
132
|
-
const percent = (counts[prop]/useTotal)*100
|
|
133
|
-
const strPct = percent.toLocaleString(undefined, {maximumFractionDigits: 1})
|
|
134
|
-
if(strPct === "0")
|
|
135
|
-
continue
|
|
136
|
-
if(!isBool && (prop === na && perNa > rmNaPer)){
|
|
137
|
-
const rmNt = "Note: <b>N/A</b> values make up " + Math.floor(perNa).toLocaleString(undefined, {maximumFractionDigits: 0}) + "% of all values, " +
|
|
138
|
-
"so we removed it from the chart to help visualize the make up of values in this column from the " +
|
|
139
|
-
Math.ceil(100-perNa).toLocaleString(undefined, {maximumFractionDigits: 0}) + "% that has values."
|
|
140
|
-
this.rmNotes.push(rmNt)
|
|
141
|
-
continue
|
|
142
|
-
}
|
|
143
|
-
const color = colors[props.indexOf(prop)]
|
|
144
|
-
data.push({ label: prop, value: counts[prop], color: color })
|
|
145
|
-
this.pieLbls.push({ text: this.common.sanitizeUi(prop).replace(/n_a/, "N/A"), background: color, percent: (strPct+"%") })
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
let n = 0
|
|
149
|
-
let total = 0;
|
|
150
|
-
const dlen = data.length
|
|
151
|
-
for (n; n < dlen; n++) {
|
|
152
|
-
total += data[n].value;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const maxArr = data.sort( function(a, b) { return a.value < b.value ? -1 : 1 })
|
|
156
|
-
const max = maxArr[(maxArr.length-1)]
|
|
157
|
-
if(odiv && max && (max.value !== maxArr[0].value || maxArr.length === 1)){
|
|
158
|
-
odiv.style.color = max.color;
|
|
159
|
-
odiv.innerHTML = ("<div><div>" + this.common.sanitizeUi(max.label) + '</div><div class="pad-top-sm">'+((max.value/total)*100).toFixed(1)+ '%</div></div>')
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if(dlen > 1){
|
|
163
|
-
try{
|
|
164
|
-
let m = 0
|
|
165
|
-
let diffCts = []
|
|
166
|
-
for(m; m < dlen; m++){
|
|
167
|
-
const dct = data[m].value
|
|
168
|
-
if(diffCts.indexOf(dct) < 0)
|
|
169
|
-
diffCts.push(dct)
|
|
170
|
-
}
|
|
171
|
-
if(diffCts.length === 1){
|
|
172
|
-
let cltxt = this.column
|
|
173
|
-
if(!cltxt.endsWith("s"))
|
|
174
|
-
cltxt += "s";
|
|
175
|
-
if(odiv)
|
|
176
|
-
odiv.innerHTML = ('<div><div><b class="ins-even-dist-ct">' + dlen + '</b> </div><div class="pad-top-sm">' +cltxt+ '</div></div>')
|
|
177
|
-
}
|
|
178
|
-
}catch(e){}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let i = 0
|
|
182
|
-
let startAngle = 0;
|
|
183
|
-
for (i; i < dlen; i++) {
|
|
184
|
-
const sliceAngle = 2 * Math.PI * data[i].value / total;
|
|
185
|
-
|
|
186
|
-
ctx.beginPath();
|
|
187
|
-
ctx.arc(canvas.width/2, canvas.height/2, Math.min(canvas.width, canvas.height)/2, startAngle, startAngle + sliceAngle);
|
|
188
|
-
ctx.lineTo(canvas.width/2, canvas.height/2);
|
|
189
|
-
ctx.fillStyle = data[i].color;
|
|
190
|
-
ctx.fill();
|
|
191
|
-
ctx.closePath();
|
|
192
|
-
|
|
193
|
-
startAngle += sliceAngle;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
File without changes
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<div #cellEl [attr.contenteditable]="canEdit" [ngStyle]="cellStyle" class="data-cell data-cell-{{elCol}}{{rightAlign}}{{symbolCls}}{{columnValClass}}"
|
|
2
|
-
[ngClass]="{ 'col-item-freeze': cell.freeze, 'col-header-minimized': cell.minimized, 'holding-check': cell.column === dataTableService.firstCol }" tabindex="0"
|
|
3
|
-
(mousemove)="tblDragService.checkItemBorderCursor($event, noColResize)" (mousemove)="tblDragService.handleCellSizeAdjust($event, elCol)"
|
|
4
|
-
(mousedown)="tblDragService.handleCellSizeAdjust($event, elCol)" (focus)="setCellToEdit()" (blur)="emitEdit($event)"
|
|
5
|
-
[attr.data-index]="rowId" (dblclick)="handleColResDblClick(cell.column)"
|
|
6
|
-
></div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { DataCell } from './data-cell';
|
|
4
|
-
|
|
5
|
-
describe('DataCell', () => {
|
|
6
|
-
let component: DataCell;
|
|
7
|
-
let fixture: ComponentFixture<DataCell>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [DataCell]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(DataCell);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|