diff --git a/README.md b/README.md index 5d2c30e..9721718 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ The options object is an optional parameter and allows to override the default v * `nodeStrokeColor`: Function that returns a color to use as stroke color. Is called with a node as parameter. By default, the node color is used. * `linkStrokeColor`: Function that returns a color to use as link color between two nodes. Is called with an object containing a `source` and `target` node as parameter. By default, the target node color is used. * `countAccessor` : Function that returns the value associated with the node. Is called with a node as parameter. By default, the value of `node.data.count` is used. +* `rerootCallback`: Function that gets called after every "reroot" (rightClick) of the visualization. Is called with a node as parameter. By default, this is empty. ## Treemap diff --git a/dist/unipept-visualizations.es5.js b/dist/unipept-visualizations.es5.js index a41f0f4..8782606 100644 --- a/dist/unipept-visualizations.es5.js +++ b/dist/unipept-visualizations.es5.js @@ -139,6 +139,7 @@ var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbo countAccessor: function countAccessor(d) { return d.data.count; }, + rerootCallback: undefined, colors: function colors(d) { return COLOR_SCALE(d.name); @@ -422,6 +423,10 @@ var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbo } update(d); centerNode(d); + + if (settings.rerootCallback) { + settings.rerootCallback.call(null, d); + } } // Center a node @@ -1745,7 +1750,7 @@ var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbo height: 600, width: 600, breadcrumbWidth: 200, - radius: this.settings.width / 2, + radius: 300, className: "unipept-sunburst", levels: 4, diff --git a/dist/unipept-visualizations.es5.js.map b/dist/unipept-visualizations.es5.js.map index 351d1b7..8273a18 100644 --- a/dist/unipept-visualizations.es5.js.map +++ b/dist/unipept-visualizations.es5.js.map @@ -1 +1 @@ -{"version":3,"sources":["unipept-visualizations.js"],"names":["modules","installedModules","__webpack_require__","moduleId","exports","module","id","loaded","call","m","c","p","_treeview","_treeview2","_interopRequireDefault","_treemap","_treemap2","_sunburst","_sunburst2","obj","__esModule","default","Object","defineProperty","value","_typeof","Symbol","iterator","constructor","prototype","_extends","assign","target","i","arguments","length","source","key","hasOwnProperty","TreeView","_univis","_univis2","_treeviewNode","_treeviewNode2","element","data","options","undefined","that","MARGIN","top","right","bottom","left","DURATION","COLOR_SCALE","d3","scale","category10","DEFAULTS","height","width","nodeDistance","levelsToExpand","minNodeSize","maxNodeSize","countAccessor","d","count","colors","name","nodeFillColor","nodeStrokeColor","linkStrokeColor","enableInnerArcs","enableExpandOnClick","enableRightClick","enableLabels","getLabel","enableTooltips","getTooltip","getTooltipTitle","getTooltipText","settings","visibleRoot","tooltipTimer","nodeId","root","tree","tooltip","diagonal","widthScale","innerArc","zoomListener","svg","init","initTooltip","initInnerArcs","layout","nodeSize","separation","a","b","distance","parent","projection","y","x","linear","range","behavior","zoom","scaleExtent","on","attr","event","translate","select","append","draw","createNode","style","arcScale","Math","PI","arc","outerRadius","startAngle","endAngle","self_count","_this","domain","x0","y0","setSelected","children","forEach","color","functor","setRecursiveProperty","collapseAll","expand","expandAll","update","centerNode","nodes","reverse","links","depth","node","selectAll","nodeEnter","enter","click","tooltipIn","tooltipOut","rightClick","isLeaf","text","nodeUpdate","transition","duration","_children","nodeExit","exit","remove","link","insert","o","selected","_ref","defaultPrevented","shiftKey","collapse","reroot","preventDefault","html","pageY","pageX","setTimeout","clearTimeout","reset","Plugin","userData","option","each","$this","$","extend","fn","treeview","Constructor","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","protoProps","staticProps","_classCallCheck","instance","TypeError","Univis","stringHash","s","split","reduce","charCodeAt","getReadableColorFor","textColor","brightness","rgb","err","r","g","_node","_node2","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","setPrototypeOf","__proto__","TreeviewNode","_Node","getPrototypeOf","setCount","sum","_new","new","Node","property","getHeight","_height","max","getDepth","_depth","construct","map","n","TreeMap","_treemapNode","_treemapNode2","className","levels","getLevel","rerootCallback","getBreadcrumbTooltip","colorRoot","colorLeaf","colorBreadcrumbs","labelHeight","current","treemapLayout","breadcrumbs","treemap","colorScale","initCSS","elementClass","addClass","prop","appendTo","empty","size","padding","interpolate","interpolateLab","setBreadcrumbs","crumbs","temp","push","triggerCallback","tooltipMove","order","position","dx","dy","resize","setFullScreen","isFullScreen","w","h","window","TreemapNode","apply","_sunburstNode","_sunburstNode2","_toConsumableArray","arr","Array","isArray","arr2","from","Sunburst","colorCounter","addEmptyChildren","redraw","breadcrumbWidth","_this2","radius","currentMaxLevel","vis","partition","sort","min","innerRadius","path","colour","floor","getComputedTextLength","arcTween","my","maxY","xd","yd","yr","t","_this3","shift","breadArc","bc","getTitleText","round","_this4","enableBreadcrumbs","attrTween","e","isParentOf","angle","useFixedColors","fixedColors","abs","rank","colours","hsl","singleChild","l","getColor","redrawColors","_this5","get","_this6","COLORS","FIXED_COLORS","ml","some","sunburst","SunburstNode"],"mappings":";;;;AAAA,QAAS,CAAC,UAASA,OAAT,EAAkB;AAAE;AAC9B,SAD4B,CAClB;AACV,SAAU,IAAIC,mBAAmB,EAAvB;AACV;AACA,SAJ4B,CAIlB;AACV,SAAU,SAASC,mBAAT,CAA6BC,QAA7B,EAAuC;AACjD;AACA,UAFiD,CAEtC;AACX,UAAW,IAAGF,iBAAiBE,QAAjB,CAAH;AACX,WAAY,OAAOF,iBAAiBE,QAAjB,EAA2BC,OAAlC;AACZ;AACA,UANiD,CAMtC;AACX,UAAW,IAAIC,SAASJ,iBAAiBE,QAAjB,IAA6B;AACrD,WAAYC,SAAS,EADgC;AAErD,WAAYE,IAAIH,QAFqC;AAGrD,WAAYI,QAAQ;AACpB,WAJqD,EAA1C;AAKX;AACA,UAbiD,CAatC;AACX,UAAWP,QAAQG,QAAR,EAAkBK,IAAlB,CAAuBH,OAAOD,OAA9B,EAAuCC,MAAvC,EAA+CA,OAAOD,OAAtD,EAA+DF,mBAA/D;AACX;AACA,UAhBiD,CAgBtC;AACX,UAAWG,OAAOE,MAAP,GAAgB,IAAhB;AACX;AACA,UAnBiD,CAmBtC;AACX,UAAW,OAAOF,OAAOD,OAAd;AACX;AAAW;AACX;AACA;AACA,SA7B4B,C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gB;AACnB,QAAIpF,OAAOnH,UAAUC,MAAV,GAAmB,CAAnB,IAAwBD,UAAU,CAAV,MAAiBa,SAAzC,GAAqDb,UAAU,CAAV,CAArD,GAAoE,EAA/E;;AAEA,WAAO,IAAI8T,YAAJ,CAAiB3M,IAAjB,CAAP;AACH;AAN6B,GAAD,EAO9B;AACChH,QAAK,YADN;AAECb,UAAO,SAASgG,UAAT,CAAoB6B,IAApB,EAA0B;AAC7B,WAAOqE,OAAOrM,OAAP,CAAemG,UAAf,CAA0B6B,IAA1B,EAAgC2M,aAAatH,GAA7C,CAAP;AACH;AAJF,GAP8B,CAAjC;;AAcA,SAAOsH,YAAP;AACH,EAxBkB,CAwBjBtI,OAAOrM,OAxBU,CAAnB;;AA0BAjB,SAAQiB,OAAR,GAAkB2U,YAAlB;;AAED;AAAO;AACP,QA3rDU,CA1CD;AAsuDT","file":"unipept-visualizations.es5.js","sourcesContent":["/******/ (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/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tvar _treeview = __webpack_require__(1);\n\t\n\tvar _treeview2 = _interopRequireDefault(_treeview);\n\t\n\tvar _treemap = __webpack_require__(5);\n\t\n\tvar _treemap2 = _interopRequireDefault(_treemap);\n\t\n\tvar _sunburst = __webpack_require__(7);\n\t\n\tvar _sunburst2 = _interopRequireDefault(_sunburst);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n\t * Zoomable treeview, inspiration from\n\t * - http://bl.ocks.org/mbostock/4339083\n\t * - https://gist.github.com/robschmuecker/7880033\n\t * - http://www.brightpointinc.com/interactive/budget/index.html?source=d3js\n\t */\n\t\n\t\n\texports.default = TreeView;\n\t\n\tvar _univis = __webpack_require__(2);\n\t\n\tvar _univis2 = _interopRequireDefault(_univis);\n\t\n\tvar _treeviewNode = __webpack_require__(3);\n\t\n\tvar _treeviewNode2 = _interopRequireDefault(_treeviewNode);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction TreeView(element, data) {\n\t var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var that = {};\n\t\n\t var MARGIN = {\n\t top: 5,\n\t right: 5,\n\t bottom: 5,\n\t left: 5\n\t },\n\t DURATION = 750,\n\t COLOR_SCALE = d3.scale.category10(),\n\t DEFAULTS = {\n\t height: 300,\n\t width: 600,\n\t nodeDistance: 180,\n\t levelsToExpand: 2,\n\t minNodeSize: 2,\n\t maxNodeSize: 105,\n\t\n\t countAccessor: function countAccessor(d) {\n\t return d.data.count;\n\t },\n\t\n\t colors: function colors(d) {\n\t return COLOR_SCALE(d.name);\n\t },\n\t nodeFillColor: nodeFillColor,\n\t nodeStrokeColor: nodeStrokeColor,\n\t linkStrokeColor: linkStrokeColor,\n\t\n\t enableInnerArcs: true,\n\t enableExpandOnClick: true,\n\t enableRightClick: true,\n\t\n\t enableLabels: true,\n\t getLabel: function getLabel(d) {\n\t return d.name;\n\t },\n\t\n\t enableTooltips: true,\n\t getTooltip: getTooltip,\n\t getTooltipTitle: _univis2.default.getTooltipTitle,\n\t getTooltipText: _univis2.default.getTooltipText\n\t };\n\t\n\t var settings = void 0;\n\t\n\t var visibleRoot = void 0,\n\t tooltipTimer = void 0;\n\t\n\t var nodeId = 0,\n\t root = void 0;\n\t\n\t var tree = void 0,\n\t tooltip = void 0,\n\t diagonal = void 0,\n\t widthScale = void 0,\n\t innerArc = void 0,\n\t zoomListener = void 0,\n\t svg = void 0;\n\t\n\t function init() {\n\t settings = _extends({}, DEFAULTS, options);\n\t _treeviewNode2.default.settings = settings;\n\t\n\t settings.width = settings.width - MARGIN.right - MARGIN.left;\n\t settings.height = settings.height - MARGIN.top - MARGIN.bottom;\n\t\n\t if (settings.enableTooltips) {\n\t initTooltip();\n\t }\n\t\n\t if (settings.enableInnerArcs) {\n\t initInnerArcs();\n\t }\n\t\n\t tree = d3.layout.tree().nodeSize([2, 10]).separation(function (a, b) {\n\t var width = nodeSize(a) + nodeSize(b),\n\t distance = width / 2 + 4;\n\t return a.parent === b.parent ? distance : distance + 4;\n\t });\n\t\n\t diagonal = d3.svg.diagonal().projection(function (d) {\n\t return [d.y, d.x];\n\t });\n\t\n\t widthScale = d3.scale.linear().range([settings.minNodeSize, settings.maxNodeSize]);\n\t\n\t // define the zoomListener which calls the zoom function on the \"zoom\" event constrained within the scaleExtents\n\t zoomListener = d3.behavior.zoom().scaleExtent([0.1, 3]).on(\"zoom\", function () {\n\t svg.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n\t });\n\t\n\t svg = d3.select(element).append(\"svg\").attr(\"version\", \"1.1\").attr(\"xmlns\", \"http://www.w3.org/2000/svg\").attr(\"viewBox\", \"0 0 \" + (settings.width + MARGIN.right + MARGIN.left) + \" \" + (settings.height + MARGIN.top + MARGIN.bottom)).attr(\"width\", settings.width + MARGIN.right + MARGIN.left).attr(\"height\", settings.height + MARGIN.top + MARGIN.bottom).call(zoomListener).append(\"g\").attr(\"transform\", \"translate(\" + MARGIN.left + \",\" + MARGIN.top + \")\").append(\"g\");\n\t\n\t draw(_treeviewNode2.default.createNode(data));\n\t }\n\t\n\t function initTooltip() {\n\t tooltip = d3.select(\"body\").append(\"div\").attr(\"id\", element.id + \"-tooltip\").attr(\"class\", \"tip\").style(\"position\", \"absolute\").style(\"z-index\", \"10\").style(\"visibility\", \"hidden\").style(\"background-color\", \"white\").style(\"padding\", \"2px\").style(\"border\", \"1px solid #dddddd\").style(\"border-radius\", \"3px;\");\n\t }\n\t\n\t function initInnerArcs() {\n\t var arcScale = d3.scale.linear().range([0, 2 * Math.PI]);\n\t\n\t innerArc = d3.svg.arc().outerRadius(nodeSize).startAngle(0).endAngle(function (d) {\n\t return arcScale(d.data.self_count / d.data.count) || 0;\n\t });\n\t }\n\t\n\t function draw(data) {\n\t var _this = this;\n\t\n\t widthScale.domain([0, data.data.count]);\n\t\n\t root = data;\n\t root.x0 = settings.height / 2;\n\t root.y0 = 0;\n\t\n\t // set everything visible\n\t root.setSelected(true);\n\t\n\t root.children.forEach(function (d, i) {\n\t d.color = d3.functor(settings.colors).call(_this, d, i);\n\t d.setRecursiveProperty(\"color\", d.color);\n\t });\n\t\n\t if (settings.enableExpandOnClick) {\n\t root.collapseAll();\n\t root.expand();\n\t } else {\n\t root.expandAll();\n\t }\n\t\n\t update(root);\n\t centerNode(root);\n\t }\n\t\n\t function update(source) {\n\t // Compute the new tree layout.\n\t var nodes = tree.nodes(root).reverse(),\n\t links = tree.links(nodes);\n\t\n\t // Normalize for fixed-depth.\n\t nodes.forEach(function (d) {\n\t d.y = d.depth * settings.nodeDistance;\n\t });\n\t\n\t // Update the nodes…\n\t var node = svg.selectAll(\"g.node\").data(nodes, function (d) {\n\t return d.id || (d.id = ++nodeId);\n\t });\n\t\n\t // Enter any new nodes at the parent's previous position.\n\t var nodeEnter = node.enter().append(\"g\").attr(\"class\", \"node\").style(\"cursor\", \"pointer\").attr(\"transform\", function (d) {\n\t return \"translate(\" + (source.y || 0) + \",\" + (source.x0 || 0) + \")\";\n\t }).on(\"click\", click).on(\"mouseover\", tooltipIn).on(\"mouseout\", tooltipOut).on(\"contextmenu\", rightClick);\n\t\n\t nodeEnter.append(\"circle\").attr(\"r\", 1e-6).style(\"stroke-width\", \"1.5px\").style(\"stroke\", settings.nodeStrokeColor).style(\"fill\", settings.nodeFillColor);\n\t\n\t if (settings.enableInnerArcs) {\n\t nodeEnter.append(\"path\").attr(\"d\", innerArc).style(\"fill\", settings.nodeStrokeColor).style(\"fill-opacity\", 0);\n\t }\n\t\n\t if (settings.enableLabels) {\n\t nodeEnter.append(\"text\").attr(\"x\", function (d) {\n\t return d.isLeaf() ? 10 : -10;\n\t }).attr(\"dy\", \".35em\").attr(\"text-anchor\", function (d) {\n\t return d.isLeaf() ? \"start\" : \"end\";\n\t }).text(settings.getLabel).style(\"font\", \"10px sans-serif\").style(\"fill-opacity\", 1e-6);\n\t }\n\t\n\t // Transition nodes to their new position.\n\t var nodeUpdate = node.transition().duration(DURATION).attr(\"transform\", function (d) {\n\t return \"translate(\" + d.y + \",\" + d.x + \")\";\n\t });\n\t\n\t nodeUpdate.select(\"circle\").attr(\"r\", nodeSize).style(\"fill-opacity\", function (d) {\n\t return d._children ? 1 : 0;\n\t }).style(\"stroke\", settings.nodeStrokeColor).style(\"fill\", settings.nodeFillColor);\n\t\n\t if (settings.enableLabels) {\n\t nodeUpdate.select(\"text\").style(\"fill-opacity\", 1);\n\t }\n\t\n\t if (settings.enableInnerArcs) {\n\t nodeUpdate.select(\"path\").duration(DURATION).attr(\"d\", innerArc).style(\"fill-opacity\", 0.8);\n\t }\n\t\n\t // Transition exiting nodes to the parent's new position.\n\t var nodeExit = node.exit().transition().duration(DURATION).attr(\"transform\", function (d) {\n\t return \"translate(\" + source.y + \",\" + source.x + \")\";\n\t }).remove();\n\t\n\t nodeExit.select(\"circle\").attr(\"r\", 1e-6);\n\t\n\t nodeExit.select(\"path\").style(\"fill-opacity\", 1e-6);\n\t\n\t nodeExit.select(\"text\").style(\"fill-opacity\", 1e-6);\n\t\n\t // Update the links…\n\t var link = svg.selectAll(\"path.link\").data(links, function (d) {\n\t return d.target.id;\n\t });\n\t\n\t // Enter any new links at the parent's previous position.\n\t link.enter().insert(\"path\", \"g\").attr(\"class\", \"link\").style(\"fill\", \"none\").style(\"stroke-opacity\", \"0.5\").style(\"stroke-linecap\", \"round\").style(\"stroke\", settings.linkStrokeColor).style(\"stroke-width\", 1e-6).attr(\"d\", function (d) {\n\t var o = {\n\t x: source.x0 || 0,\n\t y: source.y0 || 0\n\t };\n\t return diagonal({\n\t source: o,\n\t target: o\n\t });\n\t });\n\t\n\t // Transition links to their new position.\n\t link.transition().duration(DURATION).attr(\"d\", diagonal).style(\"stroke\", settings.linkStrokeColor).style(\"stroke-width\", function (d) {\n\t if (d.source.selected) {\n\t return widthScale(d.target.data.count) + \"px\";\n\t } else {\n\t return \"4px\";\n\t }\n\t });\n\t\n\t // Transition exiting nodes to the parent's new position.\n\t link.exit().transition().duration(DURATION).style(\"stroke-width\", 1e-6).attr(\"d\", function (d) {\n\t var o = {\n\t x: source.x,\n\t y: source.y\n\t };\n\t return diagonal({\n\t source: o,\n\t target: o\n\t });\n\t }).remove();\n\t\n\t // Stash the old positions for transition.\n\t nodes.forEach(function (d) {\n\t var _ref = [d.x, d.y];\n\t d.x0 = _ref[0];\n\t d.y0 = _ref[1];\n\t });\n\t }\n\t\n\t function nodeSize(d) {\n\t if (d.selected) {\n\t return widthScale(d.data.count) / 2;\n\t } else {\n\t return 2;\n\t }\n\t }\n\t\n\t // Toggle children on click.\n\t function click(d) {\n\t if (!settings.enableExpandOnClick) {\n\t return;\n\t }\n\t\n\t // check if click is triggered by panning on a node\n\t if (d3.event.defaultPrevented) {\n\t return;\n\t }\n\t\n\t if (d3.event.shiftKey) {\n\t d.expandAll();\n\t } else if (d.children) {\n\t d.collapse();\n\t } else {\n\t d.expand();\n\t }\n\t update(d);\n\t centerNode(d);\n\t }\n\t\n\t function rightClick(d) {\n\t if (settings.enableRightClick) {\n\t reroot(d);\n\t }\n\t }\n\t\n\t // Sets the width of the right clicked node to 100%\n\t function reroot(d) {\n\t if (d === visibleRoot && d !== root) {\n\t reroot(root);\n\t return;\n\t }\n\t visibleRoot = d;\n\t\n\t // set Selection properties\n\t root.setSelected(false);\n\t d.setSelected(true);\n\t\n\t // scale the lines\n\t widthScale.domain([0, d.data.count]);\n\t\n\t d.expand();\n\t\n\t // redraw\n\t if (d3.event !== null) {\n\t d3.event.preventDefault();\n\t }\n\t update(d);\n\t centerNode(d);\n\t }\n\t\n\t // Center a node\n\t function centerNode(source) {\n\t var scale = zoomListener.scale(),\n\t x = -source.y0,\n\t y = -source.x0;\n\t\n\t x = x * scale + settings.width / 4;\n\t y = y * scale + settings.height / 2;\n\t svg.transition().duration(DURATION).attr(\"transform\", \"translate(\" + x + \",\" + y + \")scale(\" + scale + \")\");\n\t zoomListener.scale(scale);\n\t zoomListener.translate([x, y]);\n\t }\n\t\n\t // tooltip functions\n\t function tooltipIn(d, i) {\n\t if (!settings.enableTooltips) {\n\t return;\n\t }\n\t tooltip.html(settings.getTooltip(d)).style(\"top\", d3.event.pageY - 5 + \"px\").style(\"left\", d3.event.pageX + 15 + \"px\");\n\t\n\t tooltipTimer = setTimeout(function () {\n\t tooltip.style(\"visibility\", \"visible\");\n\t }, 1000);\n\t }\n\t\n\t function tooltipOut(d, i) {\n\t if (!settings.enableTooltips) {\n\t return;\n\t }\n\t clearTimeout(tooltipTimer);\n\t tooltip.style(\"visibility\", \"hidden\");\n\t }\n\t\n\t /** ************ Default methods ***************/\n\t // set fill color\n\t function nodeFillColor(d) {\n\t if (d.selected) {\n\t return d._children ? d.color || \"#aaa\" : \"#fff\";\n\t } else {\n\t return \"#aaa\";\n\t }\n\t }\n\t\n\t // set node stroke color\n\t function nodeStrokeColor(d) {\n\t if (d.selected) {\n\t return d.color || \"#aaa\";\n\t } else {\n\t return \"#aaa\";\n\t }\n\t }\n\t\n\t // set link stroke color\n\t function linkStrokeColor(d) {\n\t if (d.source.selected) {\n\t return d.target.color;\n\t } else {\n\t return \"#aaa\";\n\t }\n\t }\n\t\n\t function getTooltip(d) {\n\t return \"

