@hpcc-js/tree 2.44.0 → 2.45.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/LICENSE +43 -43
- package/README.md +454 -454
- package/dist/index.es6.js +2836 -0
- package/dist/index.es6.js.map +1 -0
- package/dist/index.js +2852 -2020
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +34 -32
- package/src/CirclePacking.css +16 -16
- package/src/CirclePacking.ts +148 -152
- package/src/Dendrogram.css +42 -42
- package/src/Dendrogram.ts +284 -296
- package/src/DirectoryTree.ts +310 -306
- package/src/Indented.css +16 -16
- package/src/Indented.ts +283 -290
- package/src/SunburstPartition.css +5 -5
- package/src/SunburstPartition.ts +151 -157
- package/src/Treemap.css +41 -41
- package/src/Treemap.ts +320 -346
- package/src/__package__.ts +3 -3
- package/src/index.ts +7 -7
- package/types/CirclePacking.d.ts +6 -7
- package/types/CirclePacking.d.ts.map +1 -0
- package/types/Dendrogram.d.ts +35 -20
- package/types/Dendrogram.d.ts.map +1 -0
- package/types/DirectoryTree.d.ts +16 -11
- package/types/DirectoryTree.d.ts.map +1 -0
- package/types/Indented.d.ts +16 -11
- package/types/Indented.d.ts.map +1 -0
- package/types/SunburstPartition.d.ts +5 -8
- package/types/SunburstPartition.d.ts.map +1 -0
- package/types/Treemap.d.ts +96 -51
- package/types/Treemap.d.ts.map +1 -0
- package/types/__package__.d.ts +3 -2
- package/types/__package__.d.ts.map +1 -0
- package/types/index.d.ts +8 -7
- package/types/index.d.ts.map +1 -0
- package/types-3.4/CirclePacking.d.ts +32 -0
- package/types-3.4/Dendrogram.d.ts +60 -0
- package/types-3.4/DirectoryTree.d.ts +62 -0
- package/types-3.4/Indented.d.ts +46 -0
- package/types-3.4/SunburstPartition.d.ts +23 -0
- package/types-3.4/Treemap.d.ts +125 -0
- package/types-3.4/__package__.d.ts +4 -0
- package/types-3.4/index.d.ts +8 -0
- package/dist/index.umd.cjs +0 -2
- package/dist/index.umd.cjs.map +0 -1
package/src/DirectoryTree.ts
CHANGED
|
@@ -1,306 +1,310 @@
|
|
|
1
|
-
import { HTMLWidget, Palette, Platform, select as d3Select, Utility,
|
|
2
|
-
import { max as d3Max
|
|
3
|
-
import { hierarchy as d3Hierarchy } from "d3-hierarchy";
|
|
4
|
-
|
|
5
|
-
interface DirectoryItem {
|
|
6
|
-
color?: string;
|
|
7
|
-
iconClass?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
depth: number;
|
|
10
|
-
content?: string;
|
|
11
|
-
markers?: any;
|
|
12
|
-
isFolder: boolean;
|
|
13
|
-
bold?: boolean;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
weightValue?: string;
|
|
16
|
-
weightColor?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class DirectoryTree extends HTMLWidget {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
root
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
flatData
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
d.weightColor =
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
.
|
|
135
|
-
.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.
|
|
146
|
-
.style("
|
|
147
|
-
.style("
|
|
148
|
-
.style("
|
|
149
|
-
.style("font-
|
|
150
|
-
.
|
|
151
|
-
.
|
|
152
|
-
.
|
|
153
|
-
.
|
|
154
|
-
.style("
|
|
155
|
-
.style("
|
|
156
|
-
.style("
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
.
|
|
162
|
-
.style("
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
.
|
|
168
|
-
.style("
|
|
169
|
-
.style("
|
|
170
|
-
.style("
|
|
171
|
-
.style("
|
|
172
|
-
.style("
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.
|
|
178
|
-
.style("
|
|
179
|
-
.style("
|
|
180
|
-
.style("
|
|
181
|
-
.style("font-
|
|
182
|
-
.
|
|
183
|
-
.
|
|
184
|
-
.
|
|
185
|
-
.
|
|
186
|
-
.style("
|
|
187
|
-
.style("
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
next =
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
omitRoot(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
textFileIcon():
|
|
288
|
-
|
|
289
|
-
verticalScroll():
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
DirectoryTree.prototype.
|
|
296
|
-
|
|
297
|
-
DirectoryTree.prototype.publish("
|
|
298
|
-
DirectoryTree.prototype.publish("
|
|
299
|
-
DirectoryTree.prototype.publish("
|
|
300
|
-
DirectoryTree.prototype.publish("
|
|
301
|
-
DirectoryTree.prototype.publish("
|
|
302
|
-
DirectoryTree.prototype.publish("
|
|
303
|
-
DirectoryTree.prototype.publish("
|
|
304
|
-
DirectoryTree.prototype.publish("
|
|
305
|
-
DirectoryTree.prototype.publish("
|
|
306
|
-
DirectoryTree.prototype.publish("
|
|
1
|
+
import { HTMLWidget, Palette, Platform, select as d3Select, Utility, } from "@hpcc-js/common";
|
|
2
|
+
import { max as d3Max} from "d3-array";
|
|
3
|
+
import { hierarchy as d3Hierarchy } from "d3-hierarchy";
|
|
4
|
+
|
|
5
|
+
interface DirectoryItem {
|
|
6
|
+
color?: string;
|
|
7
|
+
iconClass?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
depth: number;
|
|
10
|
+
content?: string;
|
|
11
|
+
markers?: any;
|
|
12
|
+
isFolder: boolean;
|
|
13
|
+
bold?: boolean;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
weightValue?: string;
|
|
16
|
+
weightColor?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class DirectoryTree extends HTMLWidget {
|
|
20
|
+
|
|
21
|
+
_palette;
|
|
22
|
+
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
flattenData(json): DirectoryItem[] {
|
|
28
|
+
const context = this;
|
|
29
|
+
const root = d3Hierarchy(json);
|
|
30
|
+
const ret = [];
|
|
31
|
+
|
|
32
|
+
if (!this.omitRoot()) {
|
|
33
|
+
visitNode(root);
|
|
34
|
+
} else if (root.children) {
|
|
35
|
+
root.children.forEach(visitNode);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return ret;
|
|
39
|
+
|
|
40
|
+
function visitNode(node) {
|
|
41
|
+
const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : "";
|
|
42
|
+
ret.push({
|
|
43
|
+
label: node.data.label,
|
|
44
|
+
depth: node.depth - (context.omitRoot() ? 1 : 0),
|
|
45
|
+
content: node.data.content,
|
|
46
|
+
isFolder: !!node.data.children,
|
|
47
|
+
iconClass: node.data.iconClass,
|
|
48
|
+
color: node.data.color,
|
|
49
|
+
bold: node.data.bold,
|
|
50
|
+
weightValue,
|
|
51
|
+
markers: node.data.markers,
|
|
52
|
+
selected: node.data.selected
|
|
53
|
+
});
|
|
54
|
+
if (node.children) {
|
|
55
|
+
node.children.forEach(visitNode);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected iconClass(d) {
|
|
61
|
+
if (d.label === "error") {
|
|
62
|
+
return "fa fa-exclamation";
|
|
63
|
+
}
|
|
64
|
+
if (d.isFolder) {
|
|
65
|
+
return this.folderIconOpen();
|
|
66
|
+
}
|
|
67
|
+
return this.textFileIcon();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected calcRequiredWidth() {
|
|
71
|
+
const flatData = this.flattenData(this.data());
|
|
72
|
+
|
|
73
|
+
let widest = 0;
|
|
74
|
+
|
|
75
|
+
const padding = this.rowItemPadding();
|
|
76
|
+
const iconWidth = this.iconSize() + (padding * 2);
|
|
77
|
+
const scrollbarWidth = Platform.getScrollbarWidth();
|
|
78
|
+
|
|
79
|
+
flatData.forEach(row => {
|
|
80
|
+
const offsetWidth = (row.depth * iconWidth) + (padding * 2);
|
|
81
|
+
const textWidth = Utility.textSize(
|
|
82
|
+
row.label,
|
|
83
|
+
this.fontFamily(),
|
|
84
|
+
this.fontSize(),
|
|
85
|
+
!!row.bold
|
|
86
|
+
).width + (padding * 2);
|
|
87
|
+
const totalWidth = textWidth + iconWidth + offsetWidth + scrollbarWidth;
|
|
88
|
+
if (widest < totalWidth) {
|
|
89
|
+
widest = totalWidth;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return widest;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
rowClick(str, markers) {}
|
|
96
|
+
|
|
97
|
+
enter(domNode, element) {
|
|
98
|
+
super.enter(domNode, element);
|
|
99
|
+
element
|
|
100
|
+
.style("width", "100%")
|
|
101
|
+
.style("height", "100%")
|
|
102
|
+
;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
update(domNode, element) {
|
|
106
|
+
super.update(domNode, element);
|
|
107
|
+
|
|
108
|
+
this._palette = this._palette.switch(this.paletteID());
|
|
109
|
+
|
|
110
|
+
element
|
|
111
|
+
.style("overflow-y", this.verticalScroll() ? "scroll" : null)
|
|
112
|
+
;
|
|
113
|
+
const flatData = this.flattenData(this.data());
|
|
114
|
+
const maxWeightValue = d3Max(flatData, n=>Number(n.weightValue));
|
|
115
|
+
|
|
116
|
+
flatData.forEach(d=>{
|
|
117
|
+
if(!d.weightValue){
|
|
118
|
+
d.weightColor = "transparent";
|
|
119
|
+
} else {
|
|
120
|
+
d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const context = this;
|
|
124
|
+
const padding = this.rowItemPadding();
|
|
125
|
+
const iconWidth = this.iconSize() + padding;
|
|
126
|
+
const lineHeight = Math.max(context.iconSize(), context.fontSize());
|
|
127
|
+
const rowSelection = element.selectAll(".directory-row").data(flatData);
|
|
128
|
+
const fontFamily = this.fontFamily();
|
|
129
|
+
const fontSize = this.fontSize();
|
|
130
|
+
const maxWeightWidth = d3Max(flatData, d=>this.textSize(d.weightValue, fontFamily, fontSize).width);
|
|
131
|
+
const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;
|
|
132
|
+
|
|
133
|
+
const rowEnter = rowSelection.enter().append("div")
|
|
134
|
+
.attr("class", d => `directory-row directory-row-depth-${d.depth}`)
|
|
135
|
+
.style("display", "flex")
|
|
136
|
+
.style("cursor", "pointer")
|
|
137
|
+
.each(function (d: DirectoryItem) {
|
|
138
|
+
const rowDiv = d3Select(this);
|
|
139
|
+
|
|
140
|
+
const fontColor = d.color ? d.color : context.fontColor();
|
|
141
|
+
const weightColor = d.weightColor ? d.weightColor : "transparent";
|
|
142
|
+
const weightFontColor = Palette.textColor(weightColor);
|
|
143
|
+
|
|
144
|
+
const weightDiv = rowDiv.append("div")
|
|
145
|
+
.attr("class", "row-weight")
|
|
146
|
+
.style("padding", rowItemPadding)
|
|
147
|
+
.style("color", weightFontColor)
|
|
148
|
+
.style("box-shadow", `inset 0 0 100px ${weightColor}`)
|
|
149
|
+
.style("font-weight", d.bold ? "bold" : "normal")
|
|
150
|
+
.style("font-family", fontFamily)
|
|
151
|
+
.style("font-size", fontSize + "px")
|
|
152
|
+
.text(d.weightValue)
|
|
153
|
+
.attr("title", d.weightValue)
|
|
154
|
+
.style("overflow", "hidden")
|
|
155
|
+
.style("width", (maxWeightWidth + (padding * 2)) + "px")
|
|
156
|
+
.style("text-overflow", "ellipsis")
|
|
157
|
+
.style("text-align", "right")
|
|
158
|
+
.style("line-height", lineHeight + "px")
|
|
159
|
+
;
|
|
160
|
+
rowDiv.append("div")
|
|
161
|
+
.attr("class", "row-depth")
|
|
162
|
+
.style("width", (context.depthSize() * d.depth) + "px")
|
|
163
|
+
.style("opacity", 1)
|
|
164
|
+
.style("line-height", lineHeight + "px")
|
|
165
|
+
;
|
|
166
|
+
const iconDiv = rowDiv.append("div")
|
|
167
|
+
.attr("class", "row-icon " + (d.iconClass ? d.iconClass : context.iconClass(d)))
|
|
168
|
+
.style("width", iconWidth + "px")
|
|
169
|
+
.style("height", lineHeight + "px")
|
|
170
|
+
.style("color", fontColor)
|
|
171
|
+
.style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
|
|
172
|
+
.style("font-size", context.iconSize() + "px")
|
|
173
|
+
.style("padding", rowItemPadding)
|
|
174
|
+
.style("line-height", lineHeight + "px")
|
|
175
|
+
;
|
|
176
|
+
const labelDiv = rowDiv.append("div")
|
|
177
|
+
.attr("class", "row-label")
|
|
178
|
+
.style("padding", rowItemPadding)
|
|
179
|
+
.style("color", fontColor)
|
|
180
|
+
.style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
|
|
181
|
+
.style("font-weight", d.bold ? "bold" : "normal")
|
|
182
|
+
.style("font-family", context.fontFamily())
|
|
183
|
+
.style("font-size", context.fontSize() + "px")
|
|
184
|
+
.text(d.label)
|
|
185
|
+
.attr("title", d.label)
|
|
186
|
+
.style("flex", 1)
|
|
187
|
+
.style("overflow", "hidden")
|
|
188
|
+
.style("text-overflow", "ellipsis")
|
|
189
|
+
.style("line-height", lineHeight + "px")
|
|
190
|
+
;
|
|
191
|
+
|
|
192
|
+
rowDiv
|
|
193
|
+
.on("mouseenter", () => {
|
|
194
|
+
labelDiv.style("font-weight", "bold");
|
|
195
|
+
})
|
|
196
|
+
.on("mouseleave", () => {
|
|
197
|
+
labelDiv.style("font-weight", d.bold ? "bold" : "normal");
|
|
198
|
+
})
|
|
199
|
+
;
|
|
200
|
+
weightDiv
|
|
201
|
+
.on("mouseenter", () => {
|
|
202
|
+
context.weight_mouseenter(d);
|
|
203
|
+
})
|
|
204
|
+
.on("mouseleave", () => {
|
|
205
|
+
context.weight_mouseleave(d);
|
|
206
|
+
})
|
|
207
|
+
;
|
|
208
|
+
|
|
209
|
+
if (d.isFolder) {
|
|
210
|
+
rowDiv.on("click", function (d: any) {
|
|
211
|
+
let next = this.nextSibling;
|
|
212
|
+
const wasClosed = rowDiv.classed("folder-closed");
|
|
213
|
+
if (wasClosed) {
|
|
214
|
+
rowDiv.classed("folder-closed", false);
|
|
215
|
+
rowDiv.classed("folder-open", true);
|
|
216
|
+
iconDiv.attr("class", "row-icon " + context.folderIconOpen());
|
|
217
|
+
} else {
|
|
218
|
+
rowDiv.classed("folder-closed", true);
|
|
219
|
+
rowDiv.classed("folder-open", false);
|
|
220
|
+
iconDiv.attr("class", "row-icon " + context.folderIconClosed());
|
|
221
|
+
}
|
|
222
|
+
while (next !== null) {
|
|
223
|
+
const nextDepth = (d3Select(next).datum() as any).depth;
|
|
224
|
+
if (nextDepth > d.depth) {
|
|
225
|
+
next.style.display = wasClosed ? "flex" : "none";
|
|
226
|
+
next = next.nextSibling;
|
|
227
|
+
} else {
|
|
228
|
+
next = null;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
} else {
|
|
233
|
+
rowDiv.on("click", () => {
|
|
234
|
+
element.selectAll(".row-label").style("background-color", "transparent");
|
|
235
|
+
element.selectAll(".row-icon").style("background-color", "transparent");
|
|
236
|
+
iconDiv.style("background-color", context.selectionBackgroundColor());
|
|
237
|
+
labelDiv.style("background-color", context.selectionBackgroundColor());
|
|
238
|
+
const ext = d.label.split(".").pop().toLowerCase();
|
|
239
|
+
context.rowClick(ext === "json" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
})
|
|
243
|
+
;
|
|
244
|
+
|
|
245
|
+
rowEnter
|
|
246
|
+
.merge(rowSelection)
|
|
247
|
+
.style("background-color", context.backgroundColor())
|
|
248
|
+
;
|
|
249
|
+
|
|
250
|
+
rowSelection.exit().remove();
|
|
251
|
+
}
|
|
252
|
+
weight_mouseenter(d){
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
weight_mouseleave(d){
|
|
256
|
+
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
DirectoryTree.prototype._class += " tree_DirectoryTree";
|
|
260
|
+
|
|
261
|
+
export interface DirectoryTree {
|
|
262
|
+
backgroundColor(): string;
|
|
263
|
+
backgroundColor(_: string): this;
|
|
264
|
+
fontColor(): string;
|
|
265
|
+
fontColor(_: string): this;
|
|
266
|
+
fontFamily(): string;
|
|
267
|
+
fontFamily(_: string): this;
|
|
268
|
+
omitRoot(): boolean;
|
|
269
|
+
omitRoot(_: boolean): this;
|
|
270
|
+
fontSize(): number;
|
|
271
|
+
fontSize(_: number): this;
|
|
272
|
+
iconSize(): number;
|
|
273
|
+
iconSize(_: number): this;
|
|
274
|
+
fileIconSize(): number;
|
|
275
|
+
fileIconSize(_: number): this;
|
|
276
|
+
folderIconOpen(): string;
|
|
277
|
+
folderIconOpen(_: string): this;
|
|
278
|
+
folderIconClosed(): string;
|
|
279
|
+
folderIconClosed(_: string): this;
|
|
280
|
+
hoverBackgroundColor(): string;
|
|
281
|
+
hoverBackgroundColor(_: string): this;
|
|
282
|
+
selectionBackgroundColor(): string;
|
|
283
|
+
selectionBackgroundColor(_: string): this;
|
|
284
|
+
rowItemPadding(): number;
|
|
285
|
+
rowItemPadding(_: number): this;
|
|
286
|
+
textFileIcon(): string;
|
|
287
|
+
textFileIcon(_: string): this;
|
|
288
|
+
verticalScroll(): boolean;
|
|
289
|
+
verticalScroll(_: boolean): this;
|
|
290
|
+
paletteID(): string;
|
|
291
|
+
paletteID(_: string): this;
|
|
292
|
+
depthSize(): number;
|
|
293
|
+
depthSize(_: number): this;
|
|
294
|
+
}
|
|
295
|
+
DirectoryTree.prototype._palette = Palette.rainbow("Blues");
|
|
296
|
+
|
|
297
|
+
DirectoryTree.prototype.publish("depthSize", 14, "number", "Width of indentation per file or folder depth (pixels)");
|
|
298
|
+
DirectoryTree.prototype.publish("paletteID", "Blues", "set", "Color palette for the weight backgrounds", DirectoryTree.prototype._palette.switch(), { tags: ["Basic"] });
|
|
299
|
+
DirectoryTree.prototype.publish("omitRoot", false, "boolean", "If true, root node will not display");
|
|
300
|
+
DirectoryTree.prototype.publish("rowItemPadding", 2, "number", "Top, bottom, left and right row item padding");
|
|
301
|
+
DirectoryTree.prototype.publish("selectionBackgroundColor", "#CCC", "html-color", "Background color of selected directory rows");
|
|
302
|
+
DirectoryTree.prototype.publish("backgroundColor", "#FFF", "html-color", "Directory item background color");
|
|
303
|
+
DirectoryTree.prototype.publish("fontColor", "#000", "html-color", "Directory item font color");
|
|
304
|
+
DirectoryTree.prototype.publish("fontFamily", "Arial", "string", "Directory item font family");
|
|
305
|
+
DirectoryTree.prototype.publish("fontSize", 12, "number", "Directory item font size (pixels)");
|
|
306
|
+
DirectoryTree.prototype.publish("iconSize", 12, "number", "Directory folder and file icon size (pixels)");
|
|
307
|
+
DirectoryTree.prototype.publish("folderIconOpen", "fa fa-folder-open", "string", "Open folder icon class");
|
|
308
|
+
DirectoryTree.prototype.publish("folderIconClosed", "fa fa-folder", "string", "Closed folder icon class");
|
|
309
|
+
DirectoryTree.prototype.publish("textFileIcon", "fa fa-file-text-o", "string", "Text file icon class");
|
|
310
|
+
DirectoryTree.prototype.publish("verticalScroll", true, "boolean", "If true, vertical scroll bar will be shown");
|