artisan-dagre-d3

0.6.4 • Public • Published

dagre-d3 - A D3-based renderer for dagre

Dagre is a JavaScript library that makes it easy to lay out directed graphs on the client-side. The dagre-d3 library acts as a front-end to dagre, providing actual rendering using D3.

For more details, including examples and configuration options, please see our wiki.

License

dagre-d3 is licensed under the terms of the MIT License. See the LICENSE file for details.

注意

本仓库是从dagre-d3仓库0.6.4版本的镜像,但是进行了部分修改,解决在画图在缩放时文字与框的缩放比不一致,导致的文字超出框的问题。

主要修改:lib/label/add-label.js

if (node.labelType === "svg") {
    addSVGLabel(labelSvg, node);
  } else if (typeof label !== "string" || node.labelType === "html") {
-    addHtmlLabel(labelSvg, node);
+    addTextLabel(labelSvg, node);
  } else {
    addTextLabel(labelSvg, node);
  }

把html类型的字符也使用Text标签进行渲染就没有缩放问题了。

/artisan-dagre-d3/

    Package Sidebar

    Install

    npm i artisan-dagre-d3

    Weekly Downloads

    1

    Version

    0.6.4

    License

    MIT

    Unpacked Size

    2.42 MB

    Total Files

    42

    Last publish

    Collaborators

    • cuipengpeng