@hitachivantara/uikit-react-viz 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Barchart/Barchart.js +45 -72
- package/dist/Barchart/Barchart.js.map +1 -1
- package/dist/Barchart/barchartPlotlyOverrides.js +1 -13
- package/dist/Barchart/barchartPlotlyOverrides.js.map +1 -1
- package/dist/Barchart/index.js +0 -2
- package/dist/Barchart/index.js.map +1 -1
- package/dist/Barchart/styles.js.map +1 -1
- package/dist/Chart/Chart.d.ts +1 -1
- package/dist/Chart/Chart.js +28 -75
- package/dist/Chart/Chart.js.map +1 -1
- package/dist/Chart/Plot/Plot.js +10 -47
- package/dist/Chart/Plot/Plot.js.map +1 -1
- package/dist/Chart/Plot/index.js +0 -2
- package/dist/Chart/Plot/index.js.map +1 -1
- package/dist/Chart/Plot/styles.js.map +1 -1
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js +1 -36
- package/dist/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
- package/dist/Chart/Tooltip/MultiTooltip/index.js +0 -2
- package/dist/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
- package/dist/Chart/Tooltip/MultiTooltip/styles.js +0 -2
- package/dist/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js +2 -26
- package/dist/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
- package/dist/Chart/Tooltip/SingleTooltip/index.js +0 -2
- package/dist/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
- package/dist/Chart/Tooltip/SingleTooltip/styles.js +0 -2
- package/dist/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
- package/dist/Chart/Tooltip/Tooltip.js +16 -51
- package/dist/Chart/Tooltip/Tooltip.js.map +1 -1
- package/dist/Chart/Tooltip/index.js +0 -2
- package/dist/Chart/Tooltip/index.js.map +1 -1
- package/dist/Chart/Tooltip/styles.js.map +1 -1
- package/dist/Chart/chartPlotlyOverrides.js +9 -33
- package/dist/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/Chart/index.js +0 -2
- package/dist/Chart/index.js.map +1 -1
- package/dist/Chart/styles.js +0 -13
- package/dist/Chart/styles.js.map +1 -1
- package/dist/Donutchart/Donutchart.js +10 -47
- package/dist/Donutchart/Donutchart.js.map +1 -1
- package/dist/Donutchart/donutchartPlotlyOverrides.js +1 -13
- package/dist/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
- package/dist/Donutchart/index.js +0 -2
- package/dist/Donutchart/index.js.map +1 -1
- package/dist/Donutchart/styles.js.map +1 -1
- package/dist/Linechart/Linechart.js +12 -50
- package/dist/Linechart/Linechart.js.map +1 -1
- package/dist/Linechart/index.js +0 -2
- package/dist/Linechart/index.js.map +1 -1
- package/dist/Linechart/lineChartPlotlyOverrides.js +1 -17
- package/dist/Linechart/lineChartPlotlyOverrides.js.map +1 -1
- package/dist/Linechart/styles.js.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy/Barchart/Barchart.js +45 -43
- package/dist/legacy/Barchart/Barchart.js.map +1 -1
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js +1 -6
- package/dist/legacy/Barchart/barchartPlotlyOverrides.js.map +1 -1
- package/dist/legacy/Barchart/index.js.map +1 -1
- package/dist/legacy/Barchart/styles.js.map +1 -1
- package/dist/legacy/Chart/Chart.d.ts +1 -1
- package/dist/legacy/Chart/Chart.js +28 -46
- package/dist/legacy/Chart/Chart.js.map +1 -1
- package/dist/legacy/Chart/Plot/Plot.js +10 -21
- package/dist/legacy/Chart/Plot/Plot.js.map +1 -1
- package/dist/legacy/Chart/Plot/index.js.map +1 -1
- package/dist/legacy/Chart/Plot/styles.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js +1 -17
- package/dist/legacy/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js +0 -1
- package/dist/legacy/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js +2 -9
- package/dist/legacy/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js +0 -1
- package/dist/legacy/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/Tooltip.js +16 -30
- package/dist/legacy/Chart/Tooltip/Tooltip.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/index.js.map +1 -1
- package/dist/legacy/Chart/Tooltip/styles.js.map +1 -1
- package/dist/legacy/Chart/chartPlotlyOverrides.js +9 -20
- package/dist/legacy/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/legacy/Chart/index.js.map +1 -1
- package/dist/legacy/Chart/styles.js +0 -4
- package/dist/legacy/Chart/styles.js.map +1 -1
- package/dist/legacy/Donutchart/Donutchart.js +11 -22
- package/dist/legacy/Donutchart/Donutchart.js.map +1 -1
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js +1 -6
- package/dist/legacy/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
- package/dist/legacy/Donutchart/index.js.map +1 -1
- package/dist/legacy/Donutchart/styles.js.map +1 -1
- package/dist/legacy/Linechart/Linechart.js +13 -25
- package/dist/legacy/Linechart/Linechart.js.map +1 -1
- package/dist/legacy/Linechart/index.js.map +1 -1
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js +1 -10
- package/dist/legacy/Linechart/lineChartPlotlyOverrides.js.map +1 -1
- package/dist/legacy/Linechart/styles.js.map +1 -1
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/Barchart/Barchart.js +38 -31
- package/dist/modern/Barchart/Barchart.js.map +1 -1
- package/dist/modern/Barchart/barchartPlotlyOverrides.js +1 -6
- package/dist/modern/Barchart/barchartPlotlyOverrides.js.map +1 -1
- package/dist/modern/Barchart/index.js.map +1 -1
- package/dist/modern/Barchart/styles.js.map +1 -1
- package/dist/modern/Chart/Chart.d.ts +1 -1
- package/dist/modern/Chart/Chart.js +17 -33
- package/dist/modern/Chart/Chart.js.map +1 -1
- package/dist/modern/Chart/Plot/Plot.js +11 -22
- package/dist/modern/Chart/Plot/Plot.js.map +1 -1
- package/dist/modern/Chart/Plot/index.js.map +1 -1
- package/dist/modern/Chart/Plot/styles.js.map +1 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js +0 -17
- package/dist/modern/Chart/Tooltip/MultiTooltip/MultiTooltip.js.map +1 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/index.js.map +1 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js +0 -1
- package/dist/modern/Chart/Tooltip/MultiTooltip/styles.js.map +1 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js +0 -7
- package/dist/modern/Chart/Tooltip/SingleTooltip/SingleTooltip.js.map +1 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/index.js.map +1 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js +0 -1
- package/dist/modern/Chart/Tooltip/SingleTooltip/styles.js.map +1 -1
- package/dist/modern/Chart/Tooltip/Tooltip.js +2 -13
- package/dist/modern/Chart/Tooltip/Tooltip.js.map +1 -1
- package/dist/modern/Chart/Tooltip/index.js.map +1 -1
- package/dist/modern/Chart/Tooltip/styles.js.map +1 -1
- package/dist/modern/Chart/chartPlotlyOverrides.js +9 -20
- package/dist/modern/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/modern/Chart/index.js.map +1 -1
- package/dist/modern/Chart/styles.js +0 -4
- package/dist/modern/Chart/styles.js.map +1 -1
- package/dist/modern/Donutchart/Donutchart.js +11 -22
- package/dist/modern/Donutchart/Donutchart.js.map +1 -1
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js +1 -6
- package/dist/modern/Donutchart/donutchartPlotlyOverrides.js.map +1 -1
- package/dist/modern/Donutchart/index.js.map +1 -1
- package/dist/modern/Donutchart/styles.js.map +1 -1
- package/dist/modern/Linechart/Linechart.js +12 -24
- package/dist/modern/Linechart/Linechart.js.map +1 -1
- package/dist/modern/Linechart/index.js.map +1 -1
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js +1 -10
- package/dist/modern/Linechart/lineChartPlotlyOverrides.js.map +1 -1
- package/dist/modern/Linechart/styles.js.map +1 -1
- package/dist/modern/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":["React","useState","useMemo","useCallback","PropTypes","isNil","withStyles","useTheme","Tooltip","applyLayoutDefaults","applyConfigDefaults","Plot","styles","Chart","id","classes","data","layout","config","tooltipType","tooltip","afterPlot","xAxisTitle","yAxisTitle","others","theme","isHorizontal","orientation","toUpperCase","chartLayout","chartConfig","useSingle","isHover","setIsHover","x","y","coordinates","setCoordinates","dataTooltip","setDataTooltip","onHover","event","points","dataFromPoints","title","elements","forEach","p","i","fData","fullData","pNumber","pointNumber","name","push","color","marker","line","labels","value","onUnHover","onMouseMove","clientX","clientY","root","propTypes","string","shape","arrayOf","instanceOf","Object","isRequired","oneOf","func","subtitle"],"sources":["../../../src/Chart/Chart.js"],"sourcesContent":["import React, { useState, useMemo, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport isNil from \"lodash/isNil\";\nimport { withStyles, useTheme } from \"@mui/styles\";\n\nimport Tooltip from \"./Tooltip\";\nimport { applyLayoutDefaults, applyConfigDefaults } from \"./chartPlotlyOverrides\";\n\nimport Plot from \"./Plot\";\nimport styles from \"./styles\";\n\nconst Chart = ({\n id,\n classes,\n data,\n layout,\n config,\n tooltipType = \"multiple\",\n tooltip,\n afterPlot,\n xAxisTitle,\n yAxisTitle,\n ...others\n}) => {\n const theme = useTheme();\n\n /* Values derived from props */\n\n // Check if the barchart is horizontal or vertical.\n const isHorizontal = useMemo(\n () => (!isNil(data[0]?.orientation) ? data[0].orientation.toUpperCase() === \"H\" : false),\n [data]\n );\n\n const chartLayout = useMemo(\n () => applyLayoutDefaults(layout, theme, isHorizontal, xAxisTitle, yAxisTitle),\n [isHorizontal, layout, theme, xAxisTitle, yAxisTitle]\n );\n\n const chartConfig = useMemo(() => applyConfigDefaults(config), [config]);\n\n const useSingle = tooltipType === \"single\";\n\n /* State */\n\n const [isHover, setIsHover] = useState(false);\n const [coordinates, setCoordinates] = useState({ x: 0, y: 0 });\n const [dataTooltip, setDataTooltip] = useState();\n\n /* Callbacks */\n\n // Extract data from the plotly onHover event to be used to create the tooltip.\n const onHover = useCallback(\n (event) => {\n const { points } = event;\n\n const dataFromPoints = {\n title: \"\",\n elements: [],\n };\n\n points.forEach((p, i) => {\n const fData = p.fullData;\n const pNumber = p.pointNumber;\n\n if (i === 0) dataFromPoints.title = isHorizontal ? p.y : p.x || fData.name;\n\n dataFromPoints.elements.push({\n color: fData.marker?.color || fData.line?.color || p.color,\n name: fData.labels?.[pNumber] || fData.name,\n value: isHorizontal ? p.x : p.y || p.value,\n });\n });\n\n setDataTooltip(dataFromPoints);\n setIsHover(true);\n },\n [isHorizontal]\n );\n\n const onUnHover = useCallback(() => {\n setIsHover(false);\n }, []);\n\n const onMouseMove = useCallback((event) => {\n setCoordinates({\n x: event.clientX,\n y: event.clientY,\n });\n }, []);\n\n return (\n <>\n {isHover && (\n <Tooltip\n coordinates={coordinates}\n data={dataTooltip}\n useSingle={useSingle}\n tooltip={tooltip}\n />\n )}\n <div id={id} className={classes.root}>\n <div onMouseMove={onMouseMove}>\n <Plot\n data={data}\n layout={chartLayout}\n config={chartConfig}\n onHover={onHover}\n onUnHover={onUnHover}\n afterPlot={afterPlot}\n {...others}\n />\n </div>\n </div>\n </>\n );\n};\n\nChart.propTypes = {\n /**\n * An Id passed on to the component\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n root: PropTypes.string,\n }),\n\n /**\n * Plotly data object (see https://plot.ly/javascript/reference/).\n */\n data: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Plotly layout object (see https://plot.ly/javascript/reference/#layout).\n */\n layout: PropTypes.instanceOf(Object).isRequired,\n /**\n * Plotly config object (see https://plot.ly/javascript/configuration-options/).\n */\n config: PropTypes.instanceOf(Object),\n /**\n * Defines if should use a single or multiline tooltip.\n */\n tooltipType: PropTypes.oneOf([\"single\", \"multiple\"]),\n /**\n * Custom tooltip element to be displayed\n */\n tooltip: PropTypes.func,\n /**\n * Function to be called after plot render.\n */\n afterPlot: PropTypes.func,\n /**\n * Defines the X axis title.\n */\n xAxisTitle: PropTypes.string,\n /**\n * Defines the Y axis title.\n */\n yAxisTitle: PropTypes.string,\n /**\n * Defines the chart subtitle.\n */\n subtitle: PropTypes.string,\n};\n\nexport default withStyles(styles, { name: \"HvChart\" })(Chart);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chart.js","names":["React","useState","useMemo","useCallback","PropTypes","isNil","withStyles","useTheme","Tooltip","applyLayoutDefaults","applyConfigDefaults","Plot","styles","Chart","id","classes","data","layout","config","tooltipType","tooltip","afterPlot","xAxisTitle","yAxisTitle","others","theme","isHorizontal","orientation","toUpperCase","chartLayout","chartConfig","useSingle","isHover","setIsHover","x","y","coordinates","setCoordinates","dataTooltip","setDataTooltip","onHover","event","points","dataFromPoints","title","elements","forEach","p","i","fData","fullData","pNumber","pointNumber","name","push","color","marker","line","labels","value","onUnHover","onMouseMove","clientX","clientY","root","propTypes","string","shape","arrayOf","instanceOf","Object","isRequired","oneOf","func","subtitle"],"sources":["../../../src/Chart/Chart.js"],"sourcesContent":["import React, { useState, useMemo, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport isNil from \"lodash/isNil\";\nimport { withStyles, useTheme } from \"@mui/styles\";\n\nimport Tooltip from \"./Tooltip\";\nimport { applyLayoutDefaults, applyConfigDefaults } from \"./chartPlotlyOverrides\";\n\nimport Plot from \"./Plot\";\nimport styles from \"./styles\";\n\nconst Chart = ({\n id,\n classes,\n data,\n layout,\n config,\n tooltipType = \"multiple\",\n tooltip,\n afterPlot,\n xAxisTitle,\n yAxisTitle,\n ...others\n}) => {\n const theme = useTheme();\n\n /* Values derived from props */\n\n // Check if the barchart is horizontal or vertical.\n const isHorizontal = useMemo(\n () => (!isNil(data[0]?.orientation) ? data[0].orientation.toUpperCase() === \"H\" : false),\n [data]\n );\n\n const chartLayout = useMemo(\n () => applyLayoutDefaults(layout, theme, isHorizontal, xAxisTitle, yAxisTitle),\n [isHorizontal, layout, theme, xAxisTitle, yAxisTitle]\n );\n\n const chartConfig = useMemo(() => applyConfigDefaults(config), [config]);\n\n const useSingle = tooltipType === \"single\";\n\n /* State */\n\n const [isHover, setIsHover] = useState(false);\n const [coordinates, setCoordinates] = useState({ x: 0, y: 0 });\n const [dataTooltip, setDataTooltip] = useState();\n\n /* Callbacks */\n\n // Extract data from the plotly onHover event to be used to create the tooltip.\n const onHover = useCallback(\n (event) => {\n const { points } = event;\n\n const dataFromPoints = {\n title: \"\",\n elements: [],\n };\n\n points.forEach((p, i) => {\n const fData = p.fullData;\n const pNumber = p.pointNumber;\n\n if (i === 0) dataFromPoints.title = isHorizontal ? p.y : p.x || fData.name;\n\n dataFromPoints.elements.push({\n color: fData.marker?.color || fData.line?.color || p.color,\n name: fData.labels?.[pNumber] || fData.name,\n value: isHorizontal ? p.x : p.y || p.value,\n });\n });\n\n setDataTooltip(dataFromPoints);\n setIsHover(true);\n },\n [isHorizontal]\n );\n\n const onUnHover = useCallback(() => {\n setIsHover(false);\n }, []);\n\n const onMouseMove = useCallback((event) => {\n setCoordinates({\n x: event.clientX,\n y: event.clientY,\n });\n }, []);\n\n return (\n <>\n {isHover && (\n <Tooltip\n coordinates={coordinates}\n data={dataTooltip}\n useSingle={useSingle}\n tooltip={tooltip}\n />\n )}\n <div id={id} className={classes.root}>\n <div onMouseMove={onMouseMove}>\n <Plot\n data={data}\n layout={chartLayout}\n config={chartConfig}\n onHover={onHover}\n onUnHover={onUnHover}\n afterPlot={afterPlot}\n {...others}\n />\n </div>\n </div>\n </>\n );\n};\n\nChart.propTypes = {\n /**\n * An Id passed on to the component\n */\n id: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n root: PropTypes.string,\n }),\n\n /**\n * Plotly data object (see https://plot.ly/javascript/reference/).\n */\n data: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Plotly layout object (see https://plot.ly/javascript/reference/#layout).\n */\n layout: PropTypes.instanceOf(Object).isRequired,\n /**\n * Plotly config object (see https://plot.ly/javascript/configuration-options/).\n */\n config: PropTypes.instanceOf(Object),\n /**\n * Defines if should use a single or multiline tooltip.\n */\n tooltipType: PropTypes.oneOf([\"single\", \"multiple\"]),\n /**\n * Custom tooltip element to be displayed\n */\n tooltip: PropTypes.func,\n /**\n * Function to be called after plot render.\n */\n afterPlot: PropTypes.func,\n /**\n * Defines the X axis title.\n */\n xAxisTitle: PropTypes.string,\n /**\n * Defines the Y axis title.\n */\n yAxisTitle: PropTypes.string,\n /**\n * Defines the chart subtitle.\n */\n subtitle: PropTypes.string,\n};\n\nexport default withStyles(styles, { name: \"HvChart\" })(Chart);\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAC7D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,cAAc;AAChC,SAASC,UAAU,EAAEC,QAAQ,QAAQ,aAAa;AAElD,OAAOC,OAAO,MAAM,WAAW;AAC/B,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,wBAAwB;AAEjF,OAAOC,IAAI,MA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AAM,CAAC;EACpC;AACF;AACA;EACEnD,WAAW,EAAEf,SAAS,CAACoE,KAAK,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;EACpD;AACF;AACA;EACEpD,OAAO,EAAEhB,SAAS,CAACqE,IAAI;EACvB;AACF;AACA;EACEpD,SAAS,EAAEjB,SAAS,CAACqE,IAAI;EACzB;AACF;AACA;EACEnD,UAAU,EAAElB,SAAS,CAAC8D,MAAM;EAC5B;AACF;AACA;EACE3C,UAAU,EAAEnB,SAAS,CAAC8D,MAAM;EAC5B;AACF;AACA;EACEQ,QAAQ,EAAEtE,SAAS,CAAC8D;AACtB,CAAC;AAED,eAAe5D,UAAU,CAACM,MAAM,EAAE;EAAEyC,IAAI,EAAE;AAAU,CAAC,CAAC,CAACxC,KAAK,CAAC"}
|
|
@@ -8,11 +8,8 @@ import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
10
10
|
var _excluded = ["data", "layout", "config", "revision", "onHover", "onUnHover", "afterPlot"];
|
|
11
|
-
|
|
12
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
13
|
import React, { useLayoutEffect, useRef, useCallback } from "react";
|
|
17
14
|
import PropTypes from "prop-types";
|
|
18
15
|
import Plotly from "plotly.js-basic-dist";
|
|
@@ -24,24 +21,24 @@ var PlotGraph = createPlotlyComponent(Plotly);
|
|
|
24
21
|
var plotGraphStyle = {
|
|
25
22
|
position: "relative"
|
|
26
23
|
};
|
|
27
|
-
|
|
28
24
|
var Plot = function Plot(_ref) {
|
|
29
25
|
var data = _ref.data,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
layout = _ref.layout,
|
|
27
|
+
config = _ref.config,
|
|
28
|
+
_ref$revision = _ref.revision,
|
|
29
|
+
revision = _ref$revision === void 0 ? 0 : _ref$revision,
|
|
30
|
+
onHover = _ref.onHover,
|
|
31
|
+
onUnHover = _ref.onUnHover,
|
|
32
|
+
afterPlot = _ref.afterPlot,
|
|
33
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
39
34
|
var ref = useRef(null);
|
|
35
|
+
|
|
40
36
|
/* Callbacks */
|
|
41
37
|
|
|
42
38
|
var afterPlotInternal = useCallback(function () {
|
|
43
39
|
afterPlot === null || afterPlot === void 0 ? void 0 : afterPlot(ref);
|
|
44
40
|
}, [afterPlot]);
|
|
41
|
+
|
|
45
42
|
/* Effects */
|
|
46
43
|
|
|
47
44
|
/**
|
|
@@ -49,7 +46,6 @@ var Plot = function Plot(_ref) {
|
|
|
49
46
|
* (https://github.com/plotly/react-plotly.js/blob/bd15ca98be12b159633fb57c4ea762cb7a64c3a7/src/factory.js#L88)
|
|
50
47
|
*/
|
|
51
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
|
-
|
|
53
49
|
useLayoutEffect(afterPlotInternal, []);
|
|
54
50
|
return /*#__PURE__*/_jsx(PlotGraph, _objectSpread({
|
|
55
51
|
ref: ref,
|
|
@@ -63,38 +59,31 @@ var Plot = function Plot(_ref) {
|
|
|
63
59
|
style: plotGraphStyle
|
|
64
60
|
}, others));
|
|
65
61
|
};
|
|
66
|
-
|
|
67
62
|
process.env.NODE_ENV !== "production" ? Plot.propTypes = {
|
|
68
63
|
/**
|
|
69
64
|
* Plotly data object.
|
|
70
65
|
*/
|
|
71
66
|
data: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,
|
|
72
|
-
|
|
73
67
|
/**
|
|
74
68
|
* Plotly layout object.
|
|
75
69
|
*/
|
|
76
70
|
layout: PropTypes.instanceOf(Object).isRequired,
|
|
77
|
-
|
|
78
71
|
/**
|
|
79
72
|
* Plotly config object.
|
|
80
73
|
*/
|
|
81
74
|
config: PropTypes.instanceOf(Object).isRequired,
|
|
82
|
-
|
|
83
75
|
/**
|
|
84
76
|
* OnHover function.
|
|
85
77
|
*/
|
|
86
78
|
onHover: PropTypes.func,
|
|
87
|
-
|
|
88
79
|
/**
|
|
89
80
|
* OnUnHover function.
|
|
90
81
|
*/
|
|
91
82
|
onUnHover: PropTypes.func,
|
|
92
|
-
|
|
93
83
|
/**
|
|
94
84
|
* Function to be call after plot render.
|
|
95
85
|
*/
|
|
96
86
|
afterPlot: PropTypes.func,
|
|
97
|
-
|
|
98
87
|
/**
|
|
99
88
|
* Plot revision.
|
|
100
89
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.js","names":["React","useLayoutEffect","useRef","useCallback","PropTypes","Plotly","createPlotlyComponent","withStyles","styles","PlotGraph","plotGraphStyle","position","Plot","data","layout","config","revision","onHover","onUnHover","afterPlot","others","ref","afterPlotInternal","propTypes","arrayOf","instanceOf","Object","isRequired","func","number","name"],"sources":["../../../../src/Chart/Plot/Plot.js"],"sourcesContent":["import React, { useLayoutEffect, useRef, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Plotly from \"plotly.js-basic-dist\";\nimport createPlotlyComponent from \"react-plotly.js/factory\";\nimport { withStyles } from \"@mui/styles\";\nimport styles from \"./styles\";\n\nconst PlotGraph = createPlotlyComponent(Plotly);\n\nconst plotGraphStyle = { position: \"relative\" };\n\nconst Plot = ({ data, layout, config, revision = 0, onHover, onUnHover, afterPlot, ...others }) => {\n const ref = useRef(null);\n\n /* Callbacks */\n\n const afterPlotInternal = useCallback(() => {\n afterPlot?.(ref);\n }, [afterPlot]);\n\n /* Effects */\n\n /**\n * Call in the first render because react-plotly.js won't do so.\n * (https://github.com/plotly/react-plotly.js/blob/bd15ca98be12b159633fb57c4ea762cb7a64c3a7/src/factory.js#L88)\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(afterPlotInternal, []);\n\n return (\n <PlotGraph\n ref={ref}\n data={data}\n layout={layout}\n config={config}\n revision={revision}\n onHover={onHover}\n onUnhover={onUnHover}\n onAfterPlot={afterPlot != null ? afterPlotInternal : null}\n style={plotGraphStyle}\n {...others}\n />\n );\n};\n\nPlot.propTypes = {\n /**\n * Plotly data object.\n */\n data: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Plotly layout object.\n */\n layout: PropTypes.instanceOf(Object).isRequired,\n /**\n * Plotly config object.\n */\n config: PropTypes.instanceOf(Object).isRequired,\n /**\n * OnHover function.\n */\n onHover: PropTypes.func,\n /**\n * OnUnHover function.\n */\n onUnHover: PropTypes.func,\n /**\n * Function to be call after plot render.\n */\n afterPlot: PropTypes.func,\n /**\n * Plot revision.\n */\n revision: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvChartPlot\" })(Plot);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Plot.js","names":["React","useLayoutEffect","useRef","useCallback","PropTypes","Plotly","createPlotlyComponent","withStyles","styles","PlotGraph","plotGraphStyle","position","Plot","data","layout","config","revision","onHover","onUnHover","afterPlot","others","ref","afterPlotInternal","propTypes","arrayOf","instanceOf","Object","isRequired","func","number","name"],"sources":["../../../../src/Chart/Plot/Plot.js"],"sourcesContent":["import React, { useLayoutEffect, useRef, useCallback } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Plotly from \"plotly.js-basic-dist\";\nimport createPlotlyComponent from \"react-plotly.js/factory\";\nimport { withStyles } from \"@mui/styles\";\nimport styles from \"./styles\";\n\nconst PlotGraph = createPlotlyComponent(Plotly);\n\nconst plotGraphStyle = { position: \"relative\" };\n\nconst Plot = ({ data, layout, config, revision = 0, onHover, onUnHover, afterPlot, ...others }) => {\n const ref = useRef(null);\n\n /* Callbacks */\n\n const afterPlotInternal = useCallback(() => {\n afterPlot?.(ref);\n }, [afterPlot]);\n\n /* Effects */\n\n /**\n * Call in the first render because react-plotly.js won't do so.\n * (https://github.com/plotly/react-plotly.js/blob/bd15ca98be12b159633fb57c4ea762cb7a64c3a7/src/factory.js#L88)\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(afterPlotInternal, []);\n\n return (\n <PlotGraph\n ref={ref}\n data={data}\n layout={layout}\n config={config}\n revision={revision}\n onHover={onHover}\n onUnhover={onUnHover}\n onAfterPlot={afterPlot != null ? afterPlotInternal : null}\n style={plotGraphStyle}\n {...others}\n />\n );\n};\n\nPlot.propTypes = {\n /**\n * Plotly data object.\n */\n data: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Plotly layout object.\n */\n layout: PropTypes.instanceOf(Object).isRequired,\n /**\n * Plotly config object.\n */\n config: PropTypes.instanceOf(Object).isRequired,\n /**\n * OnHover function.\n */\n onHover: PropTypes.func,\n /**\n * OnUnHover function.\n */\n onUnHover: PropTypes.func,\n /**\n * Function to be call after plot render.\n */\n afterPlot: PropTypes.func,\n /**\n * Plot revision.\n */\n revision: PropTypes.number,\n};\n\nexport default withStyles(styles, { name: \"HvChartPlot\" })(Plot);\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,eAAe,EAAEC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AACnE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,MA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U,CAACC,MAAM,CAAC,CAAC,CAACC,UAAU;EAChE;AACF;AACA;EACEb,MAAM,EAAEV,SAAS,CAACqB,UAAU,CAACC,MAAM,CAAC,CAACC,UAAU;EAC/C;AACF;AACA;EACEZ,MAAM,EAAEX,SAAS,CAACqB,UAAU,CAACC,MAAM,CAAC,CAACC,UAAU;EAC/C;AACF;AACA;EACEV,OAAO,EAAEb,SAAS,CAACwB,IAAI;EACvB;AACF;AACA;EACEV,SAAS,EAAEd,SAAS,CAACwB,IAAI;EACzB;AACF;AACA;EACET,SAAS,EAAEf,SAAS,CAACwB,IAAI;EACzB;AACF;AACA;EACEZ,QAAQ,EAAEZ,SAAS,CAACyB;AACtB,CAAC;AAED,eAAetB,UAAU,CAACC,MAAM,EAAE;EAAEsB,IAAI,EAAE;AAAc,CAAC,CAAC,CAAClB,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Chart/Plot/index.js"],"sourcesContent":["export { default } from \"./Plot\";\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Chart/Plot/index.js"],"sourcesContent":["export { default } from \"./Plot\";\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles"],"sources":["../../../../src/Chart/Plot/styles.js"],"sourcesContent":["const styles = {};\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles"],"sources":["../../../../src/Chart/Plot/styles.js"],"sourcesContent":["const styles = {};\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,CAAC,CAAC;AAEjB,eAAeA,MAAM"}
|
|
@@ -10,12 +10,10 @@ import { HvTypography } from "@hitachivantara/uikit-react-core";
|
|
|
10
10
|
import styles from "./styles";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
13
|
var MultiTooltip = function MultiTooltip(_ref) {
|
|
15
14
|
var _data$elements;
|
|
16
|
-
|
|
17
15
|
var classes = _ref.classes,
|
|
18
|
-
|
|
16
|
+
data = _ref.data;
|
|
19
17
|
return /*#__PURE__*/_jsxs("div", {
|
|
20
18
|
className: classes.root,
|
|
21
19
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -58,7 +56,6 @@ var MultiTooltip = function MultiTooltip(_ref) {
|
|
|
58
56
|
})]
|
|
59
57
|
});
|
|
60
58
|
};
|
|
61
|
-
|
|
62
59
|
process.env.NODE_ENV !== "production" ? MultiTooltip.propTypes = {
|
|
63
60
|
/**
|
|
64
61
|
* A Jss Object used to override or extend the styles applied.
|
|
@@ -68,43 +65,35 @@ process.env.NODE_ENV !== "production" ? MultiTooltip.propTypes = {
|
|
|
68
65
|
* Styles applied to the root.
|
|
69
66
|
*/
|
|
70
67
|
root: PropTypes.string,
|
|
71
|
-
|
|
72
68
|
/**
|
|
73
69
|
* Styles applied to the title.
|
|
74
70
|
*/
|
|
75
71
|
title: PropTypes.string,
|
|
76
|
-
|
|
77
72
|
/**
|
|
78
73
|
* Styles applied to the values container.
|
|
79
74
|
*/
|
|
80
75
|
valuesContainer: PropTypes.string,
|
|
81
|
-
|
|
82
76
|
/**
|
|
83
77
|
* Styling applied to the elements describing a data.
|
|
84
78
|
*/
|
|
85
79
|
valueNameWrapper: PropTypes.string,
|
|
86
|
-
|
|
87
80
|
/**
|
|
88
81
|
* Styles applied to the values.
|
|
89
82
|
*/
|
|
90
83
|
values: PropTypes.string,
|
|
91
|
-
|
|
92
84
|
/**
|
|
93
85
|
* Styles applied to the color.
|
|
94
86
|
*/
|
|
95
87
|
color: PropTypes.string,
|
|
96
|
-
|
|
97
88
|
/**
|
|
98
89
|
* Styles applied to the separator between color and title.
|
|
99
90
|
*/
|
|
100
91
|
separatorColor: PropTypes.string,
|
|
101
|
-
|
|
102
92
|
/**
|
|
103
93
|
* Styles applied to the separator.
|
|
104
94
|
*/
|
|
105
95
|
separator: PropTypes.string
|
|
106
96
|
}).isRequired,
|
|
107
|
-
|
|
108
97
|
/**
|
|
109
98
|
* Data of the tooltip.
|
|
110
99
|
*/
|
|
@@ -113,7 +102,6 @@ process.env.NODE_ENV !== "production" ? MultiTooltip.propTypes = {
|
|
|
113
102
|
* Styles applied to the barchart root class.
|
|
114
103
|
*/
|
|
115
104
|
title: PropTypes.string,
|
|
116
|
-
|
|
117
105
|
/**
|
|
118
106
|
* Values of tooltip
|
|
119
107
|
*/
|
|
@@ -122,12 +110,10 @@ process.env.NODE_ENV !== "production" ? MultiTooltip.propTypes = {
|
|
|
122
110
|
* Color (in hex).
|
|
123
111
|
*/
|
|
124
112
|
color: PropTypes.string,
|
|
125
|
-
|
|
126
113
|
/**
|
|
127
114
|
* Name.
|
|
128
115
|
*/
|
|
129
116
|
name: PropTypes.string,
|
|
130
|
-
|
|
131
117
|
/**
|
|
132
118
|
* Value.
|
|
133
119
|
*/
|
|
@@ -135,11 +121,9 @@ process.env.NODE_ENV !== "production" ? MultiTooltip.propTypes = {
|
|
|
135
121
|
}))
|
|
136
122
|
}).isRequired
|
|
137
123
|
} : void 0;
|
|
138
|
-
|
|
139
124
|
var arePropsEqual = function arePropsEqual(prevProps, nextProps) {
|
|
140
125
|
return prevProps.data === nextProps.data;
|
|
141
126
|
};
|
|
142
|
-
|
|
143
127
|
export default withStyles(styles, {
|
|
144
128
|
name: "HvChartMultiTooltip"
|
|
145
129
|
})( /*#__PURE__*/memo(MultiTooltip, arePropsEqual));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiTooltip.js","names":["React","memo","PropTypes","withStyles","HvTypography","styles","MultiTooltip","classes","data","root","title","valuesContainer","elements","map","element","values","valueNameWrapper","color","backgroundColor","separatorColor","name","separator","value","propTypes","shape","string","isRequired","arrayOf","number","arePropsEqual","prevProps","nextProps"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/MultiTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst MultiTooltip = ({ classes, data }) => (\n <div className={classes.root}>\n <div className={classes.title}>\n <div>\n <HvTypography variant=\"highlightText\">{data.title}</HvTypography>\n </div>\n </div>\n <div className={classes.valuesContainer}>\n {data?.elements?.map((element) => (\n <div key={element.name} className={classes.values}>\n <div className={classes.valueNameWrapper}>\n <div className={classes.color} style={{ backgroundColor: element.color }} />\n <div className={classes.separatorColor} />\n <div>\n <HvTypography variant=\"highlightText\">{element.name}</HvTypography>\n </div>\n <div className={classes.separator} />\n </div>\n <div>\n <HvTypography>{element.value}</HvTypography>\n </div>\n </div>\n ))}\n </div>\n </div>\n);\n\nMultiTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the title.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the values container.\n */\n valuesContainer: PropTypes.string,\n /**\n * Styling applied to the elements describing a data.\n */\n valueNameWrapper: PropTypes.string,\n /**\n * Styles applied to the values.\n */\n values: PropTypes.string,\n /**\n * Styles applied to the color.\n */\n color: PropTypes.string,\n /**\n * Styles applied to the separator between color and title.\n */\n separatorColor: PropTypes.string,\n /**\n * Styles applied to the separator.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n title: PropTypes.string,\n /**\n * Values of tooltip\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color (in hex).\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) => prevProps.data === nextProps.data;\n\nexport default withStyles(styles, { name: \"HvChartMultiTooltip\" })(\n memo(MultiTooltip, arePropsEqual)\n);\n"],"mappings":";;;;;AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"MultiTooltip.js","names":["React","memo","PropTypes","withStyles","HvTypography","styles","MultiTooltip","classes","data","root","title","valuesContainer","elements","map","element","values","valueNameWrapper","color","backgroundColor","separatorColor","name","separator","value","propTypes","shape","string","isRequired","arrayOf","number","arePropsEqual","prevProps","nextProps"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/MultiTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst MultiTooltip = ({ classes, data }) => (\n <div className={classes.root}>\n <div className={classes.title}>\n <div>\n <HvTypography variant=\"highlightText\">{data.title}</HvTypography>\n </div>\n </div>\n <div className={classes.valuesContainer}>\n {data?.elements?.map((element) => (\n <div key={element.name} className={classes.values}>\n <div className={classes.valueNameWrapper}>\n <div className={classes.color} style={{ backgroundColor: element.color }} />\n <div className={classes.separatorColor} />\n <div>\n <HvTypography variant=\"highlightText\">{element.name}</HvTypography>\n </div>\n <div className={classes.separator} />\n </div>\n <div>\n <HvTypography>{element.value}</HvTypography>\n </div>\n </div>\n ))}\n </div>\n </div>\n);\n\nMultiTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the title.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the values container.\n */\n valuesContainer: PropTypes.string,\n /**\n * Styling applied to the elements describing a data.\n */\n valueNameWrapper: PropTypes.string,\n /**\n * Styles applied to the values.\n */\n values: PropTypes.string,\n /**\n * Styles applied to the color.\n */\n color: PropTypes.string,\n /**\n * Styles applied to the separator between color and title.\n */\n separatorColor: PropTypes.string,\n /**\n * Styles applied to the separator.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Data of the tooltip.\n */\n data: PropTypes.shape({\n /**\n * Styles applied to the barchart root class.\n */\n title: PropTypes.string,\n /**\n * Values of tooltip\n */\n elements: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Color (in hex).\n */\n color: PropTypes.string,\n /**\n * Name.\n */\n name: PropTypes.string,\n /**\n * Value.\n */\n value: PropTypes.number,\n })\n ),\n }).isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) => prevProps.data === nextProps.data;\n\nexport default withStyles(styles, { name: \"HvChartMultiTooltip\" })(\n memo(MultiTooltip, arePropsEqual)\n);\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,YAAY,QAAQ,kCAAkC;AAC/D,OAAOC,MAAM,MAAM,UAAU;AAAC;AAAA;AAE9B,IAAMC,YAAY,GAAG,SAAfA,YAAY;EAAA;EAAA,IAAMC,OAAO,QAAPA,OAAO;IAAEC,IAAI,QAAJA,IAAI;EAAA,oBACnC;IAAK,SAAS,EAAED,OAAO,CAACE,IAAK;IAAA,wBAC3B;MAAK,SAAS,EAAEF,OAAO,CAACG,KAAM;MAAA,uBAC5B;QAAA,uBACE,KAAC,YAAY;UAAC,OAAO,EAAC,eAAe;UAAA,UAAEF,IAAI,CAACE;QAAK;MAAgB;IAC7D,EACF,eACN;MAAK,SAAS,EAAEH,OAAO,CAACI,eAAgB;MAAA,UACrCH,IAAI,aAAJA,IAAI,yCAAJA,IAAI,CAAEI,QAAQ,mDAAd,eAAgBC,GAAG,CAAC,UAACC,OAAO;QAAA,oBAC3B;UAAwB,SAAS,EAAEP,OAAO,CAACQ,MAAO;UAAA,wBA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Ib,QAAQ,EAAEV,SAAS,CAACyB,OAAO,CACzBzB,SAAS,CAACsB,KAAK,CAAC;MACd;AACR;AACA;MACQP,KAAK,EAAEf,SAAS,CAACuB,MAAM;MACvB;AACR;AACA;MACQL,IAAI,EAAElB,SAAS,CAACuB,MAAM;MACtB;AACR;AACA;MACQH,KAAK,EAAEpB,SAAS,CAAC0B;IACnB,CAAC,CAAC;EAEN,CAAC,CAAC,CAACF;AACL,CAAC;AAED,IAAMG,aAAa,GAAG,SAAhBA,aAAa,CAAIC,SAAS,EAAEC,SAAS;EAAA,OAAKD,SAAS,CAACtB,IAAI,KAAKuB,SAAS,CAACvB,IAAI;AAAA;AAEjF,eAAeL,UAAU,CAACE,MAAM,EAAE;EAAEe,IAAI,EAAE;AAAsB,CAAC,CAAC,eAChEnB,IAAI,CAACK,YAAY,EAAEuB,aAAa,CAAC,CAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/index.js"],"sourcesContent":["export { default } from \"./MultiTooltip\";\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/index.js"],"sourcesContent":["export { default } from \"./MultiTooltip\";\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","backgroundColor","hv","palette","atmosphere","atmo1","width","boxShadow","shadows","zIndex","title","padding","hvSpacing","borderBottom","atmo2","valuesContainer","spacing","sm","values","display","justifyContent","alignItems","paddingBottom","valueNameWrapper","color","xs","height","separator","separatorColor"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n width: \"fit-content\",\n boxShadow: theme.hv.shadows[1],\n zIndex: 100,\n },\n title: {\n padding: theme.hvSpacing(\"15px\", \"sm\"),\n borderBottom: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n valuesContainer: {\n padding: theme.hv.spacing.sm,\n },\n values: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n paddingBottom: theme.hv.spacing.sm,\n \"&:last-child\": {\n paddingBottom: 0,\n },\n },\n valueNameWrapper: {\n display: \"flex\",\n alignItems: \"center\",\n },\n color: {\n width: theme.hv.spacing.xs,\n height: theme.hv.spacing.xs,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n separatorColor: {\n width: \"5px\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","backgroundColor","hv","palette","atmosphere","atmo1","width","boxShadow","shadows","zIndex","title","padding","hvSpacing","borderBottom","atmo2","valuesContainer","spacing","sm","values","display","justifyContent","alignItems","paddingBottom","valueNameWrapper","color","xs","height","separator","separatorColor"],"sources":["../../../../../src/Chart/Tooltip/MultiTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n width: \"fit-content\",\n boxShadow: theme.hv.shadows[1],\n zIndex: 100,\n },\n title: {\n padding: theme.hvSpacing(\"15px\", \"sm\"),\n borderBottom: `3px solid ${theme.hv.palette.atmosphere.atmo2}`,\n },\n valuesContainer: {\n padding: theme.hv.spacing.sm,\n },\n values: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n paddingBottom: theme.hv.spacing.sm,\n \"&:last-child\": {\n paddingBottom: 0,\n },\n },\n valueNameWrapper: {\n display: \"flex\",\n alignItems: \"center\",\n },\n color: {\n width: theme.hv.spacing.xs,\n height: theme.hv.spacing.xs,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n separatorColor: {\n width: \"5px\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE;MACJC,eAAe,EAAEF,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,UAAU,CAACC,KAAK;MAClDC,KAAK,EAAE,aAAa;MACpBC,SAAS,EAAER,KAAK,CAACG,EAAE,CAACM,OAAO,CAAC,CAAC,CAAC;MAC9BC,MAAM,EAAE;IACV,CAAC;IACDC,KAAK,EAAE;MACLC,OAAO,EAAEZ,KAAK,CAACa,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC;MACtCC,YAAY,sBAAed,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,UAAU,CAACU,KAAK;IAC9D,CAAC;IACDC,eAAe,EAAE;MACfJ,OAAO,EAAEZ,KAAK,CAACG,EAAE,CAACc,OAAO,CAACC;IAC5B,CAAC;IACDC,MAAM,EAAE;MACNC,OAAO,EAAE,MAAM;MACfC,cAAc,EAAE,eAAe;MAC/BC,UAAU,EAAE,QAAQ;MACpBC,aAAa,EAAEvB,KAAK,CAACG,EAAE,CAACc,OAAO,CAACC,EAAE;MAClC,cAAc,EAAE;QACdK,aAAa,EAAE;MACjB;IACF,CAAC;IACDC,gBAAgB,EAAE;MAChBJ,OAAO,EAAE,MAAM;MACfE,UAAU,EAAE;IACd,CAAC;IACDG,KAAK,EAAE;MACLlB,KAAK,EAAEP,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS,EAAE;MAC1BC,MAAM,EAAE3B,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS;IAC3B,CAAC;IACDE,SAAS,EAAE;MACTrB,KAAK,EAAEP,KAAK,CAACG,EAAE,CAACc,OAAO,CAACS;IAC1B,CAAC;IACDG,cAAc,EAAE;MACdtB,KAAK,EAAE;IACT;EACF,CAAC;AAAA,CAAC;AAEF,eAAeR,MAAM"}
|
|
@@ -5,11 +5,10 @@ import { HvTypography } from "@hitachivantara/uikit-react-core";
|
|
|
5
5
|
import styles from "./styles";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
8
|
var SingleTooltip = function SingleTooltip(_ref) {
|
|
10
9
|
var classes = _ref.classes,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
title = _ref.title,
|
|
11
|
+
value = _ref.value;
|
|
13
12
|
return /*#__PURE__*/_jsxs("div", {
|
|
14
13
|
className: classes.root,
|
|
15
14
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -26,7 +25,6 @@ var SingleTooltip = function SingleTooltip(_ref) {
|
|
|
26
25
|
})]
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
process.env.NODE_ENV !== "production" ? SingleTooltip.propTypes = {
|
|
31
29
|
/**
|
|
32
30
|
* A Jss Object used to override or extend the styles applied.
|
|
@@ -36,28 +34,23 @@ process.env.NODE_ENV !== "production" ? SingleTooltip.propTypes = {
|
|
|
36
34
|
* Styles applied to the root class.
|
|
37
35
|
*/
|
|
38
36
|
root: PropTypes.string,
|
|
39
|
-
|
|
40
37
|
/**
|
|
41
38
|
* Styles applied to the separator between title and value.
|
|
42
39
|
*/
|
|
43
40
|
separator: PropTypes.string
|
|
44
41
|
}).isRequired,
|
|
45
|
-
|
|
46
42
|
/**
|
|
47
43
|
* Title of the chart.
|
|
48
44
|
*/
|
|
49
45
|
title: PropTypes.string.isRequired,
|
|
50
|
-
|
|
51
46
|
/**
|
|
52
47
|
* Value of the chart.
|
|
53
48
|
*/
|
|
54
49
|
value: PropTypes.number.isRequired
|
|
55
50
|
} : void 0;
|
|
56
|
-
|
|
57
51
|
var arePropsEqual = function arePropsEqual(prevProps, nextProps) {
|
|
58
52
|
return prevProps.title === nextProps.title && prevProps.value === nextProps.value;
|
|
59
53
|
};
|
|
60
|
-
|
|
61
54
|
export default withStyles(styles, {
|
|
62
55
|
name: "HvChartSingleTooltip"
|
|
63
56
|
})( /*#__PURE__*/memo(SingleTooltip, arePropsEqual));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleTooltip.js","names":["React","memo","PropTypes","withStyles","HvTypography","styles","SingleTooltip","classes","title","value","root","separator","propTypes","shape","string","isRequired","number","arePropsEqual","prevProps","nextProps","name"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/SingleTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst SingleTooltip = ({ classes, title, value }) => (\n <div className={classes.root}>\n <div>\n <HvTypography variant=\"highlightText\">{title}</HvTypography>\n </div>\n <div className={classes.separator} />\n <div>\n <HvTypography>{value}</HvTypography>\n </div>\n </div>\n);\n\nSingleTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the separator between title and value.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Title of the chart.\n */\n title: PropTypes.string.isRequired,\n /**\n * Value of the chart.\n */\n value: PropTypes.number.isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) =>\n prevProps.title === nextProps.title && prevProps.value === nextProps.value;\n\nexport default withStyles(styles, { name: \"HvChartSingleTooltip\" })(\n memo(SingleTooltip, arePropsEqual)\n);\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"SingleTooltip.js","names":["React","memo","PropTypes","withStyles","HvTypography","styles","SingleTooltip","classes","title","value","root","separator","propTypes","shape","string","isRequired","number","arePropsEqual","prevProps","nextProps","name"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/SingleTooltip.js"],"sourcesContent":["import React, { memo } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport styles from \"./styles\";\n\nconst SingleTooltip = ({ classes, title, value }) => (\n <div className={classes.root}>\n <div>\n <HvTypography variant=\"highlightText\">{title}</HvTypography>\n </div>\n <div className={classes.separator} />\n <div>\n <HvTypography>{value}</HvTypography>\n </div>\n </div>\n);\n\nSingleTooltip.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the separator between title and value.\n */\n separator: PropTypes.string,\n }).isRequired,\n /**\n * Title of the chart.\n */\n title: PropTypes.string.isRequired,\n /**\n * Value of the chart.\n */\n value: PropTypes.number.isRequired,\n};\n\nconst arePropsEqual = (prevProps, nextProps) =>\n prevProps.title === nextProps.title && prevProps.value === nextProps.value;\n\nexport default withStyles(styles, { name: \"HvChartSingleTooltip\" })(\n memo(SingleTooltip, arePropsEqual)\n);\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,YAAY,QAAQ,kCAAkC;AAC/D,OAAOC,MAAM,MAAM,UAAU;AAAC;AAAA;AAE9B,IAAMC,aAAa,GAAG,SAAhBA,aAAa;EAAA,IAAMC,OAAO,QAAPA,OAAO;IAAEC,KAAK,QAALA,KAAK;IAAEC,KAAK,QAALA,KAAK;EAAA,oBAC5C;IAAK,SAAS,EAAEF,OAAO,CAACG,IAAK;IAAA,wBAC3B;MAAA,uBACE,KAAC,YAAY;QAAC,OAAO,EAAC,eAAe;QAAA,UAAEF;MAAK;IAAgB,EACxD,eACN;MAAK,SAAS,EAAED,OAAO,CAACI;IAAU,EAAG,eACrC;MAAA,uBACE,KAAC,YAAY;QAAA,UAAEF;MAAK;IAAgB,EAChC;EAAA,EACF;AAAA,CACP;AAED,wCAAAH,aAAa,CAACM,SAAS,GAAG;EACxB;AACF;AACA;EACEL,OAAO,EAAEL,SAAS,CAACW,KAAK,CAAC;IACvB;AACJ;AACA;IACIH,IAAI,EAAER,SAAS,CAACY,MAAM;IACtB;AACJ;AACA;IACIH,SAAS,EAAET,SAAS,CAACY;EACvB,CAAC,CAAC,CAACC,UAAU;EACb;AACF;AACA;EACEP,KAAK,EAAEN,SAAS,CAACY,MAAM,CAACC,UAAU;EAClC;AACF;AACA;EACEN,KAAK,EAAEP,SAAS,CAACc,MAAM,CAACD;AAC1B,CAAC;AAED,IAAME,aAAa,GAAG,SAAhBA,aAAa,CAAIC,SAAS,EAAEC,SAAS;EAAA,OACzCD,SAAS,CAACV,KAAK,KAAKW,SAAS,CAACX,KAAK,IAAIU,SAAS,CAACT,KAAK,KAAKU,SAAS,CAACV,KAAK;AAAA;AAE5E,eAAeN,UAAU,CAACE,MAAM,EAAE;EAAEe,IAAI,EAAE;AAAuB,CAAC,CAAC,eACjEnB,IAAI,CAACK,aAAa,EAAEW,aAAa,CAAC,CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/index.js"],"sourcesContent":["export { default } from \"./SingleTooltip\";\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/index.js"],"sourcesContent":["export { default } from \"./SingleTooltip\";\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hv","spacing","sm","display","backgroundColor","palette","atmosphere","atmo1","boxShadow","shadows","width","zIndex","separator","xs"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hv.spacing.sm,\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n boxShadow: theme.hv.shadows[1],\n width: \"fit-content\",\n zIndex: 100,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","theme","root","padding","hv","spacing","sm","display","backgroundColor","palette","atmosphere","atmo1","boxShadow","shadows","width","zIndex","separator","xs"],"sources":["../../../../../src/Chart/Tooltip/SingleTooltip/styles.js"],"sourcesContent":["const styles = (theme) => ({\n root: {\n padding: theme.hv.spacing.sm,\n display: \"flex\",\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n boxShadow: theme.hv.shadows[1],\n width: \"fit-content\",\n zIndex: 100,\n },\n separator: {\n width: theme.hv.spacing.xs,\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAM,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE;MACJC,OAAO,EAAEF,KAAK,CAACG,EAAE,CAACC,OAAO,CAACC,EAAE;MAC5BC,OAAO,EAAE,MAAM;MACfC,eAAe,EAAEP,KAAK,CAACG,EAAE,CAACK,OAAO,CAACC,UAAU,CAACC,KAAK;MAClDC,SAAS,EAAEX,KAAK,CAACG,EAAE,CAACS,OAAO,CAAC,CAAC,CAAC;MAC9BC,KAAK,EAAE,aAAa;MACpBC,MAAM,EAAE;IACV,CAAC;IACDC,SAAS,EAAE;MACTF,KAAK,EAAEb,KAAK,CAACG,EAAE,CAACC,OAAO,CAACY;IAC1B;EACF,CAAC;AAAA,CAAC;AAEF,eAAejB,MAAM"}
|
|
@@ -7,44 +7,39 @@ import MultipleTooltip from "./MultiTooltip";
|
|
|
7
7
|
import styles from "./styles";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
var offset = 20;
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Component responsible for deciding which tooltip should be use and to calculate
|
|
12
13
|
* the exact position where it should be render.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
15
|
var MainToolTip = function MainToolTip(_ref) {
|
|
16
16
|
var _MultipleTooltip;
|
|
17
|
-
|
|
18
17
|
var classes = _ref.classes,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
coordinates = _ref.coordinates,
|
|
19
|
+
data = _ref.data,
|
|
20
|
+
useSingle = _ref.useSingle,
|
|
21
|
+
tooltip = _ref.tooltip;
|
|
23
22
|
var x = coordinates.x,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
y = coordinates.y;
|
|
26
24
|
var _useState = useState({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
left: x,
|
|
26
|
+
top: y,
|
|
27
|
+
visibility: "hidden"
|
|
28
|
+
}),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
style = _useState2[0],
|
|
31
|
+
setStyle = _useState2[1];
|
|
35
32
|
var ref = useRef(null);
|
|
33
|
+
|
|
36
34
|
/**
|
|
37
35
|
* Calculate the position where the tooltip has to render, having in account
|
|
38
36
|
* the dimensions.
|
|
39
37
|
*/
|
|
40
|
-
|
|
41
38
|
useEffect(function () {
|
|
42
39
|
if (!ref.current || !ref.current.getBoundingClientRect().width) return;
|
|
43
|
-
|
|
44
40
|
var _ref$current$getBound = ref.current.getBoundingClientRect(),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
width = _ref$current$getBound.width,
|
|
42
|
+
height = _ref$current$getBound.height;
|
|
48
43
|
setStyle({
|
|
49
44
|
left: x - width / 2,
|
|
50
45
|
top: y - height - offset
|
|
@@ -67,7 +62,6 @@ var MainToolTip = function MainToolTip(_ref) {
|
|
|
67
62
|
children: renderTooltip(tooltip)
|
|
68
63
|
});
|
|
69
64
|
};
|
|
70
|
-
|
|
71
65
|
process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
|
|
72
66
|
/**
|
|
73
67
|
* A Jss Object used to override or extend the styles applied.
|
|
@@ -78,7 +72,6 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
|
|
|
78
72
|
*/
|
|
79
73
|
root: PropTypes.string
|
|
80
74
|
}).isRequired,
|
|
81
|
-
|
|
82
75
|
/**
|
|
83
76
|
* Data of the tooltip.
|
|
84
77
|
*/
|
|
@@ -87,7 +80,6 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
|
|
|
87
80
|
* Title.
|
|
88
81
|
*/
|
|
89
82
|
title: PropTypes.string,
|
|
90
|
-
|
|
91
83
|
/**
|
|
92
84
|
* Values of the tooltip.
|
|
93
85
|
*/
|
|
@@ -96,19 +88,16 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
|
|
|
96
88
|
* Color of the bar.
|
|
97
89
|
*/
|
|
98
90
|
color: PropTypes.string,
|
|
99
|
-
|
|
100
91
|
/**
|
|
101
92
|
* Name.
|
|
102
93
|
*/
|
|
103
94
|
name: PropTypes.string,
|
|
104
|
-
|
|
105
95
|
/**
|
|
106
96
|
* Value.
|
|
107
97
|
*/
|
|
108
98
|
value: PropTypes.number
|
|
109
99
|
}))
|
|
110
100
|
}).isRequired,
|
|
111
|
-
|
|
112
101
|
/**
|
|
113
102
|
* Coordinates.
|
|
114
103
|
*/
|
|
@@ -117,18 +106,15 @@ process.env.NODE_ENV !== "production" ? MainToolTip.propTypes = {
|
|
|
117
106
|
* xx's coordinate.
|
|
118
107
|
*/
|
|
119
108
|
x: PropTypes.number.isRequired,
|
|
120
|
-
|
|
121
109
|
/**
|
|
122
110
|
* yy's coordinate.
|
|
123
111
|
*/
|
|
124
112
|
y: PropTypes.number.isRequired
|
|
125
113
|
}).isRequired,
|
|
126
|
-
|
|
127
114
|
/**
|
|
128
115
|
* Defines if should use a single or multiline tooltip.
|
|
129
116
|
*/
|
|
130
117
|
useSingle: PropTypes.bool,
|
|
131
|
-
|
|
132
118
|
/**
|
|
133
119
|
* Custom tooltip element to be displayed
|
|
134
120
|
*/
|