@hpcc-js/layout 3.7.0 → 3.8.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/dist/index.js +259 -241
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +4 -4
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +13 -13
- package/src/Border.ts +7 -10
- package/src/Grid.ts +14 -16
- package/src/Surface.ts +2 -2
- package/types/Border.d.ts +3 -3
- package/types/Grid.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/layout",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "hpcc-js - Viz Layout",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"update-major": "npx --yes npm-check-updates -u"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@hpcc-js/api": "^3.
|
|
43
|
-
"@hpcc-js/chart": "^3.
|
|
44
|
-
"@hpcc-js/common": "^3.
|
|
45
|
-
"@hpcc-js/dgrid2": "^3.
|
|
46
|
-
"@hpcc-js/util": "^3.7.
|
|
42
|
+
"@hpcc-js/api": "^3.7.1",
|
|
43
|
+
"@hpcc-js/chart": "^3.10.1",
|
|
44
|
+
"@hpcc-js/common": "^3.11.1",
|
|
45
|
+
"@hpcc-js/dgrid2": "^3.9.1",
|
|
46
|
+
"@hpcc-js/util": "^3.7.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@hpcc-js/vite-plugins": "^1.
|
|
50
|
-
"@types/d3-transition": "
|
|
51
|
-
"d3-drag": "
|
|
52
|
-
"d3-selection": "
|
|
53
|
-
"d3-shape": "
|
|
49
|
+
"@hpcc-js/vite-plugins": "^1.4.1",
|
|
50
|
+
"@types/d3-transition": "3.0.9",
|
|
51
|
+
"d3-drag": "3.0.0",
|
|
52
|
+
"d3-selection": "3.0.0",
|
|
53
|
+
"d3-shape": "3.2.0",
|
|
54
54
|
"d3-svg-legend": "2.25.6",
|
|
55
|
-
"d3-transition": "
|
|
55
|
+
"d3-transition": "3.0.1",
|
|
56
56
|
"grid-list": "0.4.1"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
67
67
|
},
|
|
68
68
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "f2f54184e334591caa8d02ae9384a50e0c206b15"
|
|
70
70
|
}
|
package/src/Border.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLWidget, Platform, select as d3Select, selectAll as d3SelectAll, Utility } from "@hpcc-js/common";
|
|
2
2
|
import { drag as d3Drag } from "d3-drag";
|
|
3
3
|
import { Cell } from "./Cell.ts";
|
|
4
4
|
|
|
@@ -265,8 +265,7 @@ export class Border extends HTMLWidget {
|
|
|
265
265
|
this._offsetY = this._element.node().getBoundingClientRect().top + (this.gutter() / 2);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
dragStart(handle) {
|
|
269
|
-
const event = d3Event();
|
|
268
|
+
dragStart(event, handle) {
|
|
270
269
|
event.sourceEvent.stopPropagation();
|
|
271
270
|
const context = this;
|
|
272
271
|
|
|
@@ -285,10 +284,9 @@ export class Border extends HTMLWidget {
|
|
|
285
284
|
this._dragPrevX = event.sourceEvent.clientX;
|
|
286
285
|
this._dragPrevY = event.sourceEvent.clientY;
|
|
287
286
|
}
|
|
288
|
-
dragTick(handle) {
|
|
287
|
+
dragTick(event, handle) {
|
|
289
288
|
const context = this;
|
|
290
289
|
|
|
291
|
-
const event = d3Event();
|
|
292
290
|
const xDelta = this._dragPrevX - event.sourceEvent.clientX;
|
|
293
291
|
const yDelta = this._dragPrevY - event.sourceEvent.clientY;
|
|
294
292
|
|
|
@@ -350,9 +348,8 @@ export class Border extends HTMLWidget {
|
|
|
350
348
|
});
|
|
351
349
|
}
|
|
352
350
|
}
|
|
353
|
-
dragEnd(handle) {
|
|
351
|
+
dragEnd(event, handle) {
|
|
354
352
|
if (handle) {
|
|
355
|
-
const event = d3Event();
|
|
356
353
|
const xDelta = this._dragPrevX - event.sourceEvent.clientX;
|
|
357
354
|
const yDelta = this._dragPrevY - event.sourceEvent.clientY;
|
|
358
355
|
|
|
@@ -450,9 +447,9 @@ export class Border extends HTMLWidget {
|
|
|
450
447
|
});
|
|
451
448
|
|
|
452
449
|
const drag = d3Drag()
|
|
453
|
-
.on("start", function (
|
|
454
|
-
.on("drag", function (
|
|
455
|
-
.on("end", function (
|
|
450
|
+
.on("start", function (event, d) { context.dragStart.call(context, event, d); })
|
|
451
|
+
.on("drag", function (event, d) { context.dragTick.call(context, event, d); })
|
|
452
|
+
.on("end", function (event, d) { context.dragEnd.call(context, event, d); })
|
|
456
453
|
;
|
|
457
454
|
if (this.designMode()) {
|
|
458
455
|
element.selectAll("#" + this.id() + " > div.borderHandle").call(drag);
|
package/src/Grid.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { drag as d3Drag, HTMLWidget, Platform, select as d3Select, Utility } from "@hpcc-js/common";
|
|
2
2
|
import * as _GridList from "grid-list";
|
|
3
3
|
import { Cell } from "./Cell.ts";
|
|
4
4
|
|
|
@@ -195,9 +195,9 @@ export class Grid extends HTMLWidget {
|
|
|
195
195
|
const d = context.cellToGridItem(_d);
|
|
196
196
|
return { x: d.x * context.cellWidth, y: d.y * context.cellHeight };
|
|
197
197
|
})
|
|
198
|
-
.on("start", function (_d: any) {
|
|
198
|
+
.on("start", function (event, _d: any) {
|
|
199
199
|
if (!context.designMode()) return;
|
|
200
|
-
|
|
200
|
+
event.sourceEvent.stopPropagation();
|
|
201
201
|
context.initGridList();
|
|
202
202
|
const d = context.itemsMap[_d.id()];
|
|
203
203
|
context.dragItem = element.append("div")
|
|
@@ -206,11 +206,10 @@ export class Grid extends HTMLWidget {
|
|
|
206
206
|
.style("width", function () { return d.w * context.cellWidth - context.gutter() + "px"; })
|
|
207
207
|
.style("height", function () { return d.h * context.cellHeight - context.gutter() + "px"; })
|
|
208
208
|
;
|
|
209
|
-
context.selectionBagClick(_d);
|
|
209
|
+
context.selectionBagClick(event, _d);
|
|
210
210
|
})
|
|
211
|
-
.on("drag", function (_d: any) {
|
|
211
|
+
.on("drag", function (event, _d: any) {
|
|
212
212
|
if (!context.designMode()) return;
|
|
213
|
-
const event = d3Event();
|
|
214
213
|
event.sourceEvent.stopPropagation();
|
|
215
214
|
const d = context.itemsMap[_d.id()];
|
|
216
215
|
if (event.x < 0) {
|
|
@@ -245,9 +244,9 @@ export class Grid extends HTMLWidget {
|
|
|
245
244
|
.style("height", function () { return d.h * context.cellHeight + "px"; })
|
|
246
245
|
;
|
|
247
246
|
})
|
|
248
|
-
.on("end", function () {
|
|
247
|
+
.on("end", function (event) {
|
|
249
248
|
if (!context.designMode()) return;
|
|
250
|
-
|
|
249
|
+
event.sourceEvent.stopPropagation();
|
|
251
250
|
context.dragItem.remove();
|
|
252
251
|
context.dragItem = null;
|
|
253
252
|
context.killGridList();
|
|
@@ -259,9 +258,9 @@ export class Grid extends HTMLWidget {
|
|
|
259
258
|
const d = context.cellToGridItem(_d);
|
|
260
259
|
return { x: (d.x + d.w - 1) * context.cellWidth, y: (d.y + d.h - 1) * context.cellHeight };
|
|
261
260
|
})
|
|
262
|
-
.on("start", function (_d: any) {
|
|
261
|
+
.on("start", function (event, _d: any) {
|
|
263
262
|
if (!context.designMode()) return;
|
|
264
|
-
|
|
263
|
+
event.sourceEvent.stopPropagation();
|
|
265
264
|
context.initGridList();
|
|
266
265
|
const d = context.itemsMap[_d.id()];
|
|
267
266
|
context.dragItem = element.append("div")
|
|
@@ -272,9 +271,8 @@ export class Grid extends HTMLWidget {
|
|
|
272
271
|
;
|
|
273
272
|
context.dragItemPos = { x: d.x, y: d.y };
|
|
274
273
|
})
|
|
275
|
-
.on("drag", function (_d: any) {
|
|
274
|
+
.on("drag", function (event, _d: any) {
|
|
276
275
|
if (!context.designMode()) return;
|
|
277
|
-
const event = d3Event();
|
|
278
276
|
event.sourceEvent.stopPropagation();
|
|
279
277
|
const d = context.itemsMap[_d.id()];
|
|
280
278
|
const pos = [Math.max(0, Math.round(event.x / context.cellWidth)), Math.max(0, Math.round(event.y / context.cellHeight))];
|
|
@@ -300,9 +298,9 @@ export class Grid extends HTMLWidget {
|
|
|
300
298
|
.style("height", function () { return (-d.y + 1) * context.cellHeight + event.y - context.gutter() + "px"; })
|
|
301
299
|
;
|
|
302
300
|
})
|
|
303
|
-
.on("end", function () {
|
|
301
|
+
.on("end", function (event) {
|
|
304
302
|
if (!context.designMode()) return;
|
|
305
|
-
|
|
303
|
+
event.sourceEvent.stopPropagation();
|
|
306
304
|
context.dragItem.remove();
|
|
307
305
|
context.dragItem = null;
|
|
308
306
|
context.killGridList();
|
|
@@ -478,10 +476,10 @@ export class Grid extends HTMLWidget {
|
|
|
478
476
|
}
|
|
479
477
|
}
|
|
480
478
|
|
|
481
|
-
selectionBagClick(d) {
|
|
479
|
+
selectionBagClick(event, d) {
|
|
482
480
|
if (d !== null) {
|
|
483
481
|
const selectionObj = this._createSelectionObject(d);
|
|
484
|
-
if (
|
|
482
|
+
if (event.sourceEvent.ctrlKey) {
|
|
485
483
|
if (this._selectionBag.isSelected(selectionObj)) {
|
|
486
484
|
this._selectionBag.remove(selectionObj);
|
|
487
485
|
this.postSelectionChange();
|
package/src/Surface.ts
CHANGED
|
@@ -72,14 +72,14 @@ export class Surface extends HTMLWidget {
|
|
|
72
72
|
el
|
|
73
73
|
.style("background", "transparent")
|
|
74
74
|
.style("border", "none")
|
|
75
|
-
.on("click", function (d) { context.click(d); })
|
|
75
|
+
.on("click", function (_event, d) { context.click(d); })
|
|
76
76
|
.append("i")
|
|
77
77
|
.attr("class", "fa")
|
|
78
78
|
.text(function () { return button.label; });
|
|
79
79
|
} else {
|
|
80
80
|
el
|
|
81
81
|
.text(function () { return button.label; })
|
|
82
|
-
.on("click", function (d) { context.click(d); });
|
|
82
|
+
.on("click", function (_event, d) { context.click(d); });
|
|
83
83
|
}
|
|
84
84
|
})
|
|
85
85
|
;
|
package/types/Border.d.ts
CHANGED
|
@@ -33,9 +33,9 @@ export declare class Border extends HTMLWidget {
|
|
|
33
33
|
getCell(id: any): any;
|
|
34
34
|
getContent(id: any): any;
|
|
35
35
|
setLayoutOffsets(): void;
|
|
36
|
-
dragStart(handle: any): void;
|
|
37
|
-
dragTick(handle: any): void;
|
|
38
|
-
dragEnd(handle: any): void;
|
|
36
|
+
dragStart(event: any, handle: any): void;
|
|
37
|
+
dragTick(event: any, handle: any): void;
|
|
38
|
+
dragEnd(event: any, handle: any): void;
|
|
39
39
|
size(_?: any): any;
|
|
40
40
|
enter(domNode: any, element: any): void;
|
|
41
41
|
update(domNode: any, element: any): void;
|
package/types/Grid.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class Grid extends HTMLWidget {
|
|
|
50
50
|
};
|
|
51
51
|
selection(_: any): any;
|
|
52
52
|
selectionBagClear(): void;
|
|
53
|
-
selectionBagClick(d: any): void;
|
|
53
|
+
selectionBagClick(event: any, d: any): void;
|
|
54
54
|
postSelectionChange(): void;
|
|
55
55
|
applyLayout(layoutArr: ICellPosition[]): void;
|
|
56
56
|
vizActivation(elem: any): void;
|