@uiw/react-heat-map
Version:
React component create calendar heatmap to visualize time series data, a la github contribution graph.
29 lines (28 loc) • 1.04 kB
JavaScript
import React, { Fragment, useMemo } from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
export var LablesWeek = function LablesWeek(_ref) {
var _ref$weekLables = _ref.weekLables,
weekLables = _ref$weekLables === void 0 ? [] : _ref$weekLables,
_ref$rectSize = _ref.rectSize,
rectSize = _ref$rectSize === void 0 ? 0 : _ref$rectSize,
_ref$topPad = _ref.topPad,
topPad = _ref$topPad === void 0 ? 0 : _ref$topPad,
_ref$space = _ref.space,
space = _ref$space === void 0 ? 0 : _ref$space;
return useMemo(function () {
return /*#__PURE__*/_jsx(Fragment, {
children: [].concat(Array(7)).map(function (_, idx) {
if (weekLables && weekLables[idx]) {
return /*#__PURE__*/_jsx("text", {
x: 15,
y: topPad,
dy: (idx + 1) * (rectSize + space) - 5,
children: weekLables[idx]
}, idx);
}
return null;
})
});
}, [rectSize, space, topPad, weekLables]);
};
//# sourceMappingURL=LablesWeek.js.map