From e651bfc2fbf4b63b79334144da39c7d79fd68c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20G=C3=A4rtner?= Date: Sat, 25 Apr 2020 00:41:13 +0200 Subject: [PATCH] Bump 2.4.1 --- CHANGELOG.md | 6 ++++++ README.md | 2 +- dist/dTree.js | 2 +- dist/dTree.js.map | 2 +- dist/dTree.min.js | 2 +- dist/dTree.min.js.map | 2 +- package.json | 2 +- test/demo/dTree.min.js | 2 ++ test/demo/dTree.min.js.map | 1 + 9 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 test/demo/dTree.min.js create mode 100644 test/demo/dTree.min.js.map diff --git a/CHANGELOG.md b/CHANGELOG.md index 348d6f8..a653921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +## [2.4.1](https://github.com/ErikGartner/dtree/compare/2.4.0...v2.4.1) (2020-04-24) + + + + # [2.4.0](https://github.com/ErikGartner/dtree/compare/2.3.0...v2.4.0) (2020-04-24) diff --git a/README.md b/README.md index 710adbb..b91335a 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ yarn add d3-dtree Lastly dTree is also available through several CDNs such as [jsDelivr](https://www.jsdelivr.com/package/npm/d3-dtree): ``` -https://cdn.jsdelivr.net/npm/d3-dtree@2.4.0/dist/dTree.min.js +https://cdn.jsdelivr.net/npm/d3-dtree@2.4.1/dist/dTree.min.js ``` ## Requirements diff --git a/dist/dTree.js b/dist/dTree.js index a46d5eb..5c6f110 100644 --- a/dist/dTree.js +++ b/dist/dTree.js @@ -344,7 +344,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var dTree = { - VERSION: '2.4.0', + VERSION: '2.4.1', init: function init(data) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; diff --git a/dist/dTree.js.map b/dist/dTree.js.map index dfc0435..3e4a25b 100644 --- a/dist/dTree.js.map +++ b/dist/dTree.js.map @@ -1 +1 @@ -{"version":3,"sources":["dTree.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AE,sBAAS,OAAO,EAAE,IAAI,EAAE;AACpC,UAAI,OAAO,IAAI,SAAS,EAAE;AACxB,eAAO,CAAC,IAAI,CAAC,UAAS,CAAC,EAAE,CAAC,EAAE;AAC1B,iBAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;SAC/E,CAAC,CAAC;OACJ;AACD,aAAO,OAAO,CAAC;KAChB;;AAED,kBAAc,EAAE,wBAAS,SAAS,EAAE,IAAI,EAAE;AACxC,UAAI,SAAS,IAAI,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AACtD,iBAAS,CAAC,IAAI,CAAC,UAAS,SAAS,EAAE,SAAS,EAAE;AAC5C,cAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;AACzB,cAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;AACzB,iBAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;SAC/E,CAAC,CAAC;OACJ;AACD,aAAO,SAAS,CAAC;KAClB;;GAEF,CAAC;;AAEF,SAAO,KAAK,CAAC;CAEZ,CAAE,CAAE","file":"dTree.js","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.dTree = factory());\n}(this, (function () { 'use strict';\n\nclass TreeBuilder {\n\n constructor(root, siblings, opts) {\n TreeBuilder.DEBUG_LEVEL = opts.debug ? 1 : 0;\n\n this.root = root;\n this.siblings = siblings;\n this.opts = opts;\n\n // flatten nodes\n this.allNodes = this._flatten(this.root);\n\n // calculate node sizes\n this.nodeSize = opts.callbacks.nodeSize.call(this,\n // filter hidden and marriage nodes\n _.filter(\n this.allNodes,\n node => !(node.hidden || _.get(node, 'data.isMarriage'))\n ),\n opts.nodeWidth,\n opts.callbacks.textRenderer\n );\n this.marriageSize = opts.callbacks.marriageSize.call(this,\n // filter hidden and non marriage nodes\n _.filter(\n this.allNodes,\n node => !node.hidden && _.get(node, 'data.isMarriage')\n ),\n this.opts.marriageNodeSize\n );\n }\n\n create() {\n\n let opts = this.opts;\n let allNodes = this.allNodes;\n let nodeSize = this.nodeSize;\n\n let width = opts.width + opts.margin.left + opts.margin.right;\n let height = opts.height + opts.margin.top + opts.margin.bottom;\n\n // create zoom handler\n const zoom = this.zoom = d3.zoom()\n .scaleExtent([0.1, 10])\n .on('zoom', function () {\n g.attr('transform', d3.event.transform);\n });\n\n // make a svg\n const svg = this.svg = d3.select(opts.target)\n .append('svg')\n .attr('viewBox', [0, 0, width, height])\n .call(zoom);\n\n // create svg group that holds all nodes\n const g = this.g = svg.append('g');\n\n // set zoom identity\n svg.call(zoom.transform, d3.zoomIdentity.translate(width / 2, opts.margin.top).scale(1));\n\n // Compute the layout.\n this.tree = d3.tree()\n .nodeSize([nodeSize[0] * 2,\n opts.callbacks.nodeHeightSeperation.call(this, nodeSize[0], nodeSize[1])]);\n\n this.tree.separation(function separation(a, b) {\n if (a.data.hidden || b.data.hidden) {\n return 0.3;\n } else {\n return 0.6;\n }\n });\n\n this._update(this.root);\n\n }\n\n _update(source) {\n\n let opts = this.opts;\n let allNodes = this.allNodes;\n let nodeSize = this.nodeSize;\n let marriageSize = this.marriageSize;\n\n let treenodes = this.tree(source);\n let links = treenodes.links();\n\n // Create the link lines.\n this.g.selectAll('.link')\n .data(links)\n .enter()\n // filter links with no parents to prevent empty nodes\n .filter(function(l) {\n return !l.target.data.noParent;\n })\n .append('path')\n .attr('class', opts.styles.linage)\n .attr('d', this._elbow);\n\n let nodes = this.g.selectAll('.node')\n .data(treenodes.descendants())\n .enter();\n\n this._linkSiblings();\n\n // Draw siblings (marriage)\n this.g.selectAll('.sibling')\n .data(this.siblings)\n .enter()\n .append('path')\n .attr('class', opts.styles.marriage)\n .attr('d', _.bind(this._siblingLine, this));\n\n // Create the node rectangles.\n nodes.append('foreignObject')\n .filter(function(d) {\n return d.data.hidden ? false : true;\n })\n .attr('x', function(d) {\n return Math.round(d.x - d.cWidth / 2) + 'px';\n })\n .attr('y', function(d) {\n return Math.round(d.y - d.cHeight / 2) + 'px';\n })\n .attr('width', function(d) {\n return d.cWidth + 'px';\n })\n .attr('height', function(d) {\n return d.cHeight + 'px';\n })\n .attr('id', function(d) {\n return d.id;\n })\n .html(function(d) {\n if (d.data.isMarriage) {\n return opts.callbacks.marriageRenderer.call(this,\n d.x,\n d.y,\n marriageSize[0],\n marriageSize[1],\n d.data.extra,\n d.data.id,\n d.data.class\n )\n } else {\n return opts.callbacks.nodeRenderer.call(this,\n d.data.name,\n d.x,\n d.y,\n nodeSize[0],\n nodeSize[1],\n d.data.extra,\n d.data.id,\n d.data.class,\n d.data.textClass,\n opts.callbacks.textRenderer\n )\n }\n })\n .on('dblclick', function () {\n // do not propagate a double click on a node\n // to prevent the zoom from being triggered\n d3.event.stopPropagation();\n })\n .on('click', function(d)  {\n // ignore double-clicks and clicks on hidden nodes\n if (d3.event.detail === 2 || d.data.hidden) {\n return;\n }\n if (d.data.isMarriage) {\n opts.callbacks.marriageClick.call(this, d.data.extra, d.data.id);\n } else {\n opts.callbacks.nodeClick.call(this, d.data.name, d.data.extra, d.data.id);\n }\n })\n .on('contextmenu', function(d)  {\n if (d.data.hidden) {\n return;\n }\n d3.event.preventDefault();\n if (d.data.isMarriage) {\n opts.callbacks.marriageRightClick.call(this, d.data.extra, d.data.id);\n } else {\n opts.callbacks.nodeRightClick.call(this, d.data.name, d.data.extra, d.data.id);\n }\n });\n }\n\n _flatten(root) {\n let n = [];\n let i = 0;\n\n function recurse(node) {\n if (node.children) {\n node.children.forEach(recurse);\n }\n if (!node.id) {\n node.id = ++i;\n }\n n.push(node);\n }\n recurse(root);\n return n;\n }\n\n _elbow(d, i) {\n if (d.target.data.noParent) {\n return 'M0,0L0,0';\n }\n let ny = Math.round(d.target.y + (d.source.y - d.target.y) * 0.50);\n\n let linedata = [{\n x: d.target.x,\n y: d.target.y\n }, {\n x: d.target.x,\n y: ny\n }, {\n x: d.source.x,\n y: d.source.y\n }];\n\n let fun = d3.line().curve(d3.curveStepAfter)\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n });\n return fun(linedata);\n }\n\n _linkSiblings() {\n\n let allNodes = this.allNodes;\n\n _.forEach(this.siblings, function(d) {\n let start = allNodes.filter(function(v) {\n return d.source.id == v.data.id;\n });\n let end = allNodes.filter(function(v) {\n return d.target.id == v.data.id;\n });\n d.source.x = start[0].x;\n d.source.y = start[0].y;\n d.target.x = end[0].x;\n d.target.y = end[0].y;\n\n let marriageId = (start[0].data.marriageNode != null ?\n start[0].data.marriageNode.id :\n end[0].data.marriageNode.id);\n let marriageNode = allNodes.find(function(n) {\n return n.data.id == marriageId;\n });\n d.source.marriageNode = marriageNode;\n d.target.marriageNode = marriageNode;\n });\n\n }\n\n _siblingLine(d, i) {\n\n let ny = Math.round(d.target.y + (d.source.y - d.target.y) * 0.50);\n let nodeWidth = this.nodeSize[0];\n let nodeHeight = this.nodeSize[1];\n\n // Not first marriage\n if (d.number > 0) {\n ny -= Math.round(nodeHeight * 8 / 10);\n }\n\n let linedata = [{\n x: d.source.x,\n y: d.source.y\n }, {\n x: Math.round(d.source.x + nodeWidth * 6 / 10),\n y: d.source.y\n }, {\n x: Math.round(d.source.x + nodeWidth * 6 / 10),\n y: ny\n }, {\n x: d.target.marriageNode.x,\n y: ny\n }, {\n x: d.target.marriageNode.x,\n y: d.target.y\n }, {\n x: d.target.x,\n y: d.target.y\n }];\n\n let fun = d3.line().curve(d3.curveStepAfter)\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n });\n return fun(linedata);\n }\n\n static _nodeHeightSeperation(nodeWidth, nodeMaxHeight) {\n return nodeMaxHeight + 25;\n }\n\n static _nodeSize(nodes, width, textRenderer) {\n let maxWidth = 0;\n let maxHeight = 0;\n let tmpSvg = document.createElement('svg');\n document.body.appendChild(tmpSvg);\n\n _.map(nodes, function(n) {\n let container = document.createElement('div');\n container.setAttribute('class', n.data.class);\n container.style.visibility = 'hidden';\n container.style.maxWidth = width + 'px';\n\n let text = textRenderer(n.data.name, n.data.extra, n.data.textClass);\n container.innerHTML = text;\n\n tmpSvg.appendChild(container);\n let height = container.offsetHeight;\n tmpSvg.removeChild(container);\n\n maxHeight = Math.max(maxHeight, height);\n n.cHeight = height;\n if (n.data.hidden) {\n n.cWidth = 0;\n } else {\n n.cWidth = width;\n }\n });\n document.body.removeChild(tmpSvg);\n\n return [width, maxHeight];\n }\n\n static _marriageSize (nodes, size) {\n _.map(nodes, function (n) {\n if (!n.data.hidden) {\n n.cHeight = size;\n n.cWidth = size;\n }\n });\n\n return [size, size]\n }\n\n static _nodeRenderer(name, x, y, height, width, extra, id, nodeClass, textClass, textRenderer) {\n let node = '';\n node += '
\\n';\n node += textRenderer(name, extra, textClass);\n node += '
';\n return node;\n }\n\n static _textRenderer(name, extra, textClass) {\n let node = '';\n node += '

