@hpcc-js/graph 2.81.0 → 2.82.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.es6.js CHANGED
@@ -5,8 +5,8 @@ import { render, Subgraph as Subgraph$1, Icons, Vertex as Vertex$1, Vertex3, Cen
5
5
  import { HTMLTooltip } from '@hpcc-js/html';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/graph";
8
- var PKG_VERSION = "2.81.0";
9
- var BUILD_VERSION = "2.104.0";
8
+ var PKG_VERSION = "2.82.0";
9
+ var BUILD_VERSION = "2.104.1";
10
10
 
11
11
  /*! *****************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -16928,10 +16928,11 @@ var Graph2 = /** @class */ (function (_super) {
16928
16928
  }, d3Event().sourceEvent);
16929
16929
  context.selectionChanged();
16930
16930
  var selected = d.element.classed("selected");
16931
- context.vertex_click(d.props.origData || d.props, "", selected);
16931
+ var annoData = context.resolveAnnoEventNode();
16932
+ context.vertex_click(d.props.origData || d.props, "", selected, annoData);
16932
16933
  var doClickTime = Date.now();
16933
16934
  if (doClickTime - context._prevDoClickTime < context.doubleClickMaxDelay()) {
16934
- context.vertex_dblclick(d.props.origData || d.props, "", selected);
16935
+ context.vertex_dblclick(d.props.origData || d.props, "", selected, annoData);
16935
16936
  }
16936
16937
  context._prevDoClickTime = doClickTime;
16937
16938
  }
@@ -16940,6 +16941,22 @@ var Graph2 = /** @class */ (function (_super) {
16940
16941
  _this.zoomToFitLimit(1);
16941
16942
  return _this;
16942
16943
  }
16944
+ Graph2.prototype.resolveAnnoEventNode = function () {
16945
+ var _a, _b;
16946
+ var d3evt = d3Event();
16947
+ var eventPath = (_b = (_a = d3evt === null || d3evt === void 0 ? void 0 : d3evt.sourceEvent) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : d3evt === null || d3evt === void 0 ? void 0 : d3evt.path;
16948
+ var anno = eventPath.find(function (n) { return n === null || n === void 0 ? void 0 : n.hasAttribute("data-anno"); });
16949
+ var annoData;
16950
+ if (anno) {
16951
+ try {
16952
+ annoData = JSON.parse(anno.getAttribute("data-anno"));
16953
+ }
16954
+ catch (e) {
16955
+ console.warn("Unexpected annotation data:", anno);
16956
+ }
16957
+ }
16958
+ return annoData;
16959
+ };
16943
16960
  Graph2.prototype.iconBarButtons = function () {
16944
16961
  return this._iconBar.buttons();
16945
16962
  };
@@ -17398,7 +17415,8 @@ var Graph2 = /** @class */ (function (_super) {
17398
17415
  Utility.safeRaise(this);
17399
17416
  context.highlightVertex(select(this), d);
17400
17417
  var selected = d.element.classed("selected");
17401
- context.vertex_mousein(d.props.origData || d.props, "", selected);
17418
+ var annoData = context.resolveAnnoEventNode();
17419
+ context.vertex_mousein(d.props.origData || d.props, "", selected, annoData);
17402
17420
  })
17403
17421
  .on("mouseover", function (d) {
17404
17422
  Utility.safeRaise(this);
@@ -17417,12 +17435,14 @@ var Graph2 = /** @class */ (function (_super) {
17417
17435
  .visible(true)
17418
17436
  .render();
17419
17437
  }
17420
- context.vertex_mouseover(d.props.origData || d.props, "", selected);
17438
+ var annoData = context.resolveAnnoEventNode();
17439
+ context.vertex_mouseover(d.props.origData || d.props, "", selected, annoData);
17421
17440
  })
17422
17441
  .on("mouseout", function (d) {
17423
17442
  context.highlightVertex(null, null);
17424
17443
  var selected = d.element.classed("selected");
17425
- context.vertex_mouseout(d.props.origData || d.props, "", selected);
17444
+ var annoData = context.resolveAnnoEventNode();
17445
+ context.vertex_mouseout(d.props.origData || d.props, "", selected, annoData);
17426
17446
  if (d.props.tooltip) {
17427
17447
  context._tooltip.mouseout();
17428
17448
  }
@@ -17725,15 +17745,15 @@ var Graph2 = /** @class */ (function (_super) {
17725
17745
  };
17726
17746
  Graph2.prototype.subgraph_click = function (row, _col, sel) {
17727
17747
  };
17728
- Graph2.prototype.vertex_click = function (row, _col, sel) {
17748
+ Graph2.prototype.vertex_click = function (row, _col, sel, data) {
17729
17749
  };
17730
- Graph2.prototype.vertex_dblclick = function (row, _col, sel) {
17750
+ Graph2.prototype.vertex_dblclick = function (row, _col, sel, data) {
17731
17751
  };
17732
- Graph2.prototype.vertex_mousein = function (row, _col, sel) {
17752
+ Graph2.prototype.vertex_mousein = function (row, _col, sel, data) {
17733
17753
  };
17734
- Graph2.prototype.vertex_mouseover = function (row, _col, sel) {
17754
+ Graph2.prototype.vertex_mouseover = function (row, _col, sel, data) {
17735
17755
  };
17736
- Graph2.prototype.vertex_mouseout = function (row, _col, sel) {
17756
+ Graph2.prototype.vertex_mouseout = function (row, _col, sel, data) {
17737
17757
  };
17738
17758
  Graph2.prototype.edge_click = function (row, _col, sel) {
17739
17759
  };