Socket
Socket
Sign inDemoInstall

@nivo/heatmap

Package Overview
Dependencies
49
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.54.0 to 0.55.0

129

dist/nivo-heatmap.cjs.js

@@ -29,3 +29,2 @@ 'use strict';

getIndex: PropTypes.func.isRequired,
// computed
keys: PropTypes.arrayOf(PropTypes.string).isRequired,

@@ -42,3 +41,2 @@ minValue: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,

getCellBorderColor: PropTypes.func.isRequired,
// computed
axisTop: axes.axisPropType,

@@ -53,6 +51,4 @@ axisRight: axes.axisPropType,

getLabelTextColor: PropTypes.func.isRequired,
// computed
colors: core.quantizeColorScalePropType.isRequired,
colorScale: PropTypes.func.isRequired,
// computed
nanColor: PropTypes.string,

@@ -75,3 +71,2 @@ isInteractive: PropTypes.bool,

padding: 0,
// cells
cellShape: 'rect',

@@ -81,3 +76,2 @@ cellOpacity: 0.85,

cellBorderColor: 'inherit',
// axes & grid
axisTop: {},

@@ -87,9 +81,6 @@ axisLeft: {},

enableGridY: false,
// labels
enableLabels: true,
labelTextColor: 'inherit:darker(1.4)',
// theming
colors: 'nivo',
nanColor: '#000000',
// interactivity
isInteractive: true,

@@ -100,3 +91,2 @@ onClick: core.noop,

cellHoverOthersOpacity: 0.35,
// canvas specific
pixelRatio: global.window && global.window.devicePixelRatio ? global.window.devicePixelRatio : 1

@@ -153,7 +143,5 @@ };