\\n';\n node += name;\n node += '

\\n';\n return node;\n }\n\n static _marriageRenderer (x, y, height, width, extra, id, nodeClass) {\n return `
`\n }\n\n static _debug(msg) {\n if (TreeBuilder.DEBUG_LEVEL > 0)  {\n console.log(msg);\n }\n }\n\n}\n\nconst dTree = {\n\n VERSION: '2.4.0',\n\n init: function(data, options = {}) {\n\n var opts = _.defaultsDeep(options || {}, {\n target: '#graph',\n debug: false,\n width: 600,\n height: 600,\n hideMarriageNodes: true,\n callbacks: {\n nodeClick: function(name, extra, id) {},\n nodeRightClick: function(name, extra, id) {},\n marriageClick: function(extra, id) {},\n marriageRightClick: function(extra, id) {},\n nodeHeightSeperation: function(nodeWidth, nodeMaxHeight) {\n return TreeBuilder._nodeHeightSeperation(nodeWidth, nodeMaxHeight);\n },\n nodeRenderer: function(name, x, y, height, width, extra, id, nodeClass, textClass, textRenderer) {\n return TreeBuilder._nodeRenderer(name, x, y, height, width, extra,\n id,nodeClass, textClass, textRenderer);\n },\n nodeSize: function(nodes, width, textRenderer) {\n return TreeBuilder._nodeSize(nodes, width, textRenderer);\n },\n nodeSorter: function(aName, aExtra, bName, bExtra) {return 0;},\n textRenderer: function(name, extra, textClass) {\n return TreeBuilder._textRenderer(name, extra, textClass);\n },\n marriageRenderer: function (x, y, height, width, extra, id, nodeClass) {\n return TreeBuilder._marriageRenderer(x, y, height, width, extra, id, nodeClass)\n },\n marriageSize: function (nodes, size) {\n return TreeBuilder._marriageSize(nodes, size)\n },\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n nodeWidth: 100,\n marriageNodeSize: 10,\n styles: {\n node: 'node',\n marriageNode: 'marriageNode',\n linage: 'linage',\n marriage: 'marriage',\n text: 'nodeText'\n }\n });\n\n var data = this._preprocess(data, opts);\n var treeBuilder = new TreeBuilder(data.root, data.siblings, opts);\n treeBuilder.create();\n\n function _zoomTo (x, y, zoom = 1, duration = 500) {\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity\n .translate(opts.width / 2, opts.height / 2)\n .scale(zoom)\n .translate(-x, -y)\n );\n }\n\n return {\n resetZoom: function (duration = 500) {\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity.translate(opts.width / 2, opts.margin.top).scale(1)\n );\n },\n zoomTo: _zoomTo,\n zoomToNode: function (nodeId, zoom = 2, duration = 500) {\n const node = _.find(treeBuilder.allNodes, {data: {id: nodeId}});\n if (node) {\n _zoomTo(node.x, node.y, zoom, duration);\n }\n },\n zoomToFit: function (duration = 500) {\n const groupBounds = treeBuilder.g.node().getBBox();\n const width = groupBounds.width;\n const height = groupBounds.height;\n const fullWidth = treeBuilder.svg.node().clientWidth;\n const fullHeight = treeBuilder.svg.node().clientHeight;\n const scale = 0.95 / Math.max(width / fullWidth, height / fullHeight);\n\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity\n .translate(\n fullWidth / 2 - scale * (groupBounds.x + width / 2),\n fullHeight / 2 - scale * (groupBounds.y + height / 2)\n )\n .scale(scale)\n );\n }\n }\n },\n\n _preprocess: function(data, opts) {\n\n var siblings = [];\n var id = 0;\n\n var root = {\n name: '',\n id: id++,\n hidden: true,\n children: []\n };\n\n var reconstructTree = function(person, parent) {\n\n // convert to person to d3 node\n var node = {\n name: person.name,\n id: id++,\n hidden: false,\n children: [],\n extra: person.extra,\n textClass: person.textClass ? person.textClass : opts.styles.text,\n class: person.class ? person.class : opts.styles.node\n };\n\n // hide linages to the hidden root node\n if (parent == root) {\n node.noParent = true;\n }\n\n // apply depth offset\n for (var i = 0; i < person.depthOffset; i++) {\n var pushNode = {\n name: '',\n id: id++,\n hidden: true,\n children: [],\n noParent: node.noParent\n };\n parent.children.push(pushNode);\n parent = pushNode;\n }\n\n // sort children\n dTree._sortPersons(person.children, opts);\n\n // add \"direct\" children\n _.forEach(person.children, function(child) {\n reconstructTree(child, node);\n });\n\n parent.children.push(node);\n\n //sort marriages\n dTree._sortMarriages(person.marriages, opts);\n\n // go through marriage\n _.forEach(person.marriages, function(marriage, index) {\n var m = {\n name: '',\n id: id++,\n hidden: opts.hideMarriageNodes,\n noParent: true,\n children: [],\n isMarriage: true,\n extra: marriage.extra,\n class: marriage.class ? marriage.class : opts.styles.marriageNode\n };\n\n var sp = marriage.spouse;\n\n var spouse = {\n name: sp.name,\n id: id++,\n hidden: false,\n noParent: true,\n children: [],\n textClass: sp.textClass ? sp.textClass : opts.styles.text,\n class: sp.class ? sp.class : opts.styles.node,\n extra: sp.extra,\n marriageNode: m\n };\n\n parent.children.push(m, spouse);\n\n dTree._sortPersons(marriage.children, opts);\n _.forEach(marriage.children, function(child) {\n reconstructTree(child, m);\n });\n\n siblings.push({\n source: {\n id: node.id\n },\n target: {\n id: spouse.id\n },\n number: index\n });\n });\n\n };\n\n _.forEach(data, function(person) {\n reconstructTree(person, root);\n });\n\n return {\n root: d3.hierarchy(root),\n siblings: siblings\n };\n\n },\n\n _sortPersons: function(persons, opts) {\n if (persons != undefined) {\n persons.sort(function(a, b) {\n return opts.callbacks.nodeSorter.call(this, a.name, a.extra, b.name, b.extra);\n });\n }\n return persons;\n },\n\n _sortMarriages: function(marriages, opts) {\n if (marriages != undefined && Array.isArray(marriages)) {\n marriages.sort(function(marriageA, marriageB) {\n var a = marriageA.spouse;\n var b = marriageB.spouse;\n return opts.callbacks.nodeSorter.call(this, a.name, a.extra, b.name, b.extra);\n });\n }\n return marriages;\n }\n\n};\n\nreturn dTree;\n\n})));\n"]} \ No newline at end of file +{"version":3,"sources":["dTree.js"],"names":[],"mappings":";;;;AAAA,AAAC,CAAA,UAAU,MAAM,EAAE,OAAO,EAAE;AAC3B,SAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,OAAO,GAAG,OAAO,EAAE,GACzF,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,GAC3D,MAAM,CAAC,KAAK,GAAG,OAAO,EAAE,AAAC,CAAC;CAC3B,CAAA,CAAC,IAAI,EAAG,YAAY;AAAE,cAAY,CAAC;;MAE9B,WAAW;AAEJ,aAFP,WAAW,CAEH,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;4BAF9B,WAAW;;AAGb,iBAAW,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;;AAE7C,UAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjB,UAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,UAAI,CAAC,IAA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ACzB,iBAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;SAC/E,CAAC,CAAC;OACJ;AACD,aAAO,SAAS,CAAC;KAClB;;GAEF,CAAC;;AAEF,SAAO,KAAK,CAAC;CAEZ,CAAE,CAAE","file":"dTree.js","sourcesContent":["(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.dTree = factory());\n}(this, (function () { 'use strict';\n\nclass TreeBuilder {\n\n constructor(root, siblings, opts) {\n TreeBuilder.DEBUG_LEVEL = opts.debug ? 1 : 0;\n\n this.root = root;\n this.siblings = siblings;\n this.opts = opts;\n\n // flatten nodes\n this.allNodes = this._flatten(this.root);\n\n // calculate node sizes\n this.nodeSize = opts.callbacks.nodeSize.call(this,\n // filter hidden and marriage nodes\n _.filter(\n this.allNodes,\n node => !(node.hidden || _.get(node, 'data.isMarriage'))\n ),\n opts.nodeWidth,\n opts.callbacks.textRenderer\n );\n this.marriageSize = opts.callbacks.marriageSize.call(this,\n // filter hidden and non marriage nodes\n _.filter(\n this.allNodes,\n node => !node.hidden && _.get(node, 'data.isMarriage')\n ),\n this.opts.marriageNodeSize\n );\n }\n\n create() {\n\n let opts = this.opts;\n let allNodes = this.allNodes;\n let nodeSize = this.nodeSize;\n\n let width = opts.width + opts.margin.left + opts.margin.right;\n let height = opts.height + opts.margin.top + opts.margin.bottom;\n\n // create zoom handler\n const zoom = this.zoom = d3.zoom()\n .scaleExtent([0.1, 10])\n .on('zoom', function () {\n g.attr('transform', d3.event.transform);\n });\n\n // make a svg\n const svg = this.svg = d3.select(opts.target)\n .append('svg')\n .attr('viewBox', [0, 0, width, height])\n .call(zoom);\n\n // create svg group that holds all nodes\n const g = this.g = svg.append('g');\n\n // set zoom identity\n svg.call(zoom.transform, d3.zoomIdentity.translate(width / 2, opts.margin.top).scale(1));\n\n // Compute the layout.\n this.tree = d3.tree()\n .nodeSize([nodeSize[0] * 2,\n opts.callbacks.nodeHeightSeperation.call(this, nodeSize[0], nodeSize[1])]);\n\n this.tree.separation(function separation(a, b) {\n if (a.data.hidden || b.data.hidden) {\n return 0.3;\n } else {\n return 0.6;\n }\n });\n\n this._update(this.root);\n\n }\n\n _update(source) {\n\n let opts = this.opts;\n let allNodes = this.allNodes;\n let nodeSize = this.nodeSize;\n let marriageSize = this.marriageSize;\n\n let treenodes = this.tree(source);\n let links = treenodes.links();\n\n // Create the link lines.\n this.g.selectAll('.link')\n .data(links)\n .enter()\n // filter links with no parents to prevent empty nodes\n .filter(function(l) {\n return !l.target.data.noParent;\n })\n .append('path')\n .attr('class', opts.styles.linage)\n .attr('d', this._elbow);\n\n let nodes = this.g.selectAll('.node')\n .data(treenodes.descendants())\n .enter();\n\n this._linkSiblings();\n\n // Draw siblings (marriage)\n this.g.selectAll('.sibling')\n .data(this.siblings)\n .enter()\n .append('path')\n .attr('class', opts.styles.marriage)\n .attr('d', _.bind(this._siblingLine, this));\n\n // Create the node rectangles.\n nodes.append('foreignObject')\n .filter(function(d) {\n return d.data.hidden ? false : true;\n })\n .attr('x', function(d) {\n return Math.round(d.x - d.cWidth / 2) + 'px';\n })\n .attr('y', function(d) {\n return Math.round(d.y - d.cHeight / 2) + 'px';\n })\n .attr('width', function(d) {\n return d.cWidth + 'px';\n })\n .attr('height', function(d) {\n return d.cHeight + 'px';\n })\n .attr('id', function(d) {\n return d.id;\n })\n .html(function(d) {\n if (d.data.isMarriage) {\n return opts.callbacks.marriageRenderer.call(this,\n d.x,\n d.y,\n marriageSize[0],\n marriageSize[1],\n d.data.extra,\n d.data.id,\n d.data.class\n )\n } else {\n return opts.callbacks.nodeRenderer.call(this,\n d.data.name,\n d.x,\n d.y,\n nodeSize[0],\n nodeSize[1],\n d.data.extra,\n d.data.id,\n d.data.class,\n d.data.textClass,\n opts.callbacks.textRenderer\n )\n }\n })\n .on('dblclick', function () {\n // do not propagate a double click on a node\n // to prevent the zoom from being triggered\n d3.event.stopPropagation();\n })\n .on('click', function(d)  {\n // ignore double-clicks and clicks on hidden nodes\n if (d3.event.detail === 2 || d.data.hidden) {\n return;\n }\n if (d.data.isMarriage) {\n opts.callbacks.marriageClick.call(this, d.data.extra, d.data.id);\n } else {\n opts.callbacks.nodeClick.call(this, d.data.name, d.data.extra, d.data.id);\n }\n })\n .on('contextmenu', function(d)  {\n if (d.data.hidden) {\n return;\n }\n d3.event.preventDefault();\n if (d.data.isMarriage) {\n opts.callbacks.marriageRightClick.call(this, d.data.extra, d.data.id);\n } else {\n opts.callbacks.nodeRightClick.call(this, d.data.name, d.data.extra, d.data.id);\n }\n });\n }\n\n _flatten(root) {\n let n = [];\n let i = 0;\n\n function recurse(node) {\n if (node.children) {\n node.children.forEach(recurse);\n }\n if (!node.id) {\n node.id = ++i;\n }\n n.push(node);\n }\n recurse(root);\n return n;\n }\n\n _elbow(d, i) {\n if (d.target.data.noParent) {\n return 'M0,0L0,0';\n }\n let ny = Math.round(d.target.y + (d.source.y - d.target.y) * 0.50);\n\n let linedata = [{\n x: d.target.x,\n y: d.target.y\n }, {\n x: d.target.x,\n y: ny\n }, {\n x: d.source.x,\n y: d.source.y\n }];\n\n let fun = d3.line().curve(d3.curveStepAfter)\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n });\n return fun(linedata);\n }\n\n _linkSiblings() {\n\n let allNodes = this.allNodes;\n\n _.forEach(this.siblings, function(d) {\n let start = allNodes.filter(function(v) {\n return d.source.id == v.data.id;\n });\n let end = allNodes.filter(function(v) {\n return d.target.id == v.data.id;\n });\n d.source.x = start[0].x;\n d.source.y = start[0].y;\n d.target.x = end[0].x;\n d.target.y = end[0].y;\n\n let marriageId = (start[0].data.marriageNode != null ?\n start[0].data.marriageNode.id :\n end[0].data.marriageNode.id);\n let marriageNode = allNodes.find(function(n) {\n return n.data.id == marriageId;\n });\n d.source.marriageNode = marriageNode;\n d.target.marriageNode = marriageNode;\n });\n\n }\n\n _siblingLine(d, i) {\n\n let ny = Math.round(d.target.y + (d.source.y - d.target.y) * 0.50);\n let nodeWidth = this.nodeSize[0];\n let nodeHeight = this.nodeSize[1];\n\n // Not first marriage\n if (d.number > 0) {\n ny -= Math.round(nodeHeight * 8 / 10);\n }\n\n let linedata = [{\n x: d.source.x,\n y: d.source.y\n }, {\n x: Math.round(d.source.x + nodeWidth * 6 / 10),\n y: d.source.y\n }, {\n x: Math.round(d.source.x + nodeWidth * 6 / 10),\n y: ny\n }, {\n x: d.target.marriageNode.x,\n y: ny\n }, {\n x: d.target.marriageNode.x,\n y: d.target.y\n }, {\n x: d.target.x,\n y: d.target.y\n }];\n\n let fun = d3.line().curve(d3.curveStepAfter)\n .x(function(d) {\n return d.x;\n })\n .y(function(d) {\n return d.y;\n });\n return fun(linedata);\n }\n\n static _nodeHeightSeperation(nodeWidth, nodeMaxHeight) {\n return nodeMaxHeight + 25;\n }\n\n static _nodeSize(nodes, width, textRenderer) {\n let maxWidth = 0;\n let maxHeight = 0;\n let tmpSvg = document.createElement('svg');\n document.body.appendChild(tmpSvg);\n\n _.map(nodes, function(n) {\n let container = document.createElement('div');\n container.setAttribute('class', n.data.class);\n container.style.visibility = 'hidden';\n container.style.maxWidth = width + 'px';\n\n let text = textRenderer(n.data.name, n.data.extra, n.data.textClass);\n container.innerHTML = text;\n\n tmpSvg.appendChild(container);\n let height = container.offsetHeight;\n tmpSvg.removeChild(container);\n\n maxHeight = Math.max(maxHeight, height);\n n.cHeight = height;\n if (n.data.hidden) {\n n.cWidth = 0;\n } else {\n n.cWidth = width;\n }\n });\n document.body.removeChild(tmpSvg);\n\n return [width, maxHeight];\n }\n\n static _marriageSize (nodes, size) {\n _.map(nodes, function (n) {\n if (!n.data.hidden) {\n n.cHeight = size;\n n.cWidth = size;\n }\n });\n\n return [size, size]\n }\n\n static _nodeRenderer(name, x, y, height, width, extra, id, nodeClass, textClass, textRenderer) {\n let node = '';\n node += '
\\n';\n node += textRenderer(name, extra, textClass);\n node += '
';\n return node;\n }\n\n static _textRenderer(name, extra, textClass) {\n let node = '';\n node += '

\\n';\n node += name;\n node += '

\\n';\n return node;\n }\n\n static _marriageRenderer (x, y, height, width, extra, id, nodeClass) {\n return `
`\n }\n\n static _debug(msg) {\n if (TreeBuilder.DEBUG_LEVEL > 0)  {\n console.log(msg);\n }\n }\n\n}\n\nconst dTree = {\n\n VERSION: '2.4.1',\n\n init: function(data, options = {}) {\n\n var opts = _.defaultsDeep(options || {}, {\n target: '#graph',\n debug: false,\n width: 600,\n height: 600,\n hideMarriageNodes: true,\n callbacks: {\n nodeClick: function(name, extra, id) {},\n nodeRightClick: function(name, extra, id) {},\n marriageClick: function(extra, id) {},\n marriageRightClick: function(extra, id) {},\n nodeHeightSeperation: function(nodeWidth, nodeMaxHeight) {\n return TreeBuilder._nodeHeightSeperation(nodeWidth, nodeMaxHeight);\n },\n nodeRenderer: function(name, x, y, height, width, extra, id, nodeClass, textClass, textRenderer) {\n return TreeBuilder._nodeRenderer(name, x, y, height, width, extra,\n id,nodeClass, textClass, textRenderer);\n },\n nodeSize: function(nodes, width, textRenderer) {\n return TreeBuilder._nodeSize(nodes, width, textRenderer);\n },\n nodeSorter: function(aName, aExtra, bName, bExtra) {return 0;},\n textRenderer: function(name, extra, textClass) {\n return TreeBuilder._textRenderer(name, extra, textClass);\n },\n marriageRenderer: function (x, y, height, width, extra, id, nodeClass) {\n return TreeBuilder._marriageRenderer(x, y, height, width, extra, id, nodeClass)\n },\n marriageSize: function (nodes, size) {\n return TreeBuilder._marriageSize(nodes, size)\n },\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n nodeWidth: 100,\n marriageNodeSize: 10,\n styles: {\n node: 'node',\n marriageNode: 'marriageNode',\n linage: 'linage',\n marriage: 'marriage',\n text: 'nodeText'\n }\n });\n\n var data = this._preprocess(data, opts);\n var treeBuilder = new TreeBuilder(data.root, data.siblings, opts);\n treeBuilder.create();\n\n function _zoomTo (x, y, zoom = 1, duration = 500) {\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity\n .translate(opts.width / 2, opts.height / 2)\n .scale(zoom)\n .translate(-x, -y)\n );\n }\n\n return {\n resetZoom: function (duration = 500) {\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity.translate(opts.width / 2, opts.margin.top).scale(1)\n );\n },\n zoomTo: _zoomTo,\n zoomToNode: function (nodeId, zoom = 2, duration = 500) {\n const node = _.find(treeBuilder.allNodes, {data: {id: nodeId}});\n if (node) {\n _zoomTo(node.x, node.y, zoom, duration);\n }\n },\n zoomToFit: function (duration = 500) {\n const groupBounds = treeBuilder.g.node().getBBox();\n const width = groupBounds.width;\n const height = groupBounds.height;\n const fullWidth = treeBuilder.svg.node().clientWidth;\n const fullHeight = treeBuilder.svg.node().clientHeight;\n const scale = 0.95 / Math.max(width / fullWidth, height / fullHeight);\n\n treeBuilder.svg\n .transition()\n .duration(duration)\n .call(\n treeBuilder.zoom.transform,\n d3.zoomIdentity\n .translate(\n fullWidth / 2 - scale * (groupBounds.x + width / 2),\n fullHeight / 2 - scale * (groupBounds.y + height / 2)\n )\n .scale(scale)\n );\n }\n }\n },\n\n _preprocess: function(data, opts) {\n\n var siblings = [];\n var id = 0;\n\n var root = {\n name: '',\n id: id++,\n hidden: true,\n children: []\n };\n\n var reconstructTree = function(person, parent) {\n\n // convert to person to d3 node\n var node = {\n name: person.name,\n id: id++,\n hidden: false,\n children: [],\n extra: person.extra,\n textClass: person.textClass ? person.textClass : opts.styles.text,\n class: person.class ? person.class : opts.styles.node\n };\n\n // hide linages to the hidden root node\n if (parent == root) {\n node.noParent = true;\n }\n\n // apply depth offset\n for (var i = 0; i < person.depthOffset; i++) {\n var pushNode = {\n name: '',\n id: id++,\n hidden: true,\n children: [],\n noParent: node.noParent\n };\n parent.children.push(pushNode);\n parent = pushNode;\n }\n\n // sort children\n dTree._sortPersons(person.children, opts);\n\n // add \"direct\" children\n _.forEach(person.children, function(child) {\n reconstructTree(child, node);\n });\n\n parent.children.push(node);\n\n //sort marriages\n dTree._sortMarriages(person.marriages, opts);\n\n // go through marriage\n _.forEach(person.marriages, function(marriage, index) {\n var m = {\n name: '',\n id: id++,\n hidden: opts.hideMarriageNodes,\n noParent: true,\n children: [],\n isMarriage: true,\n extra: marriage.extra,\n class: marriage.class ? marriage.class : opts.styles.marriageNode\n };\n\n var sp = marriage.spouse;\n\n var spouse = {\n name: sp.name,\n id: id++,\n hidden: false,\n noParent: true,\n children: [],\n textClass: sp.textClass ? sp.textClass : opts.styles.text,\n class: sp.class ? sp.class : opts.styles.node,\n extra: sp.extra,\n marriageNode: m\n };\n\n parent.children.push(m, spouse);\n\n dTree._sortPersons(marriage.children, opts);\n _.forEach(marriage.children, function(child) {\n reconstructTree(child, m);\n });\n\n siblings.push({\n source: {\n id: node.id\n },\n target: {\n id: spouse.id\n },\n number: index\n });\n });\n\n };\n\n _.forEach(data, function(person) {\n reconstructTree(person, root);\n });\n\n return {\n root: d3.hierarchy(root),\n siblings: siblings\n };\n\n },\n\n _sortPersons: function(persons, opts) {\n if (persons != undefined) {\n persons.sort(function(a, b) {\n return opts.callbacks.nodeSorter.call(this, a.name, a.extra, b.name, b.extra);\n });\n }\n return persons;\n },\n\n _sortMarriages: function(marriages, opts) {\n if (marriages != undefined && Array.isArray(marriages)) {\n marriages.sort(function(marriageA, marriageB) {\n var a = marriageA.spouse;\n var b = marriageB.spouse;\n return opts.callbacks.nodeSorter.call(this, a.name, a.extra, b.name, b.extra);\n });\n }\n return marriages;\n }\n\n};\n\nreturn dTree;\n\n})));\n"]} \ No newline at end of file diff --git a/dist/dTree.min.js b/dist/dTree.min.js index 95a9d85..7db8628 100644 --- a/dist/dTree.min.js +++ b/dist/dTree.min.js @@ -1,2 +1,2 @@ -function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var a=0;a0&&(a-=Math.round(8*n/10));var i=[{x:e.source.x,y:e.source.y},{x:Math.round(e.source.x+6*r/10),y:e.source.y},{x:Math.round(e.source.x+6*r/10),y:a},{x:e.target.marriageNode.x,y:a},{x:e.target.marriageNode.x,y:e.target.y},{x:e.target.x,y:e.target.y}],o=d3.line().curve(d3.curveStepAfter).x(function(e){return e.x}).y(function(e){return e.y});return o(i)}}],[{key:"_nodeHeightSeperation",value:function(e,t){return t+25}},{key:"_nodeSize",value:function(e,t,a){var r=0,n=document.createElement("svg");return document.body.appendChild(n),_.map(e,function(e){var i=document.createElement("div");i.setAttribute("class",e.data["class"]),i.style.visibility="hidden",i.style.maxWidth=t+"px";var o=a(e.data.name,e.data.extra,e.data.textClass);i.innerHTML=o,n.appendChild(i);var d=i.offsetHeight;n.removeChild(i),r=Math.max(r,d),e.cHeight=d,e.data.hidden?e.cWidth=0:e.cWidth=t}),document.body.removeChild(n),[t,r]}},{key:"_marriageSize",value:function(e,t){return _.map(e,function(e){e.data.hidden||(e.cHeight=t,e.cWidth=t)}),[t,t]}},{key:"_nodeRenderer",value:function(e,t,a,r,n,i,o,d,s,l){var c="";return c+="
\n',c+=l(e,i,s),c+="
"}},{key:"_textRenderer",value:function(e,t,a){var r="";return r+="

\n',r+=e,r+="

\n"}},{key:"_marriageRenderer",value:function(e,t,a,r,n,i,o){return'
'}},{key:"_debug",value:function(t){e.DEBUG_LEVEL>0&&console.log(t)}}]),e}(),t={VERSION:"2.4.0",init:function(t){function a(e,t){var a=arguments.length<=2||void 0===arguments[2]?1:arguments[2],r=arguments.length<=3||void 0===arguments[3]?500:arguments[3];i.svg.transition().duration(r).call(i.zoom.transform,d3.zoomIdentity.translate(n.width/2,n.height/2).scale(a).translate(-e,-t))}var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=_.defaultsDeep(r||{},{target:"#graph",debug:!1,width:600,height:600,hideMarriageNodes:!0,callbacks:{nodeClick:function(e,t,a){},nodeRightClick:function(e,t,a){},marriageClick:function(e,t){},marriageRightClick:function(e,t){},nodeHeightSeperation:function(t,a){return e._nodeHeightSeperation(t,a)},nodeRenderer:function(t,a,r,n,i,o,d,s,l,c){return e._nodeRenderer(t,a,r,n,i,o,d,s,l,c)},nodeSize:function(t,a,r){return e._nodeSize(t,a,r)},nodeSorter:function(e,t,a,r){return 0},textRenderer:function(t,a,r){return e._textRenderer(t,a,r)},marriageRenderer:function(t,a,r,n,i,o,d){return e._marriageRenderer(t,a,r,n,i,o,d)},marriageSize:function(t,a){return e._marriageSize(t,a)}},margin:{top:0,right:0,bottom:0,left:0},nodeWidth:100,marriageNodeSize:10,styles:{node:"node",marriageNode:"marriageNode",linage:"linage",marriage:"marriage",text:"nodeText"}}),t=this._preprocess(t,n),i=new e(t.root,t.siblings,n);return i.create(),{resetZoom:function(){var e=arguments.length<=0||void 0===arguments[0]?500:arguments[0];i.svg.transition().duration(e).call(i.zoom.transform,d3.zoomIdentity.translate(n.width/2,n.margin.top).scale(1))},zoomTo:a,zoomToNode:function(e){var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],r=arguments.length<=2||void 0===arguments[2]?500:arguments[2],n=_.find(i.allNodes,{data:{id:e}});n&&a(n.x,n.y,t,r)},zoomToFit:function(){var e=arguments.length<=0||void 0===arguments[0]?500:arguments[0],t=i.g.node().getBBox(),a=t.width,r=t.height,n=i.svg.node().clientWidth,o=i.svg.node().clientHeight,d=.95/Math.max(a/n,r/o);i.svg.transition().duration(e).call(i.zoom.transform,d3.zoomIdentity.translate(n/2-d*(t.x+a/2),o/2-d*(t.y+r/2)).scale(d))}}},_preprocess:function(e,a){var r=[],n=0,i={name:"",id:n++,hidden:!0,children:[]},o=function d(e,o){var s={name:e.name,id:n++,hidden:!1,children:[],extra:e.extra,textClass:e.textClass?e.textClass:a.styles.text,"class":e["class"]?e["class"]:a.styles.node};o==i&&(s.noParent=!0);for(var l=0;l0&&(a-=Math.round(8*n/10));var i=[{x:e.source.x,y:e.source.y},{x:Math.round(e.source.x+6*r/10),y:e.source.y},{x:Math.round(e.source.x+6*r/10),y:a},{x:e.target.marriageNode.x,y:a},{x:e.target.marriageNode.x,y:e.target.y},{x:e.target.x,y:e.target.y}],o=d3.line().curve(d3.curveStepAfter).x(function(e){return e.x}).y(function(e){return e.y});return o(i)}}],[{key:"_nodeHeightSeperation",value:function(e,t){return t+25}},{key:"_nodeSize",value:function(e,t,a){var r=0,n=document.createElement("svg");return document.body.appendChild(n),_.map(e,function(e){var i=document.createElement("div");i.setAttribute("class",e.data["class"]),i.style.visibility="hidden",i.style.maxWidth=t+"px";var o=a(e.data.name,e.data.extra,e.data.textClass);i.innerHTML=o,n.appendChild(i);var d=i.offsetHeight;n.removeChild(i),r=Math.max(r,d),e.cHeight=d,e.data.hidden?e.cWidth=0:e.cWidth=t}),document.body.removeChild(n),[t,r]}},{key:"_marriageSize",value:function(e,t){return _.map(e,function(e){e.data.hidden||(e.cHeight=t,e.cWidth=t)}),[t,t]}},{key:"_nodeRenderer",value:function(e,t,a,r,n,i,o,d,s,l){var c="";return c+="
\n',c+=l(e,i,s),c+="
"}},{key:"_textRenderer",value:function(e,t,a){var r="";return r+="

\n',r+=e,r+="

\n"}},{key:"_marriageRenderer",value:function(e,t,a,r,n,i,o){return'
'}},{key:"_debug",value:function(t){e.DEBUG_LEVEL>0&&console.log(t)}}]),e}(),t={VERSION:"2.4.1",init:function(t){function a(e,t){var a=arguments.length<=2||void 0===arguments[2]?1:arguments[2],r=arguments.length<=3||void 0===arguments[3]?500:arguments[3];i.svg.transition().duration(r).call(i.zoom.transform,d3.zoomIdentity.translate(n.width/2,n.height/2).scale(a).translate(-e,-t))}var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=_.defaultsDeep(r||{},{target:"#graph",debug:!1,width:600,height:600,hideMarriageNodes:!0,callbacks:{nodeClick:function(e,t,a){},nodeRightClick:function(e,t,a){},marriageClick:function(e,t){},marriageRightClick:function(e,t){},nodeHeightSeperation:function(t,a){return e._nodeHeightSeperation(t,a)},nodeRenderer:function(t,a,r,n,i,o,d,s,l,c){return e._nodeRenderer(t,a,r,n,i,o,d,s,l,c)},nodeSize:function(t,a,r){return e._nodeSize(t,a,r)},nodeSorter:function(e,t,a,r){return 0},textRenderer:function(t,a,r){return e._textRenderer(t,a,r)},marriageRenderer:function(t,a,r,n,i,o,d){return e._marriageRenderer(t,a,r,n,i,o,d)},marriageSize:function(t,a){return e._marriageSize(t,a)}},margin:{top:0,right:0,bottom:0,left:0},nodeWidth:100,marriageNodeSize:10,styles:{node:"node",marriageNode:"marriageNode",linage:"linage",marriage:"marriage",text:"nodeText"}}),t=this._preprocess(t,n),i=new e(t.root,t.siblings,n);return i.create(),{resetZoom:function(){var e=arguments.length<=0||void 0===arguments[0]?500:arguments[0];i.svg.transition().duration(e).call(i.zoom.transform,d3.zoomIdentity.translate(n.width/2,n.margin.top).scale(1))},zoomTo:a,zoomToNode:function(e){var t=arguments.length<=1||void 0===arguments[1]?2:arguments[1],r=arguments.length<=2||void 0===arguments[2]?500:arguments[2],n=_.find(i.allNodes,{data:{id:e}});n&&a(n.x,n.y,t,r)},zoomToFit:function(){var e=arguments.length<=0||void 0===arguments[0]?500:arguments[0],t=i.g.node().getBBox(),a=t.width,r=t.height,n=i.svg.node().clientWidth,o=i.svg.node().clientHeight,d=.95/Math.max(a/n,r/o);i.svg.transition().duration(e).call(i.zoom.transform,d3.zoomIdentity.translate(n/2-d*(t.x+a/2),o/2-d*(t.y+r/2)).scale(d))}}},_preprocess:function(e,a){var r=[],n=0,i={name:"",id:n++,hidden:!0,children:[]},o=function d(e,o){var s={name:e.name,id:n++,hidden:!1,children:[],extra:e.extra,textClass:e.textClass?e.textClass:a.styles.text,"class":e["class"]?e["class"]:a.styles.node};o==i&&(s.noParent=!0);for(var l=0;l