diff --git a/dist/bubble_chart.js b/dist/bubble_chart.js
index feab22a8..9db9cb92 100644
--- a/dist/bubble_chart.js
+++ b/dist/bubble_chart.js
@@ -2186,7 +2186,7 @@
/*!******************************************!*\
!*** ./src/bubble_chart/bubble_chart.js ***!
\******************************************/
-/*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "./node_modules/d3/index.js");\n/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");\n/* harmony import */ var _bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bubble_chart_styles.css */ "./src/bubble_chart/bubble_chart_styles.css");\n/* harmony import */ var _bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3__);\nfunction _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral(["\\n font-family: \'Open Sans\', \'Noto Sans JP\', \'Noto Sans\', \'Noto Sans CJK KR\', Helvetica, Arial, sans-serif;\\n text-align: center;\\n overflow: hidden;\\n"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\n\n\n\n\nvar BubbleChartWrapper = styled_components__WEBPACK_IMPORTED_MODULE_2__["default"].div(_templateObject());\n\nvar BubbleChart =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(BubbleChart, _Component);\n\n function BubbleChart() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, BubbleChart);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(BubbleChart)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), "drawChartWithParams", function () {\n _this.drawChart(\'#chart\');\n });\n\n return _this;\n }\n\n _createClass(BubbleChart, [{\n key: "componentDidMount",\n value: function componentDidMount() {\n this.drawChartWithParams();\n window.addEventListener(\'resize\', this.drawChartWithParams);\n }\n }, {\n key: "componentDidUpdate",\n value: function componentDidUpdate() {\n this.drawChartWithParams();\n }\n }, {\n key: "componentWillUnmount",\n value: function componentWillUnmount() {\n window.removeEventListener(\'resize\', this.drawChartWithParams);\n }\n }, {\n key: "getWindowSize",\n value: function getWindowSize() {\n return window.innerWidth > window.innerHeight ? window.innerHeight : window.innerWidth;\n }\n }, {\n key: "getFontSize",\n value: function getFontSize() {\n var windowSize = this.getWindowSize();\n var fontSize = Math.round(windowSize * 0.017);\n return fontSize > 13 ? 13 : fontSize;\n }\n }, {\n key: "drawChart",\n value: function drawChart(id) {\n function getDivWidth(div) {\n var width = d3__WEBPACK_IMPORTED_MODULE_1__["select"](div) // get the width of div element\n .style(\'width\') // take of \'px\'\n .slice(0, -2); // return as an integer\n\n return Math.round(Number(width));\n }\n\n var _this$props = this.props,\n config = _this$props.config,\n data = _this$props.data;\n var windowSize = this.getWindowSize();\n var fontSize = this.getFontSize();\n var diameter = windowSize * .97,\n format = d3__WEBPACK_IMPORTED_MODULE_1__["format"](",d"),\n color = d3__WEBPACK_IMPORTED_MODULE_1__["scaleOrdinal"]().range(config.value_colors || []);\n var bubble = d3__WEBPACK_IMPORTED_MODULE_1__["pack"]().size([diameter, diameter]).padding(.5);\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).select("svg").remove();\n var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).append("svg").attr("width", diameter).attr("height", diameter).attr("class", "bubble");\n var d = {\n children: data\n };\n var maxColor = this.props.maxColor;\n var root = d3__WEBPACK_IMPORTED_MODULE_1__["hierarchy"](d).sum(function (d) {\n return d.value;\n }).sort(function (a, b) {\n return b.value - a.value;\n });\n bubble(root);\n this.tooltip = d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).append("div").attr("id", "tooltip").style("opacity", 1);\n var node = svg.selectAll("g").data(root.children).enter().append("g").attr("class", "node").attr("transform", function (d) {\n return "translate(" + d.x + "," + d.y + ")";\n }); // node.append("title")\n // .text(function(d) { return d.data.itemName + ": " + format(d.value); });\n\n node.append("circle").attr("class", "circle_node").attr("r", function (d) {\n return d.r;\n }).style("z-index", 1).style("opacity", function (d) {\n return d.data.color / maxColor > .15 ? d.data.color / maxColor : .15;\n }).style("fill", config[\'toColor\']).on("mousemove", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](this).style("stroke-width", 10) // set the stroke width\n .style("stroke", config[\'toColor\']).style("z-index", 10).style("stroke-opacity", function (d) {\n return d.data.color / maxColor > .5 ? d.data.color / 2 / maxColor : d.data.color * 2 / maxColor;\n });\n }).on("mouseout", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](this).style("z-index", 1).style("stroke-width", 0).style("opacity", function (d) {\n return d.data.color / maxColor > .15 ? d.data.color / maxColor : .15;\n });\n });\n\n if (config[\'value_titles\'] !== false) {\n node.append("text").attr("class", "label").attr("dy", config[\'value_labels\'] === false ? ".3em" : ".1em").style("text-anchor", "middle").style("font-size", config[\'font_size_value\']).text(function (d) {\n return d.data.itemName.substring(0, d.r / 3);\n });\n }\n\n if (config[\'value_labels\'] !== false) {\n node.append("text").attr("class", "label").attr("dy", config[\'value_titles\'] === false ? ".3em" : "1.5em").style("font-size", config[\'font_size_label\']).style("text-anchor", "middle").text(function (d) {\n return d.data.value;\n });\n } // node.on(\'mousemove\', d => {\n // d3.select(this)\n // .append(\'circle\')\n // .attr("r", function(d) { return d.r * 1.1; })\n // .style("fill", function(d) { \n // return color(d.data.color); \n // })\n // .style("z-index", "0")\n // .style("opacity", ".85");\n // let tooltip_html = \'\'\n // tooltip_html += \'
\' + d.itemName + \'\';\n // tooltip_html += \' \' + d.value + \'
\';\n // this.tooltip.html(tooltip_html);\n // // console.log(Math.round(Number(d3.select("#tooltip").style(\'width\').slice(0, -2))));\n // this.tooltip\n // .style("left", event.pageX-(Math.round(Number(this.tooltip.style(\'width\').slice(0, -2)))/2)+"px")\n // .style("top", event.pageY-50+"px")\n // .style(\'opacity\', 1)\n // .style("position", "absolute")\n // .style("text-align", "center")\n // .style("padding", ".5rem")\n // .style(\'pointer-events\', \'none\')\n // .style("color", "white")\n // .style("background-color", "#313639")\n // .style("background-opacity", ".85")\n // .style("border-radius", "#8px");\n // this.tooltip\n // .append(\'div\')\n // .style(\'border-right\', \'solid 8px transparent\')\n // .style(\'border-left\', \'solid 8px transparent\')\n // .style(\'border-top\', \'solid 8px #313639\')\n // .style(\'transform\', \'translateX(-50%)\')\n // .style(\'content\', \'\')\n // .style(\'top\', \'100%\')\n // .style(\'left\', "50%")\n // .style(\'height\', 5)\n // .style(\'width\', 5)\n // .style(\'position\', \'absolute\');\n // })\n\n\n node.on("mousemove", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#chart\').append(\'div\').attr(\'id\', \'tooltip\');\n var tooltip_html = \'\';\n tooltip_html += \'\' + d.data.itemName + \'
\';\n tooltip_html += \' \' + d.data.value + \'
\';\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').html(tooltip_html);\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').style("left", event.pageX - Math.round(Number(d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').style(\'width\').slice(0, -2))) / 2 + "px").style("top", event.pageY - 60 + "px").style(\'opacity\', 1).style("position", "absolute").style("font-family", "Open Sans").style("font-size", ".8rem").style("text-align", "center").style("padding", ".5rem").style(\'pointer-events\', \'none\').style("color", "white").style("background-color", "#313639").style("background-opacity", ".85").style("border-radius", "#8px");\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').append(\'div\').style(\'border-right\', \'solid 4px transparent\').style(\'border-left\', \'solid 4px transparent\').style(\'border-top\', \'solid 4px #313639\').style(\'transform\', \'translateX(-50%)\').style(\'content\', \'\').style(\'top\', \'100%\').style(\'left\', "50%").style(\'height\', 5).style(\'width\', 5).style(\'position\', \'absolute\');\n }).on("mouseout", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').transition().duration(\'50\').style("opacity", 0);\n });\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](self.frameElement).style("height", diameter + "px");\n }\n }, {\n key: "render",\n value: function render() {\n var fontSize = this.getFontSize();\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(BubbleChartWrapper, {\n id: "chart",\n style: {\n fontSize: fontSize\n }\n });\n }\n }]);\n\n return BubbleChart;\n}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);\n\nBubbleChart.defaultProps = {\n config: {},\n data: []\n};\n/* harmony default export */ __webpack_exports__["default"] = (BubbleChart);\n\n//# sourceURL=webpack://%5Bname%5D/./src/bubble_chart/bubble_chart.js?')},"./src/bubble_chart/bubble_chart_container.js":
+/*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "./node_modules/d3/index.js");\n/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");\n/* harmony import */ var _bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bubble_chart_styles.css */ "./src/bubble_chart/bubble_chart_styles.css");\n/* harmony import */ var _bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_bubble_chart_styles_css__WEBPACK_IMPORTED_MODULE_3__);\nfunction _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral(["\\n font-family: \'Open Sans\', \'Noto Sans JP\', \'Noto Sans\', \'Noto Sans CJK KR\', Helvetica, Arial, sans-serif;\\n text-align: center;\\n overflow: hidden;\\n"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\n\n\n\n\nvar BubbleChartWrapper = styled_components__WEBPACK_IMPORTED_MODULE_2__["default"].div(_templateObject());\n\nvar BubbleChart =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(BubbleChart, _Component);\n\n function BubbleChart() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, BubbleChart);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(BubbleChart)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), "drawChartWithParams", function () {\n _this.drawChart(\'#chart\');\n });\n\n return _this;\n }\n\n _createClass(BubbleChart, [{\n key: "componentDidMount",\n value: function componentDidMount() {\n this.drawChartWithParams();\n window.addEventListener(\'resize\', this.drawChartWithParams);\n }\n }, {\n key: "componentDidUpdate",\n value: function componentDidUpdate() {\n this.drawChartWithParams();\n }\n }, {\n key: "componentWillUnmount",\n value: function componentWillUnmount() {\n window.removeEventListener(\'resize\', this.drawChartWithParams);\n }\n }, {\n key: "getWindowSize",\n value: function getWindowSize() {\n return window.innerWidth > window.innerHeight ? window.innerHeight : window.innerWidth;\n }\n }, {\n key: "getFontSize",\n value: function getFontSize() {\n var windowSize = this.getWindowSize();\n var fontSize = Math.round(windowSize * 0.017);\n return fontSize > 13 ? 13 : fontSize;\n }\n }, {\n key: "drawChart",\n value: function drawChart(id) {\n function getDivWidth(div) {\n var width = d3__WEBPACK_IMPORTED_MODULE_1__["select"](div) // get the width of div element\n .style(\'width\') // take of \'px\'\n .slice(0, -2); // return as an integer\n\n return Math.round(Number(width));\n }\n\n var _this$props = this.props,\n config = _this$props.config,\n data = _this$props.data;\n var windowSize = this.getWindowSize();\n var fontSize = this.getFontSize();\n var diameter = windowSize * .97,\n format = d3__WEBPACK_IMPORTED_MODULE_1__["format"](",d"),\n color = d3__WEBPACK_IMPORTED_MODULE_1__["scaleOrdinal"]().range(config.value_colors || []);\n var bubble = d3__WEBPACK_IMPORTED_MODULE_1__["pack"]().size([diameter, diameter]).padding(.5);\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).select("svg").remove();\n var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).append("svg").attr("width", diameter).attr("height", diameter).attr("class", "bubble");\n var d = {\n children: data\n };\n var maxColor = this.props.maxColor;\n var root = d3__WEBPACK_IMPORTED_MODULE_1__["hierarchy"](d).sum(function (d) {\n return d.value;\n }).sort(function (a, b) {\n return b.value - a.value;\n });\n bubble(root);\n this.tooltip = d3__WEBPACK_IMPORTED_MODULE_1__["select"](id).append("div").attr("id", "tooltip").style("opacity", 1);\n var node = svg.selectAll("g").data(root.children).enter().append("g").attr("class", "node").attr("transform", function (d) {\n return "translate(" + d.x + "," + d.y + ")";\n });\n node.append("circle").attr("class", "circle_node").attr("r", function (d) {\n return d.r;\n }).style("z-index", 1).style("opacity", function (d) {\n return d.data.color / maxColor > .15 ? d.data.color / maxColor : .15;\n }).style("fill", config[\'toColor\']).on("mousemove", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](this).style("stroke-width", 10) // set the stroke width\n .style("stroke", config[\'toColor\']).style("z-index", 10).style("stroke-opacity", function (d) {\n return d.data.color / maxColor > .5 ? d.data.color / 2 / maxColor : d.data.color * 2 / maxColor;\n });\n }).on("mouseout", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](this).style("z-index", 1).style("stroke-width", 0).style("opacity", function (d) {\n return d.data.color / maxColor > .15 ? d.data.color / maxColor : .15;\n });\n });\n\n if (config[\'value_titles\'] !== false) {\n node.append("text").attr("class", "label").attr("dy", config[\'value_labels\'] === false ? ".3em" : ".1em").style("text-anchor", "middle").style("font-size", config[\'font_size_value\']).text(function (d) {\n return d.data.itemName.substring(0, d.r / 3);\n });\n }\n\n if (config[\'value_labels\'] !== false) {\n node.append("text").attr("class", "label").attr("dy", config[\'value_titles\'] === false ? ".3em" : "1.5em").style("font-size", config[\'font_size_label\']).style("text-anchor", "middle").text(function (d) {\n return d.data.value;\n });\n }\n\n node.on("mousemove", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#chart\').append(\'div\').attr(\'id\', \'tooltip\');\n var tooltip_html = \'\';\n tooltip_html += \'\' + d.data.itemName + \'
\';\n tooltip_html += \' \' + d.data.value + \'
\';\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').html(tooltip_html);\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').style("left", event.pageX - Math.round(Number(d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').style(\'width\').slice(0, -2))) / 2 + "px").style("top", event.pageY - 60 + "px").style(\'opacity\', 1).style("position", "absolute").style("font-family", "Open Sans").style("font-size", ".8rem").style("text-align", "center").style("padding", ".5rem").style(\'pointer-events\', \'none\').style("color", "white").style("background-color", "#313639").style("background-opacity", ".85").style("border-radius", "#8px");\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').append(\'div\').style(\'border-right\', \'solid 4px transparent\').style(\'border-left\', \'solid 4px transparent\').style(\'border-top\', \'solid 4px #313639\').style(\'transform\', \'translateX(-50%)\').style(\'content\', \'\').style(\'top\', \'100%\').style(\'left\', "50%").style(\'height\', 5).style(\'width\', 5).style(\'position\', \'absolute\');\n }).on("mouseout", function (d) {\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](\'#tooltip\').transition().duration(\'50\').style("opacity", 0);\n });\n d3__WEBPACK_IMPORTED_MODULE_1__["select"](self.frameElement).style("height", diameter + "px");\n }\n }, {\n key: "render",\n value: function render() {\n var fontSize = this.getFontSize();\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(BubbleChartWrapper, {\n id: "chart",\n style: {\n fontSize: fontSize\n }\n });\n }\n }]);\n\n return BubbleChart;\n}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);\n\nBubbleChart.defaultProps = {\n config: {},\n data: []\n};\n/* harmony default export */ __webpack_exports__["default"] = (BubbleChart);\n\n//# sourceURL=webpack://%5Bname%5D/./src/bubble_chart/bubble_chart.js?')},"./src/bubble_chart/bubble_chart_container.js":
/*!****************************************************!*\
!*** ./src/bubble_chart/bubble_chart_container.js ***!
\****************************************************/
diff --git a/dist/calendar_chart.js b/dist/calendar_chart.js
index 4d2ac96f..4d46fce3 100644
--- a/dist/calendar_chart.js
+++ b/dist/calendar_chart.js
@@ -2706,7 +2706,7 @@
/*!******************************************************************!*\
!*** ./src/calendar_visualization/calendar-heatmap.component.js ***!
\******************************************************************/
-/*! exports provided: default */function(module,__webpack_exports__,__webpack_require__){"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3 */ \"./node_modules/d3/index.js\");\n/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ \"./node_modules/styled-components/dist/styled-components.browser.esm.js\");\n/* harmony import */ var _calendar_heatmap_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./calendar-heatmap.css */ \"./src/calendar_visualization/calendar-heatmap.css\");\n/* harmony import */ var _calendar_heatmap_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_calendar_heatmap_css__WEBPACK_IMPORTED_MODULE_4__);\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\\n font-family: \\\"Open Sans\\\", \\\"Noto Sans JP\\\", \\\"Noto Sans\\\", \\\"Noto Sans CJK KR\\\",\\n Helvetica, Arial, sans-serif;\\n color: #3a4245;\\n height: 100%;\\n justify-content: center;\\n align-items: center;\\n text-align: center;\\n\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\n\n\n\n\n\nvar CalendarChartWrapper = styled_components__WEBPACK_IMPORTED_MODULE_3__[\"default\"].div(_templateObject()); //display: flex;\n//flex-direction: column;\n\nvar CalendarHeatmap =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inherits(CalendarHeatmap, _React$Component);\n\n function CalendarHeatmap(props) {\n var _this;\n\n _classCallCheck(this, CalendarHeatmap);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(CalendarHeatmap).call(this, props));\n _this.settings = {\n gutter: 5,\n item_gutter: 1,\n width: 1000,\n height: 2500,\n item_size: 10,\n label_padding: 40,\n max_block_height: 20,\n transition_duration: 500,\n tooltip_width: 250,\n tooltip_padding: 15\n };\n _this.in_transition = false;\n _this.overview = _this.props.overview;\n _this.history = ['global'];\n _this.selected = {};\n _this.calcDimensions = _this.calcDimensions.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(CalendarHeatmap, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n // Delete the previous visualization and create a new one with the new props\n // change color, change dates, \n this.cleanPreviousObjects();\n this.createElements();\n this.createAddons();\n }\n }, {\n key: \"cleanPreviousObjects\",\n value: function cleanPreviousObjects() {\n var titlesel = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"]('#calendar-heatmap').select(\"svg\"); // titlesel.select(\"#TitleLabel\").remove();\n // titlesel.select(\"#DatesBound\").remove(); \n\n titlesel.remove();\n }\n }, {\n key: \"createAddons\",\n value: function createAddons() // RGB: changing component to allow center title an other information related to the visualization\n {\n var titlesel = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"]('#calendar-heatmap').select(\"svg\"); //var newsvg = titlesel.append(\"svg\");\n\n var element = titlesel.node();\n var posx = element.getBoundingClientRect().width;\n var posy = element.getBoundingClientRect().height; // console.log(posy);\n\n var sdate = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.props.startdate).format('MMMM Do YYYY');\n var edate = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.props.enddate).format('MMMM Do YYYY'); // console.log(\"Show DR \" + this.props.show_date_range);\n\n if (this.props.show_date_range == true) {\n // console.log(\"DR\");\n // let h1 = this.svg.attr('height');\n // this.svg.attr('height', h1 + 15);\n titlesel.append(\"text\").text(\"\" + sdate + \" to \" + edate).attr(\"transform\", \"translate(\" + posx / 2 + \",\" + (posy - 65) + \")\").attr(\"text-anchor\", \"middle\").style(\"position\", \"absolute\").attr(\"font-size\", this.props.font_size_date).attr(\"id\", \"DatesBound\").attr(\"fill\", \"#3a4245\").attr(\"class\", \"looker-vis-context-value-text\");\n } // console.log(\"Show Title \" + this.props.show_date_range);\n\n\n if (this.props.show_title == true) {\n // console.log(\"Title\");\n // let h1 = this.svg.attr('height');\n // this.svg.attr('height', h1 + 15);\n titlesel.append(\"text\").text(this.props.title).attr(\"transform\", \"translate(\" + posx / 2 + \",\" + (posy - 40) + \")\").attr(\"text-anchor\", \"middle\").style(\"position\", \"absolute\").attr(\"font-size\", this.props.font_size_title).attr(\"id\", \"TitleLabel\") //.attr(\"font-weight\", 100)\n .attr(\"fill\", \"#3a4245\").attr(\"class\", \"looker-vis-context-title-text\");\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.createElements();\n this.parseData();\n this.drawChart();\n this.createAddons();\n window.addEventListener('resize', this.calcDimensions);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.calcDimensions);\n }\n }, {\n key: \"createElements\",\n value: function createElements() {\n // Create svg element\n this.svg = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"]('#calendar-heatmap').append('svg').attr('class', 'svg'); // Create other svg elements\n\n this.items = this.svg.append('g');\n this.labels = this.svg.append('g');\n this.buttons = this.svg.append('g'); // Add tooltip to the same element as main svg\n // this.tooltip = d3.select('#calendar-heatmap')\n // .append('div')\n // .attr('class', styles.heatmapTooltip)\n // .style('opacity', 0)\n // .style('pointer-events', 'none')\n // .style('position', 'absolute')\n // .style('z-index', 9999)\n // .style('width', '250px')\n // .style('max-width', '250px')\n // .style('overflow', 'hidden')\n // .style('padding', '15px')\n // .style('font-size', '12px')\n // .style('line-height', '14px')\n // .style('color', 'rgb(51, 51, 51)')\n // .style('background', 'rgba(255, 255, 255, 0.75)')\n\n this.tooltip = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"]('#calendar-heatmap').append('div').attr(\"id\", \"tooltip\").attr(\"class\", _calendar_heatmap_css__WEBPACK_IMPORTED_MODULE_4___default.a.heatmapTooltip).style(\"opacity\", 1).style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"#313639\").style(\"border-radius\", \"#8px\");\n this.calcDimensions();\n } // Calculate dimensions based on available width\n\n }, {\n key: \"calcDimensions\",\n value: function calcDimensions() {\n var dayIndex = Math.round((moment__WEBPACK_IMPORTED_MODULE_1___default()() - moment__WEBPACK_IMPORTED_MODULE_1___default()().subtract(1, 'year').startOf('week')) / 86400000);\n var colIndex = Math.trunc(dayIndex / 7);\n var numWeeks = colIndex + 1;\n this.settings.width = this.container.offsetWidth < 1000 ? 1000 : this.container.offsetWidth;\n this.settings.item_size = (this.settings.width - this.settings.label_padding) / numWeeks - this.settings.gutter;\n this.settings.height = this.settings.label_padding + 7 * (this.settings.item_size + this.settings.gutter);\n this.svg.attr('width', this.settings.width).attr('height', this.settings.height + 80); // RGB: adding extra space for titles and additional labels\n\n this.parseData();\n\n if (!!this.props.data && !!this.props.data[0].summary) {\n console.log(\"happening\");\n this.drawChart();\n }\n }\n }, {\n key: \"parseData\",\n value: function parseData() {\n this.props.data.map(function (d) {\n var summary = d.details.reduce(function (uniques, project) {\n if (!uniques[project.name]) {\n uniques[project.name] = {\n 'value': project.value\n };\n } else {\n uniques[project.name].value += project.value;\n }\n\n return uniques;\n }, {});\n var unsorted_summary = Object.keys(summary).map(function (key) {\n return {\n 'name': key,\n 'value': summary[key].value\n };\n });\n d.summary = unsorted_summary.sort(function (a, b) {\n return b.value - a.value;\n });\n return d;\n });\n }\n }, {\n key: \"drawChart\",\n value: function drawChart() {\n console.log(this.overview);\n\n if (this.overview === 'global') {\n this.drawGlobalOverview();\n } else if (this.overview === 'year') {\n this.drawYearOverview();\n } else if (this.overview === 'month') {\n this.drawMonthOverview();\n } else if (this.overview === 'week') {\n this.drawWeekOverview();\n } else if (this.overview === 'day') {\n this.drawDayOverview();\n }\n }\n /**\n * Draw global overview (multiple years)\n */\n\n }, {\n key: \"drawGlobalOverview\",\n value: function drawGlobalOverview() {\n var _this2 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Define start and end of the dataset\n\n\n var start = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.props.data[0].date).startOf('year');\n var end = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.props.data[this.props.data.length - 1].date).endOf('year'); // Define array of years and total values\n\n var year_data = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeYears\"](start, end).map(function (d) {\n var date = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n var getSummary = function getSummary() {\n var summary = _this2.props.data.reduce(function (summary, d) {\n if (moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).year() === date.year()) {\n d.summary.map(function (item) {\n if (!summary[item.name]) {\n summary[item.name] = {\n 'value': item.value\n };\n } else {\n summary[item.name].value += item.value;\n }\n });\n }\n\n return summary;\n }, {});\n\n var unsorted_summary = Object.keys(summary).map(function (key) {\n return {\n 'name': key,\n 'value': summary[key].value\n };\n });\n return unsorted_summary.sort(function (a, b) {\n return b.value - a.value;\n });\n };\n\n return {\n 'date': date,\n 'total': _this2.props.data.reduce(function (prev, current) {\n if (moment__WEBPACK_IMPORTED_MODULE_1___default()(current.date).year() === date.year()) {\n prev += current.total;\n }\n\n return prev;\n }, 0),\n 'summary': getSummary()\n };\n }); // Calculate max value of all the years in the dataset\n\n var max_value = d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](year_data, function (d) {\n return d.total;\n }); //console.log(year_data);\n // Define year labels and axis\n\n var year_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeYears\"](start, end).map(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n });\n var yearScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([0, this.settings.width]).padding([0.05]).domain(year_labels.map(function (d) {\n return d.year();\n })); // Add global data items to the overview\n\n this.items.selectAll('.item-block-year').remove();\n var item_block = this.items.selectAll('.item-block-year').data(year_data).enter().append('rect').attr('class', 'item item-block-year').style('cursor', 'pointer').attr('width', function () {\n return (_this2.settings.width - _this2.settings.label_padding) / year_labels.length - _this2.settings.gutter * 5;\n }).attr('height', function () {\n return _this2.settings.height - _this2.settings.label_padding;\n }).attr('transform', function (d) {\n return 'translate(' + yearScale(d.date.year()) + ',' + _this2.settings.tooltip_padding * 2 + ')';\n }).attr('fill', function (d) {\n var color = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range(['#ffffff', _this2.props.color]).domain([-0.15 * max_value, max_value]);\n return color(d.total) || '#ff4500';\n }).on('click', function (d) {\n if (_this2.in_transition) {\n return;\n } // Set in_transition flag\n\n\n _this2.in_transition = true; // Set selected date to the one clicked on\n\n _this2.selected = d; // Hide tooltip\n\n _this2.hideTooltip(); // Remove all global overview related items and labels\n\n\n _this2.removeGlobalOverview(); // Redraw the chart\n\n\n _this2.overview = 'year';\n\n _this2.drawChart();\n }).style('opacity', 0).on('mousemove', function (d) {\n if (_this2.in_transition) {\n return;\n }\n\n var tooltip_html = '';\n tooltip_html += 'Total: ';\n tooltip_html += '' + d.total + '';\n tooltip_html += ' ' + _this2.props.totmeasure + '
';\n\n _this2.tooltip.html(tooltip_html); // console.log(Math.round(Number(d3.select(\"#tooltip\").style('width').slice(0, -2))));\n\n\n _this2.tooltip.style(\"left\", event.pageX - Math.round(Number(_this2.tooltip.style('width').slice(0, -2))) / 2 + \"px\").style(\"top\", event.pageY - 50 + \"px\").style('opacity', 1).style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style('font-size', '.8rem').style('pointer-events', 'none').style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".85\").style(\"border-radius\", \"#8px\");\n\n _this2.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this2.in_transition) {\n return;\n }\n\n _this2.hideTooltip();\n }).transition().delay(function (d, i) {\n return _this2.settings.transition_duration * (i + 1) / 10;\n }).duration(function () {\n return _this2.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this2.in_transition = false;\n }); // Add year labels\n\n this.labels.selectAll('.label-year').remove();\n this.labels.selectAll('.label-year').data(year_labels).enter().append('text').attr('class', 'label label-year').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this2.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return d.year();\n }).attr('x', function (d) {\n return yearScale(d.year());\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (year_label) {\n if (_this2.in_transition) {\n return;\n }\n\n _this2.items.selectAll('.item-block-year').transition().duration(_this2.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).year() === year_label.year() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this2.in_transition) {\n return;\n }\n\n _this2.items.selectAll('.item-block-year').transition().duration(_this2.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }).on('click', function (d) {\n if (_this2.in_transition) {\n return;\n } // Set in_transition flag\n\n\n _this2.in_transition = true; // Set selected year to the one clicked on\n\n _this2.selected = {\n date: d\n }; // Hide tooltip\n\n _this2.hideTooltip(); // Remove all global overview related items and labels\n\n\n _this2.removeGlobalOverview(); // Redraw the chart\n\n\n _this2.overview = 'year';\n\n _this2.drawChart();\n });\n }\n /**\n * Draw year overview\n */\n\n }, {\n key: \"drawYearOverview\",\n value: function drawYearOverview() {\n var _this3 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Define start and end date of the selected year\n\n\n var start_of_year = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('year');\n var end_of_year = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('year'); // Filter data down to the selected year\n\n var year_data = this.props.data.filter(function (d) {\n return start_of_year <= moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) < end_of_year;\n }); // Calculate max value of the year data\n\n var max_value = d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](year_data, function (d) {\n return d.total;\n }); //let min_value = d3.min(year_data,d => d.total)\n\n var color = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range(['#ffffff', this.props.color]).domain([-0.15 * max_value, max_value]);\n\n var calcItemX = function calcItemX(d) {\n var date = moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date);\n var dayIndex = Math.round((date - moment__WEBPACK_IMPORTED_MODULE_1___default()(start_of_year).startOf('week')) / 86400000);\n var colIndex = Math.trunc(dayIndex / 7);\n return colIndex * (_this3.settings.item_size + _this3.settings.gutter) + _this3.settings.label_padding;\n };\n\n var calcItemY = function calcItemY(d) {\n return _this3.settings.label_padding + moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).weekday() * (_this3.settings.item_size + _this3.settings.gutter);\n };\n\n var calcItemSize = function calcItemSize(d) {\n if (max_value <= 0) {\n return _this3.settings.item_size;\n }\n\n return _this3.settings.item_size * 0.75 + _this3.settings.item_size * d.total / max_value * 0.25;\n };\n\n this.items.selectAll('.item-circle').remove();\n this.items.selectAll('.item-circle').data(year_data).enter().append('rect').attr('class', 'item item-circle').style('cursor', 'pointer').style('opacity', 0).attr('x', function (d) {\n return calcItemX(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('y', function (d) {\n return calcItemY(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('rx', function (d) {\n return calcItemSize(d);\n }).attr('ry', function (d) {\n return calcItemSize(d);\n }).attr('width', function (d) {\n return calcItemSize(d);\n }).attr('height', function (d) {\n return calcItemSize(d);\n }).attr('fill', function (d) {\n return d.total > 0 ? color(d.total) : 'transparent';\n }) // .on('click', d => {\n // if (this.in_transition) { return }\n // // Don't transition if there is no data to show\n // if (d.total === 0) { return }\n // this.in_transition = true\n // // Set selected date to the one clicked on\n // this.selected = d\n // // Hide tooltip\n // this.hideTooltip()\n // // Remove all year overview related items and labels\n // this.removeYearOverview()\n // // Redraw the chart\n // this.overview = 'day'\n // this.drawChart()\n // })\n .on('mousemove', function (d) {\n if (_this3.in_transition) {\n return;\n } // Pulsating animation\n\n\n var circle = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget);\n\n var repeat = function repeat() {\n circle = circle.transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).attr('x', function (d) {\n return calcItemX(d) - (_this3.settings.item_size * 1.1 - _this3.settings.item_size) / 2;\n }).attr('y', function (d) {\n return calcItemY(d) - (_this3.settings.item_size * 1.1 - _this3.settings.item_size) / 2;\n }).attr('width', _this3.settings.item_size * 1.1).attr('height', _this3.settings.item_size * 1.1).transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).attr('x', function (d) {\n return calcItemX(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('y', function (d) {\n return calcItemY(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('width', function (d) {\n return calcItemSize(d);\n }).attr('height', function (d) {\n return calcItemSize(d);\n }).on('end', repeat);\n };\n\n repeat(); //RGB: Changes on the tooltip (hint) displayed in the monthly - day view\n // Construct tooltip\n\n var tooltip_html = ''; //tooltip_html += ``\n\n tooltip_html += \"
';\n tooltip_html += '' + moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).format('dddd, MMM Do YYYY') + '
'; // Add summary to the tooltip\n // let counter = 0\n // console.log(d);\n // while ( counter < d.summary.length ) {\n // tooltip_html += '' + d.summary[counter].name + ':'\n // //tooltip_html += '' + this.formatTime(d.summary[counter].value) + '
'\n // tooltip_html += ' ' + d.summary[counter].value+ ''\n // tooltip_html += ' ' + this.props.measure + ''\n // counter++\n // }\n // Calculate tooltip position\n\n var x = calcItemX(d) + _this3.settings.item_size;\n\n if (_this3.settings.width - x < _this3.settings.tooltip_width + _this3.settings.tooltip_padding * 3) {\n x -= _this3.settings.tooltip_width + _this3.settings.tooltip_padding * 2;\n }\n\n var y = calcItemY(d) + _this3.settings.item_size; // Show tooltip\n\n\n _this3.tooltip.html(tooltip_html);\n\n console.log(Math.round(Number(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](\"#tooltip\").style('width').slice(0, -2))));\n\n _this3.tooltip.style(\"left\", event.pageX - Math.round(Number(_this3.tooltip.style('width').slice(0, -2))) / 2 - 5 + \"px\").style(\"top\", event.pageY - 100 + \"px\").transition().duration(50).style('opacity', .9).style('pointer-events', 'none').style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".75\").style(\"border-radius\", \"#8px\");\n\n _this3.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this3.in_transition) {\n return;\n } // Set circle radius back to what its supposed to be\n\n\n d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget).transition().duration(_this3.settings.transition_duration / 2).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).attr('x', function (d) {\n return calcItemX(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('y', function (d) {\n return calcItemY(d) + (_this3.settings.item_size - calcItemSize(d)) / 2;\n }).attr('width', function (d) {\n return calcItemSize(d);\n }).attr('height', function (d) {\n return calcItemSize(d);\n }); // Hide tooltip\n\n _this3.hideTooltip();\n }).transition().delay(function () {\n return (Math.cos(Math.PI * Math.random()) + 1) * _this3.settings.transition_duration;\n }).duration(function () {\n return _this3.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n return ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this3.in_transition = false;\n }); // Add month labels\n\n var month_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeMonths\"](start_of_year, end_of_year);\n var monthScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range([0, this.settings.width]).domain([0, month_labels.length]);\n this.labels.selectAll('.label-month').remove();\n this.labels.selectAll('.label-month').data(month_labels).enter().append('text').attr('class', 'label label-month').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this3.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return d.toLocaleDateString('en-us', {\n month: 'short'\n });\n }).attr('x', function (d, i) {\n return monthScale(i) + (monthScale(i) - monthScale(i - 1)) / 2;\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (d) {\n if (_this3.in_transition) {\n return;\n }\n\n var selected_month = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this3.items.selectAll('.item-circle').transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).isSame(selected_month, 'month') ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this3.in_transition) {\n return;\n }\n\n _this3.items.selectAll('.item-circle').transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }).on('click', function (d) {\n if (_this3.in_transition) {\n return;\n } // Check month data\n\n\n var month_data = _this3.props.data.filter(function (e) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).startOf('month') <= moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) < moment__WEBPACK_IMPORTED_MODULE_1___default()(d).endOf('month');\n }); // Don't transition if there is no data to show\n\n\n if (!month_data.length) {\n return;\n } // Set selected month to the one clicked on\n\n\n _this3.selected = {\n date: d\n };\n _this3.in_transition = true; // Hide tooltip\n\n _this3.hideTooltip(); // Remove all year overview related items and labels\n\n\n _this3.removeYearOverview(); // Redraw the chart\n\n\n _this3.overview = 'month';\n\n _this3.drawChart();\n }); // Add day labels\n\n var day_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeDays\"](moment__WEBPACK_IMPORTED_MODULE_1___default()().startOf('week'), moment__WEBPACK_IMPORTED_MODULE_1___default()().endOf('week'));\n var dayScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(day_labels.map(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).weekday();\n }));\n this.labels.selectAll('.label-day').remove();\n this.labels.selectAll('.label-day').data(day_labels).enter().append('text').attr('class', 'label label-day').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('x', this.settings.label_padding / 3).attr('y', function (d, i) {\n return dayScale(i) + dayScale.bandwidth() / 1.75;\n }).style('text-anchor', 'left').attr('font-size', function () {\n return Math.floor(_this3.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).format('dddd')[0];\n }).on('mouseenter', function (d) {\n if (_this3.in_transition) {\n return;\n }\n\n var selected_day = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this3.items.selectAll('.item-circle').transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).day() === selected_day.day() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this3.in_transition) {\n return;\n }\n\n _this3.items.selectAll('.item-circle').transition().duration(_this3.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add button to switch back to previous overview\n\n this.drawButton();\n }\n /**\n * Draw month overview\n */\n\n }, {\n key: \"drawMonthOverview\",\n value: function drawMonthOverview() {\n var _this4 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Define beginning and end of the month\n\n\n var start_of_month = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('month');\n var end_of_month = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('month'); // Filter data down to the selected month\n\n var month_data = this.props.data.filter(function (d) {\n return start_of_month <= moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) < end_of_month;\n });\n var max_value = d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](month_data, function (d) {\n return d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](d.summary, function (d) {\n return d.value;\n });\n }); // Define day labels and axis\n\n var day_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeDays\"](moment__WEBPACK_IMPORTED_MODULE_1___default()().startOf('week'), moment__WEBPACK_IMPORTED_MODULE_1___default()().endOf('week'));\n var dayScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(day_labels.map(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).weekday();\n })); // Define week labels and axis\n\n var week_labels = [start_of_month.clone()];\n\n while (start_of_month.week() !== end_of_month.week()) {\n week_labels.push(start_of_month.add(1, 'week').clone());\n }\n\n var weekScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.width]).padding([0.05]).domain(week_labels.map(function (weekday) {\n return weekday.week();\n })); // Add month data items to the overview\n\n this.items.selectAll('.item-block-month').remove();\n var item_block = this.items.selectAll('.item-block-month').data(month_data).enter().append('g').attr('class', 'item item-block-month').style('cursor', 'pointer').attr('width', function () {\n return (_this4.settings.width - _this4.settings.label_padding) / week_labels.length - _this4.settings.gutter * 5;\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this4.settings.max_block_height);\n }).attr('transform', function (d) {\n return 'translate(' + weekScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week()) + ',' + (dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).weekday()) + dayScale.bandwidth() / 1.75 - 15) + ')';\n }).attr('total', function (d) {\n return d.total;\n }).attr('date', function (d) {\n return d.date;\n }).attr('offset', 0); // .on('click', d => {\n // if (this.in_transition) { return }\n // // Don't transition if there is no data to show\n // if (d.total === 0) { return }\n // this.in_transition = true\n // // Set selected date to the one clicked on\n // this.selected = d\n // // Hide tooltip\n // this.hideTooltip()\n // // Remove all month overview related items and labels\n // this.removeMonthOverview()\n // // Redraw the chart\n // this.overview = 'day'\n // this.drawChart()\n // })\n\n var item_width = (this.settings.width - this.settings.label_padding) / week_labels.length - this.settings.gutter * 5;\n var itemScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().rangeRound([0, item_width]);\n var item_gutter = this.settings.item_gutter;\n item_block.selectAll('.item-block-rect').data(function (d) {\n return d.summary;\n }).enter().append('rect').attr('class', 'item item-block-rect').style('cursor', 'pointer').attr('x', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n var offset = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset'));\n itemScale.domain([0, total]);\n d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset', offset + itemScale(d.value));\n return offset;\n }).attr('width', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n itemScale.domain([0, total]);\n return Math.max(itemScale(d.value) - item_gutter, 1);\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this4.settings.max_block_height);\n }).attr('fill', function (d) {\n var color = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range(['#ffffff', _this4.props.color]).domain([-0.15 * max_value, max_value]);\n return color(d.value) || '#ff4500';\n }).style('opacity', 0).on('mousemove', function (d) {\n if (_this4.in_transition) {\n return;\n } // Get date from the parent node\n\n\n var parentNode = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget.parentNode);\n var date = new Date(parentNode.attr('date')); //RGB: Changes on the label to use the props parameter \n // Construct tooltip\n\n var tooltip_html = ''; // tooltip_html += '' + (d.value ? this.formatTime(d.value) : 'No time') + ' tracked
'\n\n tooltip_html += '' + (d.value ? d.value : 'No entries for') + ' ' + _this4.props.measure + '
'; //tooltip_html += ' Total ' + this.props.measure + ''\n\n tooltip_html += '' + moment__WEBPACK_IMPORTED_MODULE_1___default()(date).format('dddd, MMM Do YYYY') + '
'; // Calculate tooltip position\n\n var x = weekScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).week()) + _this4.settings.tooltip_padding;\n\n while (_this4.settings.width - x < _this4.settings.tooltip_width + _this4.settings.tooltip_padding * 3) {\n x -= 10;\n }\n\n var y = dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).weekday()) + _this4.settings.tooltip_padding * 2; // Show tooltip\n\n _this4.tooltip.html(tooltip_html);\n\n _this4.tooltip.style(\"left\", event.pageX - Math.round(Number(_this4.tooltip.style('width').slice(0, -2))) / 2 + \"px\").style(\"top\", event.pageY - 70 + \"px\").transition().duration(50).style('opacity', .9).style('pointer-events', 'none').style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".75\").style(\"border-radius\", \"#8px\");\n\n _this4.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.hideTooltip();\n }).transition().delay(function () {\n return (Math.cos(Math.PI * Math.random()) + 1) * _this4.settings.transition_duration;\n }).duration(function () {\n return _this4.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n return ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this4.in_transition = false;\n }); // Add week labels\n\n this.labels.selectAll('.label-week').remove();\n this.labels.selectAll('.label-week').data(week_labels).enter().append('text').attr('class', 'label label-week').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this4.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return 'Week ' + d.week();\n }).attr('x', function (d) {\n return weekScale(d.week());\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (weekday) {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week() === weekday.week() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }).on('click', function (d) {\n if (_this4.in_transition) {\n return;\n } // Check week data\n\n\n var week_data = _this4.props.data.filter(function (e) {\n return d.startOf('week') <= moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) < d.endOf('week');\n }); // Don't transition if there is no data to show\n\n\n if (!week_data.length) {\n return;\n }\n\n _this4.in_transition = true; // Set selected month to the one clicked on\n\n _this4.selected = {\n date: d\n }; // Hide tooltip\n\n _this4.hideTooltip(); // Remove all year overview related items and labels\n\n\n _this4.removeMonthOverview(); // Redraw the chart\n\n\n _this4.overview = 'week';\n\n _this4.drawChart();\n }); // Add day labels\n\n this.labels.selectAll('.label-day').remove();\n this.labels.selectAll('.label-day').data(day_labels).enter().append('text').attr('class', 'label label-day').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('x', this.settings.label_padding / 3).attr('y', function (d, i) {\n return dayScale(i) + dayScale.bandwidth() / 1.75;\n }).style('text-anchor', 'left').attr('font-size', function () {\n return Math.floor(_this4.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).format('dddd')[0];\n }).on('mouseenter', function (d) {\n if (_this4.in_transition) {\n return;\n }\n\n var selected_day = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).day() === selected_day.day() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add button to switch back to previous overview\n\n this.drawButton();\n }\n /**\n * Draw week overview\n */\n\n }, {\n key: \"drawWeekOverview\",\n value: function drawWeekOverview() {\n var _this5 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Define beginning and end of the week\n\n\n var start_of_week = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('week');\n var end_of_week = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('week'); // Filter data down to the selected week\n\n var week_data = this.props.data.filter(function (d) {\n return start_of_week <= moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) < end_of_week;\n });\n var max_value = d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](week_data, function (d) {\n return d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](d.summary, function (d) {\n return d.value;\n });\n }); // Define day labels and axis\n\n var day_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeDays\"](moment__WEBPACK_IMPORTED_MODULE_1___default()().startOf('week'), moment__WEBPACK_IMPORTED_MODULE_1___default()().endOf('week'));\n var dayScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(day_labels.map(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).weekday();\n })); // Define week labels and axis\n\n var week_labels = [start_of_week];\n var weekScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.width]).padding([0.01]).domain(week_labels.map(function (weekday) {\n return weekday.week();\n })); // Add week data items to the overview\n\n this.items.selectAll('.item-block-week').remove();\n var item_block = this.items.selectAll('.item-block-week').data(week_data).enter().append('g').attr('class', 'item item-block-week').style('cursor', 'pointer').attr('width', function () {\n return (_this5.settings.width - _this5.settings.label_padding) / week_labels.length - _this5.settings.gutter * 5;\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this5.settings.max_block_height);\n }).attr('transform', function (d) {\n return 'translate(' + weekScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week()) + ',' + (dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).weekday()) + dayScale.bandwidth() / 1.75 - 15) + ')';\n }).attr('total', function (d) {\n return d.total;\n }).attr('date', function (d) {\n return d.date;\n }).attr('offset', 0); // .on('click', d => {\n // if (this.in_transition) { return }\n // // Don't transition if there is no data to show\n // if (d.total === 0) { return }\n // this.in_transition = true\n // // Set selected date to the one clicked on\n // this.selected = d\n // // Hide tooltip\n // this.hideTooltip()\n // // Remove all week overview related items and labels\n // this.removeWeekOverview()\n // // Redraw the chart\n // this.overview = 'day'\n // this.drawChart()\n // })\n\n var item_width = (this.settings.width - this.settings.label_padding) / week_labels.length - this.settings.gutter * 5;\n var itemScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().rangeRound([0, item_width]);\n var item_gutter = this.settings.item_gutter;\n item_block.selectAll('.item-block-week').data(function (d) {\n return d.summary;\n }).enter().append('rect').attr('class', 'item item-block-week').style('cursor', 'pointer').attr('x', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n var offset = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset'));\n itemScale.domain([0, total]);\n d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset', offset + itemScale(d.value));\n return offset;\n }).attr('width', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n itemScale.domain([0, total]);\n return Math.max(itemScale(d.value) - item_gutter, 1);\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this5.settings.max_block_height);\n }).attr('fill', function (d) {\n var color = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range(['#ffffff', _this5.props.color]).domain([-0.15 * max_value, max_value]);\n return color(d.value) || '#ff4500';\n }).style('opacity', 0).on('mouseover', function (d) {\n if (_this5.in_transition) {\n return;\n } // Get date from the parent node\n\n\n var parentNode = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget.parentNode);\n var date = new Date(parentNode.attr('date')); // RGB: Changes on tooltip to add the props parameters\n // Construct tooltip\n\n var tooltip_html = '';\n tooltip_html += '' + (d.value ? d.value : 'No entries for') + ' ' + _this5.props.measure + '
'; // //tooltip_html += ' Total ' + this.props.measure + ''\n\n tooltip_html += '' + moment__WEBPACK_IMPORTED_MODULE_1___default()(date).format('dddd, MMM Do YYYY') + '
'; // Calculate tooltip position\n\n var total = parseInt(parentNode.attr('total'));\n itemScale.domain([0, total]);\n var x = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget).attr('x')) + itemScale(d.value) / 4 + _this5.settings.tooltip_width / 4;\n\n while (_this5.settings.width - x < _this5.settings.tooltip_width + _this5.settings.tooltip_padding * 3) {\n x -= 10;\n }\n\n var y = dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).weekday()) + _this5.settings.tooltip_padding * 1.5; // Show tooltip\n\n _this5.tooltip.html(tooltip_html);\n\n _this5.tooltip.style(\"left\", event.pageX - Math.round(Number(_this5.tooltip.style('width').slice(0, -2))) / 2 + \"px\").style(\"top\", event.pageY - 50 + \"px\").transition().duration(50).style('opacity', .9).style('pointer-events', 'none').style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".75\").style(\"border-radius\", \"#8px\");\n\n _this5.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.hideTooltip();\n }).transition().delay(function () {\n return (Math.cos(Math.PI * Math.random()) + 1) * _this5.settings.transition_duration;\n }).duration(function () {\n return _this5.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n return ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this5.in_transition = false;\n }); // Add week labels\n\n this.labels.selectAll('.label-week').remove();\n this.labels.selectAll('.label-week').data(week_labels).enter().append('text').attr('class', 'label label-week').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this5.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return 'Week ' + d.week();\n }).attr('x', function (d) {\n return weekScale(d.week());\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (weekday) {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week() === weekday.week() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add day labels\n\n this.labels.selectAll('.label-day').remove();\n this.labels.selectAll('.label-day').data(day_labels).enter().append('text').attr('class', 'label label-day').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('x', this.settings.label_padding / 3).attr('y', function (d, i) {\n return dayScale(i) + dayScale.bandwidth() / 1.75;\n }).style('text-anchor', 'left').attr('font-size', function () {\n return Math.floor(_this5.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).format('dddd')[0];\n }).on('mouseenter', function (d) {\n if (_this5.in_transition) {\n return;\n }\n\n var selected_day = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).day() === selected_day.day() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add button to switch back to previous overview\n\n this.drawButton();\n }\n /**\n * Draw day overview\n */\n\n }, {\n key: \"drawDayOverview\",\n value: function drawDayOverview() {\n var _this6 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Initialize selected date to today if it was not set\n\n\n if (!Object.keys(this.selected).length) {\n this.selected = this.props.data[this.props.data.length - 1];\n }\n\n var project_labels = this.selected.summary.map(function (project) {\n return project.name;\n });\n var projectScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(project_labels);\n var itemScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleTime\"]().range([this.settings.label_padding * 2, this.settings.width]).domain([moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('day'), moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('day')]);\n this.items.selectAll('.item-block').remove();\n this.items.selectAll('.item-block').data(this.selected.details).enter().append('rect').attr('class', 'item item-block').style('cursor', 'pointer').attr('x', function (d) {\n return itemScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date));\n }).attr('y', function (d) {\n return projectScale(d.name) + projectScale.bandwidth() / 2 - 15;\n }).attr('width', function (d) {\n var end = itemScale(d3__WEBPACK_IMPORTED_MODULE_2__[\"timeSecond\"].offset(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date), d.value));\n return Math.max(end - itemScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date)), _this6.props.sizeonday); //RGB: adding the props parameter to redifine the size of the rectangle in the day view\n }).attr('height', function () {\n return Math.min(projectScale.bandwidth(), _this6.settings.max_block_height);\n }).attr('fill', function () {\n return _this6.props.color;\n }).style('opacity', 0).on('mouseover', function (d) {\n if (_this6.in_transition) {\n return;\n } //RGB: Changes to add the measure comming from props to the visualization\n // Construct tooltip\n\n\n var tooltip_html = '';\n tooltip_html += \"'\n\n tooltip_html += '' + moment__WEBPACK_IMPORTED_MODULE_1___default()(date).format('dddd, MMM Do YYYY') + '
'; // Calculate tooltip position\n\n var x = weekScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).week()) + _this4.settings.tooltip_padding;\n\n while (_this4.settings.width - x < _this4.settings.tooltip_width + _this4.settings.tooltip_padding * 3) {\n x -= 10;\n }\n\n var y = dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).weekday()) + _this4.settings.tooltip_padding * 2; // Show tooltip\n\n _this4.tooltip.html(tooltip_html);\n\n _this4.tooltip.style(\"left\", event.pageX - Math.round(Number(_this4.tooltip.style('width').slice(0, -2))) / 2 + \"px\").style(\"top\", event.pageY - 70 + \"px\").transition().duration(50).style('opacity', .9).style('pointer-events', 'none').style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".75\").style(\"border-radius\", \"#8px\");\n\n _this4.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.hideTooltip();\n }).transition().delay(function () {\n return (Math.cos(Math.PI * Math.random()) + 1) * _this4.settings.transition_duration;\n }).duration(function () {\n return _this4.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n return ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this4.in_transition = false;\n }); // Add week labels\n\n this.labels.selectAll('.label-week').remove();\n this.labels.selectAll('.label-week').data(week_labels).enter().append('text').attr('class', 'label label-week').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this4.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return 'Week ' + d.week();\n }).attr('x', function (d) {\n return weekScale(d.week());\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (weekday) {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week() === weekday.week() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }).on('click', function (d) {\n if (_this4.in_transition) {\n return;\n } // Check week data\n\n\n var week_data = _this4.props.data.filter(function (e) {\n return d.startOf('week') <= moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(e.date) < d.endOf('week');\n }); // Don't transition if there is no data to show\n\n\n if (!week_data.length) {\n return;\n }\n\n _this4.in_transition = true; // Set selected month to the one clicked on\n\n _this4.selected = {\n date: d\n }; // Hide tooltip\n\n _this4.hideTooltip(); // Remove all year overview related items and labels\n\n\n _this4.removeMonthOverview(); // Redraw the chart\n\n\n _this4.overview = 'week';\n\n _this4.drawChart();\n }); // Add day labels\n\n this.labels.selectAll('.label-day').remove();\n this.labels.selectAll('.label-day').data(day_labels).enter().append('text').attr('class', 'label label-day').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('x', this.settings.label_padding / 3).attr('y', function (d, i) {\n return dayScale(i) + dayScale.bandwidth() / 1.75;\n }).style('text-anchor', 'left').attr('font-size', function () {\n return Math.floor(_this4.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).format('dddd')[0];\n }).on('mouseenter', function (d) {\n if (_this4.in_transition) {\n return;\n }\n\n var selected_day = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).day() === selected_day.day() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this4.in_transition) {\n return;\n }\n\n _this4.items.selectAll('.item-block-month').transition().duration(_this4.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add button to switch back to previous overview\n\n this.drawButton();\n }\n /**\n * Draw week overview\n */\n\n }, {\n key: \"drawWeekOverview\",\n value: function drawWeekOverview() {\n var _this5 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Define beginning and end of the week\n\n\n var start_of_week = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('week');\n var end_of_week = moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('week'); // Filter data down to the selected week\n\n var week_data = this.props.data.filter(function (d) {\n return start_of_week <= moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) && moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date) < end_of_week;\n });\n var max_value = d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](week_data, function (d) {\n return d3__WEBPACK_IMPORTED_MODULE_2__[\"max\"](d.summary, function (d) {\n return d.value;\n });\n }); // Define day labels and axis\n\n var day_labels = d3__WEBPACK_IMPORTED_MODULE_2__[\"timeDays\"](moment__WEBPACK_IMPORTED_MODULE_1___default()().startOf('week'), moment__WEBPACK_IMPORTED_MODULE_1___default()().endOf('week'));\n var dayScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(day_labels.map(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).weekday();\n })); // Define week labels and axis\n\n var week_labels = [start_of_week];\n var weekScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.width]).padding([0.01]).domain(week_labels.map(function (weekday) {\n return weekday.week();\n })); // Add week data items to the overview\n\n this.items.selectAll('.item-block-week').remove();\n var item_block = this.items.selectAll('.item-block-week').data(week_data).enter().append('g').attr('class', 'item item-block-week').style('cursor', 'pointer').attr('width', function () {\n return (_this5.settings.width - _this5.settings.label_padding) / week_labels.length - _this5.settings.gutter * 5;\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this5.settings.max_block_height);\n }).attr('transform', function (d) {\n return 'translate(' + weekScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week()) + ',' + (dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).weekday()) + dayScale.bandwidth() / 1.75 - 15) + ')';\n }).attr('total', function (d) {\n return d.total;\n }).attr('date', function (d) {\n return d.date;\n }).attr('offset', 0); // .on('click', d => {\n // if (this.in_transition) { return }\n // // Don't transition if there is no data to show\n // if (d.total === 0) { return }\n // this.in_transition = true\n // // Set selected date to the one clicked on\n // this.selected = d\n // // Hide tooltip\n // this.hideTooltip()\n // // Remove all week overview related items and labels\n // this.removeWeekOverview()\n // // Redraw the chart\n // this.overview = 'day'\n // this.drawChart()\n // })\n\n var item_width = (this.settings.width - this.settings.label_padding) / week_labels.length - this.settings.gutter * 5;\n var itemScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().rangeRound([0, item_width]);\n var item_gutter = this.settings.item_gutter;\n item_block.selectAll('.item-block-week').data(function (d) {\n return d.summary;\n }).enter().append('rect').attr('class', 'item item-block-week').style('cursor', 'pointer').attr('x', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n var offset = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset'));\n itemScale.domain([0, total]);\n d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('offset', offset + itemScale(d.value));\n return offset;\n }).attr('width', function (d) {\n var total = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](this.parentNode).attr('total'));\n itemScale.domain([0, total]);\n return Math.max(itemScale(d.value) - item_gutter, 1);\n }).attr('height', function () {\n return Math.min(dayScale.bandwidth(), _this5.settings.max_block_height);\n }).attr('fill', function (d) {\n var color = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleLinear\"]().range(['#ffffff', _this5.props.color]).domain([-0.15 * max_value, max_value]);\n return color(d.value) || '#ff4500';\n }).style('opacity', 0).on('mouseover', function (d) {\n if (_this5.in_transition) {\n return;\n } // Get date from the parent node\n\n\n var parentNode = d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget.parentNode);\n var date = new Date(parentNode.attr('date')); // RGB: Changes on tooltip to add the props parameters\n // Construct tooltip\n\n var tooltip_html = '';\n tooltip_html += '' + (d.value ? d.value : 'No entries for') + ' ' + _this5.props.measure + '
'; // //tooltip_html += ' Total ' + this.props.measure + ''\n\n tooltip_html += '' + moment__WEBPACK_IMPORTED_MODULE_1___default()(date).format('dddd, MMM Do YYYY') + '
'; // Calculate tooltip position\n\n var total = parseInt(parentNode.attr('total'));\n itemScale.domain([0, total]);\n var x = parseInt(d3__WEBPACK_IMPORTED_MODULE_2__[\"select\"](d3__WEBPACK_IMPORTED_MODULE_2__[\"event\"].currentTarget).attr('x')) + itemScale(d.value) / 4 + _this5.settings.tooltip_width / 4;\n\n while (_this5.settings.width - x < _this5.settings.tooltip_width + _this5.settings.tooltip_padding * 3) {\n x -= 10;\n }\n\n var y = dayScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(date).weekday()) + _this5.settings.tooltip_padding * 1.5; // Show tooltip\n\n _this5.tooltip.html(tooltip_html);\n\n _this5.tooltip.style(\"left\", event.pageX - Math.round(Number(_this5.tooltip.style('width').slice(0, -2))) / 2 + \"px\").style(\"top\", event.pageY - 50 + \"px\").transition().duration(50).style('opacity', .9).style('pointer-events', 'none').style(\"position\", \"absolute\").style(\"text-align\", \"center\").style(\"padding\", \".5rem\").style(\"color\", \"white\").style(\"background-color\", \"#313639\").style(\"background-opacity\", \".75\").style(\"border-radius\", \"#8px\");\n\n _this5.tooltip.append('div').style('border-right', 'solid 8px transparent').style('border-left', 'solid 8px transparent').style('border-top', 'solid 8px #313639').style('transform', 'translateX(-50%)').style('content', '').style('top', '100%').style('left', \"50%\").style('height', 5).style('width', 5).style('position', 'absolute');\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.hideTooltip();\n }).transition().delay(function () {\n return (Math.cos(Math.PI * Math.random()) + 1) * _this5.settings.transition_duration;\n }).duration(function () {\n return _this5.settings.transition_duration;\n }).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1).call(function (transition, callback) {\n if (transition.empty()) {\n callback();\n }\n\n var n = 0;\n transition.each(function () {\n return ++n;\n }).on('end', function () {\n if (! --n) {\n callback.apply(this, arguments);\n }\n });\n }, function () {\n _this5.in_transition = false;\n }); // Add week labels\n\n this.labels.selectAll('.label-week').remove();\n this.labels.selectAll('.label-week').data(week_labels).enter().append('text').attr('class', 'label label-week').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('font-size', function () {\n return Math.floor(_this5.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return 'Week ' + d.week();\n }).attr('x', function (d) {\n return weekScale(d.week());\n }).attr('y', this.settings.label_padding / 2).on('mouseenter', function (weekday) {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).week() === weekday.week() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add day labels\n\n this.labels.selectAll('.label-day').remove();\n this.labels.selectAll('.label-day').data(day_labels).enter().append('text').attr('class', 'label label-day').style('cursor', 'pointer').style('fill', 'rgb(170, 170, 170)').attr('x', this.settings.label_padding / 3).attr('y', function (d, i) {\n return dayScale(i) + dayScale.bandwidth() / 1.75;\n }).style('text-anchor', 'left').attr('font-size', function () {\n return Math.floor(_this5.settings.label_padding / 3) + 'px';\n }).text(function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d).format('dddd')[0];\n }).on('mouseenter', function (d) {\n if (_this5.in_transition) {\n return;\n }\n\n var selected_day = moment__WEBPACK_IMPORTED_MODULE_1___default()(d);\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', function (d) {\n return moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date).day() === selected_day.day() ? 1 : 0.1;\n });\n }).on('mouseout', function () {\n if (_this5.in_transition) {\n return;\n }\n\n _this5.items.selectAll('.item-block-week').transition().duration(_this5.settings.transition_duration).ease(d3__WEBPACK_IMPORTED_MODULE_2__[\"easeLinear\"]).style('opacity', 1);\n }); // Add button to switch back to previous overview\n\n this.drawButton();\n }\n /**\n * Draw day overview\n */\n\n }, {\n key: \"drawDayOverview\",\n value: function drawDayOverview() {\n var _this6 = this;\n\n // Add current overview to the history\n if (this.history[this.history.length - 1] !== this.overview) {\n this.history.push(this.overview);\n } // Initialize selected date to today if it was not set\n\n\n if (!Object.keys(this.selected).length) {\n this.selected = this.props.data[this.props.data.length - 1];\n }\n\n var project_labels = this.selected.summary.map(function (project) {\n return project.name;\n });\n var projectScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleBand\"]().rangeRound([this.settings.label_padding, this.settings.height]).domain(project_labels);\n var itemScale = d3__WEBPACK_IMPORTED_MODULE_2__[\"scaleTime\"]().range([this.settings.label_padding * 2, this.settings.width]).domain([moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).startOf('day'), moment__WEBPACK_IMPORTED_MODULE_1___default()(this.selected.date).endOf('day')]);\n this.items.selectAll('.item-block').remove();\n this.items.selectAll('.item-block').data(this.selected.details).enter().append('rect').attr('class', 'item item-block').style('cursor', 'pointer').attr('x', function (d) {\n return itemScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date));\n }).attr('y', function (d) {\n return projectScale(d.name) + projectScale.bandwidth() / 2 - 15;\n }).attr('width', function (d) {\n var end = itemScale(d3__WEBPACK_IMPORTED_MODULE_2__[\"timeSecond\"].offset(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date), d.value));\n return Math.max(end - itemScale(moment__WEBPACK_IMPORTED_MODULE_1___default()(d.date)), _this6.props.sizeonday); //RGB: adding the props parameter to redifine the size of the rectangle in the day view\n }).attr('height', function () {\n return Math.min(projectScale.bandwidth(), _this6.settings.max_block_height);\n }).attr('fill', function () {\n return _this6.props.color;\n }).style('opacity', 0).on('mouseover', function (d) {\n if (_this6.in_transition) {\n return;\n } //RGB: Changes to add the measure comming from props to the visualization\n // Construct tooltip\n\n\n var tooltip_html = '';\n tooltip_html += \"