var opacity = cellOpacity;
if (currentNode) {
opacity = isHoverTarget(node, currentNode) ? cellHoverOpacity : cellHoverOthersOpacity;
}
acc.push(Object.assign(node, {

@@ -171,7 +159,5 @@ labelTextColor: getLabelTextColor(node),

};
var computeY = function computeY(row, cellHeight, padding) {
return row * cellHeight + cellHeight * 0.5 + padding * row + padding;
};
var enhance = (function (Component) {

@@ -201,3 +187,2 @@ return compose(defaultProps(HeatMapDefaultProps), withState('currentNode', 'setCurrentNode', null), core.withTheme(), core.withDimensions(), core.withMotion(), withPropsOnChange(['colors'], function (_ref) {

var offsetY = 0;
if (forceSquare === true) {

@@ -210,3 +195,2 @@ var cellSize = Math.min(cellWidth, cellHeight);

}
return {

@@ -247,3 +231,2 @@ cellWidth: cellWidth,

var maxValue = _maxValue;
if (minValue === 'auto' || maxValue === 'auto') {

@@ -258,3 +241,2 @@ var allValues = data.reduce(function (acc, row) {

}
return {

@@ -276,7 +258,5 @@ minValue: Math.min(minValue, maxValue),

var sizeScale;
if (sizeVariation > 0) {
sizeScale = d3Scale.scaleLinear().range([1 - sizeVariation, 1]).domain([minValue, maxValue]);
}
return {

@@ -299,3 +279,2 @@ sizeScale: sizeScale

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -305,3 +284,2 @@ var style = {

};
var HeatMapCellRect = function HeatMapCellRect(_ref) {

@@ -352,3 +330,2 @@ var data = _ref.data,

};
HeatMapCellRect.propTypes = {

@@ -375,3 +352,2 @@ data: PropTypes.object.isRequired,

function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -381,3 +357,2 @@ var style$1 = {

};
var HeatMapCellCircle = function HeatMapCellCircle(_ref) {

@@ -425,3 +400,2 @@ var data = _ref.data,

};
HeatMapCellCircle.propTypes = {

@@ -448,5 +422,3 @@ data: PropTypes.object.isRequired,

function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } return target; }
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCellTooltip = function HeatMapCellTooltip(_ref) {

@@ -467,3 +439,2 @@ var node = _ref.node,

};
HeatMapCellTooltip.propTypes = {

@@ -488,43 +459,24 @@ node: PropTypes.shape({

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMap =
/*#__PURE__*/
function (_Component) {
_inherits(HeatMap, _Component);
function HeatMap() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, HeatMap);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HeatMap)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$3(_assertThisInitialized(_this), "handleNodeHover", function (showTooltip, node, event) {

@@ -544,12 +496,8 @@ var _this$props = _this.props,

});
_defineProperty$3(_assertThisInitialized(_this), "handleNodeLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
return _this;
}
_createClass(HeatMap, [{

@@ -559,3 +507,2 @@ key: "render",

var _this2 = this;
var _this$props2 = this.props,

@@ -590,3 +537,2 @@ xScale = _this$props2.xScale,

var Cell;
if (cellShape === 'rect') {

@@ -599,3 +545,2 @@ Cell = HeatMapCellRect$1;

}
var nodes = computeNodes(this.props);

@@ -710,24 +655,7 @@ var motionProps = {

}]);
return HeatMap;
}(React.Component);
_defineProperty$3(HeatMap, "propTypes", HeatMapPropTypes);
var HeatMap$1 = setDisplayName('HeatMap')(enhance(HeatMap));
/**
* Render heatmap rect cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderRect = function renderRect(ctx, _ref, _ref2) {

@@ -748,3 +676,2 @@ var enableLabels = _ref.enableLabels,

ctx.fillRect(x - width / 2, y - height / 2, width, height);
if (enableLabels === true) {

@@ -755,20 +682,4 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();
};
/**
* Render heatmap circle cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderCircle = function renderCircle(ctx, _ref3, _ref4) {

@@ -792,3 +703,2 @@ var enableLabels = _ref3.enableLabels,

ctx.fill();
if (enableLabels === true) {

@@ -799,3 +709,2 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();

@@ -805,50 +714,28 @@ };

function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties$1(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); } }
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCanvas =
/*#__PURE__*/
function (_Component) {
_inherits$1(HeatMapCanvas, _Component);
function HeatMapCanvas() {
var _getPrototypeOf2;
var _this;
_classCallCheck$1(this, HeatMapCanvas);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn$1(this, (_getPrototypeOf2 = _getPrototypeOf$1(HeatMapCanvas)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseHover", function (showTooltip, hideTooltip, event) {
if (!_this.nodes) return;
var _getRelativeCursor = core.getRelativeCursor(_this.surface, event),

@@ -858,3 +745,2 @@ _getRelativeCursor2 = _slicedToArray(_getRelativeCursor, 2),

y = _getRelativeCursor2[1];
var _this$props = _this.props,

@@ -867,7 +753,5 @@ margin = _this$props.margin,

tooltip = _this$props.tooltip;
var node = _this.nodes.find(function (node) {
return core.isCursorInRect(node.x + margin.left + offsetX - node.width / 2, node.y + margin.top + offsetY - node.height / 2, node.width, node.height, x, y);
});
if (node !== undefined) {

@@ -885,18 +769,12 @@ setCurrentNode(node);

});
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
_defineProperty$4(_assertThisInitialized$1(_this), "handleClick", function (event) {
if (!_this.props.currentNode) return;
_this.props.onClick(_this.props.currentNode, event);
});
return _this;
}
_createClass$1(HeatMapCanvas, [{

@@ -948,3 +826,2 @@ key: "componentDidMount",

var renderNode;
if (cellShape === 'rect') {

@@ -961,3 +838,2 @@ renderNode = partial(renderRect, this.ctx, {

}
var nodes = computeNodes(props);

@@ -987,3 +863,2 @@ this.ctx.fillStyle = theme.background;

var _this2 = this;
var _this$props2 = this.props,

@@ -1019,6 +894,4 @@ outerWidth = _this$props2.outerWidth,

}]);
return HeatMapCanvas;
}(React.Component);
HeatMapCanvas.propTypes = HeatMapPropTypes;

@@ -1028,3 +901,2 @@ var HeatMapCanvas$1 = enhance(HeatMapCanvas);

function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
var ResponsiveHeatMap = function ResponsiveHeatMap(props) {

@@ -1042,3 +914,2 @@ return React__default.createElement(core.ResponsiveWrapper, null, function (_ref) {

function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
var ResponsiveHeatMapCanvas = function ResponsiveHeatMapCanvas(props) {

@@ -1045,0 +916,0 @@ return React__default.createElement(core.ResponsiveWrapper, null, function (_ref) {

@@ -22,3 +22,2 @@ import React, { Component } from 'react';

getIndex: PropTypes.func.isRequired,
// computed
keys: PropTypes.arrayOf(PropTypes.string).isRequired,

@@ -35,3 +34,2 @@ minValue: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,

getCellBorderColor: PropTypes.func.isRequired,
// computed
axisTop: axisPropType,

@@ -46,6 +44,4 @@ axisRight: axisPropType,

getLabelTextColor: PropTypes.func.isRequired,
// computed
colors: quantizeColorScalePropType.isRequired,
colorScale: PropTypes.func.isRequired,
// computed
nanColor: PropTypes.string,

@@ -68,3 +64,2 @@ isInteractive: PropTypes.bool,

padding: 0,
// cells
cellShape: 'rect',

@@ -74,3 +69,2 @@ cellOpacity: 0.85,

cellBorderColor: 'inherit',
// axes & grid
axisTop: {},

@@ -80,9 +74,6 @@ axisLeft: {},

enableGridY: false,
// labels
enableLabels: true,
labelTextColor: 'inherit:darker(1.4)',
// theming
colors: 'nivo',
nanColor: '#000000',
// interactivity
isInteractive: true,

@@ -93,3 +84,2 @@ onClick: noop,

cellHoverOthersOpacity: 0.35,
// canvas specific
pixelRatio: global.window && global.window.devicePixelRatio ? global.window.devicePixelRatio : 1

@@ -146,7 +136,5 @@ };

var opacity = cellOpacity;
if (currentNode) {
opacity = isHoverTarget(node, currentNode) ? cellHoverOpacity : cellHoverOthersOpacity;
}
acc.push(Object.assign(node, {

@@ -164,7 +152,5 @@ labelTextColor: getLabelTextColor(node),

};
var computeY = function computeY(row, cellHeight, padding) {
return row * cellHeight + cellHeight * 0.5 + padding * row + padding;
};
var enhance = (function (Component) {

@@ -194,3 +180,2 @@ return compose(defaultProps(HeatMapDefaultProps), withState('currentNode', 'setCurrentNode', null), withTheme(), withDimensions(), withMotion(), withPropsOnChange(['colors'], function (_ref) {

var offsetY = 0;
if (forceSquare === true) {

@@ -203,3 +188,2 @@ var cellSize = Math.min(cellWidth, cellHeight);

}
return {

@@ -240,3 +224,2 @@ cellWidth: cellWidth,

var maxValue = _maxValue;
if (minValue === 'auto' || maxValue === 'auto') {

@@ -251,3 +234,2 @@ var allValues = data.reduce(function (acc, row) {

}
return {

@@ -269,7 +251,5 @@ minValue: Math.min(minValue, maxValue),

var sizeScale;
if (sizeVariation > 0) {
sizeScale = scaleLinear().range([1 - sizeVariation, 1]).domain([minValue, maxValue]);
}
return {

@@ -292,3 +272,2 @@ sizeScale: sizeScale

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -298,3 +277,2 @@ var style = {

};
var HeatMapCellRect = function HeatMapCellRect(_ref) {

@@ -345,3 +323,2 @@ var data = _ref.data,

};
HeatMapCellRect.propTypes = {

@@ -368,3 +345,2 @@ data: PropTypes.object.isRequired,

function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -374,3 +350,2 @@ var style$1 = {

};
var HeatMapCellCircle = function HeatMapCellCircle(_ref) {

@@ -418,3 +393,2 @@ var data = _ref.data,

};
HeatMapCellCircle.propTypes = {

@@ -441,5 +415,3 @@ data: PropTypes.object.isRequired,

function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } return target; }
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCellTooltip = function HeatMapCellTooltip(_ref) {

@@ -460,3 +432,2 @@ var node = _ref.node,

};
HeatMapCellTooltip.propTypes = {

@@ -481,43 +452,24 @@ node: PropTypes.shape({

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMap =
/*#__PURE__*/
function (_Component) {
_inherits(HeatMap, _Component);
function HeatMap() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, HeatMap);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HeatMap)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$3(_assertThisInitialized(_this), "handleNodeHover", function (showTooltip, node, event) {

@@ -537,12 +489,8 @@ var _this$props = _this.props,

});
_defineProperty$3(_assertThisInitialized(_this), "handleNodeLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
return _this;
}
_createClass(HeatMap, [{

@@ -552,3 +500,2 @@ key: "render",

var _this2 = this;
var _this$props2 = this.props,

@@ -583,3 +530,2 @@ xScale = _this$props2.xScale,

var Cell;
if (cellShape === 'rect') {

@@ -592,3 +538,2 @@ Cell = HeatMapCellRect$1;

}
var nodes = computeNodes(this.props);

@@ -703,24 +648,7 @@ var motionProps = {

}]);
return HeatMap;
}(Component);
_defineProperty$3(HeatMap, "propTypes", HeatMapPropTypes);
var HeatMap$1 = setDisplayName('HeatMap')(enhance(HeatMap));
/**
* Render heatmap rect cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderRect = function renderRect(ctx, _ref, _ref2) {

@@ -741,3 +669,2 @@ var enableLabels = _ref.enableLabels,

ctx.fillRect(x - width / 2, y - height / 2, width, height);
if (enableLabels === true) {

@@ -748,20 +675,4 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();
};
/**
* Render heatmap circle cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderCircle = function renderCircle(ctx, _ref3, _ref4) {

@@ -785,3 +696,2 @@ var enableLabels = _ref3.enableLabels,

ctx.fill();
if (enableLabels === true) {

@@ -792,3 +702,2 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();

@@ -798,50 +707,28 @@ };

function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties$1(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); } }
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCanvas =
/*#__PURE__*/
function (_Component) {
_inherits$1(HeatMapCanvas, _Component);
function HeatMapCanvas() {
var _getPrototypeOf2;
var _this;
_classCallCheck$1(this, HeatMapCanvas);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn$1(this, (_getPrototypeOf2 = _getPrototypeOf$1(HeatMapCanvas)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseHover", function (showTooltip, hideTooltip, event) {
if (!_this.nodes) return;
var _getRelativeCursor = getRelativeCursor(_this.surface, event),

@@ -851,3 +738,2 @@ _getRelativeCursor2 = _slicedToArray(_getRelativeCursor, 2),

y = _getRelativeCursor2[1];
var _this$props = _this.props,

@@ -860,7 +746,5 @@ margin = _this$props.margin,

tooltip = _this$props.tooltip;
var node = _this.nodes.find(function (node) {
return isCursorInRect(node.x + margin.left + offsetX - node.width / 2, node.y + margin.top + offsetY - node.height / 2, node.width, node.height, x, y);
});
if (node !== undefined) {

@@ -878,18 +762,12 @@ setCurrentNode(node);

});
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
_defineProperty$4(_assertThisInitialized$1(_this), "handleClick", function (event) {
if (!_this.props.currentNode) return;
_this.props.onClick(_this.props.currentNode, event);
});
return _this;
}
_createClass$1(HeatMapCanvas, [{

@@ -941,3 +819,2 @@ key: "componentDidMount",

var renderNode;
if (cellShape === 'rect') {

@@ -954,3 +831,2 @@ renderNode = partial(renderRect, this.ctx, {

}
var nodes = computeNodes(props);

@@ -980,3 +856,2 @@ this.ctx.fillStyle = theme.background;

var _this2 = this;
var _this$props2 = this.props,

@@ -1012,6 +887,4 @@ outerWidth = _this$props2.outerWidth,

}]);
return HeatMapCanvas;
}(Component);
HeatMapCanvas.propTypes = HeatMapPropTypes;

@@ -1021,3 +894,2 @@ var HeatMapCanvas$1 = enhance(HeatMapCanvas);

function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
var ResponsiveHeatMap = function ResponsiveHeatMap(props) {

@@ -1035,3 +907,2 @@ return React.createElement(ResponsiveWrapper, null, function (_ref) {

function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
var ResponsiveHeatMapCanvas = function ResponsiveHeatMapCanvas(props) {

@@ -1038,0 +909,0 @@ return React.createElement(ResponsiveWrapper, null, function (_ref) {

@@ -24,3 +24,2 @@ (function (global, factory) {

getIndex: PropTypes.func.isRequired,
// computed
keys: PropTypes.arrayOf(PropTypes.string).isRequired,

@@ -37,3 +36,2 @@ minValue: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]).isRequired,

getCellBorderColor: PropTypes.func.isRequired,
// computed
axisTop: axes.axisPropType,

@@ -48,6 +46,4 @@ axisRight: axes.axisPropType,

getLabelTextColor: PropTypes.func.isRequired,
// computed
colors: core.quantizeColorScalePropType.isRequired,
colorScale: PropTypes.func.isRequired,
// computed
nanColor: PropTypes.string,

@@ -70,3 +66,2 @@ isInteractive: PropTypes.bool,

padding: 0,
// cells
cellShape: 'rect',

@@ -76,3 +71,2 @@ cellOpacity: 0.85,

cellBorderColor: 'inherit',
// axes & grid
axisTop: {},

@@ -82,9 +76,6 @@ axisLeft: {},

enableGridY: false,
// labels
enableLabels: true,
labelTextColor: 'inherit:darker(1.4)',
// theming
colors: 'nivo',
nanColor: '#000000',
// interactivity
isInteractive: true,

@@ -95,3 +86,2 @@ onClick: core.noop,

cellHoverOthersOpacity: 0.35,
// canvas specific
pixelRatio: global.window && global.window.devicePixelRatio ? global.window.devicePixelRatio : 1

@@ -148,7 +138,5 @@ };

var opacity = cellOpacity;
if (currentNode) {
opacity = isHoverTarget(node, currentNode) ? cellHoverOpacity : cellHoverOthersOpacity;
}
acc.push(Object.assign(node, {

@@ -166,7 +154,5 @@ labelTextColor: getLabelTextColor(node),

};
var computeY = function computeY(row, cellHeight, padding) {
return row * cellHeight + cellHeight * 0.5 + padding * row + padding;
};
var enhance = (function (Component) {

@@ -196,3 +182,2 @@ return compose(defaultProps(HeatMapDefaultProps), withState('currentNode', 'setCurrentNode', null), core.withTheme(), core.withDimensions(), core.withMotion(), withPropsOnChange(['colors'], function (_ref) {

var offsetY = 0;
if (forceSquare === true) {

@@ -205,3 +190,2 @@ var cellSize = Math.min(cellWidth, cellHeight);

}
return {

@@ -242,3 +226,2 @@ cellWidth: cellWidth,

var maxValue = _maxValue;
if (minValue === 'auto' || maxValue === 'auto') {

@@ -253,3 +236,2 @@ var allValues = data.reduce(function (acc, row) {

}
return {

@@ -271,7 +253,5 @@ minValue: Math.min(minValue, maxValue),

var sizeScale;
if (sizeVariation > 0) {
sizeScale = d3Scale.scaleLinear().range([1 - sizeVariation, 1]).domain([minValue, maxValue]);
}
return {

@@ -294,3 +274,2 @@ sizeScale: sizeScale

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -300,3 +279,2 @@ var style = {

};
var HeatMapCellRect = function HeatMapCellRect(_ref) {

@@ -347,3 +325,2 @@ var data = _ref.data,

};
HeatMapCellRect.propTypes = {

@@ -370,3 +347,2 @@ data: PropTypes.object.isRequired,

function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

@@ -376,3 +352,2 @@ var style$1 = {

};
var HeatMapCellCircle = function HeatMapCellCircle(_ref) {

@@ -420,3 +395,2 @@ var data = _ref.data,

};
HeatMapCellCircle.propTypes = {

@@ -443,5 +417,3 @@ data: PropTypes.object.isRequired,

function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } return target; }
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCellTooltip = function HeatMapCellTooltip(_ref) {

@@ -462,3 +434,2 @@ var node = _ref.node,

};
HeatMapCellTooltip.propTypes = {

@@ -483,43 +454,24 @@ node: PropTypes.shape({

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMap =
/*#__PURE__*/
function (_Component) {
_inherits(HeatMap, _Component);
function HeatMap() {
var _getPrototypeOf2;
var _this;
_classCallCheck(this, HeatMap);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(HeatMap)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$3(_assertThisInitialized(_this), "handleNodeHover", function (showTooltip, node, event) {

@@ -539,12 +491,8 @@ var _this$props = _this.props,

});
_defineProperty$3(_assertThisInitialized(_this), "handleNodeLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
return _this;
}
_createClass(HeatMap, [{

@@ -554,3 +502,2 @@ key: "render",

var _this2 = this;
var _this$props2 = this.props,

@@ -585,3 +532,2 @@ xScale = _this$props2.xScale,

var Cell;
if (cellShape === 'rect') {

@@ -594,3 +540,2 @@ Cell = HeatMapCellRect$1;

}
var nodes = computeNodes(this.props);

@@ -705,24 +650,7 @@ var motionProps = {

}]);
return HeatMap;
}(React.Component);
_defineProperty$3(HeatMap, "propTypes", HeatMapPropTypes);
var HeatMap$1 = setDisplayName('HeatMap')(enhance(HeatMap));
/**
* Render heatmap rect cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderRect = function renderRect(ctx, _ref, _ref2) {

@@ -743,3 +671,2 @@ var enableLabels = _ref.enableLabels,

ctx.fillRect(x - width / 2, y - height / 2, width, height);
if (enableLabels === true) {

@@ -750,20 +677,4 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();
};
/**
* Render heatmap circle cell.
*
* @param {Object} ctx
* @param {boolean} enableLabels
* @param {number} x
* @param {number} y
* @param {number} width
* @param {number} height
* @param {string) color
* @param {number} opacity
* @param {string} labelTextColor
* @param {number} value
*/
var renderCircle = function renderCircle(ctx, _ref3, _ref4) {

@@ -787,3 +698,2 @@ var enableLabels = _ref3.enableLabels,

ctx.fill();
if (enableLabels === true) {

@@ -794,3 +704,2 @@ ctx.fillStyle = labelTextColor;

}
ctx.restore();

@@ -800,50 +709,28 @@ };

function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties$1(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); } }
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var HeatMapCanvas =
/*#__PURE__*/
function (_Component) {
_inherits$1(HeatMapCanvas, _Component);
function HeatMapCanvas() {
var _getPrototypeOf2;
var _this;
_classCallCheck$1(this, HeatMapCanvas);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _possibleConstructorReturn$1(this, (_getPrototypeOf2 = _getPrototypeOf$1(HeatMapCanvas)).call.apply(_getPrototypeOf2, [this].concat(args)));
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseHover", function (showTooltip, hideTooltip, event) {
if (!_this.nodes) return;
var _getRelativeCursor = core.getRelativeCursor(_this.surface, event),

@@ -853,3 +740,2 @@ _getRelativeCursor2 = _slicedToArray(_getRelativeCursor, 2),

y = _getRelativeCursor2[1];
var _this$props = _this.props,

@@ -862,7 +748,5 @@ margin = _this$props.margin,

tooltip = _this$props.tooltip;
var node = _this.nodes.find(function (node) {
return core.isCursorInRect(node.x + margin.left + offsetX - node.width / 2, node.y + margin.top + offsetY - node.height / 2, node.width, node.height, x, y);
});
if (node !== undefined) {

@@ -880,18 +764,12 @@ setCurrentNode(node);

});
_defineProperty$4(_assertThisInitialized$1(_this), "handleMouseLeave", function (hideTooltip) {
_this.props.setCurrentNode(null);
hideTooltip();
});
_defineProperty$4(_assertThisInitialized$1(_this), "handleClick", function (event) {
if (!_this.props.currentNode) return;
_this.props.onClick(_this.props.currentNode, event);
});
return _this;
}
_createClass$1(HeatMapCanvas, [{

@@ -943,3 +821,2 @@ key: "componentDidMount",

var renderNode;
if (cellShape === 'rect') {

@@ -956,3 +833,2 @@ renderNode = partial(renderRect, this.ctx, {

}
var nodes = computeNodes(props);

@@ -982,3 +858,2 @@ this.ctx.fillStyle = theme.background;

var _this2 = this;
var _this$props2 = this.props,

@@ -1014,6 +889,4 @@ outerWidth = _this$props2.outerWidth,

}]);
return HeatMapCanvas;
}(React.Component);
HeatMapCanvas.propTypes = HeatMapPropTypes;

@@ -1023,3 +896,2 @@ var HeatMapCanvas$1 = enhance(HeatMapCanvas);

function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
var ResponsiveHeatMap = function ResponsiveHeatMap(props) {

@@ -1037,3 +909,2 @@ return React__default.createElement(core.ResponsiveWrapper, null, function (_ref) {

function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
var ResponsiveHeatMapCanvas = function ResponsiveHeatMapCanvas(props) {

@@ -1040,0 +911,0 @@ return React__default.createElement(core.ResponsiveWrapper, null, function (_ref) {

8

package.json
{
"name": "@nivo/heatmap",
"version": "0.54.0",
"version": "0.55.0",
"license": "MIT",

@@ -26,4 +26,4 @@ "author": {

"dependencies": {
"@nivo/axes": "0.54.0",
"@nivo/core": "0.54.0",
"@nivo/axes": "0.55.0",
"@nivo/core": "0.55.0",
"d3-scale": "^2.1.2",

@@ -41,3 +41,3 @@ "lodash": "^4.17.4",

},
"gitHead": "986ed09fcf437e3e1b61b779b59bde7426e3faea"
"gitHead": "4c4cbde54f3a954016a0d6a417a9a25a6e18e8f1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc