[
  {
    "path": ".eslintrc",
    "content": "{\n  \"env\": {\n    \"browser\": true,\n    \"node\": true,\n    \"es6\": true,\n    \"mocha\": true\n  },\n\n  \"ecmaFeatures\": {\n    \"modules\": true\n  },\n\n  \"parserOptions\": {\n    \"sourceType\": \"module\"\n  },\n\n  \"extends\": \"eslint:recommended\",\n\n  \"rules\": {\n    \"no-undef\": 2,\n    \"no-console\": 1\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\nnpm-debug.log\nlib/\n"
  },
  {
    "path": "LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "JSON to Tree Diagram Converter\n==============================\n\n> For Yakusugi\n\nThis tool converts JSON strings into tree diagrams. For example, it is used to show AST(Abstract Syntax Tree) as tree diagrams for debugging. In that case, of course, you need to translate AST into JSON.\n\n\n[Online JSON to Tree Diagram Converter](http://vanya.jp.net/vtree/)\n\n\n![Screenshot](https://github.com/ivan111/vtree/raw/master/vtree.jpg)\n"
  },
  {
    "path": "css/custom.css",
    "content": "body {\r\n    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\r\n    background-color: #f8f9fa;\r\n    display: flex;\r\n    align-items: center;\r\n    min-height: 100vh;\r\n  }\r\n  \r\n  .container {\r\n    max-width: 1030px;\r\n    width: 100%;\r\n    background-color: #ffffff;\r\n    border-radius: 8px;\r\n    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.14);\r\n    padding: 2rem;\r\n    margin: 0 auto;\r\n  }\r\n  \r\n  header {\r\n    margin-bottom: 2rem;\r\n  }\r\n  \r\n  button {\r\n    width: 100%;\r\n  }\r\n  \r\n  textarea {\r\n    resize: none;\r\n  }\r\n  \r\n  footer {\r\n    margin-top: 3rem;\r\n  }"
  },
  {
    "path": "css/vtree.css",
    "content": "svg.vtree {\n  overflow: hidden;\n  background: #ffffff;\n  -webkit-box-shadow: 4px 4px 8px rgba(0,0,0,0.5);\n  -moz-box-shadow   : 4px 4px 8px rgba(0,0,0,0.5);\n  box-shadow        : 4px 4px 8px rgba(0,0,0,0.5);\n}\n"
  },
  {
    "path": "dist/vtree.js",
    "content": "var VTree =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/vtree.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./src/decorator/linkName.js\":\n/*!***********************************!*\\\n  !*** ./src/decorator/linkName.js ***!\n  \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar pad = 4;\\n\\nvar LinkNameDecorator = function () {\\n  function LinkNameDecorator(linkName) {\\n    _classCallCheck(this, LinkNameDecorator);\\n\\n    this.linkName = linkName;\\n  }\\n\\n  _createClass(LinkNameDecorator, [{\\n    key: 'render',\\n    value: function render(g, oldG, width) {\\n      var t = g.append('text').text(this.linkName);\\n\\n      var b = t.node().getBBox();\\n      var textW = Math.ceil(b.width);\\n      var textH = Math.ceil(b.height);\\n\\n      var textTotalW = textW + pad * 2;\\n\\n      var newW = width;\\n\\n      if (textTotalW > width) {\\n        newW = textTotalW;\\n      }\\n\\n      var textTotalH = textH + pad;\\n\\n      var dw = newW - width;\\n      var dh = textTotalH;\\n      var dx = Math.round(dw / 2);\\n      var dy = textTotalH;\\n\\n      t.attr('x', Math.round(newW / 2)).attr('y', textH).attr('text-anchor', 'middle');\\n\\n      return { dx: dx, dy: dy, dw: dw, dh: dh };\\n    }\\n  }]);\\n\\n  return LinkNameDecorator;\\n}();\\n\\nexports.default = LinkNameDecorator;\\n\\n//# sourceURL=webpack://VTree/./src/decorator/linkName.js?\");\n\n/***/ }),\n\n/***/ \"./src/layout/array.js\":\n/*!*****************************!*\\\n  !*** ./src/layout/array.js ***!\n  \\*****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\n/* global d3 */\\n\\nvar DURATION = 1000;\\n\\nvar diagonal = d3.svg.diagonal();\\n\\nvar ArrayLayout = function () {\\n  function ArrayLayout() {\\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\\n\\n    _classCallCheck(this, ArrayLayout);\\n\\n    this.hideLinks = options.hideLinks;\\n  }\\n\\n  _createClass(ArrayLayout, [{\\n    key: 'layout',\\n    value: function layout(node) {\\n      calcChildrenWidth(node);\\n      calcTotalSize(node);\\n\\n      _layout(node);\\n    }\\n  }, {\\n    key: 'renderLinks',\\n    value: function renderLinks(node) {\\n      if (!this.hideLinks) {\\n        _renderLinks(node);\\n      }\\n    }\\n  }]);\\n\\n  return ArrayLayout;\\n}();\\n\\nexports.default = ArrayLayout;\\n\\n\\nfunction _layout(node) {\\n  if (node.children.length === 0) {\\n    return;\\n  }\\n\\n  var x = -Math.round(node.childrenWidth / 2);\\n  var y = 0;\\n\\n  node.children.forEach(function (child) {\\n    child.x = x + Math.round(child.totalWidth / 2) - Math.round(child.width / 2);\\n    child.y = y;\\n\\n    child.g.transition().duration(DURATION).attr('transform', 'translate(' + child.x + ',' + child.y + ')');\\n\\n    x += child.totalWidth + node.margin;\\n  });\\n}\\n\\nfunction _renderLinks(node) {\\n  if (node.children.length === 0) {\\n    return;\\n  }\\n\\n  var h = node.children[0].linkY;\\n\\n  node.children.forEach(function (child) {\\n    h = Math.min(h, child.linkY);\\n  });\\n\\n  var orig = { x: 0, y: 0 };\\n\\n  var i, src, dst;\\n\\n  for (i = 0; i < node.children.length; i++) {\\n    if (i === 0) {\\n      continue;\\n    }\\n\\n    var prev = node.children[i - 1];\\n    var child = node.children[i];\\n\\n    src = {\\n      x: prev.x + prev.linkX,\\n      y: prev.y + h\\n    };\\n\\n    dst = {\\n      x: child.x + child.linkX,\\n      y: child.y + h\\n    };\\n\\n    var link = node.g.insert('path', ':first-child').attr('class', 'vtree-link').attr('d', function () {\\n      return diagonal({ source: orig, target: orig });\\n    });\\n\\n    link.transition().duration(DURATION).attr('d', function () {\\n      return diagonal({ source: src, target: dst });\\n    });\\n  }\\n}\\n\\nfunction calcChildrenWidth(node) {\\n  if (node.children.length === 0) {\\n    node.childrenWidth = 0;\\n\\n    return;\\n  }\\n\\n  var w = 0;\\n\\n  node.children.forEach(function (child) {\\n    w += child.totalWidth;\\n  });\\n\\n  w += (node.children.length - 1) * node.margin;\\n\\n  node.childrenWidth = w;\\n}\\n\\nfunction calcTotalSize(node) {\\n  if (node.children.length === 0) {\\n    node.totalWidth = node.width;\\n    node.totalHeight = node.height;\\n\\n    return;\\n  }\\n\\n  node.totalWidth = Math.max(node.width, node.childrenWidth);\\n\\n  var maxChildH = 0;\\n\\n  node.children.forEach(function (child) {\\n    maxChildH = Math.max(maxChildH, child.totalHeight);\\n  });\\n\\n  node.totalHeight = maxChildH;\\n}\\n\\n//# sourceURL=webpack://VTree/./src/layout/array.js?\");\n\n/***/ }),\n\n/***/ \"./src/layout/tree.js\":\n/*!****************************!*\\\n  !*** ./src/layout/tree.js ***!\n  \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global d3 */\\n\\nvar _array = __webpack_require__(/*! ../node/array.js */ \\\"./src/node/array.js\\\");\\n\\nvar _array2 = _interopRequireDefault(_array);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar MARGIN = 10;\\nvar HEIGHT = 50;\\nvar DURATION = 1000;\\n\\nvar diagonal = d3.svg.diagonal();\\n\\nvar TreeLayout = function () {\\n  function TreeLayout() {\\n    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\\n\\n    _classCallCheck(this, TreeLayout);\\n\\n    this.height = options.height || HEIGHT;\\n  }\\n\\n  _createClass(TreeLayout, [{\\n    key: 'layout',\\n    value: function layout(node) {\\n      calcChildrenWidth(node);\\n      calcTotalSize(node, this.height);\\n\\n      _layout(node, this.height);\\n    }\\n  }, {\\n    key: 'renderLinks',\\n    value: function renderLinks(node) {\\n      _renderLinks(node);\\n    }\\n  }]);\\n\\n  return TreeLayout;\\n}();\\n\\nexports.default = TreeLayout;\\n\\n\\nfunction _layout(node, height) {\\n  if (node.children.length === 0) {\\n    return;\\n  }\\n\\n  var x = Math.round(node.width / 2) - Math.round(node.childrenWidth / 2);\\n  var y = node.height + height;\\n\\n  node.children.forEach(function (child) {\\n    child.x = x + Math.round(child.totalWidth / 2) - Math.round(child.width / 2);\\n    child.y = y;\\n\\n    child.g.transition().duration(DURATION).attr('transform', 'translate(' + child.x + ',' + child.y + ')');\\n\\n    x += child.totalWidth + MARGIN;\\n  });\\n}\\n\\nfunction _renderLinks(node) {\\n  var src = {\\n    x: node.linkX,\\n    y: node.linkY\\n  };\\n\\n  node.children.forEach(function (child) {\\n    var dst = {\\n      x: child.x + child.linkX,\\n      y: child.y + child.linkY\\n    };\\n\\n    if (child.constructor === _array2.default) {\\n      if (child.children.length !== 0) {\\n        var gc = child.children[0];\\n        dst.x += gc.x + gc.linkX;\\n        dst.y += gc.y + gc.linkY;\\n      }\\n    }\\n\\n    var link = node.g.insert('path', ':first-child').attr('class', 'vtree-link').attr('d', function () {\\n      return diagonal({ source: src, target: src });\\n    });\\n\\n    link.transition().duration(DURATION).attr('d', function () {\\n      return diagonal({ source: src, target: dst });\\n    });\\n  });\\n}\\n\\nfunction calcChildrenWidth(node) {\\n  if (node.children.length === 0) {\\n    node.childrenWidth = 0;\\n\\n    return;\\n  }\\n\\n  var w = 0;\\n\\n  node.children.forEach(function (child) {\\n    w += child.totalWidth;\\n  });\\n\\n  w += (node.children.length - 1) * MARGIN;\\n\\n  node.childrenWidth = w;\\n}\\n\\nfunction calcTotalSize(node, height) {\\n  if (node.children.length === 0) {\\n    node.totalWidth = node.width;\\n    node.totalHeight = node.height;\\n\\n    return;\\n  }\\n\\n  node.totalWidth = Math.max(node.width, node.childrenWidth);\\n\\n  var maxChildH = 0;\\n\\n  node.children.forEach(function (child) {\\n    maxChildH = Math.max(maxChildH, child.totalHeight);\\n  });\\n\\n  node.totalHeight = node.height + height + maxChildH;\\n}\\n\\n//# sourceURL=webpack://VTree/./src/layout/tree.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/array.js\":\n/*!***************************!*\\\n  !*** ./src/node/array.js ***!\n  \\***************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nvar _node = __webpack_require__(/*! ./node.js */ \\\"./src/node/node.js\\\");\\n\\nvar _node2 = _interopRequireDefault(_node);\\n\\nvar _array = __webpack_require__(/*! ../layout/array.js */ \\\"./src/layout/array.js\\\");\\n\\nvar _array2 = _interopRequireDefault(_array);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\"this hasn't been initialised - super() hasn't been called\\\"); } return call && (typeof call === \\\"object\\\" || typeof call === \\\"function\\\") ? call : self; }\\n\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\"function\\\" && superClass !== null) { throw new TypeError(\\\"Super expression must either be null or a function, not \\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\n\\nvar defaultLayout = new _array2.default();\\n\\nvar MARGIN = 10;\\n\\nvar ArrayNode = function (_Node) {\\n  _inherits(ArrayNode, _Node);\\n\\n  function ArrayNode(nodes, layout) {\\n    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\\n\\n    _classCallCheck(this, ArrayNode);\\n\\n    if (!layout) {\\n      layout = defaultLayout;\\n    }\\n\\n    var _this = _possibleConstructorReturn(this, (ArrayNode.__proto__ || Object.getPrototypeOf(ArrayNode)).call(this, null, nodes, layout));\\n\\n    _this.width = 0;\\n    _this.height = 0;\\n\\n    _this.linkX = 0;\\n    _this.linkY = 0;\\n\\n    _this.margin = options.margin || MARGIN;\\n    return _this;\\n  }\\n\\n  _createClass(ArrayNode, [{\\n    key: '_render',\\n    value: function _render() {}\\n  }]);\\n\\n  return ArrayNode;\\n}(_node2.default);\\n\\nexports.default = ArrayNode;\\n\\n//# sourceURL=webpack://VTree/./src/node/array.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/dummy.js\":\n/*!***************************!*\\\n  !*** ./src/node/dummy.js ***!\n  \\***************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nvar _node = __webpack_require__(/*! ./node.js */ \\\"./src/node/node.js\\\");\\n\\nvar _node2 = _interopRequireDefault(_node);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\"this hasn't been initialised - super() hasn't been called\\\"); } return call && (typeof call === \\\"object\\\" || typeof call === \\\"function\\\") ? call : self; }\\n\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\"function\\\" && superClass !== null) { throw new TypeError(\\\"Super expression must either be null or a function, not \\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\n\\nvar DummyNode = function (_Node) {\\n  _inherits(DummyNode, _Node);\\n\\n  function DummyNode(child) {\\n    _classCallCheck(this, DummyNode);\\n\\n    var _this = _possibleConstructorReturn(this, (DummyNode.__proto__ || Object.getPrototypeOf(DummyNode)).call(this, null, [child]));\\n\\n    _this.r = 4;\\n    return _this;\\n  }\\n\\n  _createClass(DummyNode, [{\\n    key: '_render',\\n    value: function _render(g) {\\n      g.append('circle').attr('cx', this.r).attr('cy', this.r).attr('r', this.r);\\n\\n      this.width = this.r * 2;\\n      this.height = this.r * 2;\\n\\n      this.linkX = this.r;\\n      this.linkY = this.r;\\n    }\\n  }]);\\n\\n  return DummyNode;\\n}(_node2.default);\\n\\nexports.default = DummyNode;\\n\\n//# sourceURL=webpack://VTree/./src/node/dummy.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/node.js\":\n/*!**************************!*\\\n  !*** ./src/node/node.js ***!\n  \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\n/**\\n * Node\\n *\\n * A tree consists of nodes and links.\\n * A node consists of the following fields:\\n *\\n * - id : auto increment ID.\\n * - data : data which may be displayed.\\n *          The data format is determined by the renderer.\\n * - children : children of the node\\n */\\n\\nvar curMaxId = 0;\\n\\nvar Node = function () {\\n  function Node(data, children, layout) {\\n    _classCallCheck(this, Node);\\n\\n    this.id = ++curMaxId;\\n    this.data = data;\\n    this.children = children;\\n\\n    if (layout) {\\n      this.layout = layout;\\n    }\\n\\n    this.width = 0;\\n    this.height = 0;\\n\\n    this.decorators = [];\\n  }\\n\\n  _createClass(Node, [{\\n    key: 'render',\\n    value: function render(g) {\\n      var _this = this;\\n\\n      if (this.decorators.length === 0) {\\n        this._render(g);\\n        return;\\n      }\\n\\n      var prevG = g.append('g');\\n      this._render(prevG);\\n\\n      this.decorators.forEach(function (decorator) {\\n        var newG = g.append('g');\\n\\n        var dbbox = decorator.render(newG, prevG, _this.width, _this.height);\\n\\n        if (dbbox.dw || dbbox.dh) {\\n          _this.width += dbbox.dw;\\n          _this.height += dbbox.dh;\\n        }\\n\\n        if (dbbox.dx || dbbox.dy) {\\n          prevG.attr('transform', 'translate(' + dbbox.dx + ',' + dbbox.dy + ')');\\n\\n          _this.linkX += dbbox.dx;\\n          _this.linkY += dbbox.dy;\\n        }\\n\\n        prevG = newG;\\n      });\\n    }\\n  }, {\\n    key: '_render',\\n    value: function _render() {\\n      throw new Error('[no overwride errror] _render is not implemented.');\\n    }\\n  }]);\\n\\n  return Node;\\n}();\\n\\nexports.default = Node;\\n\\n//# sourceURL=webpack://VTree/./src/node/node.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/string.js\":\n/*!****************************!*\\\n  !*** ./src/node/string.js ***!\n  \\****************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nvar _node = __webpack_require__(/*! ./node.js */ \\\"./src/node/node.js\\\");\\n\\nvar _node2 = _interopRequireDefault(_node);\\n\\nvar _util = __webpack_require__(/*! ./util.js */ \\\"./src/node/util.js\\\");\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\"this hasn't been initialised - super() hasn't been called\\\"); } return call && (typeof call === \\\"object\\\" || typeof call === \\\"function\\\") ? call : self; }\\n\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\"function\\\" && superClass !== null) { throw new TypeError(\\\"Super expression must either be null or a function, not \\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\n\\nvar StringNode = function (_Node) {\\n  _inherits(StringNode, _Node);\\n\\n  function StringNode(data) {\\n    _classCallCheck(this, StringNode);\\n\\n    var _this = _possibleConstructorReturn(this, (StringNode.__proto__ || Object.getPrototypeOf(StringNode)).call(this, data, []));\\n\\n    _this.textPad = 4;\\n    return _this;\\n  }\\n\\n  _createClass(StringNode, [{\\n    key: '_render',\\n    value: function _render(g) {\\n      var bbox = (0, _util.appendRectText)(g, 0, 0, this.data, this.textPad);\\n\\n      this.width = bbox.width;\\n      this.height = bbox.height;\\n\\n      this.linkX = Math.round(this.width / 2);\\n      this.linkY = Math.round(this.height / 2);\\n    }\\n  }]);\\n\\n  return StringNode;\\n}(_node2.default);\\n\\nexports.default = StringNode;\\n\\n//# sourceURL=webpack://VTree/./src/node/string.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/table.js\":\n/*!***************************!*\\\n  !*** ./src/node/table.js ***!\n  \\***************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nvar _node = __webpack_require__(/*! ./node.js */ \\\"./src/node/node.js\\\");\\n\\nvar _node2 = _interopRequireDefault(_node);\\n\\nvar _util = __webpack_require__(/*! ./util.js */ \\\"./src/node/util.js\\\");\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\\\"this hasn't been initialised - super() hasn't been called\\\"); } return call && (typeof call === \\\"object\\\" || typeof call === \\\"function\\\") ? call : self; }\\n\\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \\\"function\\\" && superClass !== null) { throw new TypeError(\\\"Super expression must either be null or a function, not \\\" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\\n\\nvar TableNode = function (_Node) {\\n  _inherits(TableNode, _Node);\\n\\n  function TableNode(data, children) {\\n    _classCallCheck(this, TableNode);\\n\\n    var _this = _possibleConstructorReturn(this, (TableNode.__proto__ || Object.getPrototypeOf(TableNode)).call(this, data, children));\\n\\n    _this.textPad = 4;\\n    return _this;\\n  }\\n\\n  _createClass(TableNode, [{\\n    key: '_render',\\n    value: function _render(g) {\\n      if (this.data.length === 0 || this.data[0].length === 0) {\\n        return;\\n      }\\n\\n      var tbl = this.renderCells(g);\\n      var size = this.layoutCells(tbl);\\n\\n      this.width = size.width;\\n      this.height = size.height;\\n\\n      this.linkX = Math.round(this.width / 2);\\n      this.linkY = Math.round(this.height / 2);\\n    }\\n  }, {\\n    key: 'renderCells',\\n    value: function renderCells(g) {\\n      var _this2 = this;\\n\\n      var tbl = [];\\n\\n      this.data.forEach(function (row) {\\n        var tblRow = [];\\n\\n        row.forEach(function (col) {\\n          var colG = g.append('g');\\n          var bbox = (0, _util.appendRectText)(colG, 0, 0, col, _this2.textPad);\\n\\n          tblRow.push({\\n            g: colG,\\n            bbox: bbox\\n          });\\n        });\\n\\n        tbl.push(tblRow);\\n      });\\n\\n      return tbl;\\n    }\\n  }, {\\n    key: 'layoutCells',\\n    value: function layoutCells(tbl) {\\n      var maxW = this.calcMaxWidths(tbl);\\n      var maxH = this.calcMaxHeights(tbl);\\n\\n      var x = 0;\\n      var y = 0;\\n\\n      tbl.forEach(function (row, rowI) {\\n        x = 0;\\n\\n        row.forEach(function (col, colI) {\\n          col.g.attr('transform', 'translate(' + x + ',' + y + ')');\\n          col.g.select('rect').attr('width', maxW[colI]).attr('height', maxH[rowI]);\\n\\n          x += maxW[colI];\\n        });\\n\\n        y += maxH[rowI];\\n      });\\n\\n      return { width: x, height: y };\\n    }\\n  }, {\\n    key: 'calcMaxWidths',\\n    value: function calcMaxWidths(tbl) {\\n      var maxW = [];\\n      var colI, rowI;\\n\\n      for (colI = 0; colI < tbl[0].length; colI++) {\\n        var w = 0;\\n\\n        for (rowI = 0; rowI < tbl.length; rowI++) {\\n          w = Math.max(w, tbl[rowI][colI].bbox.width);\\n        }\\n\\n        maxW.push(w);\\n      }\\n\\n      return maxW;\\n    }\\n  }, {\\n    key: 'calcMaxHeights',\\n    value: function calcMaxHeights(tbl) {\\n      var maxH = [];\\n\\n      tbl.forEach(function (row) {\\n        var h = 0;\\n\\n        row.forEach(function (col) {\\n          h = Math.max(h, col.bbox.height);\\n        });\\n\\n        maxH.push(h);\\n      });\\n\\n      return maxH;\\n    }\\n  }]);\\n\\n  return TableNode;\\n}(_node2.default);\\n\\nexports.default = TableNode;\\n\\n//# sourceURL=webpack://VTree/./src/node/table.js?\");\n\n/***/ }),\n\n/***/ \"./src/node/util.js\":\n/*!**************************!*\\\n  !*** ./src/node/util.js ***!\n  \\**************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _typeof = typeof Symbol === \\\"function\\\" && typeof Symbol.iterator === \\\"symbol\\\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \\\"function\\\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \\\"symbol\\\" : typeof obj; };\\n\\nexports.appendRectText = appendRectText;\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar MAX_LEN = 32;\\n\\nvar BBox = exports.BBox = function BBox() {\\n  var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\\n  var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\\n  var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\\n  var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\\n\\n  _classCallCheck(this, BBox);\\n\\n  this.x = x;\\n  this.y = y;\\n  this.width = width;\\n  this.height = height;\\n};\\n\\nfunction appendRectText(g, x, y, text, pad) {\\n  if (typeof text === 'string' && text.length > MAX_LEN) {\\n    text = text.substr(0, MAX_LEN) + '...';\\n  }\\n\\n  var rect = g.append('rect').attr('class', getClassName(text));\\n\\n  var t = g.append('text').text(text);\\n\\n  var b = t.node().getBBox();\\n  var w = Math.ceil(b.width);\\n  var h = Math.ceil(b.height);\\n\\n  t.attr('x', x + pad).attr('y', y + pad + h);\\n\\n  var bbox = new BBox(x, y, w + pad * 2, h + pad * 2);\\n\\n  rect.attr('x', bbox.x).attr('y', bbox.y).attr('width', bbox.width).attr('height', bbox.height);\\n\\n  return bbox;\\n}\\n\\nfunction getClassName(d) {\\n  var name = '';\\n  var type = typeof d === 'undefined' ? 'undefined' : _typeof(d);\\n\\n  if (d === null) {\\n    return 'null-text';\\n  } else if (type === 'string') {\\n    name = 'string-text';\\n  } else if (type === 'number') {\\n    name = 'number-text';\\n  } else if (type === 'boolean') {\\n    name = 'boolean-text';\\n  } else {\\n    name = 'unknown-text';\\n  }\\n\\n  return name;\\n}\\n\\n//# sourceURL=webpack://VTree/./src/node/util.js?\");\n\n/***/ }),\n\n/***/ \"./src/reader/object.js\":\n/*!******************************!*\\\n  !*** ./src/reader/object.js ***!\n  \\******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\n\\nvar _typeof = typeof Symbol === \\\"function\\\" && typeof Symbol.iterator === \\\"symbol\\\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \\\"function\\\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \\\"symbol\\\" : typeof obj; };\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\\n\\nvar _string = __webpack_require__(/*! ../node/string.js */ \\\"./src/node/string.js\\\");\\n\\nvar _string2 = _interopRequireDefault(_string);\\n\\nvar _array = __webpack_require__(/*! ../node/array.js */ \\\"./src/node/array.js\\\");\\n\\nvar _array2 = _interopRequireDefault(_array);\\n\\nvar _table = __webpack_require__(/*! ../node/table.js */ \\\"./src/node/table.js\\\");\\n\\nvar _table2 = _interopRequireDefault(_table);\\n\\nvar _dummy = __webpack_require__(/*! ../node/dummy.js */ \\\"./src/node/dummy.js\\\");\\n\\nvar _dummy2 = _interopRequireDefault(_dummy);\\n\\nvar _linkName = __webpack_require__(/*! ../decorator/linkName.js */ \\\"./src/decorator/linkName.js\\\");\\n\\nvar _linkName2 = _interopRequireDefault(_linkName);\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar ObjectReader = function () {\\n  function ObjectReader() {\\n    _classCallCheck(this, ObjectReader);\\n  }\\n\\n  _createClass(ObjectReader, [{\\n    key: 'read',\\n    value: function read(obj) {\\n      return obj2node(obj, '');\\n    }\\n  }]);\\n\\n  return ObjectReader;\\n}();\\n\\nexports.default = ObjectReader;\\n\\n\\nfunction obj2node(obj, linkName) {\\n  var node;\\n\\n  if (isPrimitive(obj)) {\\n    node = new _string2.default(obj);\\n  } else if (Array.isArray(obj)) {\\n    var nodes = [];\\n\\n    obj.forEach(function (item, i) {\\n      if (Array.isArray(item)) {\\n        node = new _dummy2.default(obj2node(item, ''));\\n        node.decorators.push(new _linkName2.default(linkName + '[' + i + ']'));\\n        nodes.push(node);\\n      } else {\\n        node = obj2node(item, linkName + '[' + i + ']');\\n        nodes.push(node);\\n      }\\n    });\\n\\n    // empty array\\n    if (nodes.length === 0) {\\n      node = obj2node(null, linkName + '[]');\\n      nodes.push(node);\\n    }\\n\\n    node = new _array2.default(nodes);\\n  } else {\\n    var name;\\n    var tbl = [];\\n    var children = [];\\n\\n    for (name in obj) {\\n      if (!Object.prototype.hasOwnProperty.call(obj, name)) {\\n        continue;\\n      }\\n\\n      var data = obj[name];\\n\\n      if (isPrimitive(data)) {\\n        tbl.push([name, data]);\\n      } else {\\n        children.push(obj2node(data, name));\\n      }\\n    }\\n\\n    if (tbl.length === 0) {\\n      node = new _table2.default([[' ', ' ']], children);\\n    } else {\\n      node = new _table2.default(tbl, children);\\n    }\\n  }\\n\\n  if (linkName !== '' && node.constructor !== _array2.default) {\\n    node.decorators.push(new _linkName2.default(linkName));\\n  }\\n\\n  return node;\\n}\\n\\nfunction isPrimitive(d) {\\n  var type = typeof d === 'undefined' ? 'undefined' : _typeof(d);\\n\\n  if (d === null || type === 'string' || type === 'number' || type === 'boolean') {\\n    return true;\\n  }\\n\\n  return false;\\n}\\n\\n//# sourceURL=webpack://VTree/./src/reader/object.js?\");\n\n/***/ }),\n\n/***/ \"./src/util.js\":\n/*!*********************!*\\\n  !*** ./src/util.js ***!\n  \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\nexports.visitBefore = visitBefore;\\nexports.visitAfter = visitAfter;\\nfunction visitBefore(node, callback) {\\n  var nodes = [node];\\n\\n  while (nodes.length !== 0) {\\n    node = nodes.pop();\\n\\n    callback(node);\\n\\n    var children = node.children;\\n\\n    if (children) {\\n      var n = children.length;\\n\\n      while (--n >= 0) {\\n        nodes.push(children[n]);\\n      }\\n    }\\n  }\\n}\\n\\nfunction visitAfter(node, callback) {\\n  var nodes = [node];\\n  var nodes2 = [];\\n\\n  while (nodes.length !== 0) {\\n    node = nodes.pop();\\n\\n    nodes2.push(node);\\n\\n    var children = node.children;\\n\\n    if (children) {\\n      var i = -1;\\n      var n = children.length;\\n\\n      while (++i < n) {\\n        nodes.push(children[i]);\\n      }\\n    }\\n  }\\n\\n  while (nodes2.length !== 0) {\\n    node = nodes2.pop();\\n\\n    callback(node);\\n  }\\n}\\n\\n//# sourceURL=webpack://VTree/./src/util.js?\");\n\n/***/ }),\n\n/***/ \"./src/vtree.js\":\n/*!**********************!*\\\n  !*** ./src/vtree.js ***!\n  \\**********************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\neval(\"\\n\\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\\\"value\\\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* global d3 */\\n\\nvar _node = __webpack_require__(/*! ./node/node.js */ \\\"./src/node/node.js\\\");\\n\\nvar _node2 = _interopRequireDefault(_node);\\n\\nvar _string = __webpack_require__(/*! ./node/string.js */ \\\"./src/node/string.js\\\");\\n\\nvar _string2 = _interopRequireDefault(_string);\\n\\nvar _table = __webpack_require__(/*! ./node/table.js */ \\\"./src/node/table.js\\\");\\n\\nvar _table2 = _interopRequireDefault(_table);\\n\\nvar _array = __webpack_require__(/*! ./node/array.js */ \\\"./src/node/array.js\\\");\\n\\nvar _array2 = _interopRequireDefault(_array);\\n\\nvar _tree = __webpack_require__(/*! ./layout/tree.js */ \\\"./src/layout/tree.js\\\");\\n\\nvar _tree2 = _interopRequireDefault(_tree);\\n\\nvar _array3 = __webpack_require__(/*! ./layout/array.js */ \\\"./src/layout/array.js\\\");\\n\\nvar _array4 = _interopRequireDefault(_array3);\\n\\nvar _object = __webpack_require__(/*! ./reader/object.js */ \\\"./src/reader/object.js\\\");\\n\\nvar _object2 = _interopRequireDefault(_object);\\n\\nvar _util = __webpack_require__(/*! ./util.js */ \\\"./src/util.js\\\");\\n\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\n\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\"Cannot call a class as a function\\\"); } }\\n\\nvar WIDTH = 960;\\nvar HEIGHT = 800;\\nvar MARGIN = 20;\\n\\nvar DEFAULT_TREE_LAYOUT_HEIGHT = 50;\\nvar DEBUG_TREE_LAYOUT_HEIGHT = 100;\\n\\nvar style = '\\\\n.vtree-node text { font: 14px sans-serif; }\\\\n.vtree-link { fill: none; stroke: #888; stroke-width: 2px; }\\\\n.vtree-table { stroke-width: 2px; stroke: steelblue; }\\\\npath.vtree-table { fill: white; }\\\\ng.vtree-node rect { fill: white; stroke: black; stroke-width: 1px; }\\\\ng.vtree-node rect.number-text { fill: #d8f0ed; }\\\\ng.vtree-node rect.string-text { fill: #e7f0db; }\\\\ng.vtree-node rect.boolean-text { fill: #e1d8f0; }\\\\ng.vtree-node rect.null-text { fill: #888; }\\\\n';\\n\\nvar VTree = function () {\\n  function VTree(container) {\\n    var _this = this;\\n\\n    _classCallCheck(this, VTree);\\n\\n    this.root = new _array2.default([], new _array4.default({ hideLinks: true }));\\n    this.defaultLayout = new _tree2.default({ height: DEFAULT_TREE_LAYOUT_HEIGHT });\\n    this.container = container;\\n    this._width = WIDTH;\\n    this._height = HEIGHT;\\n    this._debug = false;\\n\\n    this.d3 = {};\\n\\n    this.d3.container = d3.select(this.container);\\n\\n    this.d3.zoomListener = d3.behavior.zoom().scaleExtent([0.1, 10]).on('zoom', function () {\\n      var e = d3.event;\\n\\n      if (_this.d3.g) {\\n        _this.d3.g.attr('transform', 'translate(' + e.translate + ')scale(' + e.scale + ')');\\n      }\\n    });\\n\\n    this.d3.svg = this.d3.container.append('svg').attr('class', 'vtree').attr('width', this._width).attr('height', this._height).call(this.d3.zoomListener);\\n  }\\n\\n  _createClass(VTree, [{\\n    key: 'width',\\n    value: function width(_width) {\\n      if (arguments.length === 0) {\\n        return this._width;\\n      }\\n\\n      this._width = _width;\\n\\n      this.d3.container.select('svg').attr('width', _width);\\n\\n      return this;\\n    }\\n  }, {\\n    key: 'height',\\n    value: function height(_height) {\\n      if (arguments.length === 0) {\\n        return this._height;\\n      }\\n\\n      this._height = _height;\\n\\n      this.d3.container.select('svg').attr('height', _height);\\n\\n      return this;\\n    }\\n  }, {\\n    key: 'debug',\\n    value: function debug(_debug) {\\n      if (arguments.length === 0) {\\n        return this._debug;\\n      }\\n\\n      if (_debug) {\\n        this.defaultLayout.height = DEBUG_TREE_LAYOUT_HEIGHT;\\n      } else {\\n        this.defaultLayout.height = DEFAULT_TREE_LAYOUT_HEIGHT;\\n      }\\n\\n      this._debug = _debug;\\n\\n      return this;\\n    }\\n  }, {\\n    key: 'data',\\n    value: function data(_data) {\\n      if (Array.isArray(_data)) {\\n        this.root.children = _data;\\n      } else {\\n        this.root.children = [_data];\\n      }\\n\\n      return this;\\n    }\\n  }, {\\n    key: 'createSvgString',\\n    value: function createSvgString() {\\n      var svg = this.d3.svg.node();\\n      var serializer = new XMLSerializer();\\n      var source = serializer.serializeToString(svg);\\n\\n      if (!source.match(/^<svg[^>]+xmlns=\\\"http:\\\\/\\\\/www\\\\.w3\\\\.org\\\\/2000\\\\/svg\\\"/)) {\\n        source = source.replace(/^<svg/, '<svg xmlns=\\\"http://www.w3.org/2000/svg\\\"');\\n      }\\n\\n      if (!source.match(/^<svg[^>]+\\\"http:\\\\/\\\\/www\\\\.w3\\\\.org\\\\/1999\\\\/xlink\\\"/)) {\\n        source = source.replace(/^<svg/, '<svg xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\"');\\n      }\\n\\n      source = '<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\\\r\\\\n' + source;\\n\\n      return source;\\n    }\\n  }, {\\n    key: 'createTreeGroups',\\n    value: function createTreeGroups(parentG, depth) {\\n      var hasChildren = false;\\n\\n      var g = parentG.selectAll('g.vtree-node').data(function (d) {\\n        if (d.children.length !== 0) {\\n          hasChildren = true;\\n        }\\n\\n        return d.children;\\n      }).enter().append('g').attr('class', 'vtree-node').each(function (d) {\\n        d.g = d3.select(this);\\n      });\\n\\n      if (hasChildren) {\\n        this.createTreeGroups(g, depth + 1);\\n      }\\n    }\\n  }, {\\n    key: 'update',\\n    value: function update() {\\n      var _this2 = this;\\n\\n      var root = {\\n        id: 1,\\n        children: [this.root]\\n      };\\n\\n      this.d3.svg.selectAll('*').remove();\\n\\n      this.d3.svg.append('style').text(style);\\n\\n      this._debugDrawGrid();\\n\\n      this.d3.g = this.d3.svg.selectAll('g.vtree-root').data([root]).enter().append('g').attr('class', 'vtree-root');\\n\\n      this.createTreeGroups(this.d3.g, 0);\\n\\n      (0, _util.visitAfter)(this.root, function (node) {\\n        node.render(node.g);\\n\\n        var layout = node.layout || _this2.defaultLayout;\\n\\n        layout.layout(node);\\n\\n        if (layout.renderLinks) {\\n          layout.renderLinks(node);\\n        }\\n      });\\n\\n      if (this._debug) {\\n        (0, _util.visitAfter)(this.root, function (node) {\\n          _this2._debugDrawNodeInfo(node);\\n        });\\n      }\\n\\n      this.setRootPos();\\n\\n      return this;\\n    }\\n  }, {\\n    key: 'setRootPos',\\n    value: function setRootPos() {\\n      this.root.x = Math.round((this._width - this.root.width) / 2);\\n      this.root.y = Math.round((this._height - this.root.totalHeight) / 2);\\n\\n      if (this.root.y < MARGIN) {\\n        this.root.y = MARGIN;\\n      }\\n\\n      this.root.g.attr('transform', 'translate(' + this.root.x + ',' + this.root.y + ')');\\n    }\\n  }, {\\n    key: '_debugGetG',\\n    value: function _debugGetG() {\\n      if (!this._debug) {\\n        return;\\n      }\\n\\n      var g = this.d3.svg.select('g.debug-info');\\n\\n      if (!g.empty()) {\\n        return g;\\n      }\\n\\n      return this.d3.svg.append('g').attr('class', 'debug-info');\\n    }\\n  }, {\\n    key: '_debugDrawGrid',\\n    value: function _debugDrawGrid() {\\n      if (!this._debug) {\\n        return;\\n      }\\n\\n      var g = this._debugGetG();\\n\\n      g.append('line').style('stroke', 'red').attr('x1', this._width / 2).attr('y1', 0).attr('x2', this._width / 2).attr('y2', this._height);\\n\\n      g.append('line').style('stroke', 'red').attr('x1', 0).attr('y1', this._height / 2).attr('x2', this._width).attr('y2', this._height / 2);\\n    }\\n  }, {\\n    key: '_debugDrawNodeInfo',\\n    value: function _debugDrawNodeInfo(node) {\\n      if (node.constructor === _array2.default) {\\n        return;\\n      }\\n\\n      // node rect\\n      node.g.append('rect').style('fill', 'none').style('stroke', 'tomato').attr('x', -1).attr('y', -1).attr('width', node.width + 2).attr('height', node.height + 2);\\n\\n      // node total rect\\n      node.g.append('rect').style('fill', 'none').style('stroke', 'mediumpurple').attr('x', (node.width - node.totalWidth) / 2).attr('y', 0).attr('width', node.totalWidth).attr('height', node.totalHeight);\\n\\n      // x, y\\n      var xy = node.g.append('text').text('x=' + node.x + ' y=' + node.y);\\n\\n      var bbox = xy.node().getBBox();\\n      var x = node.width / 2;\\n      var y = node.height + bbox.height + 2;\\n\\n      xy.attr('x', x).attr('y', y).attr('text-anchor', 'middle');\\n\\n      y += bbox.height + 2;\\n\\n      // width, height\\n      node.g.append('text').text('w=' + node.width + ' h=' + node.height).attr('x', x).attr('y', y).attr('text-anchor', 'middle');\\n\\n      y += bbox.height + 2;\\n\\n      // totalWidth, totalHeight\\n      node.g.append('text').text('tw=' + node.totalWidth + ' th=' + node.totalHeight).attr('x', x).attr('y', y).attr('text-anchor', 'middle');\\n\\n      y += bbox.height + 2;\\n\\n      // childrenWidth\\n      node.g.append('text').text('cw=' + node.childrenWidth).attr('x', x).attr('y', y).attr('text-anchor', 'middle');\\n    }\\n  }]);\\n\\n  return VTree;\\n}();\\n\\nVTree.node = {};\\nVTree.node.Node = _node2.default;\\nVTree.node.String = _string2.default;\\nVTree.node.Table = _table2.default;\\nVTree.node.Array = _array2.default;\\n\\nVTree.layout = {};\\nVTree.layout.Tree = _tree2.default;\\nVTree.layout.Array = _array4.default;\\n\\nVTree.reader = {};\\nVTree.reader.Object = _object2.default;\\n\\nmodule.exports = VTree;\\n\\n//# sourceURL=webpack://VTree/./src/vtree.js?\");\n\n/***/ })\n\n/******/ });"
  },
  {
    "path": "index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n  <title>Online JSON to Tree Diagram Converter</title>\n\n  <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3\" crossorigin=\"anonymous\">\n  <link rel=\"stylesheet\" href=\"css/vtree.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"css/custom.css\" type=\"text/css\" />\n\n  <script src=\"https://d3js.org/d3.v3.min.js\" charset=\"utf-8\"></script>\n  <script src=\"dist/vtree.js\"></script>\n\n  <script type=\"text/javascript\">\n    var vt;\n    \n    window.onload = function () {\n      var container = document.getElementById(\"container\");\n      var msg = document.getElementById(\"msg\");\n      vt = new VTree(container);\n      var reader = new VTree.reader.Object();\n    \n      function updateTree() {\n        var s = document.getElementById(\"from-text\").value;\n    \n        msg.innerHTML = '';\n    \n        try {\n          var jsonData = JSON.parse(s);\n        } catch (e) {\n          msg.innerHTML = 'JSON parse error: ' + e.message;\n        }\n    \n        var data = reader.read(jsonData);\n    \n        vt.data(data)\n          .update();\n      }\n    \n      function createSvgString() {\n        document.getElementById(\"svg-text\").value = vt.createSvgString();\n      }\n    \n      document.getElementById(\"go-button\").onclick = updateTree;\n      document.getElementById(\"svg-button\").onclick = createSvgString;\n    \n      updateTree();\n    };\n    \n    </script>\n\n</head>\n\n<body>\n  <!-- https://tholman.com/github-corners/ -->\n  <a href=\"https://github.com/ivan111/vtree\" target=\"_blank\" class=\"github-corner\" aria-label=\"View project on GitHub\" title=\"View project on GitHub\">\n    <svg width=\"80\" height=\"80\" viewBox=\"0 0 250 250\" style=\"fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;\" aria-hidden=\"true\">\n      <path d=\"M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z\"></path>\n      <path d=\"M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2\" fill=\"currentColor\" style=\"transform-origin: 130px 106px;\" class=\"octo-arm\"></path>\n      <path d=\"M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z\" fill=\"currentColor\" class=\"octo-body\"></path>\n    </svg>\n  </a>\n  <style>\n    .github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}\n  </style>\n\n  <div class=\"container my-4\">\n\n    <header class=\"d-flex align-items-center\">\n      <h1 class=\"mb-3\">Online JSON to Tree Diagram Converter</h1>\n    </header>\n\n    <div class=\"mb-3\">\n      <label for=\"from-text\" class=\"form-label\">JSON</label>\n      <textarea id=\"from-text\" class=\"form-control\" rows=\"6\">[{ \"array\": [ 1, 2, [3, 4], 5 ], \"boolean\": true, \"null\": null, \"number\": 123, \"object\": { \"a\": \"b\", \"c\": \"d\", \"e\": \"f\" }, \"string\": \"Hello World\" }, { \"|\": \"|\", \"  \": { \"ʕ\": \"\" }, \" \": [\"◕\", [ { \"hello! \": \"<ﾆフ\" } ], \"◕\"], \"_\": { \"\": \"ʔ\" } }]</textarea>\n    </div>\n\n    <div class=\"mb-3\">\n      <button id=\"go-button\" type=\"button\" class=\"btn btn-primary\">Visualize</button>\n    </div>\n\n    <div id=\"msg\" class=\"text-danger mb-3\"></div>\n\n    <div id=\"container\" class=\"mb-3\"></div>\n\n    <div class=\"mb-3\">\n      <button id=\"svg-button\" type=\"button\" class=\"btn btn-primary\">Get SVG String</button>\n    </div>\n\n    <div class=\"mb-3\">\n      <p>If you want to export the diagram as a svg file, copy the following text into a text editor and save the file with a .svg extension.</p>\n      <textarea id=\"svg-text\" class=\"form-control\" rows=\"6\"></textarea>\n    </div>\n\n    <footer class=\"text-end\">\n      <small>Created Date: 2014-07-27, Modified Date: 2018-11-01</small>\n    </footer>\n\n  </div>\n\n  <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js\" integrity=\"sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13\" crossorigin=\"anonymous\"></script>\n</body>\n\n</html>\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vtree\",\n  \"version\": \"0.3.0\",\n  \"description\": \"display json data in a tree diagram.\",\n  \"main\": \"build/vtree.js\",\n  \"scripts\": {\n    \"build\": \"webpack\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/ivan111/vtree.git\"\n  },\n  \"keywords\": [\n    \"json\",\n    \"tree\"\n  ],\n  \"author\": \"ivan111\",\n  \"license\": \"Apache License Version 2\",\n  \"bugs\": {\n    \"url\": \"https://github.com/ivan111/vtree/issues\"\n  },\n  \"homepage\": \"https://github.com/ivan111/vtree#readme\",\n  \"devDependencies\": {\n    \"babel-core\": \"^6.23.1\",\n    \"babel-loader\": \"^7\",\n    \"babel-preset-es2015\": \"^6.22.0\",\n    \"eslint\": \"^5.8.0\",\n    \"eslint-loader\": \"^2.1.1\",\n    \"webpack\": \"^4.23.1\",\n    \"webpack-cli\": \"^3.1.2\"\n  }\n}\n"
  },
  {
    "path": "src/decorator/linkName.js",
    "content": "const pad = 4;\n\nexport default class LinkNameDecorator {\n  constructor(linkName) {\n    this.linkName = linkName;\n  }\n\n  render(g, oldG, width) {\n    const t = g.append('text')\n      .text(this.linkName);\n\n    const b = t.node().getBBox();\n    const textW = Math.ceil(b.width);\n    const textH = Math.ceil(b.height);\n\n    const textTotalW = textW + pad * 2;\n\n    var newW = width;\n\n    if (textTotalW > width) {\n      newW = textTotalW;\n    }\n\n    const textTotalH = textH + pad;\n\n    const dw = newW - width;\n    const dh = textTotalH;\n    const dx = Math.round(dw / 2);\n    const dy = textTotalH;\n\n    t\n      .attr('x', Math.round(newW / 2))\n      .attr('y', textH)\n      .attr('text-anchor', 'middle');\n\n    return { dx, dy, dw, dh };\n  }\n}\n"
  },
  {
    "path": "src/layout/array.js",
    "content": "/* global d3 */\n\nconst DURATION = 1000;\n\nconst diagonal = d3.svg.diagonal();\n\n\nexport default class ArrayLayout {\n  constructor(options={}) {\n    this.hideLinks = options.hideLinks;\n  }\n\n  layout(node) {\n    calcChildrenWidth(node);\n    calcTotalSize(node);\n\n    layout(node);\n  }\n\n  renderLinks(node) {\n    if (!this.hideLinks) {\n      renderLinks(node);\n    }\n  }\n}\n\n\nfunction layout(node) {\n  if (node.children.length === 0) {\n    return;\n  }\n\n  var x = -Math.round(node.childrenWidth / 2);\n  const y = 0;\n\n  node.children.forEach((child) => {\n    child.x = x + Math.round(child.totalWidth / 2) - Math.round(child.width / 2);\n    child.y = y;\n\n    child.g\n      .transition()\n      .duration(DURATION)\n      .attr('transform', `translate(${child.x},${child.y})`);\n\n    x += child.totalWidth + node.margin;\n  });\n}\n\n\nfunction renderLinks(node) {\n  if (node.children.length === 0) {\n    return;\n  }\n\n  var h = node.children[0].linkY;\n\n  node.children.forEach((child) => {\n    h = Math.min(h, child.linkY);\n  });\n\n  const orig = { x: 0, y: 0 };\n\n  var i, src, dst;\n\n  for (i = 0; i < node.children.length; i++) {\n    if (i === 0) {\n      continue;\n    }\n\n    const prev = node.children[i - 1];\n    const child = node.children[i];\n\n    src = {\n      x: prev.x + prev.linkX,\n      y: prev.y + h\n    };\n\n    dst = {\n      x: child.x + child.linkX,\n      y: child.y + h\n    };\n\n    const link = node.g.insert('path', ':first-child')\n      .attr('class', 'vtree-link')\n      .attr('d', function () {\n        return diagonal({ source: orig, target: orig });\n      });\n\n    link\n      .transition()\n      .duration(DURATION)\n      .attr('d', function () {\n        return diagonal({ source: src, target: dst });\n      });\n  }\n}\n\n\nfunction calcChildrenWidth(node) {\n  if (node.children.length === 0) {\n    node.childrenWidth = 0;\n\n    return;\n  }\n\n  var w = 0;\n\n  node.children.forEach((child) => {\n    w += child.totalWidth;\n  });\n\n  w += (node.children.length - 1) * node.margin;\n\n  node.childrenWidth = w;\n}\n\n\nfunction calcTotalSize(node) {\n  if (node.children.length === 0) {\n    node.totalWidth = node.width;\n    node.totalHeight = node.height;\n\n    return;\n  }\n\n  node.totalWidth = Math.max(node.width, node.childrenWidth);\n\n  var maxChildH = 0;\n\n  node.children.forEach((child) => {\n    maxChildH = Math.max(maxChildH, child.totalHeight);\n  });\n\n  node.totalHeight = maxChildH;\n}\n"
  },
  {
    "path": "src/layout/tree.js",
    "content": "/* global d3 */\n\nimport ArrayNode from '../node/array.js';\n\nconst MARGIN = 10;\nconst HEIGHT = 50;\nconst DURATION = 1000;\n\nconst diagonal = d3.svg.diagonal();\n\n\nexport default class TreeLayout {\n  constructor(options={}) {\n    this.height = options.height || HEIGHT;\n  }\n\n  layout(node) {\n    calcChildrenWidth(node);\n    calcTotalSize(node, this.height);\n\n    layout(node, this.height);\n  }\n\n  renderLinks(node) {\n    renderLinks(node);\n  }\n}\n\n\nfunction layout(node, height) {\n  if (node.children.length === 0) {\n    return;\n  }\n\n  var x = Math.round(node.width / 2) - Math.round(node.childrenWidth / 2);\n  const y = node.height + height;\n\n  node.children.forEach((child) => {\n    child.x = x + Math.round(child.totalWidth / 2) - Math.round(child.width / 2);\n    child.y = y;\n\n    child.g\n      .transition()\n      .duration(DURATION)\n      .attr('transform', `translate(${child.x},${child.y})`);\n\n    x += child.totalWidth + MARGIN;\n  });\n}\n\n\nfunction renderLinks(node) {\n  const src = {\n    x: node.linkX,\n    y: node.linkY\n  };\n\n  node.children.forEach((child) => {\n    const dst = {\n      x: child.x + child.linkX,\n      y: child.y + child.linkY\n    };\n\n    if (child.constructor === ArrayNode) {\n      if (child.children.length !== 0) {\n        const gc = child.children[0]\n        dst.x += gc.x + gc.linkX;\n        dst.y += gc.y + gc.linkY;\n      }\n    }\n\n    const link = node.g.insert('path', ':first-child')\n      .attr('class', 'vtree-link')\n      .attr('d', function () {\n        return diagonal({ source: src, target: src });\n      });\n\n    link\n      .transition()\n      .duration(DURATION)\n      .attr('d', function () {\n        return diagonal({ source: src, target: dst });\n      });\n  });\n}\n\n\nfunction calcChildrenWidth(node) {\n  if (node.children.length === 0) {\n    node.childrenWidth = 0;\n\n    return;\n  }\n\n  var w = 0;\n\n  node.children.forEach((child) => {\n    w += child.totalWidth;\n  });\n\n  w += (node.children.length - 1) * MARGIN;\n\n  node.childrenWidth = w;\n}\n\n\nfunction calcTotalSize(node, height) {\n  if (node.children.length === 0) {\n    node.totalWidth = node.width;\n    node.totalHeight = node.height;\n\n    return;\n  }\n\n  node.totalWidth = Math.max(node.width, node.childrenWidth);\n\n  var maxChildH = 0;\n\n  node.children.forEach((child) => {\n    maxChildH = Math.max(maxChildH, child.totalHeight);\n  });\n\n  node.totalHeight = node.height + height + maxChildH;\n}\n"
  },
  {
    "path": "src/node/README.md",
    "content": "# How to make a custom node\n\n1. extend the Node class\n\n```js\nexport default class MyNode extends Node {\n  ...\n}\n```\n\n2. create the constructor functio and call super in it.\n\n```js\n  constructor(data, children) {\n    super(data, children);\n\n    ...\n  }\n```\n\n3. write a custom \\_render function.\n   And set this.width, this.height, this.linkX and this.linkY in it.\n   (linkX, linkY) is a link coord.\n\n```js\n  _render(g) {\n\n    ...\n\n    this.width = ...;\n    this.height = ...;\n\n    this.linkX = ...;\n    this.linkY = ...;\n  }\n```\n"
  },
  {
    "path": "src/node/array.js",
    "content": "import Node from './node.js';\nimport ArrayLayout from '../layout/array.js';\n\nconst defaultLayout = new ArrayLayout();\n\nconst MARGIN = 10;\n\n\nexport default class ArrayNode extends Node {\n  constructor(nodes, layout, options={}) {\n    if (!layout) {\n      layout = defaultLayout;\n    }\n\n    super(null, nodes, layout);\n\n    this.width = 0;\n    this.height = 0;\n\n    this.linkX = 0;\n    this.linkY = 0;\n\n    this.margin = options.margin || MARGIN;\n  }\n\n  _render() {\n  }\n}\n"
  },
  {
    "path": "src/node/dummy.js",
    "content": "import Node from './node.js';\n\n\nexport default class DummyNode extends Node {\n  constructor(child) {\n    super(null, [child]);\n\n    this.r = 4;\n  }\n\n  _render(g) {\n    g.append('circle')\n      .attr('cx', this.r)\n      .attr('cy', this.r)\n      .attr('r', this.r);\n\n    this.width = this.r * 2;\n    this.height = this.r * 2;\n\n    this.linkX = this.r;\n    this.linkY = this.r;\n  }\n}\n"
  },
  {
    "path": "src/node/node.js",
    "content": "/**\n * Node\n *\n * A tree consists of nodes and links.\n * A node consists of the following fields:\n *\n * - id : auto increment ID.\n * - data : data which may be displayed.\n *          The data format is determined by the renderer.\n * - children : children of the node\n */\n\n\nvar curMaxId = 0;\n\nexport default class Node {\n  constructor(data, children, layout) {\n    this.id = ++curMaxId;\n    this.data = data;\n    this.children = children;\n\n    if (layout) {\n      this.layout = layout;\n    }\n\n    this.width = 0;\n    this.height = 0;\n\n    this.decorators = [];\n  }\n\n  render(g) {\n    if (this.decorators.length === 0) {\n      this._render(g);\n      return;\n    }\n\n    var prevG = g.append('g');\n    this._render(prevG);\n\n    this.decorators.forEach((decorator) => {\n      const newG = g.append('g');\n\n      const dbbox = decorator.render(newG, prevG, this.width, this.height);\n\n      if (dbbox.dw || dbbox.dh) {\n        this.width += dbbox.dw;\n        this.height += dbbox.dh;\n      }\n\n      if (dbbox.dx || dbbox.dy) {\n        prevG.attr('transform', `translate(${dbbox.dx},${dbbox.dy})`);\n\n        this.linkX += dbbox.dx;\n        this.linkY += dbbox.dy;\n      }\n\n      prevG = newG;\n    });\n  }\n\n  _render() {\n    throw new Error('[no overwride errror] _render is not implemented.');\n  }\n}\n"
  },
  {
    "path": "src/node/string.js",
    "content": "import Node from './node.js';\nimport { appendRectText } from './util.js';\n\n\nexport default class StringNode extends Node {\n  constructor(data) {\n    super(data, []);\n\n    this.textPad = 4;\n  }\n\n  _render(g) {\n    const bbox = appendRectText(g, 0, 0, this.data, this.textPad);\n\n    this.width = bbox.width;\n    this.height = bbox.height;\n\n    this.linkX = Math.round(this.width / 2);\n    this.linkY = Math.round(this.height / 2);\n  }\n}\n"
  },
  {
    "path": "src/node/table.js",
    "content": "import Node from './node.js';\nimport { appendRectText } from './util.js';\n\n\nexport default class TableNode extends Node {\n  constructor(data, children) {\n    super(data, children);\n\n    this.textPad = 4;\n  }\n\n  _render(g) {\n    if (this.data.length === 0 || this.data[0].length === 0) {\n      return;\n    }\n\n    const tbl = this.renderCells(g);\n    const size = this.layoutCells(tbl);\n\n    this.width = size.width;\n    this.height = size.height;\n\n    this.linkX = Math.round(this.width / 2);\n    this.linkY = Math.round(this.height / 2);\n  }\n\n  renderCells(g) {\n    const tbl = [];\n\n    this.data.forEach((row) => {\n      const tblRow = [];\n\n      row.forEach((col) => {\n        const colG = g.append('g');\n        const bbox = appendRectText(colG, 0, 0, col, this.textPad);\n\n        tblRow.push({\n          g: colG,\n          bbox: bbox\n        });\n      });\n\n      tbl.push(tblRow);\n    });\n\n    return tbl;\n  }\n\n  layoutCells(tbl) {\n    const maxW = this.calcMaxWidths(tbl);\n    const maxH = this.calcMaxHeights(tbl);\n\n    var x = 0;\n    var y = 0;\n\n    tbl.forEach((row, rowI) => {\n      x = 0;\n\n      row.forEach((col, colI) => {\n        col.g.attr('transform', `translate(${x},${y})`);\n        col.g.select('rect')\n          .attr('width', maxW[colI])\n          .attr('height', maxH[rowI]);\n\n        x += maxW[colI];\n      });\n\n      y += maxH[rowI];\n    });\n\n    return { width: x, height: y };\n  }\n\n  calcMaxWidths(tbl) {\n    const maxW = [];\n    var colI, rowI;\n\n    for (colI = 0; colI < tbl[0].length; colI++) {\n      var w = 0;\n\n      for (rowI = 0; rowI < tbl.length; rowI++) {\n        w = Math.max(w, tbl[rowI][colI].bbox.width);\n      }\n\n      maxW.push(w);\n    }\n\n    return maxW;\n  }\n\n  calcMaxHeights(tbl) {\n    const maxH = [];\n\n    tbl.forEach((row) => {\n      var h = 0;\n\n      row.forEach((col) => {\n        h = Math.max(h, col.bbox.height);\n      });\n\n      maxH.push(h);\n    });\n\n    return maxH;\n  }\n}\n"
  },
  {
    "path": "src/node/util.js",
    "content": "const MAX_LEN = 32;\n\nexport class BBox {\n  constructor(x=0, y=0, width=0, height=0) {\n    this.x = x;\n    this.y = y;\n    this.width = width;\n    this.height = height;\n  }\n}\n\n\nexport function appendRectText(g, x, y, text, pad) {\n  if (typeof text === 'string' && text.length > MAX_LEN) {\n    text = text.substr(0, MAX_LEN) + '...';\n  }\n\n  const rect = g.append('rect')\n    .attr('class', getClassName(text));\n\n  const t = g.append('text')\n    .text(text);\n\n  const b = t.node().getBBox();\n  const w = Math.ceil(b.width);\n  const h = Math.ceil(b.height);\n\n  t\n    .attr('x', x + pad)\n    .attr('y', y + pad + h);\n\n  const bbox = new BBox(x, y, w + pad * 2, h + pad * 2);\n\n  rect\n    .attr('x', bbox.x)\n    .attr('y', bbox.y)\n    .attr('width', bbox.width)\n    .attr('height', bbox.height);\n\n  return bbox;\n}\n\n\nfunction getClassName(d) {\n  var name = '';\n  const type = typeof d;\n\n  if (d === null) {\n    return 'null-text';\n  } else if (type === 'string') {\n    name = 'string-text';\n  } else if (type === 'number') {\n    name = 'number-text';\n  } else if (type === 'boolean') {\n    name = 'boolean-text';\n  } else {\n    name = 'unknown-text';\n  }\n\n  return name;\n}\n"
  },
  {
    "path": "src/reader/object.js",
    "content": "import StringNode from '../node/string.js';\nimport ArrayNode from '../node/array.js';\nimport TableNode from '../node/table.js';\nimport DummyNode from '../node/dummy.js';\n\nimport LinkNameDecorator from '../decorator/linkName.js';\n\n\nexport default class ObjectReader {\n  constructor() {\n  }\n\n  read(obj) {\n    return obj2node(obj, '');\n  }\n}\n\n\nfunction obj2node(obj, linkName) {\n  var node;\n\n  if (isPrimitive(obj)) {\n    node = new StringNode(obj);\n  } else if (Array.isArray(obj)) {\n    const nodes = [];\n\n    obj.forEach((item, i) => {\n      if (Array.isArray(item)) {\n        node = new DummyNode(obj2node(item, ''));\n        node.decorators.push(new LinkNameDecorator(`${linkName}[${i}]`));\n        nodes.push(node);\n      } else {\n        node = obj2node(item, `${linkName}[${i}]`);\n        nodes.push(node);\n      }\n    });\n\n    // empty array\n    if (nodes.length === 0) {\n      node = obj2node(null, `${linkName}[]`);\n      nodes.push(node);\n    }\n\n    node = new ArrayNode(nodes);\n  } else {\n    var name;\n    var tbl = [];\n    var children = [];\n\n    for (name in obj) {\n      if (!Object.prototype.hasOwnProperty.call(obj, name)) {\n        continue;\n      }\n\n      var data = obj[name];\n\n      if (isPrimitive(data)) {\n        tbl.push([name, data]);\n      } else {\n        children.push(obj2node(data, name));\n      }\n    }\n\n    if (tbl.length === 0) {\n      node = new TableNode([[' ', ' ']], children);\n    } else {\n      node = new TableNode(tbl, children);\n    }\n\n  }\n\n  if (linkName !== '' && node.constructor !== ArrayNode) {\n    node.decorators.push(new LinkNameDecorator(linkName));\n  }\n\n  return node;\n}\n\n\nfunction isPrimitive(d) {\n  const type = typeof d;\n\n  if (d === null || type === 'string' || type === 'number' || type === 'boolean') {\n    return true;\n  }\n\n  return false;\n}\n"
  },
  {
    "path": "src/reader/test/object_reader_test.js",
    "content": "/* eslint-disable no-undef */\n\nimport Reader from '../object.js';\n\nimport StringNode from '../../node/string.js';\nimport ArrayNode from '../../node/array.js';\nimport TableNode from '../../node/table.js';\nimport DummyNode from '../../node/dummy.js';\n\nimport LinkNameDecorator from '../../decorator/linkName.js';\n\n\ndescribe('test ObjectReader', function () {\n  var r;\n\n  beforeEach(function () {\n    r = new Reader();\n  });\n\n  // read a primitive object\n\n  it ('read a null', function () {\n    var d = r.read(null);\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(null);\n    expect(d.children).to.have.lengthOf(0);\n  });\n\n  it ('read a boolean', function () {\n    var d = r.read(true);\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(true);\n    expect(d.children).to.have.lengthOf(0);\n\n    d = r.read(false);\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(false);\n    expect(d.children).to.have.lengthOf(0);\n  });\n\n  it ('read a number', function () {\n    var d = r.read(666);\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(666);\n    expect(d.children).to.have.lengthOf(0);\n\n    d = r.read(3.14);\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(3.14);\n    expect(d.children).to.have.lengthOf(0);\n  });\n\n  it ('read a string', function () {\n    var d = r.read('JK business');\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal('JK business');\n    expect(d.children).to.have.lengthOf(0);\n\n    d = r.read('お茶漬け');\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal('お茶漬け');\n    expect(d.children).to.have.lengthOf(0);\n  });\n\n  // read a complex object\n\n  it ('read an array', function () {\n    var d = r.read([1, 2]);\n    expect(d.data).to.equal(null);\n    expect(d).to.be.instanceof(ArrayNode);\n    expect(d.children).to.have.lengthOf(2);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(1);\n    expect(c.children).to.have.lengthOf(0);\n\n    c = d.children[1];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(2);\n    expect(c.children).to.have.lengthOf(0);\n  });\n\n  it ('read a nested array', function () {\n    var d = r.read([1, [2, 3]]);\n    expect(d.data).to.equal(null);\n    expect(d).to.be.instanceof(ArrayNode);\n    expect(d.children).to.have.lengthOf(2);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(1);\n    expect(c.children).to.have.lengthOf(0);\n\n    c = d.children[1];\n    expect(c).to.be.instanceof(DummyNode);\n    expect(c.data).to.eql(null);\n    expect(c.children).to.have.lengthOf(1);\n\n    d = c.children[0];\n    expect(d).to.be.instanceof(ArrayNode);\n    expect(d.data).to.equal(null);\n    expect(d.children).to.have.lengthOf(2);\n\n    c = d.children[0];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(2);\n    expect(c.children).to.have.lengthOf(0);\n\n    c = d.children[1];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(3);\n    expect(c.children).to.have.lengthOf(0);\n  });\n\n  it ('read an object', function () {\n    var d = r.read({\n      x: 1,\n      y: 2\n    });\n\n    expect(d).to.be.instanceof(TableNode);\n    expect(d.data).to.eql([['x', 1], ['y', 2]]);\n    expect(d.children).to.have.lengthOf(0);\n  });\n\n  it ('read a nested object', function () {\n    var d = r.read({\n      name: {\n        first: 'Bob',\n        last: 'Bach'\n      },\n      age: 24\n    });\n\n    expect(d).to.be.instanceof(TableNode);\n    expect(d.data).to.eql([['age', 24]]);\n    expect(d.children).to.have.lengthOf(1);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(TableNode);\n    expect(c.data).to.eql([['first', 'Bob'], ['last', 'Bach']]);\n    expect(c.children).to.have.lengthOf(0);\n\n    var deco = c.decorators[0];\n    expect(deco).to.be.instanceof(LinkNameDecorator);\n    expect(deco.linkName).to.equal('name');\n  });\n\n  it ('read a nested object with no parent data', function () {\n    var d = r.read({\n      name: {\n        first: 'Bob',\n        last: 'Bach'\n      }\n    });\n\n    expect(d).to.be.instanceof(TableNode);\n    expect(d.data).to.eql([[' ', ' ']]);\n    expect(d.children).to.have.lengthOf(1);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(TableNode);\n    expect(c.data).to.eql([['first', 'Bob'], ['last', 'Bach']]);\n    expect(c.children).to.have.lengthOf(0);\n\n    var deco = c.decorators[0];\n    expect(deco).to.be.instanceof(LinkNameDecorator);\n    expect(deco.linkName).to.equal('name');\n  });\n\n  it ('read an array containing an object', function () {\n    var d = r.read([1, {val: 4}]);\n    expect(d.data).to.equal(null);\n    expect(d).to.be.instanceof(ArrayNode);\n    expect(d.children).to.have.lengthOf(2);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(StringNode);\n    expect(c.data).to.equal(1);\n    expect(c.children).to.have.lengthOf(0);\n\n    c = d.children[1];\n    expect(c).to.be.instanceof(TableNode);\n    expect(c.data).to.eql([['val', 4]]);\n    expect(c.children).to.have.lengthOf(0);\n  });\n\n  it ('read an object containing an array', function () {\n    var d = r.read({\n      name: 'Mike',\n      vals: [2, 4]\n    });\n\n    expect(d).to.be.instanceof(TableNode);\n    expect(d.data).to.eql([['name', 'Mike']]);\n    expect(d.children).to.have.lengthOf(1);\n\n    var c = d.children[0];\n    expect(c).to.be.instanceof(ArrayNode);\n    expect(c.data).to.equal(null);\n    expect(c.children).to.have.lengthOf(2);\n\n    d = c.children[0];\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(2);\n    expect(d.children).to.have.lengthOf(0);\n\n    var deco = d.decorators[0];\n    expect(deco).to.be.instanceof(LinkNameDecorator);\n    expect(deco.linkName).to.equal('vals[0]');\n\n    d = c.children[1];\n    expect(d).to.be.instanceof(StringNode);\n    expect(d.data).to.equal(4);\n    expect(d.children).to.have.lengthOf(0);\n\n    deco = d.decorators[0];\n    expect(deco).to.be.instanceof(LinkNameDecorator);\n    expect(deco.linkName).to.equal('vals[1]');\n  });\n});\n"
  },
  {
    "path": "src/util.js",
    "content": "export function visitBefore(node, callback) {\n  const nodes = [node];\n\n  while (nodes.length !== 0) {\n    node = nodes.pop();\n\n    callback(node);\n\n    const children = node.children;\n\n    if (children) {\n      var n = children.length;\n\n      while (--n >= 0) {\n        nodes.push(children[n]);\n      }\n    }\n  }\n}\n\nexport function visitAfter(node, callback) {\n  const nodes = [node];\n  const nodes2 = [];\n\n  while (nodes.length !== 0) {\n    node = nodes.pop();\n\n    nodes2.push(node);\n\n    const children = node.children;\n\n    if (children) {\n      var i = -1;\n      const n = children.length;\n\n      while (++i < n) {\n        nodes.push(children[i]);\n      }\n    }\n  }\n\n  while (nodes2.length !== 0) {\n    node = nodes2.pop();\n\n    callback(node);\n  }\n}\n"
  },
  {
    "path": "src/vtree.js",
    "content": "/* global d3 */\n\nimport Node from './node/node.js';\nimport StringNode from './node/string.js';\nimport TableNode from './node/table.js';\nimport ArrayNode from './node/array.js';\n\nimport TreeLayout from './layout/tree.js';\nimport ArrayLayout from './layout/array.js';\n\nimport ObjectReader from './reader/object.js';\n\nimport { visitAfter } from './util.js';\n\n\nconst WIDTH = 960;\nconst HEIGHT = 800;\nconst MARGIN = 20;\n\nconst DEFAULT_TREE_LAYOUT_HEIGHT = 50;\nconst DEBUG_TREE_LAYOUT_HEIGHT = 100;\n\nconst style = `\n.vtree-node text { font: 14px sans-serif; }\n.vtree-link { fill: none; stroke: #888; stroke-width: 2px; }\n.vtree-table { stroke-width: 2px; stroke: steelblue; }\npath.vtree-table { fill: white; }\ng.vtree-node rect { fill: white; stroke: black; stroke-width: 1px; }\ng.vtree-node rect.number-text { fill: #d8f0ed; }\ng.vtree-node rect.string-text { fill: #e7f0db; }\ng.vtree-node rect.boolean-text { fill: #e1d8f0; }\ng.vtree-node rect.null-text { fill: #888; }\n`;\n\n\nclass VTree {\n  constructor(container) {\n    this.root = new ArrayNode([], new ArrayLayout({ hideLinks: true }));\n    this.defaultLayout = new TreeLayout({height: DEFAULT_TREE_LAYOUT_HEIGHT});\n    this.container = container;\n    this._width = WIDTH;\n    this._height = HEIGHT;\n    this._debug = false;\n\n    this.d3 = {};\n\n    this.d3.container = d3.select(this.container);\n\n    this.d3.zoomListener = d3.behavior.zoom()\n      .scaleExtent([0.1, 10])\n      .on('zoom', () => {\n        const e = d3.event;\n\n        if (this.d3.g) {\n          this.d3.g.attr('transform', `translate(${e.translate})scale(${e.scale})`);\n        }\n      });\n\n    this.d3.svg = this.d3.container.append('svg')\n      .attr('class', 'vtree')\n      .attr('width', this._width)\n      .attr('height', this._height)\n      .call(this.d3.zoomListener);\n  }\n\n  width(width) {\n    if (arguments.length === 0) {\n      return this._width;\n    }\n\n    this._width = width;\n\n    this.d3.container.select('svg')\n      .attr('width', width);\n\n    return this;\n  }\n\n  height(height) {\n    if (arguments.length === 0) {\n      return this._height;\n    }\n\n    this._height = height;\n\n    this.d3.container.select('svg')\n      .attr('height', height);\n\n    return this;\n  }\n\n  debug(debug) {\n    if (arguments.length === 0) {\n      return this._debug;\n    }\n\n    if (debug) {\n      this.defaultLayout.height = DEBUG_TREE_LAYOUT_HEIGHT;\n    } else {\n      this.defaultLayout.height = DEFAULT_TREE_LAYOUT_HEIGHT;\n    }\n\n    this._debug = debug;\n\n    return this;\n  }\n\n  data(data) {\n    if (Array.isArray(data)) {\n      this.root.children = data;\n    } else {\n      this.root.children = [data];\n    }\n\n    return this;\n  }\n\n  createSvgString() {\n    var svg = this.d3.svg.node();\n    var serializer = new XMLSerializer();\n    var source = serializer.serializeToString(svg);\n\n    if (!source.match(/^<svg[^>]+xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg\"/)) {\n      source = source.replace(/^<svg/, '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n    }\n\n    if (!source.match(/^<svg[^>]+\"http:\\/\\/www\\.w3\\.org\\/1999\\/xlink\"/)) {\n      source = source.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"');\n    }\n\n    source = '<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n' + source;\n\n    return source;\n  }\n\n  createTreeGroups(parentG, depth) {\n    var hasChildren = false;\n\n    const g = parentG\n      .selectAll('g.vtree-node')\n      .data(function (d) {\n        if (d.children.length !== 0) {\n          hasChildren = true;\n        }\n\n        return d.children;\n      })\n      .enter()\n      .append('g')\n      .attr('class', 'vtree-node')\n      .each(function (d) {\n        d.g = d3.select(this);\n      });\n\n    if (hasChildren) {\n      this.createTreeGroups(g, depth + 1);\n    }\n  }\n\n  update() {\n    const root = {\n      id: 1,\n      children: [this.root]\n    };\n\n    this.d3.svg.selectAll('*').remove();\n\n    this.d3.svg.append('style').text(style);\n\n    this._debugDrawGrid();\n\n    this.d3.g = this.d3.svg.selectAll('g.vtree-root')\n      .data([root])\n      .enter()\n      .append('g')\n      .attr('class', 'vtree-root');\n\n    this.createTreeGroups(this.d3.g, 0);\n\n    visitAfter(this.root, (node) => {\n      node.render(node.g);\n\n      const layout = node.layout || this.defaultLayout;\n\n      layout.layout(node);\n\n      if (layout.renderLinks) {\n        layout.renderLinks(node);\n      }\n    });\n\n    if (this._debug) {\n      visitAfter(this.root, (node) => {\n        this._debugDrawNodeInfo(node);\n      });\n    }\n\n\n    this.setRootPos();\n\n    return this;\n  }\n\n  setRootPos() {\n    this.root.x = Math.round((this._width - this.root.width) / 2);\n    this.root.y = Math.round((this._height - this.root.totalHeight) / 2);\n\n    if (this.root.y < MARGIN) {\n      this.root.y = MARGIN;\n    }\n\n    this.root.g.attr('transform', `translate(${this.root.x},${this.root.y})`);\n\n  }\n\n  _debugGetG() {\n    if (!this._debug) {\n      return;\n    }\n\n    var g = this.d3.svg.select('g.debug-info');\n\n    if (!g.empty()) {\n      return g;\n    }\n\n    return this.d3.svg.append('g')\n      .attr('class', 'debug-info');\n  }\n\n  _debugDrawGrid() {\n    if (!this._debug) {\n      return;\n    }\n\n    const g = this._debugGetG();\n\n    g.append('line')\n      .style('stroke', 'red')\n      .attr('x1', this._width / 2)\n      .attr('y1', 0)\n      .attr('x2', this._width / 2)\n      .attr('y2', this._height);\n\n    g.append('line')\n      .style('stroke', 'red')\n      .attr('x1', 0)\n      .attr('y1', this._height / 2)\n      .attr('x2', this._width)\n      .attr('y2', this._height / 2);\n  }\n\n  _debugDrawNodeInfo(node) {\n    if (node.constructor === ArrayNode) {\n      return;\n    }\n\n    // node rect\n    node.g.append('rect')\n      .style('fill', 'none')\n      .style('stroke', 'tomato')\n      .attr('x', -1)\n      .attr('y', -1)\n      .attr('width', node.width + 2)\n      .attr('height', node.height + 2);\n\n    // node total rect\n    node.g.append('rect')\n      .style('fill', 'none')\n      .style('stroke', 'mediumpurple')\n      .attr('x', (node.width - node.totalWidth) / 2)\n      .attr('y', 0)\n      .attr('width', node.totalWidth)\n      .attr('height', node.totalHeight);\n\n    // x, y\n    const xy = node.g.append('text')\n      .text(`x=${node.x} y=${node.y}`);\n\n    const bbox = xy.node().getBBox();\n    var x = node.width / 2;\n    var y = node.height + bbox.height + 2;\n\n    xy\n      .attr('x', x)\n      .attr('y', y)\n      .attr('text-anchor', 'middle');\n\n    y += bbox.height + 2;\n\n    // width, height\n    node.g.append('text')\n      .text(`w=${node.width} h=${node.height}`)\n      .attr('x', x)\n      .attr('y', y)\n      .attr('text-anchor', 'middle');\n\n    y += bbox.height + 2;\n\n    // totalWidth, totalHeight\n    node.g.append('text')\n      .text(`tw=${node.totalWidth} th=${node.totalHeight}`)\n      .attr('x', x)\n      .attr('y', y)\n      .attr('text-anchor', 'middle');\n\n    y += bbox.height + 2;\n\n    // childrenWidth\n    node.g.append('text')\n      .text(`cw=${node.childrenWidth}`)\n      .attr('x', x)\n      .attr('y', y)\n      .attr('text-anchor', 'middle');\n  }\n}\n\n\nVTree.node = {};\nVTree.node.Node = Node;\nVTree.node.String = StringNode;\nVTree.node.Table = TableNode;\nVTree.node.Array = ArrayNode;\n\nVTree.layout = {};\nVTree.layout.Tree = TreeLayout;\nVTree.layout.Array = ArrayLayout;\n\nVTree.reader = {};\nVTree.reader.Object = ObjectReader;\n\nmodule.exports = VTree;\n"
  },
  {
    "path": "test.html",
    "content": "<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n\n<title>vtree tests</title>\n\n<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">\n<link rel=\"stylesheet\" href=\"css/vtree.css\" type=\"text/css\"/>\n\n<script src=\"http://d3js.org/d3.v3.min.js\" charset=\"utf-8\"></script>\n\n<script src=\"dist/vtree.js\"></script>\n\n<script type=\"text/javascript\">\nwindow.onload = function () {\n  var NUM_TEST_S = 6;\n  var NUM_TEST_M = 6;\n  var NUM_TEST = 8;\n\n  var reader = new VTree.reader.Object();\n\n  function drawJSON(name, width, height) {\n    var container = document.getElementById(\"div-test-\" + name);\n    var s = document.getElementById(\"code-test-\" + name).innerHTML;\n    var jsonData = JSON.parse(s);\n    var data = reader.read(jsonData);\n\n    new VTree(container)\n      .width(width)\n      .height(height)\n      .debug(true)\n      .data(data)\n      .update();\n  }\n\n  var i;\n\n  for (i = 0; i < NUM_TEST_S; i++) {\n    drawJSON('s-' + i, 200, 200);\n  }\n\n  for (i = 0; i < NUM_TEST_M; i++) {\n    drawJSON('m-' + i, 400, 400);\n  }\n\n  for (i = 0; i < NUM_TEST; i++) {\n    drawJSON(i, 600, 600);\n  }\n};\n\n</script>\n\n</head>\n\n<body style=\"background-color: #DFD;\">\n\n<div class=\"container-fluid\">\n  <div class=\"row\">\n    <h1>vtree tests</h1>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-0\">null</code>\n      <div id=\"div-test-s-0\"></div>\n    </div>\n\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-1\">true</code>\n      <div id=\"div-test-s-1\"></div>\n    </div>\n\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-2\">123</code>\n      <div id=\"div-test-s-2\"></div>\n    </div>\n\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-3\">\"黄 飛鴻\"</code>\n      <div id=\"div-test-s-3\"></div>\n    </div>\n\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-4\">[1234.56789, \"ABCDE\"]</code>\n      <div id=\"div-test-s-4\"></div>\n    </div>\n\n    <div class=\"col-md-2 col-xs-4\">\n      <code id=\"code-test-s-5\">{ \"key\": \"value\" }</code>\n      <div id=\"div-test-s-5\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-0\">{\"name\": \"=\" ,\"children\": [{\"name\": \"id=range\"},{\"name\": \"class=range\"}]}</code>\n      <div id=\"div-test-m-0\"></div>\n    </div>\n\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-1\">{\n  \"array\": [\n    1,\n    2,\n    3\n  ],\n  \"boolean\": true,\n  \"null\": null,\n  \"number\": 123,\n  \"object\": {\n    \"a\": \"b\",\n    \"c\": \"d\",\n    \"e\": \"f\"\n  },\n  \"string\": \"Hello World\"\n}</code>\n      <div id=\"div-test-m-1\"></div>\n    </div>\n\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-2\">{\n  \"type\": \"Feature\",\n  \"geometry\": {\n    \"type\": \"Point\",\n    \"coordinates\": [125.6, 10.1]\n  },\n  \"properties\": {\n    \"name\": \"Dinagat Islands\"\n  }\n}</code>\n      <div id=\"div-test-m-2\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-3\">{\"employees\":[\n    {\"firstName\":\"John\", \"lastName\":\"Doe\"},\n    {\"firstName\":\"Anna\", \"lastName\":\"Smith\"},\n    {\"firstName\":\"Peter\", \"lastName\":\"Jones\"}\n]}</code>\n      <div id=\"div-test-m-3\"></div>\n    </div>\n\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-4\">{\n    \"items\": [\n        {\n            \"index\": 1,\n            \"index_start_at\": 56,\n            \"integer\": 29,\n            \"float\": 16.8278,\n            \"name\": \"Milton\",\n            \"surname\": \"Jensen\",\n            \"fullname\": \"Sheryl Winters\",\n            \"email\": \"denise@weiss.na\",\n            \"bool\": false\n        }\n    ]\n}</code>\n      <div id=\"div-test-m-4\"></div>\n    </div>\n\n    <div class=\"col-md-4 col-xs-6\">\n      <code id=\"code-test-m-5\">[1, [2, [3, 4]]]</code>\n      <div id=\"div-test-m-5\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-0\" style=\"display: none;\">[{\"sha\": \"faddda990159ad8a17eabf49fd0f89c24506d8c0\", \"commit\": {\"author\": {\"name\": \"ivan111\", \"date\": \"2017-03-19T13:52:24+09:00\"}, \"committer\": {\"name\": \"ivan111\", \"date\": \"2017-03-19T13:52:24+09:00\"}, \"message\": \"remove unused js\", \"tree\": {\"sha\": \"44c77d4d627c1c69b78041d838a38d7339c17409\"}}, \"parents\": [{\"sha\": \"1e2b280d5a182309af10b03e0d5bd0cefb038464\"}]}, {\"sha\": \"1e2b280d5a182309af10b03e0d5bd0cefb038464\", \"commit\": {\"author\": {\"name\": \"ivan111\", \"date\": \"2017-03-19T12:55:05+09:00\"}, \"committer\": {\"name\": \"ivan111\", \"date\": \"2017-03-19T12:55:05+09:00\"}, \"message\": \"make more readable and maintanable\", \"tree\": {\"sha\": \"83806c1db236a10975b195fda5ac703edaa6b3a6\"}}, \"parents\": [{\"sha\": \"c0f3d8d9ee3b19298bc470682cbb2ddcd2fdfc69\"}, {\"sha\": \"1dbf187a83ca55e4633eb4736c8a9e96ce1c9ea9\"}]}]</code>\n      <div id=\"div-test-0\"></div>\n    </div>\n\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-1\" style=\"display: none;\">{\"name\": \"for\" ,\"children\": [{\"name\": \"id=i\"},{\"name\": \"call\" ,\"children\": [{\"name\": \"id=range\"},{\"name\": \"list\" ,\"children\": [{\"name\": \"1\"},{\"name\": \"cell\" ,\"children\": [{\"name\": \"5\"},{\"name\": \"None\"}]},{\"name\": \"cell\" ,\"children\": [{\"name\": \"5\"},{\"name\": \"None\"}]}]}]},{\"name\": \"cell\" ,\"children\": [{\"name\": \"call\" ,\"children\": [{\"name\": \"id=print\"},{\"name\": \"list\" ,\"children\": [{\"name\": \"1\"},{\"name\": \"cell\" ,\"children\": [{\"name\": \"id=i\"},{\"name\": \"None\"}]},{\"name\": \"cell\" ,\"children\": [{\"name\": \"id=i\"},{\"name\": \"None\"}]}]}]},{\"name\": \"None\"}]}]}</code>\n      <div id=\"div-test-1\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-2\" style=\"display: none;\">{\n    \"firstName\": \"John\",\n    \"lastName\": \"Smith\",\n    \"gender\": \"man\",\n    \"age\": 32,\n    \"address\": {\n        \"streetAddress\": \"21 2nd Street\",\n        \"city\": \"New York\",\n        \"state\": \"NY\",\n        \"postalCode\": \"10021\"\n    },\n    \"phoneNumbers\": [\n        { \"type\": \"home\", \"number\": \"212 555-1234\" },\n        { \"type\": \"fax\", \"number\": \"646 555-4567\" }\n    ]\n}</code>\n      <div id=\"div-test-2\"></div>\n    </div>\n\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-3\" style=\"display: none;\">{\n  \"first\": \"John\",\n  \"last\": \"Doe\",\n  \"age\": 39,\n  \"sex\": \"M\",\n  \"salary\": 70000,\n  \"registered\": true,\n  \"interests\": [ \"Reading\", \"Mountain Biking\", \"Hacking\" ],\n  \"favorites\": {\n    \"color\": \"Blue\",\n    \"sport\": \"Soccer\",\n    \"food\": \"Spaghetti\"\n  },\n  \"skills\": [\n    {\n      \"category\": \"JavaScript\",\n      \"tests\": [\n        { \"name\": \"One\", \"score\": 90 },\n        { \"name\": \"Two\", \"score\": 96 }\n      ]\n    },\n    {\n      \"category\": \"CouchDB\",\n      \"tests\": [\n        { \"name\": \"One\", \"score\": 79 },\n        { \"name\": \"Two\", \"score\": 84 }\n      ]\n    },\n    {\n      \"category\": \"Node.js\",\n      \"tests\": [\n        { \"name\": \"One\", \"score\": 97 },\n        { \"name\": \"Two\", \"score\": 93 }\n      ]\n    }\n  ]\n}</code>\n      <div id=\"div-test-3\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-4\" style=\"display: none;\">{\"responseData\": {\"feed\":{\"feedUrl\":\"http://feeds.feedburner.com/marcqualie\",\"title\":\"Marc Qualie\",\"link\":\"http://blog.marcqualie.com/\",\"author\":\"\",\"description\":\"My Personal Tech Blog and Ramblings\",\"type\":\"atom10\",\"entries\":[{\"title\":\"Server Backups with s3cmd\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/acTzLDpmoBA/server-backups-with-s3cmd\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Sun, 28 Jul 2013 13:04:32 -0700\",\"contentSnippet\":\"I've been asked a few times how I back up my servers at Digital Ocean. It seems this topic is quite popular due to the fact ...\",\"content\":\"I've been asked a few times how I back up my servers at \\u003ca href\\u003d\\\"https://www.digitalocean.com/?refcode\\u003d4f6e23440060\\\"\\u003eDigital Ocean\\u003c/a\\u003e. It seems this topic is quite popular due to the fact they just started charging for automated backups on the 1st of July. In this article I'm going to go through the process of using \\u003ca href\\u003d\\\"http://s3tools.org/s3cmd\\\"\\u003es3cmd\\u003c/a\\u003e with \\u003ca href\\u003d\\\"https://aws.amazon.com/s3/\\\"\\u003eAmazon S3\\u003c/a\\u003e to easily backup and restore your servers. Although I use Digital Ocean as my own hosting company, and this is where this backup system is in place, it can just as easily be transferred to any hosting provider.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/linux\\\"\\u003eLinux\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/digital-ocean\\\"\\u003eDigital Ocean\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/aws\\\"\\u003eAWS\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/backup\\\"\\u003eBackup\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/servers\\\"\\u003eServers\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/s3\\\"\\u003eS3\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/07/server-backups-with-s3cmd\\\"\\u003ehttp://marcqualie.com/2013/07/server-backups-with-s3cmd\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/acTzLDpmoBA\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Linux\",\"Digital Ocean\",\"AWS\",\"Backup\",\"Servers\",\"S3\"]},{\"title\":\"Criterion: A PHP CI Server\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/2OSaAVrZ2-A/criterion:-a-php-ci-server\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Sat, 20 Jul 2013 12:42:06 -0700\",\"contentSnippet\":\"Today, the Romhut team just released an open source project that has been aggressively developed over the last few weeks. It ...\",\"content\":\"Today, the Romhut team just released an open source project that has been aggressively developed over the last few weeks. It started as a personal tool to test our many private repositories in a controlled environment but quickly evolved into a fully fledged, generic open source continuous integration server. Thanks to hours of discussion and endless commits (mainly from \\u003ca href\\u003d\\\"https://github.com/scottymeuk\\\"\\u003e@scottymeuk\\u003c/a\\u003e), \\u003ca href\\u003d\\\"http://romhut.github.io/criterion\\\"\\u003eCriterion\\u003c/a\\u003e was born.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/php\\\"\\u003ePHP\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/ci\\\"\\u003eCI\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/romhut\\\"\\u003eRomhut\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/07/criterion:-a-php-ci-server\\\"\\u003ehttp://marcqualie.com/2013/07/criterion:-a-php-ci-server\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/2OSaAVrZ2-A\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"PHP\",\"CI\",\"Romhut\"]},{\"title\":\"Homebrew Nginx Tap\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/-lMBWS9lz9I/homebrew-nginx-tap\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Sun, 30 Jun 2013 02:31:46 -0700\",\"contentSnippet\":\"I've recently been working on an Nginx Tap for Mac OS X Homebrew and now I think it's time to share with the world. Originally ...\",\"content\":\"I've recently been working on an \\u003ca href\\u003d\\\"https://github.com/marcqualie/homebrew-nginx\\\"\\u003eNginx Tap\\u003c/a\\u003e for Mac OS X Homebrew and now I think it's time to share with the world. Originally I created a pull request on the original repo but due to the custom nature of the modules I needed it was reccomended that I create a tap and maintain my own repository (tap). The main goal behind the tap is to create a version of Nginx with as many modules as possible so people can create fully custom builds very easily.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/nginx\\\"\\u003eNginx\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/ruby\\\"\\u003eRuby\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/homebrew\\\"\\u003eHomebrew\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/06/homebrew-nginx-tap\\\"\\u003ehttp://marcqualie.com/2013/06/homebrew-nginx-tap\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/-lMBWS9lz9I\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"Nginx\",\"Ruby\",\"Homebrew\"]},{\"title\":\"Open Source Challenge Complete!\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/K36wPrXGE0s/open-source-challenge-complete\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Thu, 20 Jun 2013 14:20:35 -0700\",\"contentSnippet\":\"For those of you that follow my blog reguarly, a few weeks ago I announced I was undertaking my Open Source Challenge. Today ...\",\"content\":\"For those of you that follow my blog reguarly, a few weeks ago I announced I was undertaking my \\u003ca href\\u003d\\\"/2013/05/open-source-challenge\\\"\\u003eOpen Source Challenge\\u003c/a\\u003e. Today marks the 32nd day of consecutive code pushes, so I successfully completed my goal! I've attached a list of the projects I contributed to for you guys to check out.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/php\\\"\\u003ePHP\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/06/open-source-challenge-complete\\\"\\u003ehttp://marcqualie.com/2013/06/open-source-challenge-complete\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/K36wPrXGE0s\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"PHP\"]},{\"title\":\"StatsD PHP Library\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/RkDcfkSNX54/statsd-php-library\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Thu, 13 Jun 2013 05:09:44 -0700\",\"contentSnippet\":\"Today, I just created a StatsD PHP Library and released it on Github . Before you start with \\\"but there are already loads..\\\", I ...\",\"content\":\"Today, I just created a \\u003ca href\\u003d\\\"https://github.com/etsy/statsd/\\\"\\u003eStatsD\\u003c/a\\u003e PHP Library and released it on \\u003ca href\\u003d\\\"https://github.com/marcqualie/php-statsd\\\"\\u003eGithub \\u003c/a\\u003e. Before you start with \\\"but there are already loads..\\\", I do realise this, but they didn't suite my needs. This is a short post to let you know why I opted to create my own, and what I hope to achieve from it.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/github\\\"\\u003eGithub\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/php\\\"\\u003ePHP\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/statistics\\\"\\u003eStatistics\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/library\\\"\\u003eLibrary\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/06/statsd-php-library\\\"\\u003ehttp://marcqualie.com/2013/06/statsd-php-library\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/RkDcfkSNX54\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"Github\",\"PHP\",\"Statistics\",\"Library\"]},{\"title\":\"Open Source Challenge\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/Vs9h5mvWdOs/open-source-challenge\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Mon, 27 May 2013 04:13:48 -0700\",\"contentSnippet\":\"It's bank Holiday Monday and I think it's about time for a new challenge. I've been working a lot with Open Source lately, both ...\",\"content\":\"It's bank Holiday Monday and I think it's about time for a new challenge. I've been working a lot with Open Source lately, both contributing to other people's projects and refactoring/improving my own. My current contribution streak on Github is 8 consecutive days of published code, which is pretty awesome considering my previous best was 2 days from about 6 months ago. Not only is this making me a better programmer but it's also extremely fun. With this in mind I've decided the new challenge is to try and create a 32 day streak.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/programming\\\"\\u003eProgramming\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/github\\\"\\u003eGithub\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/challenge\\\"\\u003eChallenge\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/05/open-source-challenge\\\"\\u003ehttp://marcqualie.com/2013/05/open-source-challenge\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/Vs9h5mvWdOs\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"Programming\",\"Github\",\"Challenge\"]},{\"title\":\"Why I use Digital Ocean Hosting\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/qoXUdyFGckQ/why-i-use-digital-ocean-hosting\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Thu, 23 May 2013 12:19:14 -0700\",\"contentSnippet\":\"In the last few years I've used a lot of hosting providers. Until now I've never actually found any that have been able to ...\",\"content\":\"In the last few years I've used a lot of hosting providers. Until now I've never actually found any that have been able to satisfy my needs at the right price. Sure, there are huge companies such as AWS, Rackspace and Softlayer to name a few, but who has the budget to use these kinds of providers for research or personal projects outside of a big enterprise company. Previously I used Linode. I'm going to let you guys know why I switched and why \\u003ca href\\u003d\\\"https://www.digitalocean.com/?refcode\\u003d4f6e23440060\\\"\\u003eDigital Ocean\\u003c/a\\u003e is my host of choice right now.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/hosting\\\"\\u003eHosting\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/promotion\\\"\\u003ePromotion\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/digital-ocean\\\"\\u003eDigital Ocean\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/05/why-i-use-digital-ocean-hosting\\\"\\u003ehttp://marcqualie.com/2013/05/why-i-use-digital-ocean-hosting\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/qoXUdyFGckQ\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Hosting\",\"Promotion\",\"Digital Ocean\"]},{\"title\":\"Why I learned Ruby\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/MUhruEiZUgY/why-i-learned-ruby\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Sat, 04 May 2013 13:30:13 -0700\",\"contentSnippet\":\"For a while now I've been hearing a lot of people taking about the programming language Ruby. Not that it's anything new, it ...\",\"content\":\"For a while now I've been hearing a lot of people taking about the programming language Ruby. Not that it's anything new, it just seems to be a lot more popular in my circle of friends and my Twitter feed. Naturally, as a professional PHP developer, I should hate the idea of Ruby and start some crazy argument about how PHP is far superior and Ruby should die (blah blah etc.. boring). Instead of this approach, I took it upon myself to learn Ruby from the ground up and understand why so many people enjoy using it to power their applications. Too many people argue over things without understanding both points of view, which always annoys me.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/programming\\\"\\u003eProgramming\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/php\\\"\\u003ePHP\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/project\\\"\\u003eProject\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/ruby\\\"\\u003eRuby\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/05/why-i-learned-ruby\\\"\\u003ehttp://marcqualie.com/2013/05/why-i-learned-ruby\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/MUhruEiZUgY\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Programming\",\"PHP\",\"Project\",\"Ruby\"]},{\"title\":\"Using Cloudflare Page Rules\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/-qkvCDEJ0p0/using-cloudflare-page-rules\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Mon, 01 Apr 2013 11:46:04 -0700\",\"contentSnippet\":\"Today, I decided to explore Cloudflare features in a bit more depth. I currently manage quite a few applications, both personal ...\",\"content\":\"Today, I decided to explore Cloudflare features in a bit more depth. I currently manage quite a few applications, both personal and business related on the platform. One feature which I'd never really looked into before was Page Rules. I'd read about them, but never actually applied them to any sites. Due to how much of an affect it actually had by applying a few rules, I feel like I should spread the word for anyone who isn't aware of what they are and how amazing they can be when used correctly.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/php\\\"\\u003ePHP\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/nginx\\\"\\u003eNginx\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/cloudflare\\\"\\u003eCloudflare\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/cache\\\"\\u003eCache\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/cdn\\\"\\u003eCDN\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/04/using-cloudflare-page-rules\\\"\\u003ehttp://marcqualie.com/2013/04/using-cloudflare-page-rules\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/-qkvCDEJ0p0\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"PHP\",\"Nginx\",\"Cloudflare\",\"Cache\",\"CDN\"]},{\"title\":\"New Writing Topics\",\"link\":\"http://feedproxy.google.com/~r/marcqualie/~3/NsovESjzfNM/new-writing-topics\",\"author\":\"Marc Qualie\",\"publishedDate\":\"Wed, 20 Mar 2013 16:34:59 -0700\",\"contentSnippet\":\"I've been neglecting my Blog lately mainly because I feel like I need to always write masses of code examples and showcase my ...\",\"content\":\"I've been neglecting my Blog lately mainly because I feel like I need to always write masses of code examples and showcase my own projects but I've decided that shouldn't be the case. Most of the code I write I can't share due to contracts, but I've been using so many awesome tools from the open source world that I feel like I need to share and spread awareness to other programmers.\\u003cbr\\u003e\\u003cbr\\u003eLabels: \\u003ca href\\u003d\\\"http://marcqualie.com/tag/open-source\\\"\\u003eOpen Source\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/random\\\"\\u003eRandom\\u003c/a\\u003e, \\u003ca href\\u003d\\\"http://marcqualie.com/tag/personal\\\"\\u003ePersonal\\u003c/a\\u003e\\u003cbr\\u003eSource: \\u003ca href\\u003d\\\"http://marcqualie.com/2013/03/new-writing-topics\\\"\\u003ehttp://marcqualie.com/2013/03/new-writing-topics\\u003c/a\\u003e\\u003cimg src\\u003d\\\"http://feeds.feedburner.com/~r/marcqualie/~4/NsovESjzfNM\\\" height\\u003d\\\"1\\\" width\\u003d\\\"1\\\"\\u003e\",\"categories\":[\"Open Source\",\"Random\",\"Personal\"]}]}}, \"responseDetails\": null, \"responseStatus\": 200}</code>\n      <div id=\"div-test-4\"></div>\n    </div>\n\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-5\" style=\"display: none;\">[\"FunctionLiteral\", {\"name\":\"\"}, [\"ExpressionStatement\", [\"Assignment\", {\"op\":\"ASSIGN\"}, [\"VariableProxy\", {\"name\":\"x\"} ], [\"Literal\", {\"handle\":1} ] ] ], [\"IfStatement\", [\"CompareOperation\", {\"op\":\"GT\"}, [\"VariableProxy\", {\"name\":\"x\"} ], [\"Literal\", {\"handle\":0} ] ], [\"Block\", [\"ExpressionStatement\", [\"Assignment\", {\"op\":\"ASSIGN\"}, [\"VariableProxy\", {\"name\":\"y\"} ], [\"BinaryOperation\", {\"op\":\"ADD\"}, [\"VariableProxy\", {\"name\":\"x\"} ], [\"Literal\", {\"handle\":2} ] ] ] ], [\"ExpressionStatement\", [\"Call\", [\"VariableProxy\", {\"name\":\"print\"} ], [\"VariableProxy\", {\"name\":\"y\"} ] ] ] ], [\"EmptyStatement\"] ] ]</code>\n      <div id=\"div-test-5\"></div>\n    </div>\n  </div>\n\n  <div class=\"row\">\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-6\" style=\"display: none;\">\n{\n    \"responseData\": {\n        \"results\": [{\n            \"GsearchResultClass\": \"GwebSearch\",\n            \"unescapedUrl\": \"http://en.wikipedia.org/wiki/Stack_(abstract_data_type )\",\n            \"url\": \"http://en.wikipedia.org/wiki/Stack_(abstract_data_type )\",\n            \"visibleUrl\": \"en.wikipedia.org\",\n            \"cacheUrl\": \"http://www.google.com/search?q\\u003dcache:hhCsdZCgMlUJ:en.wikipedia.org \",\n            \"title\": \"\\u003cb\\u003eStack\\u003c/b\\u003e (abstract data type) - Wikipedia, the free encyclopedia\",\n            \"titleNoFormatting\": \"Stack (abstract data type) - Wikipedia, the free encyclopedia\",\n            \"content\": \"In computer science, a \\u003cb\\u003estack\\u003c/b\\u003e is a particular kind of abstract data type or collection \\nin which the principal (or only) operations on the collection are the addition of \\u003cb\\u003e...\\u003c/b\\u003e\"\n        }, {\n            \"GsearchResultClass\": \"GwebSearch\",\n            \"unescapedUrl\": \"http://stackoverflow.com/\",\n            \"url\": \"http://stackoverflow.com/\",\n            \"visibleUrl\": \"stackoverflow.com\",\n            \"cacheUrl\": \"http://www.google.com/search?q\\u003dcache:U1GC2GYOToIJ:stackoverflow.com \",\n            \"title\": \"\\u003cb\\u003eStack\\u003c/b\\u003e Overflow\",\n            \"titleNoFormatting\": \"Stack Overflow\",\n            \"content\": \"A language-independent collaboratively edited question and answer site for \\nprogrammers.\"\n        }, {\n            \"GsearchResultClass\": \"GwebSearch\",\n            \"unescapedUrl\": \"http://www.stack.com/ \",\n            \"url\": \"http://www.stack.com/ \",\n            \"visibleUrl\": \"www.stack.com\",\n            \"cacheUrl\": \"http://www.google.com/search?q\\u003dcache:E20ImyHZCpIJ:www.stack.com \",\n            \"title\": \"Get Bigger, Stronger, Better, Faster | \\u003cb\\u003eSTACK\\u003c/b\\u003e\",\n            \"titleNoFormatting\": \"Get Bigger, Stronger, Better, Faster | STACK\",\n            \"content\": \"Get better at the sports you play and the life you lead at \\u003cb\\u003eSTACK\\u003c/b\\u003e. Improve your \\ntraining, nutrition and lifestyle with daily.\"\n        }, {\n            \"GsearchResultClass\": \"GwebSearch\",\n            \"unescapedUrl\": \"http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html \",\n            \"url\": \"http://docs.oracle.com/javase/7/docs/api/java/util/Stack.html \",\n            \"visibleUrl\": \"docs.oracle.com\",\n            \"cacheUrl\": \"http://www.google.com/search?q\\u003dcache:5G3WpASlFXAJ:docs.oracle.com \",\n            \"title\": \"\\u003cb\\u003eStack\\u003c/b\\u003e (Java Platform SE 7 ) - Oracle Documentation\",\n            \"titleNoFormatting\": \"Stack (Java Platform SE 7 ) - Oracle Documentation\",\n            \"content\": \"The \\u003cb\\u003eStack\\u003c/b\\u003e class represents a last-in-first-out (LIFO) \\u003cb\\u003estack\\u003c/b\\u003e of objects. It extends \\nclass Vector with five operations that allow a vector to be treated as a \\u003cb\\u003estack\\u003c/b\\u003e.\"\n        }],\n        \"cursor\": {\n            \"resultCount\": \"18,800,000\",\n            \"pages\": [{\n                \"start\": \"0\",\n                \"label\": 1\n            }, {\n                \"start\": \"4\",\n                \"label\": 2\n            }, {\n                \"start\": \"8\",\n                \"label\": 3\n            }, {\n                \"start\": \"12\",\n                \"label\": 4\n            }, {\n                \"start\": \"16\",\n                \"label\": 5\n            }, {\n                \"start\": \"20\",\n                \"label\": 6\n            }, {\n                \"start\": \"24\",\n                \"label\": 7\n            }, {\n                \"start\": \"28\",\n                \"label\": 8\n            }],\n            \"estimatedResultCount\": \"18800000\",\n            \"currentPageIndex\": 0,\n            \"moreResultsUrl\": \"http://www.google.com/search?oe\\u003dutf8\\u0026ie\\u003dutf8\\u0026source\\u003duds\\u0026start\\u003d0\\u0026hl\\u003den\\u0026q\\u003dstack \",\n            \"searchResultTime\": \"0.14\"\n        }\n    },\n    \"responseDetails\": null,\n    \"responseStatus\": 200\n}\n      </code>\n      <div id=\"div-test-6\"></div>\n    </div>\n\n    <div class=\"col-md-6 col-xs-12\">\n      <code id=\"code-test-7\" style=\"display: none;\">\"vacant lot\"</code>\n      <div id=\"div-test-7\"></div>\n    </div>\n  </div>\n</div>\n\n</body>\n\n</html>\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const path = require('path')\n\nconst config = {\n  mode: 'development',\n\n  entry: './src/vtree.js',\n\n  output: {\n    path: path.join(__dirname, 'dist'),\n    filename: 'vtree.js',\n    library: 'VTree'\n  },\n\n  module: {\n    rules: [\n    {\n      enforce: 'pre',\n      test: /\\.js$/,\n      exclude: /node_modules/,\n      loader: 'eslint-loader'\n    },\n    {\n      test: /\\.js$/,\n      exclude: /node_modules/,\n      loader: 'babel-loader',\n      query: {\n        presets: ['es2015']\n      }\n    }\n    ]\n  }\n}\n\nmodule.exports = config\n"
  }
]