@performant-software/visualize 3.1.0-beta.2 → 3.1.0-beta.3
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.cjs189.js +1 -1
- package/dist/index.cjs189.js.map +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs190.js.map +1 -1
- package/dist/index.cjs191.js +1 -1
- package/dist/index.cjs191.js.map +1 -1
- package/dist/index.cjs192.js +1 -2
- package/dist/index.cjs192.js.map +1 -1
- package/dist/index.cjs193.js +1 -1
- package/dist/index.cjs193.js.map +1 -1
- package/dist/index.cjs194.js +2 -1
- package/dist/index.cjs194.js.map +1 -1
- package/dist/index.cjs195.js +1 -1
- package/dist/index.cjs195.js.map +1 -1
- package/dist/index.cjs196.js +3 -1
- package/dist/index.cjs196.js.map +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -5
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs199.js +1 -1
- package/dist/index.cjs199.js.map +1 -1
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs200.js +1 -3
- package/dist/index.cjs200.js.map +1 -1
- package/dist/index.cjs201.js +1 -1
- package/dist/index.cjs201.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs203.js +5 -1
- package/dist/index.cjs203.js.map +1 -1
- package/dist/index.cjs204.js +1 -1
- package/dist/index.cjs204.js.map +1 -1
- package/dist/index.cjs218.js +1 -1
- package/dist/index.cjs219.js +1 -1
- package/dist/index.cjs220.js +1 -1
- package/dist/index.cjs238.js +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs245.js +1 -1
- package/dist/index.cjs250.js +1 -1
- package/dist/index.cjs250.js.map +1 -1
- package/dist/index.cjs251.js +1 -1
- package/dist/index.cjs251.js.map +1 -1
- package/dist/index.cjs252.js +1 -1
- package/dist/index.cjs252.js.map +1 -1
- package/dist/index.cjs253.js +1 -1
- package/dist/index.cjs253.js.map +1 -1
- package/dist/index.cjs254.js +1 -1
- package/dist/index.cjs254.js.map +1 -1
- package/dist/index.cjs255.js +2 -1
- package/dist/index.cjs255.js.map +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs256.js.map +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs257.js.map +1 -1
- package/dist/index.cjs258.js +1 -2
- package/dist/index.cjs258.js.map +1 -1
- package/dist/index.cjs259.js +1 -1
- package/dist/index.cjs261.js +1 -1
- package/dist/index.cjs268.js +1 -1
- package/dist/index.cjs268.js.map +1 -1
- package/dist/index.cjs269.js +1 -1
- package/dist/index.cjs269.js.map +1 -1
- package/dist/index.cjs270.js +1 -1
- package/dist/index.cjs270.js.map +1 -1
- package/dist/index.cjs271.js +1 -1
- package/dist/index.cjs271.js.map +1 -1
- package/dist/index.cjs272.js +1 -1
- package/dist/index.cjs272.js.map +1 -1
- package/dist/index.cjs273.js +1 -1
- package/dist/index.cjs273.js.map +1 -1
- package/dist/index.cjs274.js +1 -1
- package/dist/index.cjs274.js.map +1 -1
- package/dist/index.cjs275.js +1 -1
- package/dist/index.cjs275.js.map +1 -1
- package/dist/index.cjs276.js +1 -1
- package/dist/index.cjs276.js.map +1 -1
- package/dist/index.cjs277.js +1 -1
- package/dist/index.cjs277.js.map +1 -1
- package/dist/index.cjs278.js +1 -1
- package/dist/index.cjs278.js.map +1 -1
- package/dist/index.cjs279.js +1 -1
- package/dist/index.cjs279.js.map +1 -1
- package/dist/index.cjs280.js +1 -1
- package/dist/index.cjs280.js.map +1 -1
- package/dist/index.cjs281.js +1 -1
- package/dist/index.cjs281.js.map +1 -1
- package/dist/index.cjs282.js +1 -1
- package/dist/index.cjs282.js.map +1 -1
- package/dist/index.cjs283.js +1 -1
- package/dist/index.cjs283.js.map +1 -1
- package/dist/index.cjs284.js +1 -1
- package/dist/index.cjs284.js.map +1 -1
- package/dist/index.cjs285.js +1 -1
- package/dist/index.cjs285.js.map +1 -1
- package/dist/index.cjs286.js +1 -1
- package/dist/index.cjs286.js.map +1 -1
- package/dist/index.cjs287.js +1 -1
- package/dist/index.cjs287.js.map +1 -1
- package/dist/index.cjs288.js +1 -1
- package/dist/index.cjs288.js.map +1 -1
- package/dist/index.cjs289.js +1 -1
- package/dist/index.cjs289.js.map +1 -1
- package/dist/index.cjs290.js +1 -1
- package/dist/index.cjs290.js.map +1 -1
- package/dist/index.cjs291.js +1 -1
- package/dist/index.cjs291.js.map +1 -1
- package/dist/index.cjs292.js +1 -1
- package/dist/index.cjs293.js +1 -1
- package/dist/index.cjs295.js +1 -1
- package/dist/index.cjs296.js +1 -1
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs40.js +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs50.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs53.js +1 -1
- package/dist/index.cjs54.js +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs66.js.map +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs68.js.map +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs69.js.map +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs70.js.map +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs71.js.map +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs72.js.map +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs73.js.map +1 -1
- package/dist/index.cjs74.js +1 -1
- package/dist/index.cjs74.js.map +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs75.js.map +1 -1
- package/dist/index.cjs76.js +1 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.cjs82.js +1 -1
- package/dist/index.cjs82.js.map +1 -1
- package/dist/index.cjs83.js +1 -1
- package/dist/index.cjs83.js.map +1 -1
- package/dist/index.es189.js +33 -14
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +16 -2
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +14 -7
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +2 -327
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +7 -49
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +319 -50
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +48 -9
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +234 -9
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +989 -22
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +5 -39
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +58 -2
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es200.js +9 -234
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +9 -991
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +25 -5
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +39 -33
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +2 -16
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es218.js +1 -1
- package/dist/index.es219.js +1 -1
- package/dist/index.es220.js +1 -1
- package/dist/index.es238.js +1 -1
- package/dist/index.es244.js +1 -1
- package/dist/index.es245.js +1 -1
- package/dist/index.es250.js +6 -8
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +5 -11
- package/dist/index.es251.js.map +1 -1
- package/dist/index.es252.js +3 -12
- package/dist/index.es252.js.map +1 -1
- package/dist/index.es253.js +3 -6
- package/dist/index.es253.js.map +1 -1
- package/dist/index.es254.js +9 -5
- package/dist/index.es254.js.map +1 -1
- package/dist/index.es255.js +4 -3
- package/dist/index.es255.js.map +1 -1
- package/dist/index.es256.js +8 -3
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +10 -8
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es258.js +12 -4
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +4 -4
- package/dist/index.es261.js +1 -1
- package/dist/index.es268.js +6 -3
- package/dist/index.es268.js.map +1 -1
- package/dist/index.es269.js +2 -6
- package/dist/index.es269.js.map +1 -1
- package/dist/index.es270.js +2 -8
- package/dist/index.es270.js.map +1 -1
- package/dist/index.es271.js +3 -6
- package/dist/index.es271.js.map +1 -1
- package/dist/index.es272.js +8 -2
- package/dist/index.es272.js.map +1 -1
- package/dist/index.es273.js +12 -2
- package/dist/index.es273.js.map +1 -1
- package/dist/index.es274.js +68 -9
- package/dist/index.es274.js.map +1 -1
- package/dist/index.es275.js +17 -12
- package/dist/index.es275.js.map +1 -1
- package/dist/index.es276.js +6 -13
- package/dist/index.es276.js.map +1 -1
- package/dist/index.es277.js +2 -10
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +5 -12
- package/dist/index.es278.js.map +1 -1
- package/dist/index.es279.js +12 -67
- package/dist/index.es279.js.map +1 -1
- package/dist/index.es280.js +2 -18
- package/dist/index.es280.js.map +1 -1
- package/dist/index.es281.js +32 -6
- package/dist/index.es281.js.map +1 -1
- package/dist/index.es282.js +13 -2
- package/dist/index.es282.js.map +1 -1
- package/dist/index.es283.js +14 -5
- package/dist/index.es283.js.map +1 -1
- package/dist/index.es284.js +9 -12
- package/dist/index.es284.js.map +1 -1
- package/dist/index.es285.js +9 -2
- package/dist/index.es285.js.map +1 -1
- package/dist/index.es286.js +5 -32
- package/dist/index.es286.js.map +1 -1
- package/dist/index.es287.js +12 -9
- package/dist/index.es287.js.map +1 -1
- package/dist/index.es288.js +7 -19
- package/dist/index.es288.js.map +1 -1
- package/dist/index.es289.js +8 -10
- package/dist/index.es289.js.map +1 -1
- package/dist/index.es290.js +19 -12
- package/dist/index.es290.js.map +1 -1
- package/dist/index.es291.js +11 -7
- package/dist/index.es291.js.map +1 -1
- package/dist/index.es292.js +1 -1
- package/dist/index.es293.js +1 -1
- package/dist/index.es295.js +2 -2
- package/dist/index.es296.js +1 -1
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es34.js +4 -4
- package/dist/index.es35.js +2 -2
- package/dist/index.es36.js +5 -5
- package/dist/index.es39.js +1 -1
- package/dist/index.es40.js +1 -1
- package/dist/index.es41.js +1 -1
- package/dist/index.es42.js +1 -1
- package/dist/index.es43.js +1 -1
- package/dist/index.es44.js +1 -1
- package/dist/index.es45.js +1 -1
- package/dist/index.es46.js +1 -1
- package/dist/index.es47.js +1 -1
- package/dist/index.es48.js +1 -1
- package/dist/index.es49.js +1 -1
- package/dist/index.es50.js +1 -1
- package/dist/index.es51.js +2 -2
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es53.js +2 -2
- package/dist/index.es54.js +3 -3
- package/dist/index.es59.js +11 -10
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es63.js +19 -8
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +27 -4
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +5 -13
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +32 -5
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +93 -13
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +8 -9
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +4 -5
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es70.js +12 -9
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +5 -7
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +15 -5
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +9 -32
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +5 -94
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +10 -5
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +8 -5
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +5 -29
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +28 -39
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +38 -35
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es80.js +4 -22
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +36 -82
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +21 -18
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +76 -21
- package/dist/index.es83.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TreeGraph.js +1 -1
- package/src/hooks/Zoom.js +1 -1
- package/src/i18n/i18n.js +3 -3
- package/types/components/TreeGraph.js.flow +1 -1
- package/types/hooks/Zoom.js.flow +1 -1
- package/types/i18n/i18n.js.flow +3 -3
- package/build/index.js +0 -2
- package/build/index.js.map +0 -1
- package/build/main.css +0 -46
- package/index.js +0 -1
package/dist/index.es81.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es81.js","sources":["../../../node_modules/d3-hierarchy/src/tree.js"],"sourcesContent":["import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n"],"names":["defaultSeparation","a","b","nextLeft","v","children","nextRight","moveSubtree","wm","wp","shift","change","executeShifts","i","w","nextAncestor","vim","ancestor","TreeNode","node","Node","treeRoot","root","tree","nodes","child","n","d3tree","separation","dx","dy","nodeSize","t","firstWalk","secondWalk","sizeNode","left","right","bottom","s","tx","kx","ky","siblings","midpoint","apportion","vip","vop","vom","sip","sop","sim","som","x"],"mappings":";AAEA,SAASA,EAAkBC,GAAGC,GAAG;AAC/B,SAAOD,EAAE,WAAWC,EAAE,SAAS,IAAI;AACrC;AAUA,SAASC,EAASC,GAAG;AACnB,MAAIC,IAAWD,EAAE;AACjB,SAAOC,IAAWA,EAAS,CAAC,IAAID,EAAE;AACpC;AAGA,SAASE,EAAUF,GAAG;AACpB,MAAIC,IAAWD,EAAE;AACjB,SAAOC,IAAWA,EAASA,EAAS,SAAS,CAAC,IAAID,EAAE;AACtD;AAIA,SAASG,EAAYC,GAAIC,GAAIC,GAAO;AAClC,MAAIC,IAASD,KAASD,EAAG,IAAID,EAAG;AAChC,EAAAC,EAAG,KAAKE,GACRF,EAAG,KAAKC,GACRF,EAAG,KAAKG,GACRF,EAAG,KAAKC,GACRD,EAAG,KAAKC;AACV;AAKA,SAASE,EAAcR,GAAG;AAMxB,WALIM,IAAQ,GACRC,IAAS,GACTN,IAAWD,EAAE,UACbS,IAAIR,EAAS,QACbS,GACG,EAAED,KAAK;AACZ,IAAAC,IAAIT,EAASQ,CAAC,GACdC,EAAE,KAAKJ,GACPI,EAAE,KAAKJ,GACPA,KAASI,EAAE,KAAKH,KAAUG,EAAE;AAEhC;AAIA,SAASC,EAAaC,GAAKZ,GAAGa,GAAU;AACtC,SAAOD,EAAI,EAAE,WAAWZ,E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IC,CAAE;AAAA,EACzG,GAEAP,EAAK,WAAW,SAAS8B,GAAG;AAC1B,WAAO,UAAU,UAAUtB,IAAW,IAAMF,IAAK,CAACwB,EAAE,CAAC,GAAGvB,IAAK,CAACuB,EAAE,CAAC,GAAG9B,KAASQ,IAAW,CAACF,GAAIC,CAAE,IAAI;AAAA,EACrG,GAEOP;AACT;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es81.js","sources":["../../../node_modules/@visx/hierarchy/esm/HierarchyDefaultLink.js"],"sourcesContent":["import _pt from \"prop-types\";\nimport React from 'react';\nvar DEFAULT_LINK = {\n source: {\n x: 0,\n y: 0\n },\n target: {\n x: 0,\n y: 0\n }\n};\nexport default function HierarchyDefaultLink(_ref) {\n var _ref$link = _ref.link,\n link = _ref$link === void 0 ? DEFAULT_LINK : _ref$link;\n return /*#__PURE__*/React.createElement(\"line\", {\n x1: link.source.x,\n y1: link.source.y,\n x2: link.target.x,\n y2: link.target.y,\n strokeWidth: 2,\n stroke: \"#999\",\n strokeOpacity: 0.6\n });\n}\nHierarchyDefaultLink.propTypes = {\n link: _pt.shape({\n source: _pt.shape({\n x: _pt.number.isRequired,\n y: _pt.number.isRequired\n }).isRequired,\n target: _pt.shape({\n x: _pt.number.isRequired,\n y: _pt.number.isRequired\n }).isRequired\n })\n};"],"names":["DEFAULT_LINK","HierarchyDefaultLink","_ref","_ref$link","link","React","_pt"],"mappings":";;AAEA,IAAIA,IAAe;AAAA,EACjB,QAAQ;AAAA,IACN,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAAA,EAEL,QAAQ;AAAA,IACN,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAEP;AACA,SAAwBC,EAAqBC,GAAM;AACjD,MAAIC,IAAYD,EAAK,MACnBE,IAAOD,MAAc,SAASH,IAAeG;AAC/C,SAAoB,gBAAAE,EAAM,cAAc,QAAQ;AAAA,IAC9C,IAAID,EAAK,OAAO;AAAA,IAChB,IAAIA,EAAK,OAAO;AAAA,IAChB,IAAIA,EAAK,OAAO;AAAA,IAChB,IAAIA,EAAK,OAAO;AAAA,IAChB,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,eAAe;AAAA,EAAA,CAChB;AACH;AACAH,EAAqB,YAAY;AAAA,EAC/B,MAAMK,EAAI,MAAM;AAAA,IACd,QAAQA,EAAI,MAAM;AAAA,MAChB,GAAGA,EAAI,OAAO;AAAA,MACd,GAAGA,EAAI,OAAO;AAAA,IAAA,CACf,EAAE;AAAA,IACH,QAAQA,EAAI,MAAM;AAAA,MAChB,GAAGA,EAAI,OAAO;AAAA,MACd,GAAGA,EAAI,OAAO;AAAA,IAAA,CACf,EAAE;AAAA,EAAA,CACJ;AACH;","x_google_ignoreList":[0]}
|
package/dist/index.es82.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var m = r.getBoundingClientRect();
|
|
15
|
-
return new a({
|
|
16
|
-
x: t.x - m.left - r.clientLeft,
|
|
17
|
-
y: t.y - m.top - r.clientTop
|
|
1
|
+
import e from "./index.es65.js";
|
|
2
|
+
import n from "react";
|
|
3
|
+
function t(i) {
|
|
4
|
+
var o = i.node, r = o === void 0 ? {
|
|
5
|
+
x: 0,
|
|
6
|
+
y: 0,
|
|
7
|
+
r: 15
|
|
8
|
+
} : o;
|
|
9
|
+
return /* @__PURE__ */ n.createElement("circle", {
|
|
10
|
+
cx: r.x,
|
|
11
|
+
cy: r.y,
|
|
12
|
+
r: r.r || 15,
|
|
13
|
+
fill: "#21D4FD"
|
|
18
14
|
});
|
|
19
15
|
}
|
|
16
|
+
t.propTypes = {
|
|
17
|
+
node: e.shape({
|
|
18
|
+
x: e.number.isRequired,
|
|
19
|
+
y: e.number.isRequired,
|
|
20
|
+
r: e.number
|
|
21
|
+
})
|
|
22
|
+
};
|
|
20
23
|
export {
|
|
21
|
-
|
|
24
|
+
t as default
|
|
22
25
|
};
|
|
23
26
|
//# sourceMappingURL=index.es82.js.map
|
package/dist/index.es82.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es82.js","sources":["../../../node_modules/@visx/
|
|
1
|
+
{"version":3,"file":"index.es82.js","sources":["../../../node_modules/@visx/hierarchy/esm/HierarchyDefaultNode.js"],"sourcesContent":["import _pt from \"prop-types\";\nimport React from 'react';\nexport default function HierarchyDefaultNode(_ref) {\n var _ref$node = _ref.node,\n node = _ref$node === void 0 ? {\n x: 0,\n y: 0,\n r: 15\n } : _ref$node;\n return /*#__PURE__*/React.createElement(\"circle\", {\n cx: node.x,\n cy: node.y,\n r: node.r || 15,\n fill: \"#21D4FD\"\n });\n}\nHierarchyDefaultNode.propTypes = {\n node: _pt.shape({\n x: _pt.number.isRequired,\n y: _pt.number.isRequired,\n r: _pt.number\n })\n};"],"names":["HierarchyDefaultNode","_ref","_ref$node","node","React","_pt"],"mappings":";;AAEA,SAAwBA,EAAqBC,GAAM;AACjD,MAAIC,IAAYD,EAAK,MACnBE,IAAOD,MAAc,SAAS;AAAA,IAC5B,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EAAA,IACDA;AACN,SAAoB,gBAAAE,EAAM,cAAc,UAAU;AAAA,IAChD,IAAID,EAAK;AAAA,IACT,IAAIA,EAAK;AAAA,IACT,GAAGA,EAAK,KAAK;AAAA,IACb,MAAM;AAAA,EAAA,CACP;AACH;AACAH,EAAqB,YAAY;AAAA,EAC/B,MAAMK,EAAI,MAAM;AAAA,IACd,GAAGA,EAAI,OAAO;AAAA,IACd,GAAGA,EAAI,OAAO;AAAA,IACd,GAAGA,EAAI;AAAA,EAAA,CACR;AACH;","x_google_ignoreList":[0]}
|
package/dist/index.es83.js
CHANGED
|
@@ -1,31 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Node as k } from "./index.es37.js";
|
|
2
|
+
function o(r, n) {
|
|
3
|
+
return r.parent === n.parent ? 1 : 2;
|
|
3
4
|
}
|
|
4
|
-
function
|
|
5
|
-
|
|
5
|
+
function S(r) {
|
|
6
|
+
var n = r.children;
|
|
7
|
+
return n ? n[0] : r.t;
|
|
6
8
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
+
function B(r) {
|
|
10
|
+
var n = r.children;
|
|
11
|
+
return n ? n[n.length - 1] : r.t;
|
|
9
12
|
}
|
|
10
|
-
function r
|
|
11
|
-
|
|
13
|
+
function R(r, n, a) {
|
|
14
|
+
var i = a / (n.i - r.i);
|
|
15
|
+
n.c -= i, n.s += a, r.c += i, n.z += a, n.m += a;
|
|
12
16
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
17
|
+
function W(r) {
|
|
18
|
+
for (var n = 0, a = 0, i = r.children, u = i.length, z; --u >= 0; )
|
|
19
|
+
z = i[u], z.z += n, z.m += n, n += z.s + (a += z.c);
|
|
15
20
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
21
|
+
function b(r, n, a) {
|
|
22
|
+
return r.a.parent === n.parent ? r.a : a;
|
|
18
23
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
24
|
+
function A(r, n) {
|
|
25
|
+
this._ = r, this.parent = null, this.children = null, this.A = null, this.a = this, this.z = 0, this.m = 0, this.c = 0, this.s = 0, this.t = null, this.i = n;
|
|
26
|
+
}
|
|
27
|
+
A.prototype = Object.create(k.prototype);
|
|
28
|
+
function j(r) {
|
|
29
|
+
for (var n = new A(r, 0), a, i = [n], u, z, x, y; a = i.pop(); )
|
|
30
|
+
if (z = a._.children)
|
|
31
|
+
for (a.children = new Array(y = z.length), x = y - 1; x >= 0; --x)
|
|
32
|
+
i.push(u = a.children[x] = new A(z[x], x)), u.parent = a;
|
|
33
|
+
return (n.parent = new A(null, 0)).children = [n], n;
|
|
34
|
+
}
|
|
35
|
+
function L() {
|
|
36
|
+
var r = o, n = 1, a = 1, i = null;
|
|
37
|
+
function u(e) {
|
|
38
|
+
var f = j(e);
|
|
39
|
+
if (f.eachAfter(z), f.parent.m = -f.z, f.eachBefore(x), i) e.eachBefore(N);
|
|
40
|
+
else {
|
|
41
|
+
var d = e, t = e, c = e;
|
|
42
|
+
e.eachBefore(function(l) {
|
|
43
|
+
l.x < d.x && (d = l), l.x > t.x && (t = l), l.depth > c.depth && (c = l);
|
|
44
|
+
});
|
|
45
|
+
var h = d === t ? 1 : r(d, t) / 2, s = h - d.x, g = n / (t.x + h + s), _ = a / (c.depth || 1);
|
|
46
|
+
e.eachBefore(function(l) {
|
|
47
|
+
l.x = (l.x + s) * g, l.y = l.depth * _;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return e;
|
|
51
|
+
}
|
|
52
|
+
function z(e) {
|
|
53
|
+
var f = e.children, d = e.parent.children, t = e.i ? d[e.i - 1] : null;
|
|
54
|
+
if (f) {
|
|
55
|
+
W(e);
|
|
56
|
+
var c = (f[0].z + f[f.length - 1].z) / 2;
|
|
57
|
+
t ? (e.z = t.z + r(e._, t._), e.m = e.z - c) : e.z = c;
|
|
58
|
+
} else t && (e.z = t.z + r(e._, t._));
|
|
59
|
+
e.parent.A = y(e, t, e.parent.A || d[0]);
|
|
60
|
+
}
|
|
61
|
+
function x(e) {
|
|
62
|
+
e._.x = e.z + e.parent.m, e.m += e.parent.m;
|
|
63
|
+
}
|
|
64
|
+
function y(e, f, d) {
|
|
65
|
+
if (f) {
|
|
66
|
+
for (var t = e, c = e, h = f, s = t.parent.children[0], g = t.m, _ = c.m, l = h.m, w = s.m, p; h = B(h), t = S(t), h && t; )
|
|
67
|
+
s = S(s), c = B(c), c.a = e, p = h.z + l - t.z - g + r(h._, t._), p > 0 && (R(b(h, e, d), e, p), g += p, _ += p), l += h.m, g += t.m, w += s.m, _ += c.m;
|
|
68
|
+
h && !B(c) && (c.t = h, c.m += l - _), t && !S(s) && (s.t = t, s.m += g - w, d = e);
|
|
69
|
+
}
|
|
70
|
+
return d;
|
|
71
|
+
}
|
|
72
|
+
function N(e) {
|
|
73
|
+
e.x *= n, e.y = e.depth * a;
|
|
74
|
+
}
|
|
75
|
+
return u.separation = function(e) {
|
|
76
|
+
return arguments.length ? (r = e, u) : r;
|
|
77
|
+
}, u.size = function(e) {
|
|
78
|
+
return arguments.length ? (i = !1, n = +e[0], a = +e[1], u) : i ? null : [n, a];
|
|
79
|
+
}, u.nodeSize = function(e) {
|
|
80
|
+
return arguments.length ? (i = !0, n = +e[0], a = +e[1], u) : i ? [n, a] : null;
|
|
81
|
+
}, u;
|
|
21
82
|
}
|
|
22
83
|
export {
|
|
23
|
-
|
|
24
|
-
u as isEvent,
|
|
25
|
-
o as isMouseEvent,
|
|
26
|
-
i as isSVGElement,
|
|
27
|
-
r as isSVGGraphicsElement,
|
|
28
|
-
e as isSVGSVGElement,
|
|
29
|
-
c as isTouchEvent
|
|
84
|
+
L as default
|
|
30
85
|
};
|
|
31
86
|
//# sourceMappingURL=index.es83.js.map
|
package/dist/index.es83.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es83.js","sources":["../../../node_modules/@visx/event/esm/typeGuards.js"],"sourcesContent":["export function isElement(elem) {\n return !!elem && elem instanceof Element;\n}\n\n// functional definition of isSVGElement. Note that SVGSVGElements are HTMLElements\nexport function isSVGElement(elem) {\n return !!elem && (elem instanceof SVGElement || 'ownerSVGElement' in elem);\n}\n\n// functional definition of SVGGElement\nexport function isSVGSVGElement(elem) {\n return !!elem && 'createSVGPoint' in elem;\n}\nexport function isSVGGraphicsElement(elem) {\n return !!elem && 'getScreenCTM' in elem;\n}\n\n// functional definition of TouchEvent\nexport function isTouchEvent(event) {\n return !!event && 'changedTouches' in event;\n}\n\n// functional definition of MouseEvent\nexport function isMouseEvent(event) {\n return !!event && 'clientX' in event;\n}\n\n// functional definition of event\nexport function isEvent(event) {\n return !!event && (event instanceof Event || 'nativeEvent' in event && event.nativeEvent instanceof Event);\n}"],"names":["isElement","elem","isSVGElement","isSVGSVGElement","isSVGGraphicsElement","isTouchEvent","event","isMouseEvent","isEvent"],"mappings":"AAAO,SAASA,EAAUC,GAAM;AAC9B,SAAO,CAAC,CAACA,KAAQA,aAAgB;AACnC;AAGO,SAASC,EAAaD,GAAM;AACjC,SAAO,CAAC,CAACA,MAASA,aAAgB,cAAc,qBAAqBA;AACvE;AAGO,SAASE,EAAgBF,GAAM;AACpC,SAAO,CAAC,CAACA,KAAQ,oBAAoBA;AACvC;AACO,SAASG,EAAqBH,GAAM;AACzC,SAAO,CAAC,CAACA,KAAQ,kBAAkBA;AACrC;AAGO,SAASI,EAAaC,GAAO;AAClC,SAAO,CAAC,CAACA,KAAS,oBAAoBA;AACxC;AAGO,SAASC,EAAaD,GAAO;AAClC,SAAO,CAAC,CAACA,KAAS,aAAaA;AACjC;AAGO,SAASE,EAAQF,GAAO;AAC7B,SAAO,CAAC,CAACA,MAAUA,aAAiB,SAAS,iBAAiBA,KAASA,EAAM,uBAAuB;AACtG;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es83.js","sources":["../../../node_modules/d3-hierarchy/src/tree.js"],"sourcesContent":["import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n"],"names":["defaultSeparation","a","b","nextLeft","v","children","nextRight","moveSubtree","wm","wp","shift","change","executeShifts","i","w","nextAncestor","vim","ancestor","TreeNode","node","Node","treeRoot","root","tree","nodes","child","n","d3tree","separation","dx","dy","nodeSize","t","firstWalk","secondWalk","sizeNode","left","right","bottom","s","tx","kx","ky","siblings","midpoint","apportion","vip","vop","vom","sip","sop","sim","som","x"],"mappings":";AAEA,SAASA,EAAkBC,GAAGC,GAAG;AAC/B,SAAOD,EAAE,WAAWC,EAAE,SAAS,IAAI;AACrC;AAUA,SAASC,EAASC,GAAG;AACnB,MAAIC,IAAWD,EAAE;AACjB,SAAOC,IAAWA,EAAS,CAAC,IAAID,EAAE;AACpC;AAGA,SAASE,EAAUF,GAAG;AACpB,MAAIC,IAAWD,EAAE;AACjB,SAAOC,IAAWA,EAASA,EAAS,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AI/B,GACR+B,EAAI,KAAKI,IAAMD,IAEbJ,KAAO,CAAC3C,EAAS6C,CAAG,MACtBA,EAAI,IAAIF,GACRE,EAAI,KAAKC,IAAMG,GACfnC,IAAWb;AAAA,IAEf;AACA,WAAOa;AAAA,EACT;AAEA,WAASkB,EAAShB,GAAM;AACtB,IAAAA,EAAK,KAAKU,GACVV,EAAK,IAAIA,EAAK,QAAQW;AAAA,EACxB;AAEA,SAAAP,EAAK,aAAa,SAAS8B,GAAG;AAC5B,WAAO,UAAU,UAAUzB,IAAayB,GAAG9B,KAAQK;AAAA,EACrD,GAEAL,EAAK,OAAO,SAAS8B,GAAG;AACtB,WAAO,UAAU,UAAUtB,IAAW,IAAOF,IAAK,CAACwB,EAAE,CAAC,GAAGvB,IAAK,CAACuB,EAAE,CAAC,GAAG9B,KAASQ,IAAW,OAAO,CAACF,GAAIC,CAAE;AAAA,EACzG,GAEAP,EAAK,WAAW,SAAS8B,GAAG;AAC1B,WAAO,UAAU,UAAUtB,IAAW,IAAMF,IAAK,CAACwB,EAAE,CAAC,GAAGvB,IAAK,CAACuB,EAAE,CAAC,GAAG9B,KAASQ,IAAW,CAACF,GAAIC,CAAE,IAAI;AAAA,EACrG,GAEOP;AACT;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -170,7 +170,7 @@ const TreeGraph = (props: Props) => {
|
|
|
170
170
|
if (props.layout === Layout.polar) {
|
|
171
171
|
origin = {
|
|
172
172
|
x: innerWidth / 2,
|
|
173
|
-
y: innerHeight / 2
|
|
173
|
+
y: innerHeight / 2
|
|
174
174
|
};
|
|
175
175
|
sizeWidth = 2 * Math.PI;
|
|
176
176
|
sizeHeight = (Math.min(innerWidth, innerHeight) / 2) * (depth / 2);
|
package/src/hooks/Zoom.js
CHANGED
package/src/i18n/i18n.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createInstance } from 'i18next';
|
|
2
2
|
|
|
3
3
|
import en from './en.json';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ const resources = {
|
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const i18n =
|
|
11
|
+
const i18n = createInstance();
|
|
12
12
|
|
|
13
13
|
i18n
|
|
14
14
|
.init({
|
|
@@ -16,7 +16,7 @@ i18n
|
|
|
16
16
|
fallbackLng: 'en',
|
|
17
17
|
lng: 'en',
|
|
18
18
|
interpolation: {
|
|
19
|
-
escapeValue: false
|
|
19
|
+
escapeValue: false
|
|
20
20
|
},
|
|
21
21
|
resources
|
|
22
22
|
});
|
|
@@ -170,7 +170,7 @@ const TreeGraph = (props: Props) => {
|
|
|
170
170
|
if (props.layout === Layout.polar) {
|
|
171
171
|
origin = {
|
|
172
172
|
x: innerWidth / 2,
|
|
173
|
-
y: innerHeight / 2
|
|
173
|
+
y: innerHeight / 2
|
|
174
174
|
};
|
|
175
175
|
sizeWidth = 2 * Math.PI;
|
|
176
176
|
sizeHeight = (Math.min(innerWidth, innerHeight) / 2) * (depth / 2);
|
package/types/hooks/Zoom.js.flow
CHANGED
package/types/i18n/i18n.js.flow
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createInstance } from 'i18next';
|
|
2
2
|
|
|
3
3
|
import en from './en.json';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ const resources = {
|
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const i18n =
|
|
11
|
+
const i18n = createInstance();
|
|
12
12
|
|
|
13
13
|
i18n
|
|
14
14
|
.init({
|
|
@@ -16,7 +16,7 @@ i18n
|
|
|
16
16
|
fallbackLng: 'en',
|
|
17
17
|
lng: 'en',
|
|
18
18
|
interpolation: {
|
|
19
|
-
escapeValue: false
|
|
19
|
+
escapeValue: false
|
|
20
20
|
},
|
|
21
21
|
resources
|
|
22
22
|
});
|
package/build/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{TreeGraph:()=>L,withZoom:()=>k});const n=require("@visx/group"),r=require("@visx/hierarchy"),o=require("@visx/responsive"),a=require("@visx/shape"),i=require("d3-shape"),l=require("react");var c=e.n(l);const u=require("underscore");var s=e.n(u);const d=require("@visx/event"),f=require("@visx/zoom"),p=require("i18next");var m=e.n(p),y={en:{translation:JSON.parse('{"Zoom":{"buttons":{"center":"Center","clear":"Clear","reset":"Reset","zoomIn":"+","zoomOut":"-"}}}')}},b=m().createInstance();b.init({debug:!0,fallbackLng:"en",lng:"en",interpolation:{escapeValue:!1},resources:y});const g=b;function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}var v={scaleX:1,scaleY:1,translateX:0,translateY:0,skewX:0,skewY:0};const k=function(e){return function(t){var n=t.parentWidth,r=t.parentHeight,o=t.scaleXMin,a=void 0===o?.5:o,i=t.scaleXMax,u=void 0===i?4:i,s=t.scaleYMin,p=void 0===s?.5:s,m=t.scaleYMax,y=void 0===m?4:m,b=t.initialTransform,k=void 0===b?v:b,E=(0,l.useCallback)((function(e){return c().createElement("rect",{width:n,height:r,rx:14,fill:"transparent",onTouchStart:e.dragStart,onTouchMove:e.dragMove,onTouchEnd:e.dragEnd,onMouseDown:e.dragStart,onMouseMove:e.dragMove,onMouseUp:e.dragEnd,onMouseLeave:function(){e.isDragging&&e.dragEnd()},onDoubleClick:function(t){var n=(0,d.localPoint)(t)||{x:0,y:0};e.scale({scaleX:1.1,scaleY:1.1,point:n})}})}),[n,r]);return c().createElement(f.Zoom,{width:n,height:r,scaleXMin:a,scaleXMax:u,scaleYMin:p,scaleYMax:y,initialTransformMatrix:k},(function(n){return c().createElement("div",{className:"zoom"},c().createElement(e,h({},t,{renderZoomContainer:E.bind(void 0,n),zoom:n})),c().createElement("div",{className:"controls"},c().createElement("button",{type:"button",className:"btn btn-zoom",onClick:function(){return n.scale({scaleX:1.2,scaleY:1.2})}},g.t("Zoom.buttons.zoomIn")),c().createElement("button",{type:"button",className:"btn btn-zoom btn-bottom",onClick:function(){return n.scale({scaleX:.8,scaleY:.8})}},g.t("Zoom.buttons.zoomOut")),c().createElement("button",{type:"button",className:"btn btn-lg",onClick:n.center},g.t("Zoom.buttons.center")),c().createElement("button",{type:"button",className:"btn btn-lg",onClick:n.reset},g.t("Zoom.buttons.reset")),c().createElement("button",{type:"button",className:"btn btn-lg",onClick:n.clear},g.t("Zoom.buttons.clear"))))}))}};function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x="polar",M="curve",T="line",C="step",z="vertical",S=function(e){var t=(0,l.useRef)(),o=e.parentWidth-e.margin.left-e.margin.right,u=e.parentHeight-e.margin.top-e.margin.bottom,d=(0,l.useMemo)((function(){return e.layout===x?e.linkType===C?a.LinkRadialStep:e.linkType===M?a.LinkRadialCurve:e.linkType===T?a.LinkRadialLine:a.LinkRadial:e.orientation===z?e.linkType===C?a.LinkVerticalStep:e.linkType===M?a.LinkVerticalCurve:e.linkType===T?a.LinkVerticalLine:a.LinkVertical:e.linkType===C?a.LinkHorizontalStep:e.linkType===M?a.LinkHorizontalCurve:e.linkType===T?a.LinkHorizontalLine:a.LinkHorizontal}),[e.layout,e.linkType,e.orientation]),f=(0,l.useCallback)((function(e,t){var n=t;return e.isExpanded&&(n=s().max(s().map(e.children,(function(e){return f(e,t+1)})))),n}),[]),p=(0,l.useCallback)((function(t,n){var r,o,a,l;if(e.layout===x){var c=(a=(0,i.pointRadial)(t,n),l=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}}(a,l)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(a,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=c[0];r=c[1],o=u}else e.orientation===z?(r=n,o=t):(r=t,o=n);return{top:r,left:o}}),[e.layout,e.orientation]),m=(0,l.useMemo)((function(){var t,n,r,a=f(e.data,1);return e.layout===x?(r={x:o/2,y:u/2},t=2*Math.PI,n=Math.min(o,u)/2*(a/2)):(r={x:0,y:0},e.orientation===z?(t=o,n=u):(t=u,n=o)),{sizeWidth:t,sizeHeight:n,origin:r}}),[f,u,o,e.data,e.layout,e.orientation]),y=(0,l.useCallback)((function(t){return c().createElement("foreignObject",null,e.renderNode(t.data))}),[e.renderNode]),b=(0,l.useCallback)((function(e,t){var r=p(e.x,e.y),o=r.top,a=r.left;return c().createElement(n.Group,{nodeleft:a,nodetop:o,top:o,left:a,key:t},y(e))}),[y,e.layout,e.orientation,e.linkType]);return(0,l.useEffect)((function(){var e=t.current;if(e){var n=e.getElementsByTagName("g");s().each(n,(function(e){var t=s().first(e.getElementsByTagName("foreignObject"));if(t&&t.firstChild){var n=t.firstChild,r=n.offsetWidth,o=n.offsetHeight;t.setAttribute("width",r),t.setAttribute("height",o);var a=parseFloat(e.getAttribute("nodeleft")),i=parseFloat(e.getAttribute("nodetop"));if(!s().isNaN(a)&&!s().isNaN(i)){var l="translate(".concat(a-r/2,", ").concat(i-o/2,")");e.setAttribute("transform",l)}}}))}}),[e.data,e.layout,e.orientation,e.linkType]),c().createElement("div",{className:"tree-graph",style:{display:"flex",flexGrow:"1"}},c().createElement("svg",{width:e.parentWidth,height:e.parentHeight-e.offset,ref:e.zoom.containerRef},e.renderZoomContainer(),c().createElement(n.Group,{top:e.margin.top,left:e.margin.left,transform:e.zoom.toString()},c().createElement(r.Tree,{root:(0,r.hierarchy)(e.data,(function(e){return e.isExpanded?e.children:null})),size:[m.sizeWidth,m.sizeHeight],separation:function(e,t){return(e.parent===t.parent?1:2)/e.depth}},(function(r){return c().createElement(n.Group,{innerRef:t,left:m.origin.x,top:m.origin.y},r.links().map((function(t,n){return c().createElement(d,{key:n,data:t,percent:e.stepPercent,stroke:e.linkColor,strokeWidth:e.linkWidth,fill:"none"})})),s().map(r.descendants(),b))})))))};S.defaultProps={layout:"cartesian",linkColor:"#B2B09B",linkType:T,linkWidth:1,margin:{top:30,left:30,right:30,bottom:70},offset:0,orientation:"horizontal",stepPercent:.5};const L=(0,o.withParentSize)(k(S));module.exports=t})();
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"mBACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EA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KAAK,IAE7D,SAACiD,GAAI,OACL,kBAAC,EAAA9B,MAAK,CACJ+B,SAAU9E,EACVI,KAAMiC,EAAKG,OAAOxD,EAClBuB,IAAK8B,EAAKG,OAAOvD,GAEf4F,EAAKE,QAAQC,KAAI,SAACC,EAAMC,GAAC,OACzB,kBAACzE,EAAa,CACZzF,IAAKkK,EACLzC,KAAMwC,EACNE,QAASjI,EAAMkI,YACfC,OAAQnI,EAAMoI,UACdC,YAAarI,EAAMsI,UACnBxH,KAAK,QACL,IAEF+D,IAAAA,IAAM8C,EAAKY,cAAe3C,GACtB,MAOtB,EAEA/C,EAAU2F,aAAe,CACvB/E,OAzPW,YA0PX2E,UAAW,UACX1E,SAAUf,EACV2F,UAAW,EACXrF,OAAQ,CACNI,IAAK,GACLH,KAAM,GACNC,MAAO,GACPG,OAAQ,IAEV4D,OAAQ,EACRnD,YAzPY,aA0PZmE,YAAa,IAIf,SAD+CO,EAAAA,EAAAA,gBAAeC,EAAS7F,I","sources":["webpack://@performant-software/visualize/webpack/bootstrap","webpack://@performant-software/visualize/webpack/runtime/compat get default export","webpack://@performant-software/visualize/webpack/runtime/define property getters","webpack://@performant-software/visualize/webpack/runtime/hasOwnProperty shorthand","webpack://@performant-software/visualize/webpack/runtime/make namespace object","webpack://@performant-software/visualize/external commonjs \"@visx/group\"","webpack://@performant-software/visualize/external commonjs \"@visx/hierarchy\"","webpack://@performant-software/visualize/external commonjs \"@visx/responsive\"","webpack://@performant-software/visualize/external commonjs \"@visx/shape\"","webpack://@performant-software/visualize/external commonjs \"d3-shape\"","webpack://@performant-software/visualize/external commonjs2 \"react\"","webpack://@performant-software/visualize/external commonjs \"underscore\"","webpack://@performant-software/visualize/external commonjs \"@visx/event\"","webpack://@performant-software/visualize/external commonjs \"@visx/zoom\"","webpack://@performant-software/visualize/external commonjs \"i18next\"","webpack://@performant-software/visualize/./src/i18n/i18n.js","webpack://@performant-software/visualize/./src/hooks/Zoom.js","webpack://@performant-software/visualize/./src/components/TreeGraph.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/hierarchy\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/responsive\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"d3-shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"underscore\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/zoom\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18next\");","import i18next from 'i18next';\n\nimport en from './en.json';\n\nconst resources = {\n en: {\n translation: en\n }\n};\n\nconst i18n = i18next.createInstance();\n\ni18n\n .init({\n debug: true,\n fallbackLng: 'en',\n lng: 'en',\n interpolation: {\n escapeValue: false,\n },\n resources\n });\n\nexport default i18n;\n","// @flow\n\nimport React, { useCallback, type ComponentType, type Element } from 'react';\nimport { localPoint } from '@visx/event';\nimport { Zoom } from '@visx/zoom';\nimport i18n from '../i18n/i18n';\nimport './Zoom.css';\n\ntype Props = {\n initialTransform?: {\n skewX: number,\n skewY: number,\n scaleX: number,\n scaleY: number,\n translateX: number,\n translateY: number\n },\n parentHeight: number,\n parentWidth: number,\n scaleXMax?: number,\n scaleXMin?: number,\n scaleYMax?: number,\n scaleYMin?: number\n};\n\ntype WithZoomType = (WrappedComponent: ComponentType<any>) => (props: Props) => Element<any>;\n\nconst DEFAULT_INITIAL_TRANSFORM = {\n scaleX: 1,\n scaleY: 1,\n translateX: 0,\n translateY: 0,\n skewX: 0,\n skewY: 0,\n};\n\nconst withZoom: WithZoomType = (WrappedComponent: ComponentType<any>) => (props: Props) => {\n const { parentWidth: width, parentHeight: height } = props;\n const { scaleXMin = 1 / 2, scaleXMax = 4 } = props;\n const { scaleYMin = 1 / 2, scaleYMax = 4 } = props;\n const { initialTransform = DEFAULT_INITIAL_TRANSFORM } = props;\n\n /**\n * Renders the container with zoom controls.\n *\n * @type {unknown}\n */\n const renderZoomContainer = useCallback((zoom) => (\n <rect\n width={width}\n height={height}\n rx={14}\n fill='transparent'\n onTouchStart={zoom.dragStart}\n onTouchMove={zoom.dragMove}\n onTouchEnd={zoom.dragEnd}\n onMouseDown={zoom.dragStart}\n onMouseMove={zoom.dragMove}\n onMouseUp={zoom.dragEnd}\n onMouseLeave={() => {\n if (zoom.isDragging) zoom.dragEnd();\n }}\n onDoubleClick={(event) => {\n const point = localPoint(event) || { x: 0, y: 0 };\n zoom.scale({ scaleX: 1.1, scaleY: 1.1, point });\n }}\n />\n ), [width, height]);\n\n return (\n <Zoom\n width={width}\n height={height}\n scaleXMin={scaleXMin}\n scaleXMax={scaleXMax}\n scaleYMin={scaleYMin}\n scaleYMax={scaleYMax}\n initialTransformMatrix={initialTransform}\n >\n { (zoom) => (\n <div\n className='zoom'\n >\n <WrappedComponent\n {...props}\n renderZoomContainer={renderZoomContainer.bind(this, zoom)}\n zoom={zoom}\n />\n <div\n className='controls'\n >\n <button\n type='button'\n className='btn btn-zoom'\n onClick={() => zoom.scale({ scaleX: 1.2, scaleY: 1.2 })}\n >\n { i18n.t('Zoom.buttons.zoomIn') }\n </button>\n <button\n type='button'\n className='btn btn-zoom btn-bottom'\n onClick={() => zoom.scale({ scaleX: 0.8, scaleY: 0.8 })}\n >\n { i18n.t('Zoom.buttons.zoomOut') }\n </button>\n <button\n type='button'\n className='btn btn-lg'\n onClick={zoom.center}\n >\n { i18n.t('Zoom.buttons.center') }\n </button>\n <button\n type='button'\n className='btn btn-lg'\n onClick={zoom.reset}\n >\n { i18n.t('Zoom.buttons.reset') }\n </button>\n <button\n type='button'\n className='btn btn-lg'\n onClick={zoom.clear}\n >\n { i18n.t('Zoom.buttons.clear') }\n </button>\n </div>\n </div>\n )}\n </Zoom>\n );\n};\n\nexport default withZoom;\n\nexport type ZoomProps = {\n renderZoomContainer: () => Element<any>,\n zoom: typeof Zoom\n};\n","// @flow\n\nimport { Group } from '@visx/group';\nimport { hierarchy, Tree } from '@visx/hierarchy';\nimport { withParentSize } from '@visx/responsive';\nimport {\n LinkHorizontal,\n LinkHorizontalCurve,\n LinkHorizontalLine,\n LinkHorizontalStep,\n LinkRadial,\n LinkRadialCurve,\n LinkRadialLine,\n LinkRadialStep,\n LinkVertical,\n LinkVerticalCurve,\n LinkVerticalLine,\n LinkVerticalStep\n} from '@visx/shape';\nimport { pointRadial } from 'd3-shape';\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n type ComponentType,\n type Element\n} from 'react';\nimport _ from 'underscore';\nimport withZoom, { type ZoomProps } from '../hooks/Zoom';\nimport './TreeGraph.css';\n\ntype Props = ZoomProps & {\n data: any,\n layout: string,\n linkType: string,\n offset: number,\n orientation: string,\n parentHeight: number,\n parentWidth: number,\n linkColor: string,\n linkWidth: number,\n margin: {\n top: number,\n right: number,\n bottom: number,\n left: number\n },\n renderNode?: (data: any) => Element<any>,\n stepPercent: number\n};\n\nconst Layout = {\n cartesian: 'cartesian',\n polar: 'polar'\n};\n\nconst LinkType = {\n curve: 'curve',\n line: 'line',\n step: 'step'\n};\n\nconst Orientation = {\n horizontal: 'horizontal',\n vertical: 'vertical'\n};\n\nconst TreeGraph = (props: Props) => {\n const ref = useRef();\n\n const innerWidth = props.parentWidth - props.margin.left - props.margin.right;\n const innerHeight = props.parentHeight - props.margin.top - props.margin.bottom;\n\n /**\n * Sets the link component based on the layout, linkType, and orientation props.\n *\n * @type {*}\n */\n const LinkComponent = useMemo(() => {\n let value;\n\n if (props.layout === Layout.polar) {\n if (props.linkType === LinkType.step) {\n value = LinkRadialStep;\n } else if (props.linkType === LinkType.curve) {\n value = LinkRadialCurve;\n } else if (props.linkType === LinkType.line) {\n value = LinkRadialLine;\n } else {\n value = LinkRadial;\n }\n } else if (props.orientation === Orientation.vertical) {\n if (props.linkType === LinkType.step) {\n value = LinkVerticalStep;\n } else if (props.linkType === LinkType.curve) {\n value = LinkVerticalCurve;\n } else if (props.linkType === LinkType.line) {\n value = LinkVerticalLine;\n } else {\n value = LinkVertical;\n }\n } else if (props.linkType === LinkType.step) {\n value = LinkHorizontalStep;\n } else if (props.linkType === LinkType.curve) {\n value = LinkHorizontalCurve;\n } else if (props.linkType === LinkType.line) {\n value = LinkHorizontalLine;\n } else {\n value = LinkHorizontal;\n }\n\n return value;\n }, [props.layout, props.linkType, props.orientation]);\n\n /**\n * Returns the depth of the last expanded node.\n *\n * @type {function(*, *): *}\n */\n const getMaxDepth = useCallback((node, depth) => {\n let max = depth;\n\n if (node.isExpanded) {\n max = _.max(_.map(node.children, (child) => getMaxDepth(child, depth + 1)));\n }\n\n return max;\n }, []);\n\n /**\n * Returns the node position for the passed coordinates.\n *\n * @type {function(*, *): {top: *, left: *}}\n */\n const getNodePosition = useCallback((x, y) => {\n let top;\n let left;\n\n if (props.layout === Layout.polar) {\n const [radialX, radialY] = pointRadial(x, y);\n top = radialY;\n left = radialX;\n } else if (props.orientation === Orientation.vertical) {\n top = y;\n left = x;\n } else {\n top = x;\n left = y;\n }\n\n return {\n top,\n left\n };\n }, [props.layout, props.orientation]);\n\n /**\n * Returns the position and size of the root node.\n *\n * @type {{sizeWidth: *, origin: *, sizeHeight: *}}\n */\n const root = useMemo(() => {\n let sizeWidth;\n let sizeHeight;\n let origin;\n\n const depth = getMaxDepth(props.data, 1);\n\n if (props.layout === Layout.polar) {\n origin = {\n x: innerWidth / 2,\n y: innerHeight / 2,\n };\n sizeWidth = 2 * Math.PI;\n sizeHeight = (Math.min(innerWidth, innerHeight) / 2) * (depth / 2);\n } else {\n origin = { x: 0, y: 0 };\n if (props.orientation === Orientation.vertical) {\n sizeWidth = innerWidth;\n sizeHeight = innerHeight;\n } else {\n sizeWidth = innerHeight;\n sizeHeight = innerWidth;\n }\n }\n\n return {\n sizeWidth,\n sizeHeight,\n origin\n };\n }, [getMaxDepth, innerHeight, innerWidth, props.data, props.layout, props.orientation]);\n\n const renderNode = useCallback((node) => (\n <foreignObject>\n { props.renderNode(node.data) }\n </foreignObject>\n ), [props.renderNode]);\n\n /**\n * Renders the group element for the passed node.\n *\n * @type {unknown}\n */\n const renderGroup = useCallback((node, key) => {\n const { top, left } = getNodePosition(node.x, node.y);\n\n return (\n <Group\n nodeleft={left}\n nodetop={top}\n top={top}\n left={left}\n key={key}\n >\n { renderNode(node) }\n </Group>\n );\n }, [renderNode, props.layout, props.orientation, props.linkType]);\n\n /**\n * Resizes the \"circle\" and \"rect\" elements based on the text contained in the group. This effect will also\n * convert text into multiple lines.\n */\n useEffect(() => {\n const { current } = ref;\n if (current) {\n const groups = current.getElementsByTagName('g');\n _.each(groups, (group) => {\n const object = _.first(group.getElementsByTagName('foreignObject'));\n if (object && object.firstChild) {\n const { offsetWidth: width, offsetHeight: height } = object.firstChild;\n\n // Set the width and height of the foreignObject element\n object.setAttribute('width', width);\n object.setAttribute('height', height);\n\n // Transform the position of the group element based on the width and height of the contents\n const leftPosition = parseFloat(group.getAttribute('nodeleft'));\n const topPosition = parseFloat(group.getAttribute('nodetop'));\n\n if (!_.isNaN(leftPosition) && !_.isNaN(topPosition)) {\n const transform = `translate(${leftPosition - (width / 2.0)}, ${topPosition - (height / 2.0)})`;\n group.setAttribute('transform', transform);\n }\n }\n });\n }\n }, [props.data, props.layout, props.orientation, props.linkType]);\n\n return (\n <div\n className='tree-graph'\n style={{\n display: 'flex',\n flexGrow: '1'\n }}\n >\n <svg\n width={props.parentWidth}\n height={props.parentHeight - props.offset}\n ref={props.zoom.containerRef}\n >\n { props.renderZoomContainer() }\n <Group\n top={props.margin.top}\n left={props.margin.left}\n transform={props.zoom.toString()}\n >\n <Tree\n root={hierarchy(props.data, (d) => (d.isExpanded ? d.children : null))}\n size={[root.sizeWidth, root.sizeHeight]}\n separation={(a, b) => (a.parent === b.parent ? 1 : 2) / a.depth}\n >\n { (tree) => (\n <Group\n innerRef={ref}\n left={root.origin.x}\n top={root.origin.y}\n >\n { tree.links().map((link, i) => (\n <LinkComponent\n key={i}\n data={link}\n percent={props.stepPercent}\n stroke={props.linkColor}\n strokeWidth={props.linkWidth}\n fill='none'\n />\n ))}\n { _.map(tree.descendants(), renderGroup) }\n </Group>\n )}\n </Tree>\n </Group>\n </svg>\n </div>\n );\n};\n\nTreeGraph.defaultProps = {\n layout: Layout.cartesian,\n linkColor: '#B2B09B',\n linkType: LinkType.line,\n linkWidth: 1,\n margin: {\n top: 30,\n left: 30,\n right: 30,\n bottom: 70\n },\n offset: 0,\n orientation: Orientation.horizontal,\n stepPercent: 0.5\n};\n\nconst TreeGraphComponent: ComponentType<any> = withParentSize(withZoom(TreeGraph));\nexport default TreeGraphComponent;\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","resources","en","translation","i18n","i18next","init","debug","fallbackLng","lng","interpolation","escapeValue","DEFAULT_INITIAL_TRANSFORM","scaleX","scaleY","translateX","translateY","skewX","skewY","WrappedComponent","props","width","parentWidth","height","parentHeight","scaleXMin","scaleXMax","scaleYMin","scaleYMax","initialTransform","renderZoomContainer","useCallback","zoom","rx","fill","onTouchStart","dragStart","onTouchMove","dragMove","onTouchEnd","dragEnd","onMouseDown","onMouseMove","onMouseUp","onMouseLeave","isDragging","onDoubleClick","event","point","localPoint","x","y","scale","Zoom","initialTransformMatrix","className","bind","type","onClick","center","reset","clear","Layout","LinkType","Orientation","TreeGraph","ref","useRef","innerWidth","margin","left","right","innerHeight","top","bottom","LinkComponent","useMemo","layout","linkType","LinkRadialStep","LinkRadialCurve","LinkRadialLine","LinkRadial","orientation","LinkVerticalStep","LinkVerticalCurve","LinkVerticalLine","LinkVertical","LinkHorizontalStep","LinkHorizontalCurve","LinkHorizontalLine","LinkHorizontal","getMaxDepth","node","depth","max","isExpanded","_","children","child","getNodePosition","pointRadial","radialX","root","sizeWidth","sizeHeight","origin","data","Math","PI","min","renderNode","renderGroup","Group","nodeleft","nodetop","useEffect","current","groups","getElementsByTagName","group","object","firstChild","offsetWidth","offsetHeight","setAttribute","leftPosition","parseFloat","getAttribute","topPosition","transform","style","display","flexGrow","offset","containerRef","toString","Tree","hierarchy","size","separation","b","parent","tree","innerRef","links","map","link","i","percent","stepPercent","stroke","linkColor","strokeWidth","linkWidth","descendants","defaultProps","withParentSize","withZoom"],"sourceRoot":""}
|
package/build/main.css
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
.zoom {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
.zoom .btn {
|
|
5
|
-
margin: 0;
|
|
6
|
-
text-align: center;
|
|
7
|
-
border: none;
|
|
8
|
-
background: #2f2f2f;
|
|
9
|
-
color: #d3d3d3;
|
|
10
|
-
padding: 0 4px;
|
|
11
|
-
border-top: 1px solid #0a0a0a;
|
|
12
|
-
}
|
|
13
|
-
.zoom .btn-lg {
|
|
14
|
-
font-size: 1em;
|
|
15
|
-
line-height: 1;
|
|
16
|
-
padding: 7px;
|
|
17
|
-
}
|
|
18
|
-
.zoom .btn-zoom {
|
|
19
|
-
width: 30px;
|
|
20
|
-
font-size: 2em;
|
|
21
|
-
}
|
|
22
|
-
.zoom .btn-bottom {
|
|
23
|
-
font-size: 2em;
|
|
24
|
-
margin-bottom: 1rem;
|
|
25
|
-
}
|
|
26
|
-
.zoom .controls {
|
|
27
|
-
position: absolute;
|
|
28
|
-
top: 15px;
|
|
29
|
-
right: 15px;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: flex-end;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.tree-graph {
|
|
36
|
-
position: relative;
|
|
37
|
-
height: 100%;
|
|
38
|
-
}
|
|
39
|
-
.tree-graph circle,
|
|
40
|
-
.tree-graph rectangle {
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
}
|
|
43
|
-
.tree-graph text {
|
|
44
|
-
pointer-events: none;
|
|
45
|
-
}
|
|
46
|
-
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./build/index');
|