diff --git a/dist/unipept-visualizations.es5.js b/dist/unipept-visualizations.es5.js index 8d5a408..db1825b 100644 --- a/dist/unipept-visualizations.es5.js +++ b/dist/unipept-visualizations.es5.js @@ -210,7 +210,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol svg.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); }); - 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"); + 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).style("font-family", "'Helvetica Neue', Helvetica, Arial, sans-serif").call(zoomListener).append("g").attr("transform", "translate(" + MARGIN.left + "," + MARGIN.top + ")").append("g"); draw(_treeviewNode2.default.createNode(data)); } diff --git a/dist/unipept-visualizations.es5.js.map b/dist/unipept-visualizations.es5.js.map index 67e8533..99f8cf6 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","_extends","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","TreeView","_univis","_univis2","_maxcountheap","_maxcountheap2","_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","rerootCallback","colors","name","nodeFillColor","nodeStrokeColor","linkStrokeColor","enableInnerArcs","enableExpandOnClick","enableRightClick","enableLabels","getLabel","enableTooltips","getTooltip","getTooltipTitle","getTooltipText","enableAutoExpand","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","initialExpand","expandAll","update","centerNode","expand","allowedCount","isFinite","pq","size","toExpand","remove","add","nodes","reverse","links","depth","node","selectAll","nodeEnter","enter","click","tooltipIn","tooltipOut","rightClick","isLeaf","text","nodeUpdate","transition","duration","_children","nodeExit","exit","link","insert","o","selected","_ref","defaultPrevented","shiftKey","collapse","reroot","preventDefault","html","pageY","pageX","setTimeout","clearTimeout","reset","setFullScreen","isFullScreen","_ref2","w","h","$","window","getRoot","fn","treeview","get","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","Constructor","protoProps","staticProps","_classCallCheck","instance","TypeError","Univis","stringHash","s","split","reduce","charCodeAt","getReadableColorFor","textColor","brightness","rgb","err","r","g","comp","heapify","floor","sink","bubbleUp","index","parentIndex","targetIndex","MaxCountHeap","iterable","_data","Array","from","item","push","peek","output","pop","clear","_node","_node2","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","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","getBreadcrumbTooltip","colorRoot","colorLeaf","colorBreadcrumbs","labelHeight","current","treemapLayout","breadcrumbs","treemap","colorScale","initCSS","elementClass","addClass","prop","appendTo","empty","padding","interpolate","interpolateLab","setBreadcrumbs","crumbs","temp","triggerCallback","tooltipMove","order","position","dx","dy","resize","TreemapNode","apply","_sunburstNode","_sunburstNode2","_toConsumableArray","arr","isArray","arr2","Sunburst","colorCounter","addEmptyChildren","redraw","breadcrumbWidth","_this2","radius","currentMaxLevel","vis","partition","sort","min","innerRadius","path","colour","getComputedTextLength","arcTween","my","maxY","xd","yd","yr","t","_this3","shift","breadArc","bc","getTitleText","round","_this4","enableBreadcrumbs","attrTween","e","isParentOf","angle","each","useFixedColors","fixedColors","abs","rank","colours","hsl","singleChild","l","getColor","redrawColors","_this5","_this6","_this7","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,CAmBt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V,YAAlB;;AAED;AAAO,CAt1DG;AAu1DV,QAj4DS;AAk4DT","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__(6);\n\t\n\tvar _treemap2 = _interopRequireDefault(_treemap);\n\t\n\tvar _sunburst = __webpack_require__(8);\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 _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 _maxcountheap = __webpack_require__(3);\n\t\n\tvar _maxcountheap2 = _interopRequireDefault(_maxcountheap);\n\t\n\tvar _treeviewNode = __webpack_require__(4);\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 rerootCallback: undefined,\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 enableAutoExpand: false\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 initialExpand(root);\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 initialExpand(root) {\n\t if (!settings.enableAutoExpand) {\n\t root.expand();\n\t return;\n\t }\n\t\n\t root.expand(1);\n\t var allowedCount = root.data.count * (isFinite(settings.enableAutoExpand) ? settings.enableAutoExpand : 0.8);\n\t var pq = new _maxcountheap2.default(root.children || []);\n\t while (allowedCount > 0 && pq.size > 0) {\n\t var toExpand = pq.remove();\n\t allowedCount -= toExpand.data.count;\n\t toExpand.expand(1);\n\t (toExpand.children || []).forEach(function (c) {\n\t return pq.add(c);\n\t });\n\t }\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 if (settings.rerootCallback) {\n\t settings.rerootCallback.call(null, d);\n\t }\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 /**\n\t * Sets the visualisation in full screen mode\n\t *\n\t * @param isFullScreen indicates if we're in full screen mode\n\t */\n\t that.setFullScreen = function setFullScreen(isFullScreen) {\n\t // the delay is because the event fires before we're in fullscreen\n\t // so the height en width functions don't give a correct result\n\t // without the delay\n\t setTimeout(function () {\n\t var _ref2 = [settings.width, settings.height],\n\t w = _ref2[0],\n\t h = _ref2[1];\n\t\n\t if (isFullScreen) {\n\t w = $(window).width();\n\t h = $(window).height() - 44;\n\t }\n\t $(element).children(\"svg\").attr(\"width\", w).attr(\"height\", h);\n\t }, 1000);\n\t };\n\t\n\t /**\n\t * Get the root of the visual tree\n\t *\n\t * @return {TreeviewNode} The root node of the visualisation\n\t */\n\t that.getRoot = function getRoot() {\n\t return root;\n\t };\n\t\n\t /**\n\t * Apply changes made to the tree or its data\n\t */\n\t that.update = update;\n\t\n\t /**\n\t * Center a node of the tree\n\t */\n\t that.centerNode = centerNode;\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\t$.fn.treeview = function (data, options) {\n\t return new TreeView(this.get(0), data, options);\n\t};\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) {\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\t/*\n\t * A priority qeueue that works with Nodes.\n\t * Based on https://github.com/gkz/es-collections\n\t */\n\t\n\t/* eslint-disable require-jsdoc, no-param-reassign */\n\t\n\tvar comp = function comp(a, b) {\n\t return b.data.count - a.data.count;\n\t};\n\t\n\tfunction heapify(data) {\n\t for (var i = Math.floor((data.length - 2) / 2); i >= 0; i--) {\n\t sink(data, comp, i);\n\t }\n\t return data;\n\t}\n\t\n\tfunction bubbleUp(data, index) {\n\t var value = data[index];\n\t\n\t while (index > 0) {\n\t var parentIndex = Math.floor((index - 1) / 2);\n\t var parent = data[parentIndex];\n\t if (comp(value, parent) < 0) {\n\t data[index] = parent;\n\t } else {\n\t break;\n\t }\n\t index = parentIndex;\n\t }\n\t data[index] = value;\n\t return index;\n\t}\n\t\n\tfunction sink(data, index) {\n\t var value = data[index];\n\t var size = data.length;\n\t\n\t while (2 * index + 1 < size) {\n\t var targetIndex = 2 * index + 1;\n\t if (targetIndex < size - 1 && comp(data[targetIndex + 1], data[targetIndex]) < 0) {\n\t targetIndex++;\n\t }\n\t if (comp(value, data[targetIndex]) <= 0) {\n\t break;\n\t }\n\t data[index] = data[targetIndex];\n\t index = targetIndex;\n\t }\n\t data[index] = value;\n\t return index;\n\t}\n\t\n\tvar MaxCountHeap = function () {\n\t function MaxCountHeap() {\n\t var iterable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\t\n\t _classCallCheck(this, MaxCountHeap);\n\t\n\t this._data = heapify(Array.from(iterable));\n\t }\n\t\n\t _createClass(MaxCountHeap, [{\n\t key: \"add\",\n\t value: function add(item) {\n\t this._data.push(item);\n\t bubbleUp(this._data, this.size - 1);\n\t return this;\n\t }\n\t }, {\n\t key: \"peek\",\n\t value: function peek() {\n\t return this._data[0];\n\t }\n\t }, {\n\t key: \"remove\",\n\t value: function remove() {\n\t var output = this._data[0];\n\t if (this.size > 1) {\n\t this._data[0] = this._data.pop();\n\t sink(this._data, 0);\n\t } else {\n\t this._data.pop();\n\t }\n\t return output;\n\t }\n\t }, {\n\t key: \"clear\",\n\t value: function clear() {\n\t this._data = [];\n\t }\n\t }, {\n\t key: \"size\",\n\t get: function get() {\n\t return this._data.length;\n\t }\n\t }]);\n\t\n\t return MaxCountHeap;\n\t}();\n\t\n\texports.default = MaxCountHeap;\n\n/***/ }),\n/* 4 */\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__(5);\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/* 5 */\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/* 6 */\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 _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__(7);\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 $(\"