@mui/x-charts
Version:
The community edition of the Charts components (MUI X).
39 lines (37 loc) • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HighlightedContext = void 0;
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
/**
* The data of the highlighted item.
* To highlight an item, you need to provide the series id and the item id.
* If targeting the whole series, you can omit the item id.
* To clear the highlight, set the value to an empty object.
*
* @example
* // Highlight the item with the series id 'london' and the item id 0.
* { seriesId: 'london', dataIndex: 0 }
*
* // Highlight the whole series with the series id 'london'.
* { seriesId: 'london' }
*
* // Clear the highlight.
* {}
*/
const HighlightedContext = exports.HighlightedContext = /*#__PURE__*/React.createContext({
isInitialized: false,
data: {
highlightedItem: null,
setHighlighted: () => {},
clearHighlighted: () => {},
isHighlighted: () => false,
isFaded: () => false
}
});
if (process.env.NODE_ENV !== 'production') {
HighlightedContext.displayName = 'HighlightedContext';
}