\" + settings.getTooltipTitle(d) + \"

\" + settings.getTooltipText(d) + \"

\";\n\t }\n\t\n\t /** ************* Public methods ***************/\n\t that.reset = function reset() {\n\t zoomListener.scale(1);\n\t reroot(root);\n\t };\n\t\n\t // initialize the object\n\t init();\n\t\n\t // return the object\n\t return that;\n\t}\n\t\n\tfunction Plugin(userData, option) {\n\t return this.each(function () {\n\t var $this = $(this);\n\t var data = $this.data(\"vis.treeview\");\n\t var options = $.extend({}, $this.data(), (typeof option === \"undefined\" ? \"undefined\" : _typeof(option)) === \"object\" && option);\n\t\n\t if (!data) {\n\t $this.data(\"vis.treeview\", data = new TreeView(this, userData, options));\n\t }\n\t if (typeof option === \"string\") {\n\t data[option]();\n\t }\n\t });\n\t}\n\t\n\t$.fn.treeview = Plugin;\n\t$.fn.treeview.Constructor = TreeView;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Univis = function () {\n\t function Univis() {\n\t _classCallCheck(this, Univis);\n\t }\n\t\n\t _createClass(Univis, null, [{\n\t key: \"stringHash\",\n\t\n\t\n\t /**\n\t * Hash function for strings from\n\t * http://stackoverflow.com/a/15710692/865696\n\t */\n\t value: function stringHash(s) {\n\t return s.split(\"\").reduce(function (a, b) {\n\t var c = (a << 5) - a + b.charCodeAt(0);\n\t return c & c;\n\t }, 0);\n\t }\n\t\n\t /*\n\t * Returns the readable text color based on the brightness of a given backgroud color\n\t */\n\t\n\t }, {\n\t key: \"getReadableColorFor\",\n\t value: function getReadableColorFor(color) {\n\t var textColor = \"#000\";\n\t try {\n\t textColor = Univis.brightness(d3.rgb(color)) < 125 ? \"#eee\" : \"#000\";\n\t } catch (err) {/* go on */}\n\t return textColor;\n\t }\n\t\n\t /*\n\t * Returns the brightness of an rgb-color\n\t * from: http:// www.w3.org/WAI/ER/WD-AERT/#color-contrast\n\t */\n\t\n\t }, {\n\t key: \"brightness\",\n\t value: function brightness(rgb) {\n\t return rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114;\n\t }\n\t }, {\n\t key: \"getTooltipTitle\",\n\t value: function getTooltipTitle(d) {\n\t return d.name;\n\t }\n\t }, {\n\t key: \"getTooltipText\",\n\t value: function getTooltipText(d) {\n\t return d.data.count + \" hits\";\n\t }\n\t }]);\n\t\n\t return Univis;\n\t}();\n\t\n\texports.default = Univis;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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\t\n\tvar _node = __webpack_require__(4);\n\t\n\tvar _node2 = _interopRequireDefault(_node);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _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\t\n\tfunction _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\t\n\tvar TreeviewNode = function (_Node) {\n\t _inherits(TreeviewNode, _Node);\n\t\n\t function TreeviewNode() {\n\t var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t\n\t _classCallCheck(this, TreeviewNode);\n\t\n\t var _this = _possibleConstructorReturn(this, (TreeviewNode.__proto__ || Object.getPrototypeOf(TreeviewNode)).call(this, node));\n\t\n\t _this.settings = TreeviewNode.settings;\n\t _this.setCount();\n\t return _this;\n\t }\n\t\n\t _createClass(TreeviewNode, [{\n\t key: \"setCount\",\n\t value: function setCount() {\n\t if (this.settings.countAccessor(this)) {\n\t this.data.count = this.settings.countAccessor(this);\n\t } else if (this.children) {\n\t this.data.count = this.children.reduce(function (sum, c) {\n\t return sum + c.data.count;\n\t }, 0);\n\t } else {\n\t this.data.count = 0;\n\t }\n\t }\n\t }, {\n\t key: \"setSelected\",\n\t value: function setSelected(value) {\n\t this.setRecursiveProperty(\"selected\", value);\n\t }\n\t\n\t // collapse everything\n\t\n\t }, {\n\t key: \"collapseAll\",\n\t value: function collapseAll() {\n\t if (this.children && this.children.length === 0) {\n\t this.children = null;\n\t }\n\t if (this.children) {\n\t this._children = this.children;\n\t this._children.forEach(function (c) {\n\t c.collapseAll();\n\t });\n\t this.children = null;\n\t }\n\t }\n\t\n\t // Collapses a node\n\t\n\t }, {\n\t key: \"collapse\",\n\t value: function collapse() {\n\t if (this.children) {\n\t this._children = this.children;\n\t this.children = null;\n\t }\n\t }\n\t }, {\n\t key: \"expandAll\",\n\t value: function expandAll() {\n\t this.expand(100);\n\t }\n\t\n\t // Expands a node and its children\n\t\n\t }, {\n\t key: \"expand\",\n\t value: function expand() {\n\t var i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.settings.levelsToExpand;\n\t\n\t if (i > 0) {\n\t if (this._children) {\n\t this.children = this._children;\n\t this._children = null;\n\t }\n\t if (this.children) {\n\t this.children.forEach(function (c) {\n\t c.expand(i - 1);\n\t });\n\t }\n\t }\n\t }\n\t }], [{\n\t key: \"new\",\n\t value: function _new() {\n\t var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t\n\t return new TreeviewNode(node);\n\t }\n\t }, {\n\t key: \"createNode\",\n\t value: function createNode(node) {\n\t return _node2.default.createNode(node, TreeviewNode.new);\n\t }\n\t }]);\n\t\n\t return TreeviewNode;\n\t}(_node2.default);\n\t\n\texports.default = TreeviewNode;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\t\n\tvar _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\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar Node = function () {\n\t function Node() {\n\t var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t\n\t _classCallCheck(this, Node);\n\t\n\t this.data = {};\n\t _extends(this, node);\n\t }\n\t\n\t _createClass(Node, [{\n\t key: \"setRecursiveProperty\",\n\t\n\t\n\t // sets a property for a node and all its children\n\t value: function setRecursiveProperty(property, value) {\n\t this[property] = value;\n\t if (this.children) {\n\t this.children.forEach(function (c) {\n\t c.setRecursiveProperty(property, value);\n\t });\n\t } else if (this._children) {\n\t this._children.forEach(function (c) {\n\t c.setRecursiveProperty(property, value);\n\t });\n\t }\n\t }\n\t\n\t // Returns true if a node is a leaf\n\t\n\t }, {\n\t key: \"isLeaf\",\n\t value: function isLeaf() {\n\t return !this.children && !this._children || this.children && this.children.length === 0 || this._children && this._children.length === 0;\n\t }\n\t }, {\n\t key: \"getHeight\",\n\t value: function getHeight() {\n\t if (this._height === undefined) {\n\t if (this.isLeaf()) {\n\t this._height = 0;\n\t } else {\n\t this._height = d3.max(this.children, function (c) {\n\t return c.getHeight();\n\t }) + 1;\n\t }\n\t }\n\t return this._height;\n\t }\n\t }, {\n\t key: \"getDepth\",\n\t value: function getDepth() {\n\t if (this._depth === undefined) {\n\t if (this.parent === undefined) {\n\t this._depth = 0;\n\t } else {\n\t this._depth = this.parent.getDepth() + 1;\n\t }\n\t }\n\t return this._depth;\n\t }\n\t }], [{\n\t key: \"new\",\n\t value: function _new() {\n\t var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t\n\t return new Node(node);\n\t }\n\t }, {\n\t key: \"createNode\",\n\t value: function createNode(node) {\n\t var construct = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Node.new;\n\t\n\t if (node.children) {\n\t node.children = node.children.map(function (n) {\n\t return Node.createNode(n, construct);\n\t });\n\t }\n\t return construct.call(null, node);\n\t }\n\t }]);\n\t\n\t return Node;\n\t}();\n\t\n\texports.default = Node;\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _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\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**\n\t * Interactive treemap\n\t */\n\t\n\t\n\texports.default = TreeMap;\n\t\n\tvar _univis = __webpack_require__(2);\n\t\n\tvar _univis2 = _interopRequireDefault(_univis);\n\t\n\tvar _treemapNode = __webpack_require__(6);\n\t\n\tvar _treemapNode2 = _interopRequireDefault(_treemapNode);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction TreeMap(element, data) {\n\t var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var that = {};\n\t\n\t var MARGIN = {\n\t top: 0,\n\t right: 0,\n\t bottom: 0,\n\t left: 0\n\t },\n\t DEFAULTS = {\n\t height: 300,\n\t width: 600,\n\t\n\t className: \"unipept-treemap\",\n\t levels: undefined,\n\t getLevel: function getLevel(d) {\n\t return d.getDepth();\n\t },\n\t\n\t countAccessor: function countAccessor(d) {\n\t return d.data.self_count;\n\t },\n\t rerootCallback: undefined,\n\t\n\t getBreadcrumbTooltip: function getBreadcrumbTooltip(d) {\n\t return d.name;\n\t },\n\t colorRoot: \"#104B7D\",\n\t colorLeaf: \"#fdffcc\",\n\t colorBreadcrumbs: \"#FF8F00\",\n\t\n\t labelHeight: 10,\n\t getLabel: function getLabel(d) {\n\t return d.name;\n\t },\n\t\n\t enableTooltips: true,\n\t getTooltip: getTooltip,\n\t getTooltipTitle: _univis2.default.getTooltipTitle,\n\t getTooltipText: _univis2.default.getTooltipText\n\t };\n\t\n\t var settings = void 0;\n\t\n\t var root = void 0,\n\t nodeId = 0,\n\t current = void 0,\n\t treemapLayout = void 0,\n\t breadcrumbs = void 0,\n\t treemap = void 0,\n\t tooltip = void 0,\n\t colorScale = void 0;\n\t\n\t /**\n\t * Initializes Treemap\n\t */\n\t function init() {\n\t settings = _extends({}, DEFAULTS, options);\n\t\n\t root = _treemapNode2.default.createNode(data);\n\t\n\t settings.width = settings.width - MARGIN.right - MARGIN.left;\n\t settings.height = settings.height - MARGIN.top - MARGIN.bottom;\n\t\n\t settings.levels = settings.levels || root.getHeight();\n\t\n\t if (settings.enableTooltips) {\n\t initTooltip();\n\t }\n\t\n\t initCSS();\n\t\n\t // setup the visualisation\n\t draw(root);\n\t reroot(root, false);\n\t }\n\t\n\t function initTooltip() {\n\t tooltip = d3.select(\"body\").append(\"div\").attr(\"id\", element.id + \"-tooltip\").attr(\"class\", \"tip\").style(\"position\", \"absolute\").style(\"z-index\", \"10\").style(\"visibility\", \"hidden\").style(\"background-color\", \"white\").style(\"padding\", \"2px\").style(\"border\", \"1px solid #dddddd\").style(\"border-radius\", \"3px;\");\n\t }\n\t\n\t function initCSS() {\n\t var elementClass = settings.className;\n\t $(element).addClass(elementClass);\n\t $(\"