@yanqirenshi/d3.deployment 0.7.0 → 0.8.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.
Files changed (2) hide show
  1. package/dist/js/Rectum.js +10 -1
  2. package/package.json +1 -1
package/dist/js/Rectum.js CHANGED
@@ -423,6 +423,12 @@ var Rectum = exports["default"] = /*#__PURE__*/function (_Colon) {
423
423
  /**
424
424
  * ノードのクリック通知(callbacks.node.click)。
425
425
  * d3.drag は移動を伴ったクリックを抑止するため、静止クリックだけが届く。
426
+ *
427
+ * コールバックには (core, node) を渡す。
428
+ * core: 入力データそのまま(ライブラリが解釈しないフィールドも落ちない)
429
+ * node: 正規化済みデータ(位置・サイズ等が必要な場合に使う)
430
+ *
431
+ * リンク(a.link-alt)のクリックはリンク側を優先し、コールバックは発火しない。
426
432
  */
427
433
  }, {
428
434
  key: "attachNodeClick",
@@ -430,8 +436,11 @@ var Rectum = exports["default"] = /*#__PURE__*/function (_Colon) {
430
436
  var callback = this._callbacks.node.click;
431
437
  if (!callback) return;
432
438
  place.selectAll('g.node, g.component').on('click', function (event, d) {
439
+ var target = event.target;
440
+ if (target && target.closest && target.closest('a.link-alt')) return; // リンク優先(既存の <a target="_blank"> と干渉しない)
441
+
433
442
  event.stopPropagation();
434
- callback(d);
443
+ callback(d._core, d);
435
444
  });
436
445
  }
437
446
  ///// ////////////////////////////////////////////////////////////////
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yanqirenshi/d3.deployment",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "See [Documents](https://yanqirenshi.github.io/D3.Deployment/)",
5
5
  "main": "dist/index.js",
6
6
  "directories": {