@hpcc-js/common 3.5.3 → 3.6.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/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/src/SVGWidget.ts +20 -2
- package/src/TitleBar.css +33 -17
- package/src/TitleBar.ts +6 -0
- package/types/SVGWidget.d.ts +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/common",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "hpcc-js - Viz Common",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
89
89
|
},
|
|
90
90
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "e26c95239fec90e34e31c16a17bc1522e1086f40"
|
|
92
92
|
}
|
package/src/SVGWidget.ts
CHANGED
|
@@ -92,6 +92,7 @@ const intersectCircleLine = function (c: Point, r: number, a1: Point, a2: Point)
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
export class SVGGlowFilter {
|
|
95
|
+
protected id;
|
|
95
96
|
protected filter;
|
|
96
97
|
protected feOffset;
|
|
97
98
|
protected feColorMatrix;
|
|
@@ -99,6 +100,7 @@ export class SVGGlowFilter {
|
|
|
99
100
|
protected feBlend;
|
|
100
101
|
|
|
101
102
|
constructor(target, id: string) {
|
|
103
|
+
this.id = id;
|
|
102
104
|
this.filter = target.append("filter")
|
|
103
105
|
.attr("id", id)
|
|
104
106
|
.attr("width", "130%")
|
|
@@ -136,8 +138,14 @@ export class SVGGlowFilter {
|
|
|
136
138
|
].join(" ");
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
enable(enable: boolean) {
|
|
142
|
+
this.filter.attr("id", enable ? this.id : `disabled_${this.id}`);
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
|
|
139
146
|
update(color: string) {
|
|
140
147
|
this.feColorMatrix.attr("values", this.rgb2ColorMatrix(color));
|
|
148
|
+
return this;
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
|
|
@@ -147,7 +155,7 @@ export class SVGWidget extends Widget {
|
|
|
147
155
|
protected _boundingBox;
|
|
148
156
|
protected transition;
|
|
149
157
|
protected _drawStartPos: "center" | "origin";
|
|
150
|
-
protected _svgSelectionFilter;
|
|
158
|
+
protected _svgSelectionFilter: SVGGlowFilter;
|
|
151
159
|
protected _parentRelativeDiv;
|
|
152
160
|
protected _parentOverlay;
|
|
153
161
|
|
|
@@ -278,6 +286,10 @@ export class SVGWidget extends Widget {
|
|
|
278
286
|
return retVal;
|
|
279
287
|
}
|
|
280
288
|
|
|
289
|
+
get parentRelativeDiv() {
|
|
290
|
+
return this._parentRelativeDiv;
|
|
291
|
+
}
|
|
292
|
+
|
|
281
293
|
parentOverlay() {
|
|
282
294
|
return this._parentOverlay;
|
|
283
295
|
}
|
|
@@ -289,7 +301,10 @@ export class SVGWidget extends Widget {
|
|
|
289
301
|
update(domNode, element) {
|
|
290
302
|
super.update(domNode, element);
|
|
291
303
|
if (this._svgSelectionFilter) {
|
|
292
|
-
this._svgSelectionFilter
|
|
304
|
+
this._svgSelectionFilter
|
|
305
|
+
.enable(this.selectionGlow())
|
|
306
|
+
.update(this.selectionGlowColor())
|
|
307
|
+
;
|
|
293
308
|
}
|
|
294
309
|
}
|
|
295
310
|
|
|
@@ -558,8 +573,11 @@ export class SVGWidget extends Widget {
|
|
|
558
573
|
SVGWidget.prototype._class += " common_SVGWidget";
|
|
559
574
|
|
|
560
575
|
export interface SVGWidget {
|
|
576
|
+
selectionGlow(): boolean;
|
|
577
|
+
selectionGlow(_: boolean): this;
|
|
561
578
|
selectionGlowColor(): string;
|
|
562
579
|
selectionGlowColor(_: string): this;
|
|
563
580
|
}
|
|
564
581
|
|
|
582
|
+
SVGWidget.prototype.publish("selectionGlow", true, "boolean", "Selection Glow");
|
|
565
583
|
SVGWidget.prototype.publish("selectionGlowColor", "red", "html-color", "Selection Glow Color");
|
package/src/TitleBar.css
CHANGED
|
@@ -11,27 +11,39 @@
|
|
|
11
11
|
margin: 0px;
|
|
12
12
|
white-space: nowrap;
|
|
13
13
|
line-height: 28px;
|
|
14
|
-
z-index:1;
|
|
14
|
+
z-index: 1;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.common_IconBar .icon-bar a {
|
|
18
|
-
|
|
18
|
+
position: relative;
|
|
19
|
+
z-index: 0;
|
|
20
|
+
/* Center-align text */
|
|
21
|
+
text-align: center;
|
|
19
22
|
padding-top: 4px;
|
|
20
23
|
padding-left: 2px;
|
|
21
24
|
padding-right: 2px;
|
|
22
25
|
padding-bottom: 4px;
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
/* Add transition for hover effects */
|
|
27
|
+
transition: all 0.3s ease;
|
|
28
|
+
/* White text color */
|
|
29
|
+
color: darkgray;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.common_IconBar .icon-bar a:focus,
|
|
33
|
+
.common_IconBar .icon-bar a:focus-visible {
|
|
34
|
+
outline: 2px solid #0078d4;
|
|
35
|
+
outline-offset: 2px;
|
|
36
|
+
z-index: 2;
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
.common_IconBar .icon-bar a.disabled {
|
|
28
40
|
opacity: 0.3;
|
|
29
41
|
pointer-events: none;
|
|
30
|
-
color: darkgray;
|
|
42
|
+
color: darkgray;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
.common_IconBar .icon-bar a:hover {
|
|
34
|
-
background-color: whitesmoke;
|
|
46
|
+
background-color: whitesmoke;
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
.common_IconBar .icon-bar a {
|
|
@@ -39,36 +51,38 @@
|
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
.common_IconBar .icon-bar a.selected {
|
|
42
|
-
|
|
54
|
+
/* Add a hover color */
|
|
55
|
+
background-color: #efe5e5;
|
|
43
56
|
}
|
|
44
57
|
|
|
58
|
+
|
|
45
59
|
.common_IconBar .icon-bar div.spacer {
|
|
46
|
-
text-align: center;
|
|
47
|
-
height:28px;
|
|
60
|
+
text-align: center;
|
|
61
|
+
height: 28px;
|
|
48
62
|
border-left-style: solid;
|
|
49
63
|
border-left-width: 1px;
|
|
50
64
|
border-left-color: transparent;
|
|
51
65
|
padding-top: 0px;
|
|
52
|
-
padding-left: 2px;
|
|
53
|
-
margin-left: 2px;
|
|
66
|
+
padding-left: 2px;
|
|
67
|
+
margin-left: 2px;
|
|
54
68
|
padding-bottom: 0px;
|
|
55
69
|
}
|
|
56
70
|
|
|
57
71
|
.common_IconBar .icon-bar div.spacer.vline {
|
|
58
72
|
border-left-color: darkgray;
|
|
59
|
-
padding-left: 4px;
|
|
60
|
-
margin-left: 4px;
|
|
73
|
+
padding-left: 4px;
|
|
74
|
+
margin-left: 4px;
|
|
61
75
|
}
|
|
62
76
|
|
|
63
77
|
.common_IconBar .icon-bar a.spacer:hover {
|
|
64
78
|
background-color: transparent;
|
|
65
79
|
}
|
|
66
80
|
|
|
67
|
-
.common_TitleBar
|
|
81
|
+
.common_TitleBar>.title-title {
|
|
68
82
|
margin: 4px;
|
|
69
83
|
}
|
|
70
84
|
|
|
71
|
-
.common_TitleBar
|
|
85
|
+
.common_TitleBar>.icon-bar {
|
|
72
86
|
margin: 4px;
|
|
73
87
|
}
|
|
74
88
|
|
|
@@ -77,7 +91,8 @@
|
|
|
77
91
|
position: static;
|
|
78
92
|
|
|
79
93
|
}
|
|
80
|
-
|
|
94
|
+
|
|
95
|
+
.common_TitleBar .data-count {
|
|
81
96
|
position: absolute;
|
|
82
97
|
visibility: hidden;
|
|
83
98
|
}
|
|
@@ -90,10 +105,11 @@
|
|
|
90
105
|
font-size: 20px;
|
|
91
106
|
font-weight: bold;
|
|
92
107
|
}
|
|
108
|
+
|
|
93
109
|
.common_TitleBar .description-text {
|
|
94
110
|
padding: 0px;
|
|
95
111
|
text-overflow: ellipsis;
|
|
96
112
|
white-space: nowrap;
|
|
97
113
|
overflow: hidden;
|
|
98
114
|
font-weight: normal;
|
|
99
|
-
}
|
|
115
|
+
}
|
package/src/TitleBar.ts
CHANGED
|
@@ -24,6 +24,12 @@ export class Button extends HTMLWidget {
|
|
|
24
24
|
context.click();
|
|
25
25
|
d3Event.preventDefault();
|
|
26
26
|
})
|
|
27
|
+
.on("keydown", function (this: HTMLElement) {
|
|
28
|
+
if (d3Event.key === " " || d3Event.key === "Spacebar" || d3Event.code === "Space" || d3Event.key === "Enter") {
|
|
29
|
+
this.click();
|
|
30
|
+
d3Event.preventDefault();
|
|
31
|
+
}
|
|
32
|
+
})
|
|
27
33
|
.on("mousemove", this.mouseMove)
|
|
28
34
|
.on("mouseout", this.mouseOut)
|
|
29
35
|
.append("i")
|
package/types/SVGWidget.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ type Rect = {
|
|
|
10
10
|
height: number;
|
|
11
11
|
};
|
|
12
12
|
export declare class SVGGlowFilter {
|
|
13
|
+
protected id: any;
|
|
13
14
|
protected filter: any;
|
|
14
15
|
protected feOffset: any;
|
|
15
16
|
protected feColorMatrix: any;
|
|
@@ -17,14 +18,15 @@ export declare class SVGGlowFilter {
|
|
|
17
18
|
protected feBlend: any;
|
|
18
19
|
constructor(target: any, id: string);
|
|
19
20
|
rgb2ColorMatrix(color: string): string;
|
|
20
|
-
|
|
21
|
+
enable(enable: boolean): this;
|
|
22
|
+
update(color: string): this;
|
|
21
23
|
}
|
|
22
24
|
export declare class SVGWidget extends Widget {
|
|
23
25
|
static _class: string;
|
|
24
26
|
protected _boundingBox: any;
|
|
25
27
|
protected transition: any;
|
|
26
28
|
protected _drawStartPos: "center" | "origin";
|
|
27
|
-
protected _svgSelectionFilter:
|
|
29
|
+
protected _svgSelectionFilter: SVGGlowFilter;
|
|
28
30
|
protected _parentRelativeDiv: any;
|
|
29
31
|
protected _parentOverlay: any;
|
|
30
32
|
constructor();
|
|
@@ -44,6 +46,7 @@ export declare class SVGWidget extends Widget {
|
|
|
44
46
|
svgGlowID(): string;
|
|
45
47
|
target(): null | HTMLElement | SVGElement;
|
|
46
48
|
target(_: null | string | HTMLElement | SVGElement): this;
|
|
49
|
+
get parentRelativeDiv(): any;
|
|
47
50
|
parentOverlay(): any;
|
|
48
51
|
enter(domNode: any, element: any): void;
|
|
49
52
|
update(domNode: any, element: any): void;
|
|
@@ -70,6 +73,8 @@ export declare class SVGWidget extends Widget {
|
|
|
70
73
|
_fixIEMarkers(element?: any): void;
|
|
71
74
|
}
|
|
72
75
|
export interface SVGWidget {
|
|
76
|
+
selectionGlow(): boolean;
|
|
77
|
+
selectionGlow(_: boolean): this;
|
|
73
78
|
selectionGlowColor(): string;
|
|
74
79
|
selectionGlowColor(_: string): this;
|
|
75
80
|
}
|