@hpcc-js/html 3.3.6 → 3.3.9
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/LICENSE +43 -43
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +6 -6
- package/src/BreakdownTable.ts +218 -218
- package/src/HTMLTooltip.ts +384 -384
- package/src/JSXWidget.ts +13 -13
- package/src/SimpleTable.ts +63 -63
- package/src/StatsTable.ts +103 -103
- package/src/StyledTable.ts +68 -68
- package/src/TitleBar.css +84 -84
- package/src/TitleBar.ts +136 -136
- package/src/VizComponent.tsx +39 -39
- package/src/VizInstance.tsx +39 -39
- package/src/__package__.ts +3 -3
- package/src/index.ts +11 -11
- package/src/reactD3.ts +127 -127
package/src/TitleBar.css
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
#wrap
|
|
2
|
-
{
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
#left, #right {padding:5px;}
|
|
6
|
-
|
|
7
|
-
#left {
|
|
8
|
-
background-color:red;
|
|
9
|
-
text-align:left;
|
|
10
|
-
display: block;
|
|
11
|
-
text-overflow: ellipsis;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
#right {
|
|
17
|
-
background-color:orange;
|
|
18
|
-
float:right;
|
|
19
|
-
text-align:right;
|
|
20
|
-
white-space: nowrap;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.html_TitleBar > .main {
|
|
24
|
-
width: 100%;
|
|
25
|
-
display: block;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.html_TitleBar .title {
|
|
29
|
-
padding:4px;
|
|
30
|
-
text-align:left;
|
|
31
|
-
display: block;
|
|
32
|
-
text-overflow: ellipsis;
|
|
33
|
-
white-space: nowrap;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
font-size:20px;
|
|
36
|
-
font-weight: bold;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.html_TitleBar .icon-bar {
|
|
40
|
-
padding:4px;
|
|
41
|
-
float: right;
|
|
42
|
-
text-align:right;
|
|
43
|
-
white-space: nowrap;
|
|
44
|
-
line-height: 28px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.html_TitleBar .icon-bar-item {
|
|
48
|
-
display: inline;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.html_TitleBar .icon-bar-item > div {
|
|
52
|
-
display: inline;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.html_TitleBar .icon-bar a {
|
|
56
|
-
text-align: center; /* Center-align text */
|
|
57
|
-
padding-top: 4px;
|
|
58
|
-
padding-bottom: 4px;
|
|
59
|
-
transition: all 0.3s ease; /* Add transition for hover effects */
|
|
60
|
-
color: darkgray; /* White text color */
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.html_TitleBar .icon-bar a:hover {
|
|
64
|
-
background-color: whitesmoke; /* Add a hover color */
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.html_TitleBar .icon-bar a.selected {
|
|
68
|
-
background-color: #efe5e5; /* Add a hover color */
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.html_TitleBar .icon-bar a.spacer {
|
|
72
|
-
text-align: center; /* Center-align text */
|
|
73
|
-
padding-top: 2px;
|
|
74
|
-
padding-left: 8px;
|
|
75
|
-
padding-bottom: 0px;
|
|
76
|
-
color: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.html_TitleBar .icon-bar a.spacer:hover {
|
|
80
|
-
background-color: transparent;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.html_TitleBar .icon-bar .active {
|
|
84
|
-
background-color: #4CAF50; /* Add an active/current color */
|
|
1
|
+
#wrap
|
|
2
|
+
{
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
#left, #right {padding:5px;}
|
|
6
|
+
|
|
7
|
+
#left {
|
|
8
|
+
background-color:red;
|
|
9
|
+
text-align:left;
|
|
10
|
+
display: block;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#right {
|
|
17
|
+
background-color:orange;
|
|
18
|
+
float:right;
|
|
19
|
+
text-align:right;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.html_TitleBar > .main {
|
|
24
|
+
width: 100%;
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.html_TitleBar .title {
|
|
29
|
+
padding:4px;
|
|
30
|
+
text-align:left;
|
|
31
|
+
display: block;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
font-size:20px;
|
|
36
|
+
font-weight: bold;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.html_TitleBar .icon-bar {
|
|
40
|
+
padding:4px;
|
|
41
|
+
float: right;
|
|
42
|
+
text-align:right;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
line-height: 28px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.html_TitleBar .icon-bar-item {
|
|
48
|
+
display: inline;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.html_TitleBar .icon-bar-item > div {
|
|
52
|
+
display: inline;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.html_TitleBar .icon-bar a {
|
|
56
|
+
text-align: center; /* Center-align text */
|
|
57
|
+
padding-top: 4px;
|
|
58
|
+
padding-bottom: 4px;
|
|
59
|
+
transition: all 0.3s ease; /* Add transition for hover effects */
|
|
60
|
+
color: darkgray; /* White text color */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.html_TitleBar .icon-bar a:hover {
|
|
64
|
+
background-color: whitesmoke; /* Add a hover color */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.html_TitleBar .icon-bar a.selected {
|
|
68
|
+
background-color: #efe5e5; /* Add a hover color */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.html_TitleBar .icon-bar a.spacer {
|
|
72
|
+
text-align: center; /* Center-align text */
|
|
73
|
+
padding-top: 2px;
|
|
74
|
+
padding-left: 8px;
|
|
75
|
+
padding-bottom: 0px;
|
|
76
|
+
color: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.html_TitleBar .icon-bar a.spacer:hover {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.html_TitleBar .icon-bar .active {
|
|
84
|
+
background-color: #4CAF50; /* Add an active/current color */
|
|
85
85
|
}
|
package/src/TitleBar.ts
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
import { HTMLWidget } from "@hpcc-js/common";
|
|
2
|
-
import { JSXWidget } from "./JSXWidget.ts";
|
|
3
|
-
|
|
4
|
-
import "../src/TitleBar.css";
|
|
5
|
-
|
|
6
|
-
export interface IClickHandler {
|
|
7
|
-
titleBarClick(src: Item, d, idx: number, groups): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class Item extends HTMLWidget {
|
|
11
|
-
protected _owner: IClickHandler;
|
|
12
|
-
|
|
13
|
-
constructor(owner: IClickHandler) {
|
|
14
|
-
super();
|
|
15
|
-
this._owner = owner;
|
|
16
|
-
this._tag = "a";
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
Item.prototype._class += " html_Item";
|
|
20
|
-
|
|
21
|
-
export class Button extends Item {
|
|
22
|
-
private _icon: string;
|
|
23
|
-
|
|
24
|
-
constructor(owner: IClickHandler, icon: string) {
|
|
25
|
-
super(owner);
|
|
26
|
-
this._icon = icon;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
icon() {
|
|
30
|
-
return this._icon;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
enter(domNode: HTMLElement, element) {
|
|
34
|
-
super.enter(domNode, element);
|
|
35
|
-
element
|
|
36
|
-
.attr("href", "#")
|
|
37
|
-
.on("click", (d, idx, groups) => this._owner.titleBarClick(this, d, idx, groups))
|
|
38
|
-
.append("i")
|
|
39
|
-
.attr("class", `fa ${this._icon} fa-lg fa-fw`)
|
|
40
|
-
;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
Button.prototype._class += " html_Button";
|
|
44
|
-
|
|
45
|
-
export class ToggleButton extends Button {
|
|
46
|
-
|
|
47
|
-
enter(domNode: HTMLElement, element) {
|
|
48
|
-
element.on("click.sel", (d, idx, groups) => {
|
|
49
|
-
this.selected(!this.selected());
|
|
50
|
-
this.render();
|
|
51
|
-
});
|
|
52
|
-
super.enter(domNode, element);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
update(domNode, element) {
|
|
56
|
-
super.update(domNode, element);
|
|
57
|
-
this._element.classed("selected", this.selected());
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
ToggleButton.prototype._class += " html_ToggleButton";
|
|
61
|
-
export interface ToggleButton {
|
|
62
|
-
selected(): boolean;
|
|
63
|
-
selected(_: boolean): this;
|
|
64
|
-
}
|
|
65
|
-
ToggleButton.prototype.publish("selected", false, "boolean");
|
|
66
|
-
|
|
67
|
-
export class Spacer extends Item {
|
|
68
|
-
|
|
69
|
-
enter(domNode, element) {
|
|
70
|
-
super.enter(domNode, element);
|
|
71
|
-
element
|
|
72
|
-
.attr("class", "spacer")
|
|
73
|
-
.attr("href", "#")
|
|
74
|
-
.append("i")
|
|
75
|
-
;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
Spacer.prototype._class += " html_Spacer";
|
|
79
|
-
|
|
80
|
-
export class TitleBar extends JSXWidget {
|
|
81
|
-
protected _divMain;
|
|
82
|
-
protected _divIconBar;
|
|
83
|
-
protected _divTitle;
|
|
84
|
-
|
|
85
|
-
constructor() {
|
|
86
|
-
super();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
enter(domNode, element) {
|
|
90
|
-
super.enter(domNode, element);
|
|
91
|
-
this._divMain = element.append("div")
|
|
92
|
-
.attr("class", "main")
|
|
93
|
-
;
|
|
94
|
-
this._divIconBar = this._divMain.append("div")
|
|
95
|
-
.attr("class", "icon-bar")
|
|
96
|
-
;
|
|
97
|
-
this._divTitle = this._divMain.append("div")
|
|
98
|
-
.attr("class", "title")
|
|
99
|
-
;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
update(domNode, element) {
|
|
103
|
-
super.update(domNode, element);
|
|
104
|
-
|
|
105
|
-
this._divTitle.text(this.title());
|
|
106
|
-
|
|
107
|
-
const icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
|
|
108
|
-
icons.enter().append("div")
|
|
109
|
-
.attr("class", "icon-bar-item")
|
|
110
|
-
.each(function (this: HTMLElement, d: Item) {
|
|
111
|
-
d.target(this);
|
|
112
|
-
})
|
|
113
|
-
.merge(icons)
|
|
114
|
-
.each(function (d: Item) {
|
|
115
|
-
d.render();
|
|
116
|
-
})
|
|
117
|
-
;
|
|
118
|
-
icons.exit()
|
|
119
|
-
.each(function (d: Item) {
|
|
120
|
-
d.target(null);
|
|
121
|
-
})
|
|
122
|
-
.remove()
|
|
123
|
-
;
|
|
124
|
-
icons.order();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
TitleBar.prototype._class += " html_TitleBar";
|
|
128
|
-
|
|
129
|
-
export interface TitleBar {
|
|
130
|
-
title(): string;
|
|
131
|
-
title(_: string): this;
|
|
132
|
-
buttons(): Item[];
|
|
133
|
-
buttons(items: Item[]): this;
|
|
134
|
-
}
|
|
135
|
-
TitleBar.prototype.publish("title", "", "string");
|
|
136
|
-
TitleBar.prototype.publish("buttons", [], "widgetArray");
|
|
1
|
+
import { HTMLWidget } from "@hpcc-js/common";
|
|
2
|
+
import { JSXWidget } from "./JSXWidget.ts";
|
|
3
|
+
|
|
4
|
+
import "../src/TitleBar.css";
|
|
5
|
+
|
|
6
|
+
export interface IClickHandler {
|
|
7
|
+
titleBarClick(src: Item, d, idx: number, groups): void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class Item extends HTMLWidget {
|
|
11
|
+
protected _owner: IClickHandler;
|
|
12
|
+
|
|
13
|
+
constructor(owner: IClickHandler) {
|
|
14
|
+
super();
|
|
15
|
+
this._owner = owner;
|
|
16
|
+
this._tag = "a";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
Item.prototype._class += " html_Item";
|
|
20
|
+
|
|
21
|
+
export class Button extends Item {
|
|
22
|
+
private _icon: string;
|
|
23
|
+
|
|
24
|
+
constructor(owner: IClickHandler, icon: string) {
|
|
25
|
+
super(owner);
|
|
26
|
+
this._icon = icon;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
icon() {
|
|
30
|
+
return this._icon;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
enter(domNode: HTMLElement, element) {
|
|
34
|
+
super.enter(domNode, element);
|
|
35
|
+
element
|
|
36
|
+
.attr("href", "#")
|
|
37
|
+
.on("click", (d, idx, groups) => this._owner.titleBarClick(this, d, idx, groups))
|
|
38
|
+
.append("i")
|
|
39
|
+
.attr("class", `fa ${this._icon} fa-lg fa-fw`)
|
|
40
|
+
;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
Button.prototype._class += " html_Button";
|
|
44
|
+
|
|
45
|
+
export class ToggleButton extends Button {
|
|
46
|
+
|
|
47
|
+
enter(domNode: HTMLElement, element) {
|
|
48
|
+
element.on("click.sel", (d, idx, groups) => {
|
|
49
|
+
this.selected(!this.selected());
|
|
50
|
+
this.render();
|
|
51
|
+
});
|
|
52
|
+
super.enter(domNode, element);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
update(domNode, element) {
|
|
56
|
+
super.update(domNode, element);
|
|
57
|
+
this._element.classed("selected", this.selected());
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
ToggleButton.prototype._class += " html_ToggleButton";
|
|
61
|
+
export interface ToggleButton {
|
|
62
|
+
selected(): boolean;
|
|
63
|
+
selected(_: boolean): this;
|
|
64
|
+
}
|
|
65
|
+
ToggleButton.prototype.publish("selected", false, "boolean");
|
|
66
|
+
|
|
67
|
+
export class Spacer extends Item {
|
|
68
|
+
|
|
69
|
+
enter(domNode, element) {
|
|
70
|
+
super.enter(domNode, element);
|
|
71
|
+
element
|
|
72
|
+
.attr("class", "spacer")
|
|
73
|
+
.attr("href", "#")
|
|
74
|
+
.append("i")
|
|
75
|
+
;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
Spacer.prototype._class += " html_Spacer";
|
|
79
|
+
|
|
80
|
+
export class TitleBar extends JSXWidget {
|
|
81
|
+
protected _divMain;
|
|
82
|
+
protected _divIconBar;
|
|
83
|
+
protected _divTitle;
|
|
84
|
+
|
|
85
|
+
constructor() {
|
|
86
|
+
super();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
enter(domNode, element) {
|
|
90
|
+
super.enter(domNode, element);
|
|
91
|
+
this._divMain = element.append("div")
|
|
92
|
+
.attr("class", "main")
|
|
93
|
+
;
|
|
94
|
+
this._divIconBar = this._divMain.append("div")
|
|
95
|
+
.attr("class", "icon-bar")
|
|
96
|
+
;
|
|
97
|
+
this._divTitle = this._divMain.append("div")
|
|
98
|
+
.attr("class", "title")
|
|
99
|
+
;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
update(domNode, element) {
|
|
103
|
+
super.update(domNode, element);
|
|
104
|
+
|
|
105
|
+
this._divTitle.text(this.title());
|
|
106
|
+
|
|
107
|
+
const icons = this._divIconBar.selectAll(".icon-bar-item").data(this.buttons());
|
|
108
|
+
icons.enter().append("div")
|
|
109
|
+
.attr("class", "icon-bar-item")
|
|
110
|
+
.each(function (this: HTMLElement, d: Item) {
|
|
111
|
+
d.target(this);
|
|
112
|
+
})
|
|
113
|
+
.merge(icons)
|
|
114
|
+
.each(function (d: Item) {
|
|
115
|
+
d.render();
|
|
116
|
+
})
|
|
117
|
+
;
|
|
118
|
+
icons.exit()
|
|
119
|
+
.each(function (d: Item) {
|
|
120
|
+
d.target(null);
|
|
121
|
+
})
|
|
122
|
+
.remove()
|
|
123
|
+
;
|
|
124
|
+
icons.order();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
TitleBar.prototype._class += " html_TitleBar";
|
|
128
|
+
|
|
129
|
+
export interface TitleBar {
|
|
130
|
+
title(): string;
|
|
131
|
+
title(_: string): this;
|
|
132
|
+
buttons(): Item[];
|
|
133
|
+
buttons(items: Item[]): this;
|
|
134
|
+
}
|
|
135
|
+
TitleBar.prototype.publish("title", "", "string");
|
|
136
|
+
TitleBar.prototype.publish("buttons", [], "widgetArray");
|
package/src/VizComponent.tsx
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { JSXWidget } from "./JSXWidget.ts";
|
|
2
|
-
|
|
3
|
-
export class VizComponent extends JSXWidget.Component<any, any> {
|
|
4
|
-
widget;
|
|
5
|
-
|
|
6
|
-
refreshProps() {
|
|
7
|
-
for (const key in (this as any).props) {
|
|
8
|
-
if (this.widget[key] && typeof this.widget[key] === "function") {
|
|
9
|
-
this.widget[key]((this as any).props[key]);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
this.widget = new (this as any).props.type()
|
|
16
|
-
.target((this as any).base)
|
|
17
|
-
;
|
|
18
|
-
this.refreshProps();
|
|
19
|
-
this.widget
|
|
20
|
-
.render()
|
|
21
|
-
;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
componentWillUnmount() {
|
|
25
|
-
this.widget
|
|
26
|
-
.target(null)
|
|
27
|
-
.render()
|
|
28
|
-
;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
return <div style={(this as any).props.style} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentDidUpdate() {
|
|
36
|
-
this.refreshProps();
|
|
37
|
-
this.widget.render();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
import { JSXWidget } from "./JSXWidget.ts";
|
|
2
|
+
|
|
3
|
+
export class VizComponent extends JSXWidget.Component<any, any> {
|
|
4
|
+
widget;
|
|
5
|
+
|
|
6
|
+
refreshProps() {
|
|
7
|
+
for (const key in (this as any).props) {
|
|
8
|
+
if (this.widget[key] && typeof this.widget[key] === "function") {
|
|
9
|
+
this.widget[key]((this as any).props[key]);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
componentDidMount() {
|
|
15
|
+
this.widget = new (this as any).props.type()
|
|
16
|
+
.target((this as any).base)
|
|
17
|
+
;
|
|
18
|
+
this.refreshProps();
|
|
19
|
+
this.widget
|
|
20
|
+
.render()
|
|
21
|
+
;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
componentWillUnmount() {
|
|
25
|
+
this.widget
|
|
26
|
+
.target(null)
|
|
27
|
+
.render()
|
|
28
|
+
;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
return <div style={(this as any).props.style} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
componentDidUpdate() {
|
|
36
|
+
this.refreshProps();
|
|
37
|
+
this.widget.render();
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/VizInstance.tsx
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { JSXWidget } from "./JSXWidget.ts";
|
|
2
|
-
|
|
3
|
-
export class VizInstance extends JSXWidget.Component<any, any> {
|
|
4
|
-
widget;
|
|
5
|
-
|
|
6
|
-
refreshProps() {
|
|
7
|
-
for (const key in (this as any).props) {
|
|
8
|
-
if (this.widget[key] && typeof this.widget[key] === "function") {
|
|
9
|
-
this.widget[key]((this as any).props[key]);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
this.widget = (this as any).props.instance
|
|
16
|
-
.target((this as any).base)
|
|
17
|
-
;
|
|
18
|
-
this.refreshProps();
|
|
19
|
-
this.widget
|
|
20
|
-
.render()
|
|
21
|
-
;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
componentWillUnmount() {
|
|
25
|
-
this.widget
|
|
26
|
-
.target(null)
|
|
27
|
-
.render()
|
|
28
|
-
;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
return <div style={(this as any).props.style} />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
componentDidUpdate() {
|
|
36
|
-
this.refreshProps();
|
|
37
|
-
this.widget.render();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
import { JSXWidget } from "./JSXWidget.ts";
|
|
2
|
+
|
|
3
|
+
export class VizInstance extends JSXWidget.Component<any, any> {
|
|
4
|
+
widget;
|
|
5
|
+
|
|
6
|
+
refreshProps() {
|
|
7
|
+
for (const key in (this as any).props) {
|
|
8
|
+
if (this.widget[key] && typeof this.widget[key] === "function") {
|
|
9
|
+
this.widget[key]((this as any).props[key]);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
componentDidMount() {
|
|
15
|
+
this.widget = (this as any).props.instance
|
|
16
|
+
.target((this as any).base)
|
|
17
|
+
;
|
|
18
|
+
this.refreshProps();
|
|
19
|
+
this.widget
|
|
20
|
+
.render()
|
|
21
|
+
;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
componentWillUnmount() {
|
|
25
|
+
this.widget
|
|
26
|
+
.target(null)
|
|
27
|
+
.render()
|
|
28
|
+
;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
return <div style={(this as any).props.style} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
componentDidUpdate() {
|
|
36
|
+
this.refreshProps();
|
|
37
|
+
this.widget.render();
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
-
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
-
export const BUILD_VERSION = "__BUILD_VERSION__";
|
|
1
|
+
export const PKG_NAME = "__PACKAGE_NAME__";
|
|
2
|
+
export const PKG_VERSION = "__PACKAGE_VERSION__";
|
|
3
|
+
export const BUILD_VERSION = "__BUILD_VERSION__";
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./__package__.ts";
|
|
2
|
-
export * from "./BreakdownTable.ts";
|
|
3
|
-
export * from "./HTMLTooltip.ts";
|
|
4
|
-
export * from "./JSXWidget.ts";
|
|
5
|
-
export * from "./reactD3.ts";
|
|
6
|
-
export * from "./VizComponent.tsx";
|
|
7
|
-
export * from "./VizInstance.tsx";
|
|
8
|
-
export * from "./SimpleTable.ts";
|
|
9
|
-
export * from "./StatsTable.ts";
|
|
10
|
-
export * from "./StyledTable.ts";
|
|
11
|
-
export * from "./TitleBar.ts";
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
export * from "./BreakdownTable.ts";
|
|
3
|
+
export * from "./HTMLTooltip.ts";
|
|
4
|
+
export * from "./JSXWidget.ts";
|
|
5
|
+
export * from "./reactD3.ts";
|
|
6
|
+
export * from "./VizComponent.tsx";
|
|
7
|
+
export * from "./VizInstance.tsx";
|
|
8
|
+
export * from "./SimpleTable.ts";
|
|
9
|
+
export * from "./StatsTable.ts";
|
|
10
|
+
export * from "./StyledTable.ts";
|
|
11
|
+
export * from "./TitleBar.ts";
|