define(function() { return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
var __WEBPACK_AMD_DEFINE_RESULT__;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
  return (/******/function (modules) {
      // webpackBootstrap
      /******/ // The module cache
      /******/var installedModules = {};
      /******/
      /******/ // The require function
      /******/function __webpack_require__(moduleId) {
        /******/
        /******/ // Check if module is in cache
        /******/if (installedModules[moduleId]) {
          /******/return installedModules[moduleId].exports;
          /******/
        }
        /******/ // Create a new module (and put it into the cache)
        /******/var module = installedModules[moduleId] = {
          /******/i: moduleId,
          /******/l: false,
          /******/exports: {}
          /******/ };
        /******/
        /******/ // Execute the module function
        /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
        /******/
        /******/ // Flag the module as loaded
        /******/module.l = true;
        /******/
        /******/ // Return the exports of the module
        /******/return module.exports;
        /******/
      }
      /******/
      /******/
      /******/ // expose the modules object (__webpack_modules__)
      /******/__webpack_require__.m = modules;
      /******/
      /******/ // expose the module cache
      /******/__webpack_require__.c = installedModules;
      /******/
      /******/ // define getter function for harmony exports
      /******/__webpack_require__.d = function (exports, name, getter) {
        /******/if (!__webpack_require__.o(exports, name)) {
          /******/Object.defineProperty(exports, name, {
            /******/configurable: false,
            /******/enumerable: true,
            /******/get: getter
            /******/ });
          /******/
        }
        /******/
      };
      /******/
      /******/ // getDefaultExport function for compatibility with non-harmony modules
      /******/__webpack_require__.n = function (module) {
        /******/var getter = module && module.__esModule ?
        /******/function getDefault() {
          return module['default'];
        } :
        /******/function getModuleExports() {
          return module;
        };
        /******/__webpack_require__.d(getter, 'a', getter);
        /******/return getter;
        /******/
      };
      /******/
      /******/ // Object.prototype.hasOwnProperty.call
      /******/__webpack_require__.o = function (object, property) {
        return Object.prototype.hasOwnProperty.call(object, property);
      };
      /******/
      /******/ // __webpack_public_path__
      /******/__webpack_require__.p = "";
      /******/
      /******/ // Load entry module and return exports
      /******/return __webpack_require__(__webpack_require__.s = 13);
      /******/
    }(
    /************************************************************************/
    /******/[
    /* 0 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _base = __webpack_require__(3);

      var _base2 = _interopRequireDefault(_base);

      var _mathjaxWrapper = __webpack_require__(16);

      var _mathjaxWrapper2 = _interopRequireDefault(_mathjaxWrapper);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      /* global d3 */

      var Renderer = function (_Base) {
        _inherits(Renderer, _Base);

        function Renderer(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler,
              _ref$options = _ref.options,
              options = _ref$options === undefined ? {} : _ref$options;

          _classCallCheck(this, Renderer);

          var _this = _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler, options: options }));

          if (new.target === Renderer) {
            throw new TypeError('Cannot construct [Renderer] instances directly!');
          }
          if (_this.render === undefined || typeof _this.render !== 'function') {
            throw new TypeError('Must override [render()] method!');
          }
          if (_this.unrender === undefined) {
            _this.logger.debug('No [unrender()] method specified...');
          }
          _this.mathjaxWrapper = new _mathjaxWrapper2.default(_this.options);
          _this.element = undefined;
          _this.transitionDuration = 750; //ms
          return _this;
        }

        _createClass(Renderer, [{
          key: '_initialize',
          value: function _initialize() {}
        }, {
          key: 'HTMLParent',
          get: function get() {
            return this.parent.node().tagName.toLowerCase() === 'svg' ? d3.select(this.parent.node().parentNode) : this.parent;
          }
        }, {
          key: 'SVGParent',
          get: function get() {
            return this.parent.node().tagName.toLowerCase() === 'div' ? this.parent.select('svg') : this.parent;
          }
        }, {
          key: 'margin',
          get: function get() {
            return { top: 50, right: 50, bottom: 50, left: 50 };
          }
        }, {
          key: 'width',
          get: function get() {
            var width = +this.parent.attr('width') || d3.select('body').node().getBoundingClientRect().width;
            return width - this.margin.left - this.margin.right;
          }
        }, {
          key: 'height',
          get: function get() {
            var height = +this.parent.attr('height') || d3.select('body').node().getBoundingClientRect().height;
            return height - this.margin.top - this.margin.bottom;
          }
        }, {
          key: 'mathjax',
          get: function get() {
            return this.mathjaxWrapper.load(this.data);
          }
        }]);

        return Renderer;
      }(_base2.default);

      exports.default = Renderer;

      /***/
    },
    /* 1 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.requires = requires;
      exports.enabled = enabled;
      function requires(props) {
        return function decorator(target, name, descriptor) {
          var oldValue = descriptor.value;

          descriptor.value = function () {
            if (!hasData(getProperty(this.data, props))) {
              this.logger.debug('No data here [' + props + '], nothing to render... continuing...');
              return;
            }
            return oldValue.apply(this, arguments);
          };

          return descriptor;
        };
      }

      function enabled(props) {
        return function decorator(target, name, descriptor) {
          var oldValue = descriptor.value;

          descriptor.value = function () {
            if (!getProperty(this.data, props)) {
              this.logger.debug('Property disabled [' + props + '], skip execution... continuing...');
              return;
            }
            return oldValue.apply(this, arguments);
          };

          return descriptor;
        };
      }

      function getProperty(obj, propertyPath) {

        var tmp = obj;

        if (tmp && propertyPath) {
          var properties = propertyPath.split('.');

          var _iteratorNormalCompletion = true;
          var _didIteratorError = false;
          var _iteratorError = undefined;

          try {
            for (var _iterator = properties[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
              var property = _step.value;

              if (!tmp.hasOwnProperty(property)) {
                tmp = undefined;
                break;
              } else {
                tmp = tmp[property];
              }
            }
          } catch (err) {
            _didIteratorError = true;
            _iteratorError = err;
          } finally {
            try {
              if (!_iteratorNormalCompletion && _iterator.return) {
                _iterator.return();
              }
            } finally {
              if (_didIteratorError) {
                throw _iteratorError;
              }
            }
          }
        }

        return tmp;
      }

      function hasData(obj) {
        return obj && (obj instanceof Array && obj.length || obj instanceof Object && Object.values(obj).length);
      }

      /***/
    },
    /* 2 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.initialize = initialize;
      function initialize() {
        return function (target, key, descriptor) {
          var oldValue = descriptor.value;

          descriptor.value = function () {
            this._initialize();
            return oldValue.apply(this, arguments);
          };
          return descriptor;
        };
      }

      /***/
    },
    /* 3 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _logger = __webpack_require__(6);

      var _logger2 = _interopRequireDefault(_logger);

      var _jsonUtils = __webpack_require__(15);

      var _jsonUtils2 = _interopRequireDefault(_jsonUtils);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      /* global d3 */

      var Base = function () {
        function Base(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              _ref$appendTo = _ref.appendTo,
              appendTo = _ref$appendTo === undefined ? 'body' : _ref$appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Base);

          /**
           * @typedef {Object} Options
           * @property {Boolean} verbose prints extra log information to console.log, default false
           * @property {Boolean} appendTo where the generated html/svg components will be attached to, default body
           * @property {Function} callbackHandler this handler will be used to invoke actions from the menu, default console.log
           */
          this.options = undefined;
          this.settings({ verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler });
          /**
           * @Type {Object} the internal data model object
           */
          this.data = undefined;
          /**
           * @type {Logger} the logger for this class
           */
          this.log = new _logger2.default(this.options);
        }

        _createClass(Base, [{
          key: 'settings',
          value: function settings(_ref2) {
            var verbose = _ref2.verbose,
                appendTo = _ref2.appendTo,
                callbackHandler = _ref2.callbackHandler;

            this.options = this.options || {};
            if (!this.options.callbackHandler && !callbackHandler) {
              throw new Error('A Callback Handler must be provided! This will be used to trigger events from the graphics produced...');
            }
            if (!this.options.appendTo && !appendTo) {
              throw new Error('Missing an element or id to append the graphics to...!');
            }
            if (typeof appendTo === 'string') {
              appendTo = d3.select(appendTo);
            }
            this.options.verbose = verbose || this.options.verbose;
            this.options.appendTo = appendTo || this.options.appendTo;
            this.options.callbackHandler = callbackHandler || this.options.callbackHandler;
            return this;
          }
        }, {
          key: 'load',
          value: function load(json, partial) {
            var data = _jsonUtils2.default.parse(json, partial);
            if (data) {
              this.data = data;
            }
            return this;
          }
        }, {
          key: 'parent',
          get: function get() {
            return this.options.appendTo.element;
          }
        }, {
          key: 'logger',
          get: function get() {
            return this.log;
          }
        }]);

        return Base;
      }();

      exports.default = Base;

      /***/
    },
    /* 4 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _tooltip = __webpack_require__(12);

      var _tooltip2 = _interopRequireDefault(_tooltip);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      /* global d3 */

      var Chart = function (_Renderer) {
        _inherits(Chart, _Renderer);

        function Chart(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Chart);

          var _this = _possibleConstructorReturn(this, (Chart.__proto__ || Object.getPrototypeOf(Chart)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.axis = undefined;
          _this.yScale = undefined;
          _this.xScale = undefined;
          _this.datasets = undefined;
          _this.datasetNames = undefined;
          _this.tooltip = undefined;
          return _this;
        }

        _createClass(Chart, [{
          key: '_initialize',
          value: function _initialize() {
            var _this2 = this;

            this.tooltip = new _tooltip2.default(this.options);

            this.element = this.parent.select('g.francy-content');

            this.axis = this.data.canvas.chart.axis;
            this.datasets = this.data.canvas.chart.data;
            this.datasetNames = Object.keys(this.datasets);

            this.xScale = d3.scaleLinear().range([0, this.width]).domain(this.axis.x.domain);
            this.yScale = d3.scaleLinear().range([this.height, 0]).domain(this.axis.y.domain);

            this.allValues = [];
            this.datasetNames.forEach(function (key) {
              return _this2.allValues = _this2.allValues.concat(_this2.datasets[key]);
            });

            if (!this.axis.y.domain.length) {
              this.yScale.domain([0, d3.max(this.allValues, function (d) {
                return d;
              })]);
            }

            if (!this.axis.x.domain.length) {
              this.xScale.domain([0, this.allValues.length / this.datasetNames.length]);
            }
          }
        }, {
          key: '_renderAxis',
          value: function _renderAxis() {
            // force rebuild axis again
            var xAxisGroup = this.element.selectAll('g.francy-x-axis');

            if (!xAxisGroup.node()) {
              xAxisGroup = this.element.append('g').attr('class', 'francy-x-axis');
            }

            xAxisGroup.selectAll('*').remove();

            // add the x Axis
            xAxisGroup.attr('transform', 'translate(0,' + this.height + ')').call(d3.axisBottom(this.xScale)).append('text').attr('dy', 50).attr('dx', this.width / 2).attr('fill', 'black').attr('class', 'francy-axis').style('text-anchor', 'end').text(this.axis.x.title);

            // force rebuild axis again
            var yAxisGroup = this.element.selectAll('g.francy-y-axis');

            if (!yAxisGroup.node()) {
              yAxisGroup = this.element.append('g').attr('class', 'francy-y-axis');
            }

            yAxisGroup.selectAll('*').remove();

            // add the y Axis
            yAxisGroup.call(d3.axisLeft(this.yScale)).append('text').attr('dx', -50).attr('dy', this.height / 2).attr('fill', 'black').attr('class', 'francy-axis').style('text-anchor', 'end').text(this.axis.y.title);
          }
        }, {
          key: '_renderLegend',
          value: function _renderLegend() {
            if (this.data.canvas.chart.showLegend) {

              var legendGroup = this.element.selectAll('.francy-legend');

              if (!legendGroup.node()) {
                legendGroup = this.element.append('g').attr('class', 'francy-legend');
              }

              // force rebuild legend again
              legendGroup.selectAll('*').remove();

              var legend = legendGroup.selectAll('g').data(this.datasetNames.slice());

              legend.exit().remove();

              legend = legend.enter().append('g').attr('transform', function (d, i) {
                return 'translate(0,' + i * 20 + ')';
              }).merge(legend);

              legend.append('rect').attr('x', this.width + 20).attr('width', 19).attr('height', 19).style('fill', function (d, i) {
                return Chart.colors(i * 5);
              });

              legend.append('text').attr('x', this.width + 80).attr('y', 9).attr('dy', '.35em').style('text-anchor', 'end').text(function (d) {
                return d;
              });
            }
          }
        }], [{
          key: 'tooltip',
          value: function tooltip(dataset, value) {
            return { 'A': { 'title': 'Dataset', 'text': dataset }, 'B': { 'title': 'Value', 'text': value } };
          }
        }, {
          key: 'domainRange',
          value: function domainRange(max) {
            return Array.from(new Array(max), function (_, i) {
              return i;
            }).map(function (x) {
              return x;
            });
          }
        }, {
          key: 'colors',
          get: function get() {
            return d3.scaleSequential().domain([0, 100]).interpolator(d3.interpolateRainbow);
          }
        }]);

        return Chart;
      }(_renderer2.default);

      exports.default = Chart;

      /***/
    },
    /* 5 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      var Composite = function (_Renderer) {
        _inherits(Composite, _Renderer);

        function Composite(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Composite);

          var _this = _possibleConstructorReturn(this, (Composite.__proto__ || Object.getPrototypeOf(Composite)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          if (new.target === Composite) {
            throw new TypeError('Cannot construct [Composite] instances directly!');
          }
          _this.renderers = [];
          return _this;
        }

        _createClass(Composite, [{
          key: 'add',
          value: function add(renderer) {
            if (renderer) {
              this.renderers.push(renderer);
            }
            return this;
          }
        }, {
          key: 'renderChildren',
          value: function renderChildren() {
            // render other components
            var _iteratorNormalCompletion = true;
            var _didIteratorError = false;
            var _iteratorError = undefined;

            try {
              for (var _iterator = this.renderers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
                var renderer = _step.value;

                renderer.settings({ appendTo: this }).load(this.data).render();
              }
            } catch (err) {
              _didIteratorError = true;
              _iteratorError = err;
            } finally {
              try {
                if (!_iteratorNormalCompletion && _iterator.return) {
                  _iterator.return();
                }
              } finally {
                if (_didIteratorError) {
                  throw _iteratorError;
                }
              }
            }
          }
        }]);

        return Composite;
      }(_renderer2.default);

      exports.default = Composite;

      /***/
    },
    /* 6 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      /**
       * This class provides a logger for the Francy application.
       */
      var Logger = function () {

        /**
         * Logger constructor
         * @param verbose prints extra log information to console.log, defaults to false
         */
        function Logger() {
          var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
              _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose;

          _classCallCheck(this, Logger);

          this.verbose = verbose;
          this.console = console;
        }

        /**
         * Creates a [DEBUG] entry in the console log
         * @param message the message to print
         */

        _createClass(Logger, [{
          key: 'debug',
          value: function debug(message) {
            if (this.verbose) {
              this.console.debug(Logger._format('DEBUG', message));
            }
          }

          /**
           * Creates a [INFO] entry in the console log
           * @param message the message to print
           */

        }, {
          key: 'info',
          value: function info(message) {
            this.console.info(Logger._format('INFO', message));
          }

          /**
           * Creates a [ERROR] entry in the console log
           * @param message the message to print
           * @param error the error Object to attach to the message
           */

        }, {
          key: 'error',
          value: function error(message, _error) {
            this.console.error(Logger._format('ERROR', message), _error);
          }

          /**
           * Creates a [WARN] entry in the console log
           * @param message the message to print
           * @param error the error Object to attach to the message
           */

        }, {
          key: 'warn',
          value: function warn(message, error) {
            error = error || {};
            this.console.error(Logger._format('WARN', message), error);
          }

          /**
           * This is a private method that formats all log messages
           * @param level the log level
           * @param message the message to print
           */

        }], [{
          key: '_format',
          value: function _format(level, message) {
            return '[' + level + '] - ' + new Date().toISOString() + ' - ' + message;
          }
        }]);

        return Logger;
      }();

      exports.default = Logger;

      /***/
    },
    /* 7 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _menuContext = __webpack_require__(20);

      var _menuContext2 = _interopRequireDefault(_menuContext);

      var _tooltip = __webpack_require__(12);

      var _tooltip2 = _interopRequireDefault(_tooltip);

      var _callback = __webpack_require__(9);

      var _callback2 = _interopRequireDefault(_callback);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      /* global d3 */

      var Graph = function (_Renderer) {
        _inherits(Graph, _Renderer);

        function Graph(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Graph);

          var _this = _possibleConstructorReturn(this, (Graph.__proto__ || Object.getPrototypeOf(Graph)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.tooltip = new _tooltip2.default(_this.options);
          _this.contextMenu = new _menuContext2.default(_this.options);
          _this.callback = new _callback2.default(_this.options);
          return _this;
        }

        _createClass(Graph, [{
          key: '_initialize',
          value: function _initialize() {
            this.element = this.parent.select('g.francy-content');
          }
        }, {
          key: '_applyEvents',
          value: function _applyEvents(element) {
            if (!element) return;

            var self = this;
            element.on('contextmenu', function (d) {
              var data = d.data || d;
              // default, build context menu
              self.contextMenu.load(data, true).render();
              // any callbacks will be handled here
              executeCallback.call(this, data, 'contextmenu');
            }).on('click', function (d) {
              var data = d.data || d;
              // TODO make some sense of selection on nodes
              d.selected = !d.selected;
              // any callbacks will be handled here
              executeCallback.call(this, data, 'click');
            }).on('dblclick', function (d) {
              var data = d.data || d;
              // any callbacks will be handled here
              executeCallback.call(this, data, 'dblclick');
            }).on('mouseover', function (d) {
              var data = d.data || d;
              if (data.messages) {
                // default, show tooltip
                self.tooltip.load({ messages: data.messages }, true).render();
                // ok, this is almost a hack, because this should be rendered on
                // the tooltip itself.. but because a tooltip gets only the messages 
                // object to render and not the whole this.data object, 
                // we can't check for the property canvas.texTypesetting, 
                // hence this:
                self.mathjax.settings({ appendTo: self.tooltip }).renderHTML();
              }
            }).on('mouseout', function () {
              // default, hide tooltip
              self.tooltip.unrender();
            });

            function executeCallback(data, event) {
              if (data.callbacks) {
                Object.values(data.callbacks).forEach(function (cb) {
                  // execute only the ones that match the event!
                  cb.trigger === event && self.callback.load({ callback: cb }, true).execute();
                });
              }
            }
          }
        }], [{
          key: 'linkXPos',
          value: function linkXPos(s, t) {
            var angle = Math.atan2(t.y - s.y, t.x - s.x);
            return Math.cos(angle) + (s.x + t.x) / 2;
          }
        }, {
          key: 'linkYPos',
          value: function linkYPos(s, t) {
            var angle = Math.atan2(t.y - s.y, t.x - s.x);
            return Math.sin(angle) + (s.y + t.y) / 2;
          }
        }, {
          key: 'getSymbol',
          value: function getSymbol(type) {

            var element = undefined;
            switch (type) {
              case 'cross':
                element = d3.symbolCross;
                break;
              case 'diamond':
                element = d3.symbolDiamond;
                break;
              case 'square':
                element = d3.symbolSquare;
                break;
              case 'triangle':
                element = d3.symbolTriangle;
                break;
              case 'star':
                element = d3.symbolStar;
                break;
              case 'wye':
                element = d3.symbolWye;
                break;
              case 'circle':
              default:
                element = d3.symbolCircle;
            }

            return element;
          }
        }, {
          key: 'colors',
          get: function get() {
            return d3.scaleSequential().domain([0, 100]).interpolator(d3.interpolateRainbow);
          }
        }]);

        return Graph;
      }(_renderer2.default);

      exports.default = Graph;

      /***/
    },
    /* 8 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _callback = __webpack_require__(9);

      var _callback2 = _interopRequireDefault(_callback);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      var Menu = function (_Renderer) {
        _inherits(Menu, _Renderer);

        function Menu(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Menu);

          return _possibleConstructorReturn(this, (Menu.__proto__ || Object.getPrototypeOf(Menu)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(Menu, [{
          key: 'traverse',
          value: function traverse(appendTo, menusIterator) {
            var _this2 = this;

            while (menusIterator.hasNext()) {
              var menuItem = menusIterator.next();
              var entry = appendTo.append('li');
              var action = entry.selectAll('a').data([menuItem]).enter().append('a').attr('title', menuItem.title).html(menuItem.title);
              if (menuItem.callback && Object.values(menuItem.callback).length) {
                action.on('click', function (d) {
                  return new _callback2.default(_this2.options).load(d, true).execute();
                });
              }
              if (menuItem.menus && Object.values(menuItem.menus).length > 0) {
                var content = entry.append('ul');
                var subMenusIterator = this.iterator(Object.values(menuItem.menus));
                this.traverse(content, subMenusIterator);
              }
            }
          }
        }, {
          key: 'iterator',
          value: function iterator(array) {
            var nextIndex = 0;
            return {
              next: function next() {
                return this.hasNext() ? array[nextIndex++] : undefined;
              },
              hasNext: function hasNext() {
                return nextIndex < array.length;
              }
            };
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return Menu;
      }(_renderer2.default);

      exports.default = Menu;

      /***/
    },
    /* 9 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _base = __webpack_require__(3);

      var _base2 = _interopRequireDefault(_base);

      var _modalRequired = __webpack_require__(21);

      var _modalRequired2 = _interopRequireDefault(_modalRequired);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      var CallbackHandler = (_dec = (0, _dataDecorator.requires)('callback'), (_class = function (_Base) {
        _inherits(CallbackHandler, _Base);

        function CallbackHandler(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, CallbackHandler);

          var _this = _possibleConstructorReturn(this, (CallbackHandler.__proto__ || Object.getPrototypeOf(CallbackHandler)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.callback = callbackHandler;
          return _this;
        }

        _createClass(CallbackHandler, [{
          key: 'execute',
          value: function execute() {
            var _this2 = this;

            if (Object.keys(this.data.callback.requiredArgs).length) {
              var options = this.options;
              options.callbackHandler = function (callbackObj) {
                return _this2._execute.call(_this2, callbackObj);
              };
              return new _modalRequired2.default(options).load(this.data, true).render();
            }

            // Trigger is the expected command on GAP for this events!
            this._execute(this.data.callback);
          }
        }, {
          key: '_execute',
          value: function _execute(calbackObj) {
            this.callback('Trigger(' + JSON.stringify(JSON.stringify(calbackObj)) + ');');
          }
        }]);

        return CallbackHandler;
      }(_base2.default), _applyDecoratedDescriptor(_class.prototype, 'execute', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'execute'), _class.prototype), _class));
      exports.default = CallbackHandler;

      /***/
    },
    /* 10 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      /* global d3 */

      var Modal = function (_Renderer) {
        _inherits(Modal, _Renderer);

        function Modal(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Modal);

          var _this = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.overlay = undefined;
          _this.holder = undefined;
          return _this;
        }

        _createClass(Modal, [{
          key: '_initialize',
          value: function _initialize() {
            // we want to overlay everything, hence 'body' must be used
            this.overlay = d3.select('body').append('div').attr('class', 'francy-overlay');
            this.holder = d3.select('body').append('div').attr('class', 'francy');
          }
        }, {
          key: 'unrender',
          value: function unrender() {
            this.overlay.remove();
            this.element.remove();
            this.holder.remove();
            return false;
          }
        }]);

        return Modal;
      }(_renderer2.default);

      exports.default = Modal;

      /***/
    },
    /* 11 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.RegisterJupyterKeyboardEvents = RegisterJupyterKeyboardEvents;
      exports.syntaxHighlight = syntaxHighlight;

      var _logger = __webpack_require__(6);

      var _logger2 = _interopRequireDefault(_logger);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      /* global Jupyter */

      function RegisterJupyterKeyboardEvents(classes) {
        // disable keyboard shortcuts in Jupyter for specific css classed elements
        if (!classes) return;
        try {
          classes.map(function (c) {
            Jupyter.keyboard_manager.register_events(c);
          });
        } catch (e) {
          if (e.name === 'ReferenceError') {
            new _logger2.default().info('It seems we\'re not running on Jupyter...', e);
          }
        }
      }

      // credits here: https://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript#answer-7220510
      function syntaxHighlight(json) {
        json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
        return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g, function (match) {
          var cls = 'number';
          if (/^"/.test(match)) {
            if (/:$/.test(match)) {
              cls = 'key';
            } else {
              cls = 'string';
            }
          } else if (/true|false/.test(match)) {
            cls = 'boolean';
          } else if (/null/.test(match)) {
            cls = 'null';
          }
          return '<span class="' + cls + '">' + match + '</span>';
        });
      }

      /***/
    },
    /* 12 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var Tooltip = (_dec = (0, _dataDecorator.requires)('messages'), (_class = function (_Renderer) {
        _inherits(Tooltip, _Renderer);

        function Tooltip(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Tooltip);

          return _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(Tooltip, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            this.element = this.HTMLParent.select('div.francy-tooltip-holder');
            // check if the window is already present
            if (!this.element.node()) {
              this.element = this.HTMLParent.append('div').attr('class', 'francy-tooltip-holder');
            }

            // check if it exists already
            if (this.element.selectAll('*').node()) return;

            var pos = d3.mouse(this.SVGParent.node());

            // TODO this won't be visible all the times, fine until someone complains about :P
            this.element.style('left', pos[0] + 15 + 'px').style('top', pos[1] - 15 + 'px');

            var table = this.element.append('div').attr('class', 'francy-tooltip').append('div').attr('class', 'francy-table').append('div').attr('class', 'francy-table-body');

            Object.keys(this.data.messages).map(function (key) {
              var row = table.append('div').attr('class', 'francy-table-row');
              row.append('div').attr('class', 'francy-table-cell').text(_this2.data.messages[key].title);
              row.append('div').attr('class', 'francy-table-cell').text(_this2.data.messages[key].text);
            });

            // show tooltip
            this.element.style('display', 'block');

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {
            if (this.element) {
              this.element.selectAll('*').remove();
              this.element.style('display', null);
            }
          }
        }]);

        return Tooltip;
      }(_renderer2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Tooltip;

      /***/
    },
    /* 13 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _frame = __webpack_require__(14);

      var _frame2 = _interopRequireDefault(_frame);

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var ALL_CANVAS = {};

      /**
       * Francy is the main entry point for the whole framework. By passing an input string/object to the {Francy.load} function,
       * Francy will handle the creation of that json as long it is a valid and understandable json object to Francy.
       *  
       * @access public
       * 
       * @version 0.5.x
       * 
       * @example
       * let francy = new Francy({verbose: true, appendTo: '#div-id', callbackHandler: console.log});
       * francy.load(json).render();
       */
      var Francy = (_dec = (0, _dataDecorator.requires)('canvas'), (_class = function (_Renderer) {
        _inherits(Francy, _Renderer);

        /**
         * Creates an instance of Francy with the following options:
         * @typedef {Object} Options
         * @property {Boolean} verbose prints extra log information to console.log, default false
         * @property {Boolean} appendTo where the generated html/svg components will be attached to, default body
         * @property {Function} callbackHandler this handler will be used to invoke actions from the menu, default console.log
         */
        function Francy(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Francy);

          var _this = _possibleConstructorReturn(this, (Francy.__proto__ || Object.getPrototypeOf(Francy)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          if (!d3) {
            throw new Error('D3 is not imported and Francy won\'t work without it... please import D3 v4+ library.');
          }
          return _this;
        }

        /**
         * Main entry point. Calling render will trigger the drawing of a json object 
         * passed through the load method.
         * @returns {Object} the html element created
         */

        _createClass(Francy, [{
          key: 'render',
          value: function render() {
            var frame = new _frame2.default(this.options).load(this.data).render();
            ALL_CANVAS[this.data.canvas.id] = frame;
            return frame.element.node();
          }
        }], [{
          key: 'unrender',
          value: function unrender(id) {
            delete ALL_CANVAS[id];
          }
        }]);

        return Francy;
      }(_renderer2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Francy;

      try {
        exports.Francy = window.Francy = Francy;
        // handle events on resize
        var oldResize = window.onresize;
        window.onresize = function () {
          // zoom to fit all canvas on resize
          Object.values(ALL_CANVAS).forEach(function (frame) {
            frame.canvas.zoomToFit();
          });
          // call old resize function if any!
          if (typeof oldResize === 'function') {
            oldResize();
          }
        };
      } catch (e) {
        exports.Francy = Francy;
      }

      /***/
    },
    /* 14 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _composite = __webpack_require__(5);

      var _composite2 = _interopRequireDefault(_composite);

      var _canvas = __webpack_require__(17);

      var _canvas2 = _interopRequireDefault(_canvas);

      var _menuMain = __webpack_require__(27);

      var _menuMain2 = _interopRequireDefault(_menuMain);

      var _message = __webpack_require__(30);

      var _message2 = _interopRequireDefault(_message);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var Frame = (_dec = (0, _dataDecorator.requires)('canvas'), (_class = function (_Composite) {
        _inherits(Frame, _Composite);

        function Frame(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Frame);

          var _this = _possibleConstructorReturn(this, (Frame.__proto__ || Object.getPrototypeOf(Frame)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.canvas = new _canvas2.default(_this.options);
          _this.menu = new _menuMain2.default(_this.options);
          _this.messages = new _message2.default(_this.options);
          _this.add(_this.menu).add(_this.canvas).add(_this.messages);
          return _this;
        }

        _createClass(Frame, [{
          key: 'render',
          value: function render() {
            var parent = this.options.appendTo;

            var frameId = 'Frame-' + this.data.canvas.id;
            this.element = d3.select('div#' + frameId);
            // check if the canvas is already present
            if (!this.element.node()) {
              // create a svg element detached from the DOM!
              this.logger.debug('Creating Frame [' + frameId + ']...');
              this.element = parent.append('div').attr('class', 'francy').attr('id', frameId);
            }

            // cannot continue if canvas is not present
            if (!this.element.node()) {
              throw new Error('Oops, could not create frame with id [' + frameId + ']... Cannot proceed.');
            }

            this.logger.debug('Frame updated [' + frameId + ']...');

            this.renderChildren();

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return Frame;
      }(_composite2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Frame;

      /***/
    },
    /* 15 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      /**
       * This class contains methods to deal with JSON.
       */
      var JsonUtils = function () {
        function JsonUtils() {
          _classCallCheck(this, JsonUtils);
        }

        _createClass(JsonUtils, null, [{
          key: 'parse',

          /**
           * Parses an input nd checks whether this input is valid and returns a JSON object.
           * @param input - the input to parse
           * @param partial - if the input is not a complete Francy JSON Object, defaults to false
           * @returns {json} - if the input is a valid JSON object, otherwise returns {undefined}
           */
          value: function parse(input) {
            var partial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

            if (!input) return;
            if (typeof input === 'string') {
              input = input.replace(/[\n\r\b]+|(gap>)/g, '');
              var jsonRegex = /{(?:[^])*}/g;
              var match = jsonRegex.exec(input);
              if (!match) return;
              input = JSON.parse(match[0]);
            }
            return input.mime === JsonUtils.MIME || partial ? input : undefined;
          }

          /**
           * Returns a static string representing the mime type supported by this package
           */

        }, {
          key: 'MIME',
          get: function get() {
            return 'application/vnd.francy+json';
          }
        }]);

        return JsonUtils;
      }();

      exports.default = JsonUtils;

      /***/
    },
    /* 16 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _dec2, _dec3, _dec4, _desc, _value, _class;

      var _base = __webpack_require__(3);

      var _base2 = _interopRequireDefault(_base);

      var _dataDecorator = __webpack_require__(1);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global MathJax, d3 */

      var initialized = false;

      var MathJaxWrapper = (_dec = (0, _initializeDecorator.initialize)(), _dec2 = (0, _dataDecorator.enabled)('canvas.texTypesetting'), _dec3 = (0, _initializeDecorator.initialize)(), _dec4 = (0, _dataDecorator.enabled)('canvas.texTypesetting'), (_class = function (_Base) {
        _inherits(MathJaxWrapper, _Base);

        function MathJaxWrapper(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, MathJaxWrapper);

          return _possibleConstructorReturn(this, (MathJaxWrapper.__proto__ || Object.getPrototypeOf(MathJaxWrapper)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(MathJaxWrapper, [{
          key: '_initialize',
          value: function _initialize() {
            if (initialized) return;
            MathJax.Hub.Config({
              showMathMenu: false,
              skipStartupTypeset: true,
              tex2jax: {
                inlineMath: [['$', '$'], ['\\(', '\\)']],
                displayMath: [['$$', '$$'], ['\\[', '\\]']],
                processEscapes: true,
                processEnvironments: true
              },
              MathML: {
                extensions: ['content-mathml.js']
              },
              displayAlign: 'center',
              'HTML-CSS': {
                availableFonts: [],
                imageFont: null,
                preferredFont: null,
                font: 'STIX-Web',
                webFont: 'STIX-Web',
                styles: { '.MathJax_Display': { 'margin': 0 } },
                linebreaks: {
                  automatic: true
                }
              },
              'SVG': {
                availableFonts: [],
                imageFont: null,
                preferredFont: null,
                font: 'STIX-Web',
                webFont: 'STIX-Web',
                styles: { '.MathJax_Display': { 'margin': 0 } },
                linebreaks: {
                  automatic: true
                }
              }
            });

            MathJax.Hub.Register.MessageHook('New Math', function (id) {
              if (id && id.length > 1) {
                var mathJaxElement = d3.select('#' + id[1] + '-Frame');
                var svgMathJaxElement = mathJaxElement.select('svg');
                if (svgMathJaxElement.node()) {
                  setTimeout(function () {
                    setTimeout(function () {
                      var width = svgMathJaxElement.node().width.baseVal.value;
                      svgMathJaxElement.attr('x', -width / 2);
                      svgMathJaxElement.attr('y', -15);
                    }, 50);
                    d3.select(mathJaxElement.node().parentNode.parentNode).append(function () {
                      return svgMathJaxElement.node();
                    });
                  }, 50);
                }
              }
            });

            MathJax.Hub.Configured();

            initialized = true;
          }
        }, {
          key: 'renderSVG',
          value: function renderSVG() {
            // if no element here just return...
            if (!this.parent || !this.parent.node()) return;
            MathJax.Hub.Queue(['setRenderer', MathJax.Hub, 'SVG'], ['Typeset', MathJax.Hub, this.parent.node()]);
          }
        }, {
          key: 'renderHTML',
          value: function renderHTML() {
            // if no element here just return...
            if (!this.parent || !this.parent.node()) return;
            MathJax.Hub.Queue(['setRenderer', MathJax.Hub, 'HTML-CSS'], ['Typeset', MathJax.Hub, this.parent.node()]);
          }
        }]);

        return MathJaxWrapper;
      }(_base2.default), (_applyDecoratedDescriptor(_class.prototype, 'renderSVG', [_dec, _dec2], Object.getOwnPropertyDescriptor(_class.prototype, 'renderSVG'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'renderHTML', [_dec3, _dec4], Object.getOwnPropertyDescriptor(_class.prototype, 'renderHTML'), _class.prototype)), _class));
      exports.default = MathJaxWrapper;

      /***/
    },
    /* 17 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _composite = __webpack_require__(5);

      var _composite2 = _interopRequireDefault(_composite);

      var _graphFactory = __webpack_require__(18);

      var _graphFactory2 = _interopRequireDefault(_graphFactory);

      var _chartFactory = __webpack_require__(23);

      var _chartFactory2 = _interopRequireDefault(_chartFactory);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var Canvas = (_dec = (0, _dataDecorator.requires)('canvas'), (_class = function (_Composite) {
        _inherits(Canvas, _Composite);

        function Canvas(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Canvas);

          var _this = _possibleConstructorReturn(this, (Canvas.__proto__ || Object.getPrototypeOf(Canvas)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));

          _this.graphFactory = new _graphFactory2.default(_this.options);
          _this.chartFactory = new _chartFactory2.default(_this.options);
          _this.add(_this.graphFactory).add(_this.chartFactory);
          return _this;
        }

        _createClass(Canvas, [{
          key: 'render',
          value: function render() {
            var content = void 0;
            var zoom = d3.zoom();
            var self = this;

            function updateZoom(translateX, translateY, scale) {
              self.element.call(zoom.transform, d3.zoomIdentity.translate(translateX, translateY).scale(scale, scale));
            }

            function zoomed() {
              content.attr('transform', d3.event.transform);
            }

            function stopped() {
              if (d3.event.defaultPrevented) {
                d3.event.stopPropagation();
              }
            }

            function zoomToFit(force) {
              // only execute if enable, of course
              if (self.data.canvas.zoomToFit || force) {
                var bounds = content.node().getBBox();

                var clientBounds = self.element.node().getBoundingClientRect(),
                    fullWidth = clientBounds.right - clientBounds.left,
                    fullHeight = clientBounds.bottom - clientBounds.top;

                var width = +bounds.width,
                    height = +bounds.height;

                if (width === 0 || height === 0) return;

                var midX = bounds.x + width / 2,
                    midY = bounds.y + height / 2;

                var scale = 0.9 / Math.max(width / fullWidth, height / fullHeight);
                var translateX = fullWidth / 2 - scale * midX,
                    translateY = fullHeight / 2 - scale * midY;

                content.transition().duration(self.transitionDuration).attr('transform', 'translate(' + translateX + ',' + translateY + ')scale(' + scale + ',' + scale + ')').on('end', function () {
                  return updateZoom(translateX, translateY, scale);
                });
              }
            }

            var canvasId = 'Canvas-' + this.data.canvas.id;
            this.element = d3.select('svg#' + canvasId);
            // check if the canvas is already present
            if (!this.element.node()) {
              // create a svg element detached from the DOM!
              this.logger.debug('Creating Canvas [' + canvasId + ']...');
              this.element = this.parent.append('svg').attr('class', 'francy-canvas').attr('id', canvasId);
            }

            // cannot continue if canvas is not present
            if (!this.element.node()) {
              throw new Error('Oops, could not create canvas with id [' + canvasId + ']... Cannot proceed.');
            }

            this.element.attr('width', this.data.canvas.width).attr('height', this.data.canvas.height);

            content = this.element.select('g.francy-content');

            if (!content.node()) {
              content = this.element.append('g').attr('class', 'francy-content');
              zoom.on('zoom', zoomed);
              // remove zoom on double click!
              this.element.call(zoom).on('dblclick.zoom', null);
            }

            this.element.on('click', stopped, true);

            this.element.zoomToFit = this.zoomToFit = zoomToFit;

            this.logger.debug('Canvas updated [' + canvasId + ']...');

            this.renderChildren();

            setTimeout(function () {
              zoomToFit();
            }, this.transitionDuration);

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return Canvas;
      }(_composite2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Canvas;

      /***/
    },
    /* 18 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _graphTree = __webpack_require__(19);

      var _graphTree2 = _interopRequireDefault(_graphTree);

      var _graphGeneric = __webpack_require__(22);

      var _graphGeneric2 = _interopRequireDefault(_graphGeneric);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      var Graph = (_dec = (0, _dataDecorator.requires)('canvas.graph'), (_class = function (_Renderer) {
        _inherits(Graph, _Renderer);

        function Graph(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Graph);

          return _possibleConstructorReturn(this, (Graph.__proto__ || Object.getPrototypeOf(Graph)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(Graph, [{
          key: 'render',
          value: function render() {

            var element = undefined;
            switch (this.data.canvas.graph.type) {
              case 'tree':
                element = new _graphTree2.default(this.options).load(this.data).render();
                break;
              default:
                element = new _graphGeneric2.default(this.options).load(this.data).render();
            }

            return element;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return Graph;
      }(_renderer2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Graph;

      /***/
    },
    /* 19 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _graph = __webpack_require__(7);

      var _graph2 = _interopRequireDefault(_graph);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var TreeGraph = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Graph) {
        _inherits(TreeGraph, _Graph);

        function TreeGraph(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, TreeGraph);

          return _possibleConstructorReturn(this, (TreeGraph.__proto__ || Object.getPrototypeOf(TreeGraph)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(TreeGraph, [{
          key: 'render',
          value: function render() {

            var i = 0,
                root = void 0;

            root = d3.hierarchy(this.treeData, function (d) {
              return d.children;
            });
            root.x0 = this.height / 2;
            root.y0 = 0;

            // compute height based on the depth of the graph
            var levelWidth = [1];
            var childCount = function childCount(level, n) {

              if (n.children && n.children.length > 0) {
                if (levelWidth.length <= level + 1) levelWidth.push(0);

                levelWidth[level + 1] += n.children.length;
                n.children.forEach(function (d) {
                  childCount(level + 1, d);
                });
              }
            };
            childCount(0, root);
            var newHeight = d3.max(levelWidth) * 100;

            var treemap = d3.tree().size([newHeight, this.width]);

            if (this.data.canvas.graph.collapsed) {
              root.children.forEach(collapse);
            }

            update.call(this, root);

            function collapse(d) {
              if (d.children) {
                d._children = d.children;
                d._children.forEach(collapse);
                d.children = null;
              }
            }

            function update(source) {
              var _this2 = this;

              var treeData = treemap(root);

              var nodes = treeData.descendants(),
                  links = treeData.descendants().slice(1);

              nodes.forEach(function (d) {
                return d.y = d.depth * 150;
              });

              var linkGroup = this.element.selectAll('g.francy-links');

              if (!linkGroup.node()) {
                linkGroup = this.element.append('g').attr('class', 'francy-links');
              }

              var link = linkGroup.selectAll('path.francy-edge').data(links, function (d) {
                return d.id || (d.id = ++i);
              });

              var linkEnter = link.enter().append('path').attr('class', 'francy-edge').attr('d', function () {
                var o = { x: source.x0, y: source.y0 };
                return diagonal(o, o);
              });

              linkEnter.merge(link).transition().duration(this.transitionDuration).attr('d', function (d) {
                return diagonal(d, d.parent);
              });

              link.exit().transition().duration(this.transitionDuration).attr('d', function () {
                var o = { x: source.x, y: source.y };
                return diagonal(o, o);
              }).remove();

              linkGroup.selectAll('path.francy-edge').style('fill', 'none').style('stroke', '#ccc').style('stroke-width', '1px');

              nodes.forEach(function (d) {
                d.x0 = d.x;
                d.y0 = d.y;
              });

              function diagonal(s, d) {
                return 'M ' + s.y + ' ' + s.x + '\n            C ' + (s.y + d.y) / 2 + ' ' + s.x + ',\n              ' + (s.y + d.y) / 2 + ' ' + d.x + ',\n              ' + d.y + ' ' + d.x;
              }

              var nodeGroup = this.element.selectAll('g.francy-nodes');

              if (!nodeGroup.node()) {
                nodeGroup = this.element.append('g').attr('class', 'francy-nodes');
              }

              var node = nodeGroup.selectAll('g.francy-node').data(nodes, function (d) {
                return d.id || (d.id = ++i);
              });

              var nodeEnter = node.enter().append('g').attr('class', 'francy-node').attr('transform', function () {
                return 'translate(' + source.y0 + ',' + source.x0 + ')';
              });

              nodeEnter.append('path').attr('d', d3.symbol().type(function (d) {
                return _graph2.default.getSymbol(d.data.type);
              }).size(function (d) {
                return d.data.size * 100;
              })).attr('class', 'francy-symbol');

              nodeEnter.append('text').attr('class', 'francy-label').text(function (d) {
                return d.data.title;
              }).attr('x', function () {
                var bound = this.getBBox();
                return -(bound.width / 2);
              }).style('cursor', function (d) {
                return d.children || d._children ? 'pointer' : 'default';
              });

              var nodeUpdate = nodeEnter.merge(node);

              nodeUpdate.transition().duration(this.transitionDuration).attr('transform', function (d) {
                return 'translate(' + d.y + ',' + d.x + ')';
              });

              node.exit().transition().duration(this.transitionDuration).attr('transform', function () {
                return 'translate(' + source.y + ',' + source.x + ')';
              }).remove();

              nodeGroup.selectAll('path.francy-symbol').style('fill', function (d) {
                return d.children || d._children ? 'lightsteelblue' : _graph2.default.colors(d.data.layer * 5);
              }).style('cursor', function (d) {
                return d.children || d._children ? 'pointer' : 'default';
              });

              node = nodeGroup.selectAll('g.francy-node');

              if (node.node()) {
                this._applyEvents(node);

                var nodeOnClick = node.on('click');
                node.on('click', function (d) {
                  // any callbacks will be handled here
                  nodeOnClick.call(_this2, d.data);
                  // default, highlight connected nodes
                  click.call(_this2, d);
                });
              }

              // Toggle children on click.
              var self = this;

              function click(d) {
                if (d.children) {
                  d._children = d.children;
                  d.children = null;
                } else {
                  d.children = d._children;
                  d._children = null;
                }
                update.call(self, d);
              }

              setTimeout(function () {
                _this2.parent.zoomToFit();
              }, this.transitionDuration);
            }

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}

          /**
           * Transforms flat data into tree data by analysing the parents of each node
           * @returns {Object} the data transformed in tree data
           */

        }, {
          key: 'treeData',
          get: function get() {
            var canvasNodes = this.data.canvas.graph.nodes ? Object.values(this.data.canvas.graph.nodes) : [];
            var dataMap = canvasNodes.reduce(function (map, node) {
              map[node.id] = node;
              return map;
            }, {});
            var treeData = [];
            canvasNodes.forEach(function (node) {
              var parent = dataMap[node.parent];
              if (parent) {
                (parent.children || (parent.children = [])).push(node);
              } else {
                treeData.push(node);
              }
            });
            return treeData[0];
          }
        }]);

        return TreeGraph;
      }(_graph2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = TreeGraph;

      /***/
    },
    /* 20 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _menu = __webpack_require__(8);

      var _menu2 = _interopRequireDefault(_menu);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var ContextMenu = (_dec = (0, _dataDecorator.requires)('menus'), (_class = function (_Menu) {
        _inherits(ContextMenu, _Menu);

        function ContextMenu(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, ContextMenu);

          return _possibleConstructorReturn(this, (ContextMenu.__proto__ || Object.getPrototypeOf(ContextMenu)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(ContextMenu, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            d3.event.preventDefault();

            this.element = this.HTMLParent.select('div.francy-context-menu-holder');
            // check if the menu holder is already present
            if (!this.element.node()) {
              this.element = this.HTMLParent.append('div').attr('class', 'francy-context-menu-holder');
            }

            var pos = d3.mouse(this.SVGParent.node());

            this.element.style('left', pos[0] + 5 + 'px').style('top', pos[1] + 5 + 'px');

            // show the context menu
            this.element.style('display', 'block');

            // check if it exists already
            if (this.element.selectAll('*').node()) return;

            // destroy menu
            d3.select('body').on('click.francy-context-menu', function () {
              return _this2.unrender();
            });

            // this gets executed when a contextmenu event occurs
            var menu = this.element.append('div').attr('class', 'francy-context-menu').append('ul');
            var menusIterator = this.iterator(Object.values(this.data.menus));
            this.traverse(menu, menusIterator);

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {
            if (this.element) {
              this.element.selectAll('*').remove();
              this.element.style('display', null);
            }
          }
        }]);

        return ContextMenu;
      }(_menu2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = ContextMenu;

      /***/
    },
    /* 21 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _modal = __webpack_require__(10);

      var _modal2 = _interopRequireDefault(_modal);

      var _component = __webpack_require__(11);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var RequiredArgsModal = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Modal) {
        _inherits(RequiredArgsModal, _Modal);

        function RequiredArgsModal(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, RequiredArgsModal);

          return _possibleConstructorReturn(this, (RequiredArgsModal.__proto__ || Object.getPrototypeOf(RequiredArgsModal)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(RequiredArgsModal, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            var self = this;

            var modalId = this.data.callback.id;

            this.logger.debug('Creating Callback Modal [' + modalId + ']...');

            this.element = this.holder.append('div').attr('id', modalId).attr('class', 'francy-modal');

            var form = this.element.append('form');

            var header = form.append('div').attr('class', 'francy-modal-header');

            var headerTitle = header.append('span').html('Required arguments&nbsp;');
            if (this.data.title) {
              headerTitle.append('span').attr('style', 'font-weight: bold;').text('for ' + this.data.title);
            }

            var content = form.append('div').attr('class', 'francy-modal-content').append('div').attr('class', 'francy-table').append('div').attr('class', 'francy-table-body');

            var _iteratorNormalCompletion = true;
            var _didIteratorError = false;
            var _iteratorError = undefined;

            try {
              for (var _iterator = Object.values(this.data.callback.requiredArgs)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
                var arg = _step.value;

                var row = content.append('div').attr('class', 'francy-table-row');
                row.append('div').attr('class', 'francy-table-cell').append('label').attr('for', arg.id).text(arg.title);
                var input = row.append('div').attr('class', 'francy-table-cell').append('input').attr('id', arg.id).attr('class', 'francy-arg').attr('required', '').attr('name', arg.id).attr('type', arg.type).attr('value', arg.value).on('change', function () {
                  self.data.callback.requiredArgs[this.id].value = this.value;
                }).on('input', this.onchange).on('keyup', this.onchange).on('paste', this.onchange);
                // wait, if it is boolean we create a checkbox
                if (arg.type === 'boolean') {
                  // well, a checkbox works this way so we need to initialize 
                  // the value to false and update the value based on the checked 
                  // property that triggers the onchange event
                  arg.value = arg.value || false;
                  input.attr('type', 'checkbox').attr('required', null).attr('value', arg.value).on('change', function () {
                    self.data.callback.requiredArgs[this.id].value = this.value = this.checked;
                  });
                }
                row.append('span').attr('class', 'validity');
              }
            } catch (err) {
              _didIteratorError = true;
              _iteratorError = err;
            } finally {
              try {
                if (!_iteratorNormalCompletion && _iterator.return) {
                  _iterator.return();
                }
              } finally {
                if (_didIteratorError) {
                  throw _iteratorError;
                }
              }
            }

            var footer = form.append('div').attr('class', 'francy-modal-footer');

            footer.append('button').text('Ok').on('click', function () {
              if (form.node().checkValidity()) {
                d3.event.preventDefault();
                _this2.options.callbackHandler(_this2.data.callback);
                _this2.unrender.call(_this2);
              }
              return false;
            });
            footer.append('button').text('Cancel').on('click', function () {
              d3.event.preventDefault();
              _this2.unrender.call(_this2);
            });

            // disable keyboard shortcuts when using this modal in Jupyter
            (0, _component.RegisterJupyterKeyboardEvents)(['.francy', '.francy-arg', '.francy-overlay', '.francy-modal']);

            var inputElement = content.selectAll('.francy-arg').node();
            if (inputElement) {
              inputElement.focus();
            }

            this.logger.debug('Callback Modal updated [' + modalId + ']...');

            return this;
          }
        }]);

        return RequiredArgsModal;
      }(_modal2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = RequiredArgsModal;

      /***/
    },
    /* 22 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _graph = __webpack_require__(7);

      var _graph2 = _interopRequireDefault(_graph);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var GenericGraph = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Graph) {
        _inherits(GenericGraph, _Graph);

        function GenericGraph(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, GenericGraph);

          return _possibleConstructorReturn(this, (GenericGraph.__proto__ || Object.getPrototypeOf(GenericGraph)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(GenericGraph, [{
          key: 'render',
          value: function render() {
            var self = this;

            var simulationActive = this.data.canvas.graph.simulation;
            var radius = 0;

            var canvasNodes = this.data.canvas.graph.nodes ? Object.values(this.data.canvas.graph.nodes) : [],
                canvasLinks = this.data.canvas.graph.links ? Object.values(this.data.canvas.graph.links) : [];

            var linkGroup = this.element.selectAll('g.francy-links');

            if (!linkGroup.node()) {
              linkGroup = this.element.append('g').classed('francy-links', true);
            }

            var links = linkGroup.selectAll('g.francy-link').data();
            var linksToAdd = this._filterNewElements(canvasLinks, links);

            var link = linkGroup.selectAll('g.francy-link').data(linksToAdd, function (d) {
              return d.id;
            });

            var nodeGroup = this.element.selectAll('g.francy-nodes');

            if (!nodeGroup.node()) {
              nodeGroup = this.element.append('g').classed('francy-nodes', true);
            }

            var nodes = nodeGroup.selectAll('g.francy-node').data();
            var nodesToAdd = this._filterNewElements(canvasNodes, nodes);

            var node = nodeGroup.selectAll('g.francy-node').data(nodesToAdd, function (d) {
              return d.id;
            });

            // this means no changes, so we can safely return
            if (node.exit().data().length === 0 && node.enter().data().length === 0 && link.enter().data().length === 0 && link.exit().data().length === 0) return;

            var linkEnter = link.enter().append('g').classed('francy-link', true);

            linkEnter.append('line').classed('francy-edge', true).style('stroke-width', function (d) {
              if (d.weight >= 3) {
                d.weight = 3;d.pos = 15;
              } else if (d.weight <= 1) {
                d.weight = 1;d.pos = 28;
              } else {
                d.pos = 18;
              }
              return d.weight;
            }).style('stroke', function (d) {
              return d.color || undefined;
            });

            linkEnter.append('text').classed('francy-label', true).classed('francy-size10', true).text(function (d) {
              return d.title;
            }).attr('text-anchor', 'middle');

            link.exit().remove();

            link = linkGroup.selectAll('g.francy-link');

            if (this.data.canvas.graph.type === 'directed') {
              // this means we need arrows, so we append the marker
              self.parent.append('defs').selectAll('marker').data(linksToAdd).enter().append('marker').classed('francy-arrows', true).attr('id', function (d) {
                return 'arrow-' + d.id;
              }).attr('viewBox', '0 0 12 12').attr('refX', function (d) {
                return d.pos;
              }).attr('refY', 6).attr('markerHeight', 12).attr('markerWidth', 12).attr('markerUnits', 'strokeWidth').attr('orient', 'auto').append('path').attr('d', 'M2,2 L10,6 L2,10 L6,6 L2,2').style('fill', function (d) {
                return d.color || undefined;
              });
              // update the style of the link
              link.selectAll('line.francy-edge').style('marker-end', function (d) {
                return 'url(#arrow-' + d.id + ')';
              });
            }

            var nodeEnter = node.enter().append('g').classed('francy-node', true).attr('id', function (d) {
              return d.id;
            });

            nodeEnter.append('path').attr('d', d3.symbol().type(function (d) {
              return _graph2.default.getSymbol(d.type);
            }).size(function (d) {
              return d.size * 100;
            })).style('fill', function (d) {
              return d.color || _graph2.default.colors(d.layer * 5);
            }).classed('francy-symbol', true).classed('francy-highlight', function (d) {
              return d.highlight;
            }).classed('francy-context', function (d) {
              return Object.values(d.menus).length && Object.values(d.menus).length > 0;
            });

            nodeEnter.append('text').classed('francy-label', true).text(function (d) {
              return d.title;
            }).attr('x', function () {
              // apply mathjax if this is the case
              var text = d3.select(this);
              if (text.text().startsWith('$') && text.text().endsWith('$')) {
                self.mathjax.settings({ appendTo: { element: text } }).renderSVG();
              }
              var bound = this.getBBox();
              // check the widest label so that we use it as default radius for colisions
              if (radius < bound.width) {
                radius = bound.width;
              }
              return -(bound.width / 2);
            });

            node.exit().remove();

            node = nodeGroup.selectAll('g.francy-node');

            if (this.data.canvas.graph.drag) {
              node.call(d3.drag().on('start', dragstarted).on('drag', dragged).on('end', dragended));
            }

            if (node && !node.empty()) {

              this._applyEvents(node);

              if (this.data.canvas.graph.showNeighbours) {
                var nodeOnClick = node.on('click');
                node.on('click', function (d) {
                  // default, highlight connected nodes
                  connectedNodes.call(this);
                  // any callbacks will be handled here
                  nodeOnClick.call(this, d);
                });
              }
            }

            if (simulationActive) {
              //Canvas Forces
              //let centerForce = d3.forceCenter().x(this.width / 2).y(this.height / 2);
              var manyForce = d3.forceManyBody().strength(-nodesToAdd.length * 75);
              var linkForce = d3.forceLink(canvasLinks).id(function (d) {
                return d.id;
              }).distance(75);
              var collideForce = d3.forceCollide().strength(0.25).radius(radius / 2).iterations(3);

              //Generic gravity for the X position
              var forceX = d3.forceX(this.width).strength(0.05);
              //Generic gravity for the Y position - undirected/directed graphs fall here
              var forceY = d3.forceY(this.height).strength(0.25);

              if (this.data.canvas.graph.type === 'hasse') {
                //Generic gravity for the X position
                forceX = d3.forceX(this.width).strength(0.1);
                //Strong y positioning based on layer to simulate the hasse diagram
                forceY = d3.forceY(function (d) {
                  return d.layer * 75;
                }).strength(1);
              }

              var simulation = d3.forceSimulation().nodes(nodesToAdd).force('charge', manyForce).force('link', linkForce)
              //.force('center', centerForce)
              .force('x', forceX).force('y', forceY).force('collide', collideForce).on('tick', ticked).on('end', self.parent.zoomToFit);

              //force simulation restart
              simulation.restart();
            } else {
              // well, simulation is off, apply fixed positions and zoom to fit now
              ticked();
              self.parent.zoomToFit();
            }

            function ticked() {
              link.selectAll('line.francy-edge').attr('x1', function (d) {
                return d.source.x;
              }).attr('y1', function (d) {
                return d.source.y;
              }).attr('x2', function (d) {
                return d.target.x;
              }).attr('y2', function (d) {
                return d.target.y;
              });

              link.selectAll('text.francy-label').attr('x', function (d) {
                return _graph2.default.linkXPos(d.target, d.source);
              }).attr('y', function (d) {
                return _graph2.default.linkYPos(d.target, d.source);
              });

              node.attr('transform', function (d) {
                return 'translate(' + d.x + ',' + d.y + ')';
              });
            }

            // HIGHLIGHT
            //Toggle stores whether the highlighting is on
            var toggle = 0;
            //Create an array logging what is connected to what
            var linkedByIndex = {};

            for (var i = 0; i < canvasNodes.length; i++) {
              linkedByIndex[i + ',' + i] = 1;
            }

            canvasLinks.forEach(function (d) {
              linkedByIndex[d.source.index + ',' + d.target.index] = 1;
            });

            function connectedNodes() {
              //This function looks up whether a pair are neighbours
              function neighboring(a, b) {
                return linkedByIndex[a.index + ',' + b.index];
              }
              d3.event.preventDefault();
              if (toggle === 0) {
                //Reduce the opacity of all but the neighbouring nodes
                var d = d3.select(this).node().__data__;
                node.style('opacity', function (o) {
                  return neighboring(d, o) || neighboring(o, d) ? 1 : 0.1;
                });
                link.style('opacity', function (o) {
                  return d.index === o.source.index || d.index === o.target.index ? 1 : 0.1;
                });
                //Reduce the op
                toggle = 1;
              } else {
                //Put them back to opacity=1
                node.style('opacity', 1);
                link.style('opacity', 1);
                toggle = 0;
              }
            }

            function dragstarted(d) {
              if (!d3.event.active && simulationActive) {
                simulation.alphaTarget(0.01).restart();
              }
              d.fx = d.x;
              d.fy = d.y;
            }

            function dragged(d) {
              d.fx = d3.event.x;
              d.fy = d3.event.y;
            }

            function dragended(d) {
              if (!d3.event.active && simulationActive) {
                simulation.alphaTarget(0);
              }
              d.fx = null;
              d.fy = null;
            }

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }, {
          key: '_filterNewElements',
          value: function _filterNewElements(canvasObjects, d3Element) {
            var newElements = [];
            canvasObjects.forEach(function (o) {
              var link = d3Element.find(function (d) {
                return d.id === o.id;
              });
              if (link) {
                newElements.push(link);
              } else {
                newElements.push(o);
              }
            });
            return newElements;
          }
        }]);

        return GenericGraph;
      }(_graph2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = GenericGraph;

      /***/
    },
    /* 23 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _chartBar = __webpack_require__(24);

      var _chartBar2 = _interopRequireDefault(_chartBar);

      var _chartLine = __webpack_require__(25);

      var _chartLine2 = _interopRequireDefault(_chartLine);

      var _chartScatter = __webpack_require__(26);

      var _chartScatter2 = _interopRequireDefault(_chartScatter);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      var ChartFactory = (_dec = (0, _dataDecorator.requires)('canvas.chart'), (_class = function (_Renderer) {
        _inherits(ChartFactory, _Renderer);

        function ChartFactory(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, ChartFactory);

          return _possibleConstructorReturn(this, (ChartFactory.__proto__ || Object.getPrototypeOf(ChartFactory)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(ChartFactory, [{
          key: 'render',
          value: function render() {

            var element = undefined;
            switch (this.data.canvas.chart.type) {
              case 'bar':
                element = new _chartBar2.default(this.options).load(this.data).render();
                break;
              case 'line':
                element = new _chartLine2.default(this.options).load(this.data).render();
                break;
              case 'scatter':
                element = new _chartScatter2.default(this.options).load(this.data).render();
                break;
            }

            return element;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return ChartFactory;
      }(_renderer2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = ChartFactory;

      /***/
    },
    /* 24 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _chart = __webpack_require__(4);

      var _chart2 = _interopRequireDefault(_chart);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var BarChart = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Chart) {
        _inherits(BarChart, _Chart);

        function BarChart(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, BarChart);

          return _possibleConstructorReturn(this, (BarChart.__proto__ || Object.getPrototypeOf(BarChart)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(BarChart, [{
          key: 'render',
          value: function render() {

            this.xScale = d3.scaleBand().range([0, this.width]).padding(0.1).domain(this.axis.x.domain);

            if (!this.axis.x.domain.length) {
              this.axis.x.domain = _chart2.default.domainRange(this.allValues.length / this.datasetNames.length);
              this.xScale.domain(this.axis.x.domain);
            }

            var barsGroup = this.element.selectAll('g.francy-bars');

            if (!barsGroup.node()) {
              barsGroup = this.element.append('g').attr('class', 'francy-bars');
            }

            var self = this;

            this.datasetNames.forEach(function (key, index) {
              var bar = barsGroup.selectAll('.francy-bar-' + index).data(self.datasets[key]);

              bar.exit().transition().duration(750).style('fill-opacity', 1e-6).remove();

              // append the rectangles for the bar chart
              var barEnter = bar.enter().append('rect').style('fill', function () {
                return _chart2.default.colors(index * 5);
              }).attr('class', 'francy-bar-' + index).attr('x', function (d, i) {
                return self.xScale(self.axis.x.domain[i]) + index * (self.xScale.bandwidth() / self.datasetNames.length);
              }).attr('width', self.xScale.bandwidth() / self.datasetNames.length - 1).attr('y', function (d) {
                return self.yScale(d);
              }).attr('height', function (d) {
                return self.height - self.yScale(d);
              }).on('mouseenter', function (d) {
                d3.select(this).transition().duration(250).style('fill-opacity', 0.5);
                self.tooltip.load(_chart2.default.tooltip(key, d), true).render();
              }).on('mouseleave', function () {
                d3.select(this).transition().duration(250).style('fill-opacity', 1);
                self.tooltip.unrender();
              });

              barEnter.merge(bar).attr('x', function (d, i) {
                return self.xScale(self.axis.x.domain[i]) + index * (self.xScale.bandwidth() / self.datasetNames.length);
              }).attr('width', self.xScale.bandwidth() / self.datasetNames.length - 1).attr('y', function (d) {
                return self.yScale(d);
              }).attr('height', function (d) {
                return self.height - self.yScale(d);
              });
            });

            this._renderAxis();
            this._renderLegend();

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return BarChart;
      }(_chart2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = BarChart;

      /***/
    },
    /* 25 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _chart = __webpack_require__(4);

      var _chart2 = _interopRequireDefault(_chart);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var LineChart = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Chart) {
        _inherits(LineChart, _Chart);

        function LineChart(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, LineChart);

          return _possibleConstructorReturn(this, (LineChart.__proto__ || Object.getPrototypeOf(LineChart)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(LineChart, [{
          key: 'render',
          value: function render() {

            var linesGroup = this.element.selectAll('g.francy-lines');

            if (!linesGroup.node()) {
              linesGroup = this.element.append('g').attr('class', 'francy-lines');
            }

            var self = this;

            this.datasetNames.forEach(function (key, index) {
              var valueLine = d3.line().x(function (d, i) {
                return self.xScale(i);
              }).y(function (d) {
                return self.yScale(d);
              });

              var line = linesGroup.selectAll('.francy-line-' + index).data([self.datasets[key]]);

              line.exit().transition().duration(750).style('fill-opacity', 1e-6).remove();

              // append the rectangles for the bar chart
              var lineEnter = line.enter().append('path').style('stroke', function () {
                return _chart2.default.colors(index * 5);
              }).style('stroke-width', '5px').attr('class', 'francy-line-' + index).attr('d', valueLine).on('mouseenter', function (d) {
                d3.select(this).transition().duration(250).style('stroke-opacity', 0.5).style('stroke-width', '10px');
                self.tooltip.load(_chart2.default.tooltip(key, d), true).render();
              }).on('mouseleave', function () {
                d3.select(this).transition().duration(250).style('stroke-opacity', 1).style('stroke-width', '5px');
                self.tooltip.unrender();
              });

              lineEnter.merge(line);
            });

            this._renderAxis();
            this._renderLegend();

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return LineChart;
      }(_chart2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = LineChart;

      /***/
    },
    /* 26 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _chart = __webpack_require__(4);

      var _chart2 = _interopRequireDefault(_chart);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var ScatterChart = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Chart) {
        _inherits(ScatterChart, _Chart);

        function ScatterChart(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, ScatterChart);

          return _possibleConstructorReturn(this, (ScatterChart.__proto__ || Object.getPrototypeOf(ScatterChart)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(ScatterChart, [{
          key: 'render',
          value: function render() {

            var scatterGroup = this.element.selectAll('g.francy-scatters');

            if (!scatterGroup.node()) {
              scatterGroup = this.element.append('g').attr('class', 'francy-scatters');
            }

            var self = this;

            this.datasetNames.forEach(function (key, index) {
              var scatter = scatterGroup.selectAll('.francy-scatter-' + index).data(self.datasets[key]);

              scatter.exit().transition().duration(750).style('fill-opacity', 1e-6).remove();

              // append the rectangles for the bar chart
              var scatterEnter = scatter.enter().append('circle').style('fill', function () {
                return _chart2.default.colors(index * 5);
              }).attr('class', 'francy-scatter-' + index).attr('r', 5).attr('cx', function (d, i) {
                return self.xScale(i);
              }).attr('cy', function (d) {
                return self.yScale(d);
              }).on('mouseenter', function (d) {
                d3.select(this).transition().duration(250).style('fill-opacity', 0.5).attr('r', 10);
                self.tooltip.load(_chart2.default.tooltip(key, d), true).render();
              }).on('mouseleave', function () {
                d3.select(this).transition().duration(250).style('fill-opacity', 1).attr('r', 5);
                self.tooltip.unrender();
              });

              scatterEnter.merge(scatter);
            });

            this._renderAxis();

            this._renderLegend();

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return ScatterChart;
      }(_chart2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = ScatterChart;

      /***/
    },
    /* 27 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _menu = __webpack_require__(8);

      var _menu2 = _interopRequireDefault(_menu);

      var _modalAbout = __webpack_require__(28);

      var _modalAbout2 = _interopRequireDefault(_modalAbout);

      var _saveSvgAsPng = __webpack_require__(29);

      var SvgToPng = _interopRequireWildcard(_saveSvgAsPng);

      function _interopRequireWildcard(obj) {
        if (obj && obj.__esModule) {
          return obj;
        } else {
          var newObj = {};if (obj != null) {
            for (var key in obj) {
              if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
            }
          }newObj.default = obj;return newObj;
        }
      }

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      /* global d3 window */

      var MainMenu = function (_Menu) {
        _inherits(MainMenu, _Menu);

        function MainMenu(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, MainMenu);

          return _possibleConstructorReturn(this, (MainMenu.__proto__ || Object.getPrototypeOf(MainMenu)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(MainMenu, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            var aboutModal = new _modalAbout2.default(this.options);

            // Otherwise clashes with the canvas itself!
            var menuId = 'MainMenu-' + this.data.canvas.id;
            this.element = d3.select('#' + menuId);

            // Check if the menu is already present
            if (!this.element.node()) {
              // create a div element detached from the DOM!
              this.logger.debug('Creating Main Menu [' + menuId + ']...');
              this.element = this.parent.append('div').attr('class', 'francy-main-menu-holder').attr('id', menuId);
            }

            // Force rebuild menu again
            this.element.selectAll('*').remove();

            this.element = this.element.append('ul').attr('class', 'francy-main-menu');

            if (this.data.canvas.title) {
              this.element.append('li').attr('class', 'francy-title').append('a').html(this.data.canvas.title);
            }

            var entry = this.element.append('li');
            entry.append('a').html('Francy');
            var content = entry.append('ul');
            content.append('li').append('a').on('click', function () {
              return _this2.options.appendTo.canvas.zoomToFit(true);
            }).attr('title', 'Zoom to Fit').html('Zoom to Fit');
            content.append('li').append('a').on('click', function () {
              return SvgToPng.saveSvgAsPng(_this2.SVGParent.node(), 'diagram.png');
            }).attr('title', 'Save to PNG').html('Save to PNG');
            content.append('li').append('a').on('click', function () {
              return aboutModal.load(_this2.data).render();
            }).attr('title', 'About').html('About');

            // Traverse all menus and flatten them!
            var menusIterator = this.iterator(Object.values(this.data.canvas.menus));
            this.traverse(this.element, menusIterator);

            this.logger.debug('Main Menu updated [' + menuId + ']...');

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return MainMenu;
      }(_menu2.default);

      exports.default = MainMenu;

      /***/
    },
    /* 28 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _modal = __webpack_require__(10);

      var _modal2 = _interopRequireDefault(_modal);

      var _component = __webpack_require__(11);

      var _initializeDecorator = __webpack_require__(2);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var AboutModal = (_dec = (0, _initializeDecorator.initialize)(), (_class = function (_Modal) {
        _inherits(AboutModal, _Modal);

        function AboutModal(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, AboutModal);

          return _possibleConstructorReturn(this, (AboutModal.__proto__ || Object.getPrototypeOf(AboutModal)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(AboutModal, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            var modalId = 'AboutModalWindow';

            this.logger.debug('Creating About Modal [' + modalId + ']...');

            this.element = this.holder.append('div').attr('id', modalId).attr('class', 'francy-modal');

            var form = this.element.append('form');

            var header = form.append('div').attr('class', 'francy-modal-header');

            header.append('span').html('About Francy v' + (this.data.version || 'N/A'));

            var content = form.append('div').attr('class', 'francy-modal-content').append('div').attr('class', 'francy-table').append('div').attr('class', 'francy-table-body');

            content.append('span').text('Loaded Object:');
            content.append('pre').attr('class', 'francy').html((0, _component.syntaxHighlight)(JSON.stringify(this.data.canvas, null, 2)));
            content.append('span').append('a').attr('href', 'https://github.com/mcmartins/francy').text('Francy on Github');

            var footer = form.append('div').attr('class', 'francy-modal-footer');

            footer.append('button').text('Ok').on('click', function () {
              d3.event.preventDefault();
              _this2.unrender.call(_this2);
            });

            // disable keyboard shortcuts when using this modal in Jupyter
            (0, _component.RegisterJupyterKeyboardEvents)(['.francy', '.francy-arg', '.francy-overlay', '.francy-modal']);

            this.logger.debug('Callback About updated [' + modalId + ']...');

            return this;
          }
        }]);

        return AboutModal;
      }(_modal2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = AboutModal;

      /***/
    },
    /* 29 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      var __WEBPACK_AMD_DEFINE_RESULT__;

      (function () {
        var out$ = typeof exports != 'undefined' && exports || "function" != 'undefined' && {} || this;

        var doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp "&#160;">]>';

        function isElement(obj) {
          return obj instanceof HTMLElement || obj instanceof SVGElement;
        }

        function requireDomNode(el) {
          if (!isElement(el)) {
            throw new Error('an HTMLElement or SVGElement is required; got ' + el);
          }
        }

        function isExternal(url) {
          return url && url.lastIndexOf('http', 0) == 0 && url.lastIndexOf(window.location.host) == -1;
        }

        function inlineImages(el, callback) {
          requireDomNode(el);

          var images = el.querySelectorAll('image'),
              left = images.length,
              checkDone = function checkDone() {
            if (left === 0) {
              callback();
            }
          };

          checkDone();
          for (var i = 0; i < images.length; i++) {
            (function (image) {
              var href = image.getAttributeNS("http://www.w3.org/1999/xlink", "href");
              if (href) {
                if (isExternal(href.value)) {
                  console.warn("Cannot render embedded images linking to external hosts: " + href.value);
                  return;
                }
              }
              var canvas = document.createElement('canvas');
              var ctx = canvas.getContext('2d');
              var img = new Image();
              img.crossOrigin = "anonymous";
              href = href || image.getAttribute('href');
              if (href) {
                img.src = href;
                img.onload = function () {
                  canvas.width = img.width;
                  canvas.height = img.height;
                  ctx.drawImage(img, 0, 0);
                  image.setAttributeNS("http://www.w3.org/1999/xlink", "href", canvas.toDataURL('image/png'));
                  left--;
                  checkDone();
                };
                img.onerror = function () {
                  console.log("Could not load " + href);
                  left--;
                  checkDone();
                };
              } else {
                left--;
                checkDone();
              }
            })(images[i]);
          }
        }

        function styles(el, options, cssLoadedCallback) {
          var selectorRemap = options.selectorRemap;
          var modifyStyle = options.modifyStyle;
          var css = "";
          // each font that has extranl link is saved into queue, and processed
          // asynchronously
          var fontsQueue = [];
          var sheets = document.styleSheets;
          for (var i = 0; i < sheets.length; i++) {
            try {
              var rules = sheets[i].cssRules;
            } catch (e) {
              console.warn("Stylesheet could not be loaded: " + sheets[i].href);
              continue;
            }

            if (rules != null) {
              for (var j = 0, match; j < rules.length; j++, match = null) {
                var rule = rules[j];
                if (typeof rule.style != "undefined") {
                  var selectorText;

                  try {
                    selectorText = rule.selectorText;
                  } catch (err) {
                    console.warn('The following CSS rule has an invalid selector: "' + rule + '"', err);
                  }

                  try {
                    if (selectorText) {
                      match = el.querySelector(selectorText) || el.parentNode.querySelector(selectorText);
                    }
                  } catch (err) {
                    console.warn('Invalid CSS selector "' + selectorText + '"', err);
                  }

                  if (match) {
                    var selector = selectorRemap ? selectorRemap(rule.selectorText) : rule.selectorText;
                    var cssText = modifyStyle ? modifyStyle(rule.style.cssText) : rule.style.cssText;
                    css += selector + " { " + cssText + " }\n";
                  } else if (rule.cssText.match(/^@font-face/)) {
                    // below we are trying to find matches to external link. E.g.
                    // @font-face {
                    //   // ...
                    //   src: local('Abel'), url(https://fonts.gstatic.com/s/abel/v6/UzN-iejR1VoXU2Oc-7LsbvesZW2xOQ-xsNqO47m55DA.woff2);
                    // }
                    //
                    // This regex will save extrnal link into first capture group
                    var fontUrlRegexp = /url\(["']?(.+?)["']?\)/;
                    // TODO: This needs to be changed to support multiple url declarations per font.
                    var fontUrlMatch = rule.cssText.match(fontUrlRegexp);

                    var externalFontUrl = fontUrlMatch && fontUrlMatch[1] || '';
                    var fontUrlIsDataURI = externalFontUrl.match(/^data:/);
                    if (fontUrlIsDataURI) {
                      // We should ignore data uri - they are already embedded
                      externalFontUrl = '';
                    }

                    if (externalFontUrl) {
                      // okay, we are lucky. We can fetch this font later

                      //handle url if relative
                      if (externalFontUrl.startsWith('../')) {
                        externalFontUrl = sheets[i].href + '/../' + externalFontUrl;
                      } else if (externalFontUrl.startsWith('./')) {
                        externalFontUrl = sheets[i].href + '/.' + externalFontUrl;
                      }

                      fontsQueue.push({
                        text: rule.cssText,
                        // Pass url regex, so that once font is downladed, we can run `replace()` on it
                        fontUrlRegexp: fontUrlRegexp,
                        format: getFontMimeTypeFromUrl(externalFontUrl),
                        url: externalFontUrl
                      });
                    } else {
                      // otherwise, use previous logic
                      css += rule.cssText + '\n';
                    }
                  }
                }
              }
            }
          }

          // Now all css is processed, it's time to handle scheduled fonts
          processFontQueue(fontsQueue);

          function getFontMimeTypeFromUrl(fontUrl) {
            var supportedFormats = {
              'woff2': 'font/woff2',
              'woff': 'font/woff',
              'otf': 'application/x-font-opentype',
              'ttf': 'application/x-font-ttf',
              'eot': 'application/vnd.ms-fontobject',
              'sfnt': 'application/font-sfnt',
              'svg': 'image/svg+xml'
            };
            var extensions = Object.keys(supportedFormats);
            for (var i = 0; i < extensions.length; ++i) {
              var extension = extensions[i];
              // TODO: This is not bullet proof, it needs to handle edge cases...
              if (fontUrl.indexOf('.' + extension) > 0) {
                return supportedFormats[extension];
              }
            }

            // If you see this error message, you probably need to update code above.
            console.error('Unknown font format for ' + fontUrl + '; Fonts may not be working correctly');
            return 'application/octet-stream';
          }

          function processFontQueue(queue) {
            if (queue.length > 0) {
              // load fonts one by one until we have anything in the queue:
              var font = queue.pop();
              processNext(font);
            } else {
              // no more fonts to load.
              cssLoadedCallback(css);
            }

            function processNext(font) {
              // TODO: This could benefit from caching.
              var oReq = new XMLHttpRequest();
              oReq.addEventListener('load', fontLoaded);
              oReq.addEventListener('error', transferFailed);
              oReq.addEventListener('abort', transferFailed);
              oReq.open('GET', font.url);
              oReq.responseType = 'arraybuffer';
              oReq.send();

              function fontLoaded() {
                // TODO: it may be also worth to wait until fonts are fully loaded before
                // attempting to rasterize them. (e.g. use https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet )
                var fontBits = oReq.response;
                var fontInBase64 = arrayBufferToBase64(fontBits);
                updateFontStyle(font, fontInBase64);
              }

              function transferFailed(e) {
                console.warn('Failed to load font from: ' + font.url);
                console.warn(e);
                css += font.text + '\n';
                processFontQueue();
              }

              function updateFontStyle(font, fontInBase64) {
                var dataUrl = 'url("data:' + font.format + ';base64,' + fontInBase64 + '")';
                css += font.text.replace(font.fontUrlRegexp, dataUrl) + '\n';

                // schedule next font download on next tick.
                setTimeout(function () {
                  processFontQueue(queue);
                }, 0);
              }
            }
          }

          function arrayBufferToBase64(buffer) {
            var binary = '';
            var bytes = new Uint8Array(buffer);
            var len = bytes.byteLength;

            for (var i = 0; i < len; i++) {
              binary += String.fromCharCode(bytes[i]);
            }

            return window.btoa(binary);
          }
        }

        function getDimension(el, clone, dim) {
          var v = el.viewBox && el.viewBox.baseVal && el.viewBox.baseVal[dim] || clone.getAttribute(dim) !== null && !clone.getAttribute(dim).match(/%$/) && parseInt(clone.getAttribute(dim)) || el.getBoundingClientRect()[dim] || parseInt(clone.style[dim]) || parseInt(window.getComputedStyle(el).getPropertyValue(dim));
          return typeof v === 'undefined' || v === null || isNaN(parseFloat(v)) ? 0 : v;
        }

        function reEncode(data) {
          data = encodeURIComponent(data);
          data = data.replace(/%([0-9A-F]{2})/g, function (match, p1) {
            var c = String.fromCharCode('0x' + p1);
            return c === '%' ? '%25' : c;
          });
          return decodeURIComponent(data);
        }

        out$.prepareSvg = function (el, options, cb) {
          requireDomNode(el);

          options = options || {};
          options.scale = options.scale || 1;
          options.responsive = options.responsive || false;
          var xmlns = "http://www.w3.org/2000/xmlns/";

          inlineImages(el, function () {
            var outer = document.createElement("div");
            var clone = el.cloneNode(true);
            var width, height;
            if (el.tagName == 'svg') {
              width = options.width || getDimension(el, clone, 'width');
              height = options.height || getDimension(el, clone, 'height');
            } else if (el.getBBox) {
              var box = el.getBBox();
              width = box.x + box.width;
              height = box.y + box.height;
              clone.setAttribute('transform', clone.getAttribute('transform').replace(/translate\(.*?\)/, ''));

              var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
              svg.appendChild(clone);
              clone = svg;
            } else {
              console.error('Attempted to render non-SVG element', el);
              return;
            }

            clone.setAttribute("version", "1.1");
            if (!clone.getAttribute('xmlns')) {
              clone.setAttributeNS(xmlns, "xmlns", "http://www.w3.org/2000/svg");
            }
            if (!clone.getAttribute('xmlns:xlink')) {
              clone.setAttributeNS(xmlns, "xmlns:xlink", "http://www.w3.org/1999/xlink");
            }

            if (options.responsive) {
              clone.removeAttribute('width');
              clone.removeAttribute('height');
              clone.setAttribute('preserveAspectRatio', 'xMinYMin meet');
            } else {
              clone.setAttribute("width", width * options.scale);
              clone.setAttribute("height", height * options.scale);
            }

            clone.setAttribute("viewBox", [options.left || 0, options.top || 0, width, height].join(" "));

            var fos = clone.querySelectorAll('foreignObject > *');
            for (var i = 0; i < fos.length; i++) {
              if (!fos[i].getAttribute('xmlns')) {
                fos[i].setAttributeNS(xmlns, "xmlns", "http://www.w3.org/1999/xhtml");
              }
            }

            outer.appendChild(clone);

            // In case of custom fonts we need to fetch font first, and then inline
            // its url into data-uri format (encode as base64). That's why style
            // processing is done asynchonously. Once all inlining is finshed
            // cssLoadedCallback() is called.
            styles(el, options, cssLoadedCallback);

            function cssLoadedCallback(css) {
              // here all fonts are inlined, so that we can render them properly.
              var s = document.createElement('style');
              s.setAttribute('type', 'text/css');
              s.innerHTML = "<![CDATA[\n" + css + "\n]]>";
              var defs = document.createElement('defs');
              defs.appendChild(s);
              clone.insertBefore(defs, clone.firstChild);

              if (cb) {
                var outHtml = outer.innerHTML;
                outHtml = outHtml.replace(/NS\d+:href/gi, 'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');
                cb(outHtml, width, height);
              }
            }
          });
        };

        out$.svgAsDataUri = function (el, options, cb) {
          out$.prepareSvg(el, options, function (svg) {
            var uri = 'data:image/svg+xml;base64,' + window.btoa(reEncode(doctype + svg));
            if (cb) {
              cb(uri);
            }
          });
        };

        out$.svgAsPngUri = function (el, options, cb) {
          requireDomNode(el);

          options = options || {};
          options.encoderType = options.encoderType || 'image/png';
          options.encoderOptions = options.encoderOptions || 0.8;

          var convertToPng = function convertToPng(src, w, h) {
            var canvas = document.createElement('canvas');
            var context = canvas.getContext('2d');
            canvas.width = w;
            canvas.height = h;

            if (options.canvg) {
              options.canvg(canvas, src);
            } else {
              context.drawImage(src, 0, 0);
            }

            if (options.backgroundColor) {
              context.globalCompositeOperation = 'destination-over';
              context.fillStyle = options.backgroundColor;
              context.fillRect(0, 0, canvas.width, canvas.height);
            }

            var png;
            try {
              png = canvas.toDataURL(options.encoderType, options.encoderOptions);
            } catch (e) {
              if (typeof SecurityError !== 'undefined' && e instanceof SecurityError || e.name == "SecurityError") {
                console.error("Rendered SVG images cannot be downloaded in this browser.");
                return;
              } else {
                throw e;
              }
            }
            cb(png);
          };

          if (options.canvg) {
            out$.prepareSvg(el, options, convertToPng);
          } else {
            out$.svgAsDataUri(el, options, function (uri) {
              var image = new Image();

              image.onload = function () {
                convertToPng(image, image.width, image.height);
              };

              image.onerror = function () {
                console.error('There was an error loading the data URI as an image on the following SVG\n', window.atob(uri.slice(26)), '\n', "Open the following link to see browser's diagnosis\n", uri);
              };

              image.src = uri;
            });
          }
        };

        out$.download = function (name, uri) {
          if (navigator.msSaveOrOpenBlob) {
            navigator.msSaveOrOpenBlob(uriToBlob(uri), name);
          } else {
            var saveLink = document.createElement('a');
            var downloadSupported = 'download' in saveLink;
            if (downloadSupported) {
              saveLink.download = name;
              saveLink.style.display = 'none';
              document.body.appendChild(saveLink);
              try {
                var blob = uriToBlob(uri);
                var url = URL.createObjectURL(blob);
                saveLink.href = url;
                saveLink.onclick = function () {
                  requestAnimationFrame(function () {
                    URL.revokeObjectURL(url);
                  });
                };
              } catch (e) {
                console.warn('This browser does not support object URLs. Falling back to string URL.');
                saveLink.href = uri;
              }
              saveLink.click();
              document.body.removeChild(saveLink);
            } else {
              window.open(uri, '_temp', 'menubar=no,toolbar=no,status=no');
            }
          }
        };

        function uriToBlob(uri) {
          var byteString = window.atob(uri.split(',')[1]);
          var mimeString = uri.split(',')[0].split(':')[1].split(';')[0];
          var buffer = new ArrayBuffer(byteString.length);
          var intArray = new Uint8Array(buffer);
          for (var i = 0; i < byteString.length; i++) {
            intArray[i] = byteString.charCodeAt(i);
          }
          return new Blob([buffer], { type: mimeString });
        }

        out$.saveSvg = function (el, name, options) {
          requireDomNode(el);

          options = options || {};
          out$.svgAsDataUri(el, options, function (uri) {
            out$.download(name, uri);
          });
        };

        out$.saveSvgAsPng = function (el, name, options) {
          requireDomNode(el);

          options = options || {};
          out$.svgAsPngUri(el, options, function (uri) {
            out$.download(name, uri);
          });
        };

        // if define is defined create as an AMD module
        if (true) {
          !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {
            return out$;
          }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
        }
      })();

      /***/
    },
    /* 30 */
    /***/function (module, exports, __webpack_require__) {

      "use strict";

      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.default = undefined;

      var _createClass = function () {
        function defineProperties(target, props) {
          for (var i = 0; i < props.length; i++) {
            var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
          }
        }return function (Constructor, protoProps, staticProps) {
          if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
        };
      }();

      var _dec, _desc, _value, _class;

      var _renderer = __webpack_require__(0);

      var _renderer2 = _interopRequireDefault(_renderer);

      var _dataDecorator = __webpack_require__(1);

      function _interopRequireDefault(obj) {
        return obj && obj.__esModule ? obj : { default: obj };
      }

      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }

      function _possibleConstructorReturn(self, call) {
        if (!self) {
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self;
      }

      function _inherits(subClass, superClass) {
        if (typeof superClass !== "function" && superClass !== null) {
          throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass)));
        }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
      }

      function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
          desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
          desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
          return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
          desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
          desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
          Object['define' + 'Property'](target, property, desc);
          desc = null;
        }

        return desc;
      }

      /* global d3 */

      var Message = (_dec = (0, _dataDecorator.requires)('canvas.messages'), (_class = function (_Renderer) {
        _inherits(Message, _Renderer);

        function Message(_ref) {
          var _ref$verbose = _ref.verbose,
              verbose = _ref$verbose === undefined ? false : _ref$verbose,
              appendTo = _ref.appendTo,
              callbackHandler = _ref.callbackHandler;

          _classCallCheck(this, Message);

          return _possibleConstructorReturn(this, (Message.__proto__ || Object.getPrototypeOf(Message)).call(this, { verbose: verbose, appendTo: appendTo, callbackHandler: callbackHandler }));
        }

        _createClass(Message, [{
          key: 'render',
          value: function render() {
            var _this2 = this;

            var messages = Object.keys(this.data.canvas.messages).map(function (key) {
              return {
                id: key,
                type: _this2.data.canvas.messages[key].type,
                title: _this2.data.canvas.messages[key].title,
                text: _this2.data.canvas.messages[key].text
              };
            });

            var alertsId = 'Messages-' + this.data.canvas.id;
            this.element = d3.select('#' + alertsId);
            // check if the div is already present
            if (!this.element.node()) {
              this.element = this.parent.append('div').attr('class', 'francy-message-holder').attr('id', alertsId);
            }

            var message = this.element.selectAll('div.francy-alert').data(messages, function (d) {
              return d.id;
            });
            var messageEnter = message.enter().append('div').attr('id', function (d) {
              return d.id;
            }).attr('class', function (d) {
              return 'francy-alert alert-' + d.type;
            }).on('click', function () {
              d3.select(this).style('display', 'none');
            });
            messageEnter.append('span').attr('class', 'strong').text(function (d) {
              return d.title;
            });
            messageEnter.append('span').text(function (d) {
              return d.text;
            });
            messageEnter.append('span').attr('class', 'strong closeme').style('display', 'none').text('x');

            messageEnter.merge(message);

            message.exit().remove();

            this.element.style('display', 'block');

            // render mathjax
            this.mathjax.settings({ appendTo: this }).renderHTML();

            return this;
          }
        }, {
          key: 'unrender',
          value: function unrender() {}
        }]);

        return Message;
      }(_renderer2.default), _applyDecoratedDescriptor(_class.prototype, 'render', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'render'), _class.prototype), _class));
      exports.default = Message;

      /***/
    }]
    /******/)
  );
}.call(exports, __webpack_require__, exports, module),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));;

/***/ })
/******/ ])});;
//# sourceMappingURL=francy.js.map