@fluentui/react-charts 0.0.0-nightly-20251215-0407.1 → 0.0.0-nightly-20251217-0407.1
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/CHANGELOG.md +13 -13
- package/dist/index.d.ts +25 -1
- package/lib/components/AreaChart/AreaChart.js +1 -28
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +41 -31
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +5 -5
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +4 -3
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +177 -29
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +17 -17
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/Legends/Legends.js +3 -4
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +1 -23
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +1 -23
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +8 -78
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +14 -26
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/utilities/Common.styles.js +0 -1
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +0 -1
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/image-export-utils.js +4 -4
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +200 -67
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +0 -26
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -2
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +40 -30
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +3 -4
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +3 -2
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +177 -28
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +15 -15
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.js +3 -4
- package/lib-commonjs/components/Legends/Legends.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +0 -22
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -2
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -2
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +0 -22
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -2
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +7 -77
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +13 -25
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -2
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +0 -1
- package/lib-commonjs/utilities/Common.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +0 -1
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +3 -3
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +212 -70
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +12 -12
- package/lib/components/DeclarativeChart/imageExporter.js +0 -223
- package/lib/components/DeclarativeChart/imageExporter.js.map +0 -1
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js +0 -233
- package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","HighContrastSelector","useRtl","getAxisTitleStyle","getTooltipStyle","cartesianchartClassNames","root","chartWrapper","plotContainer","axisTitle","xAxis","yAxis","opacityChangeOnHover","legendContainer","svgTooltip","shapeStyles","descriptionMessage","hover","tooltip","axisAnnotation","chartTitle","chart","annotationLayer","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","a9b677","Bqenvij","Beiy3e4","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","qhf8xq","chartWrapperMinWidth","B80ckks","sj55zd","Bkfmm31","Bxms50k","Bifops1","lr70ht","D01gh","vxuu72","lclgl4","zp1vxd","jxu3ei","B3i31d3","Bhcy8il","z3m6do","se2xxg","rtl","Bkw34lo","ltr","abs64n","Bceei9c","B6of3ja","Frg6f3","Bkecrkj","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","d","p","m","useCartesianChartStyles","props","_props_styles","_props_reflowProps","_props_styles1","_props_styles2","_props_styles3","_useRtl","baseStyles","styles","reflowProps","mode","undefined"],"sources":["useCartesianChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector, useRtl } from '../../utilities/utilities';\nimport { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const cartesianchartClassNames = {\n root: 'fui-cart__root',\n chartWrapper: 'fui-cart__chartWrapper',\n plotContainer: 'fui-cart__plotContainer',\n axisTitle: 'fui-cart__axisTitle',\n xAxis: 'fui-cart__xAxis',\n yAxis: 'fui-cart__yAxis',\n opacityChangeOnHover: 'fui-cart__opacityChangeOnHover',\n legendContainer: 'fui-cart__legendContainer',\n svgTooltip: 'fui-cart_svgTooltip',\n shapeStyles: 'fui-cart__shapeStyles',\n descriptionMessage: 'fui-cart__descriptionMessage',\n hover: 'fui-cart__hover',\n tooltip: 'fui-cart__tooltip',\n axisAnnotation: 'fui-cart__axisAnnotation',\n chartTitle: 'fui-cart__chartTitle',\n chart: 'fui-cart__chart',\n annotationLayer: 'fui-cart__annotationLayer'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n textAlign: 'left'\n },\n chartWrapper: {\n position: 'relative'\n },\n chartWrapperMinWidth: {\n overflow: 'auto'\n },\n plotContainer: {\n position: 'relative',\n width: '100%',\n height: '100%'\n },\n axisTitle: getAxisTitleStyle(),\n axisAnnotation: getAxisTitleStyle(),\n xAxis: {\n '& text': {\n fill: tokens.colorNeutralForeground1,\n ...typographyStyles.caption2Strong,\n forcedColorAdjust: 'auto'\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n width: '1px',\n forcedColorAdjust: 'auto'\n },\n '& path': {\n display: 'none'\n }\n },\n yAxis: {\n '& text': {\n ...typographyStyles.caption2Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n '& path': {\n display: 'none'\n }\n },\n rtl: {\n '& g': {\n textAnchor: 'end'\n }\n },\n ltr: {},\n opacityChangeOnHover: {\n opacity: '0.1',\n cursor: 'default'\n },\n legendContainer: {\n marginTop: tokens.spacingVerticalS,\n marginLeft: tokens.spacingHorizontalXL\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n annotationLayer: {\n pointerEvents: 'none'\n },\n tooltip: getTooltipStyle()\n});\n/**\n *\n * Apply styling to the Carousel slots based on the state\n */ export const useCartesianChartStyles = (props)=>{\n var _props_styles, _props_reflowProps, _props_styles1, _props_styles2, _props_styles3;\n const _useRtl = useRtl();\n const baseStyles = useStyles();\n return {\n root: mergeClasses(cartesianchartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chartWrapper: mergeClasses(cartesianchartClassNames.chartWrapper, baseStyles.chartWrapper, ((_props_reflowProps = props.reflowProps) === null || _props_reflowProps === void 0 ? void 0 : _props_reflowProps.mode) === 'min-width' ? baseStyles.chartWrapperMinWidth : undefined, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chartWrapper),\n plotContainer: mergeClasses(cartesianchartClassNames.plotContainer, baseStyles.plotContainer /*props.styles?.plotContainer*/ ),\n axisTitle: mergeClasses(cartesianchartClassNames.axisTitle, baseStyles.axisTitle /*props.styles?.axisTitle*/ ),\n xAxis: mergeClasses(cartesianchartClassNames.xAxis, baseStyles.xAxis /*props.styles?.xAxis*/ ),\n yAxis: mergeClasses(cartesianchartClassNames.yAxis, baseStyles.yAxis, _useRtl ? baseStyles.rtl : baseStyles.ltr /*props.styles?.yAxis*/ ),\n opacityChangeOnHover: mergeClasses(cartesianchartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/ ),\n legendContainer: mergeClasses(cartesianchartClassNames.legendContainer, baseStyles.legendContainer /*props.styles?.legendContainer*/ ),\n svgTooltip: mergeClasses(cartesianchartClassNames.svgTooltip, baseStyles.svgTooltip, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.svgTooltip),\n annotationLayer: mergeClasses(cartesianchartClassNames.annotationLayer, baseStyles.annotationLayer /*props.styles?.annotationLayer*/ ),\n tooltip: mergeClasses(cartesianchartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n axisAnnotation: mergeClasses(cartesianchartClassNames.axisAnnotation, baseStyles.axisAnnotation),\n chart: mergeClasses(cartesianchartClassNames.chart, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chart)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,oBAAoB,EAAEC,MAAM,QAAQ,2BAA2B;AACxE,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,uBAAuB;AAC1E;AACA;AACA;AAAI,OAAO,MAAMC,wBAAwB,GAAG;EACxCC,IAAI,EAAE,gBAAgB;EACtBC,YAAY,EAAE,wBAAwB;EACtCC,aAAa,EAAE,yBAAyB;EACx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EhB,YAAY,CAACO,wBAAwB,CAACS,UAAU,EAAEsE,UAAU,CAACtE,UAAU,EAAE,CAACmE,cAAc,GAAGJ,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAACnE,UAAU,CAAC;IAChMQ,eAAe,EAAExB,YAAY,CAACO,wBAAwB,CAACiB,eAAe,EAAE8D,UAAU,CAAC9D,eAAe,CAAC,iCAAkC,CAAC;IACtIJ,OAAO,EAAEpB,YAAY,CAACO,wBAAwB,CAACa,OAAO,EAAEkE,UAAU,CAAClE,OAAO,CAAC,yBAA0B,CAAC;IACtGC,cAAc,EAAErB,YAAY,CAACO,wBAAwB,CAACc,cAAc,EAAEiE,UAAU,CAACjE,cAAc,CAAC;IAChGE,KAAK,EAAEvB,YAAY,CAACO,wBAAwB,CAACgB,KAAK,EAAE,CAAC6D,cAAc,GAAGL,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC7D,KAAK;EAC7J,CAAC;AACL,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tokens","typographyStyles","CARTESIAN_XAXIS_CLASSNAME","HighContrastSelector","useRtl","getAxisTitleStyle","getTooltipStyle","cartesianchartClassNames","root","chartWrapper","plotContainer","axisTitle","xAxis","yAxis","opacityChangeOnHover","legendContainer","svgTooltip","shapeStyles","descriptionMessage","hover","tooltip","axisAnnotation","chartTitle","chart","annotationLayer","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","a9b677","Bqenvij","Beiy3e4","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","qhf8xq","chartWrapperMinWidth","B80ckks","sj55zd","Bkfmm31","Bxms50k","Bifops1","lr70ht","D01gh","vxuu72","lclgl4","zp1vxd","jxu3ei","B3i31d3","Bhcy8il","z3m6do","se2xxg","rtl","Bkw34lo","ltr","abs64n","Bceei9c","B6of3ja","Frg6f3","Bkecrkj","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","d","p","m","useCartesianChartStyles","props","_props_styles","_props_reflowProps","_props_styles1","_props_styles2","_props_styles3","_useRtl","baseStyles","styles","reflowProps","mode","undefined"],"sources":["useCartesianChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { CARTESIAN_XAXIS_CLASSNAME, HighContrastSelector, useRtl } from '../../utilities/utilities';\nimport { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const cartesianchartClassNames = {\n root: 'fui-cart__root',\n chartWrapper: 'fui-cart__chartWrapper',\n plotContainer: 'fui-cart__plotContainer',\n axisTitle: 'fui-cart__axisTitle',\n xAxis: CARTESIAN_XAXIS_CLASSNAME,\n yAxis: 'fui-cart__yAxis',\n opacityChangeOnHover: 'fui-cart__opacityChangeOnHover',\n legendContainer: 'fui-cart__legendContainer',\n svgTooltip: 'fui-cart_svgTooltip',\n shapeStyles: 'fui-cart__shapeStyles',\n descriptionMessage: 'fui-cart__descriptionMessage',\n hover: 'fui-cart__hover',\n tooltip: 'fui-cart__tooltip',\n axisAnnotation: 'fui-cart__axisAnnotation',\n chartTitle: 'fui-cart__chartTitle',\n chart: 'fui-cart__chart',\n annotationLayer: 'fui-cart__annotationLayer'\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n textAlign: 'left',\n position: 'relative'\n },\n chartWrapper: {\n position: 'relative'\n },\n chartWrapperMinWidth: {\n overflow: 'auto'\n },\n plotContainer: {\n position: 'relative',\n width: '100%',\n height: '100%'\n },\n axisTitle: getAxisTitleStyle(),\n axisAnnotation: getAxisTitleStyle(),\n xAxis: {\n '& text': {\n fill: tokens.colorNeutralForeground1,\n ...typographyStyles.caption2Strong,\n forcedColorAdjust: 'auto'\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n width: '1px',\n forcedColorAdjust: 'auto'\n },\n '& path': {\n display: 'none'\n }\n },\n yAxis: {\n '& text': {\n ...typographyStyles.caption2Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n '& path': {\n display: 'none'\n }\n },\n rtl: {\n '& g': {\n textAnchor: 'end'\n }\n },\n ltr: {},\n opacityChangeOnHover: {\n opacity: '0.1',\n cursor: 'default'\n },\n legendContainer: {\n marginTop: tokens.spacingVerticalS,\n marginLeft: tokens.spacingHorizontalXL\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n annotationLayer: {\n pointerEvents: 'none'\n },\n tooltip: getTooltipStyle()\n});\n/**\n *\n * Apply styling to the Carousel slots based on the state\n */ export const useCartesianChartStyles = (props)=>{\n var _props_styles, _props_reflowProps, _props_styles1, _props_styles2, _props_styles3;\n const _useRtl = useRtl();\n const baseStyles = useStyles();\n return {\n root: mergeClasses(cartesianchartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n chartWrapper: mergeClasses(cartesianchartClassNames.chartWrapper, baseStyles.chartWrapper, ((_props_reflowProps = props.reflowProps) === null || _props_reflowProps === void 0 ? void 0 : _props_reflowProps.mode) === 'min-width' ? baseStyles.chartWrapperMinWidth : undefined, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chartWrapper),\n plotContainer: mergeClasses(cartesianchartClassNames.plotContainer, baseStyles.plotContainer /*props.styles?.plotContainer*/ ),\n axisTitle: mergeClasses(cartesianchartClassNames.axisTitle, baseStyles.axisTitle /*props.styles?.axisTitle*/ ),\n xAxis: mergeClasses(cartesianchartClassNames.xAxis, baseStyles.xAxis /*props.styles?.xAxis*/ ),\n yAxis: mergeClasses(cartesianchartClassNames.yAxis, baseStyles.yAxis, _useRtl ? baseStyles.rtl : baseStyles.ltr /*props.styles?.yAxis*/ ),\n opacityChangeOnHover: mergeClasses(cartesianchartClassNames.opacityChangeOnHover, baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/ ),\n legendContainer: mergeClasses(cartesianchartClassNames.legendContainer, baseStyles.legendContainer /*props.styles?.legendContainer*/ ),\n svgTooltip: mergeClasses(cartesianchartClassNames.svgTooltip, baseStyles.svgTooltip, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.svgTooltip),\n annotationLayer: mergeClasses(cartesianchartClassNames.annotationLayer, baseStyles.annotationLayer /*props.styles?.annotationLayer*/ ),\n tooltip: mergeClasses(cartesianchartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n axisAnnotation: mergeClasses(cartesianchartClassNames.axisAnnotation, baseStyles.axisAnnotation),\n chart: mergeClasses(cartesianchartClassNames.chart, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.chart)\n };\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,SAASC,yBAAyB,EAAEC,oBAAoB,EAAEC,MAAM,QAAQ,2BAA2B;AACnG,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,uBAAuB;AAC1E;AACA;AACA;AAAI,OAAO,MAAMC,wBAAwB,GAAG;EACxCC,IAAI,EAAE,gBAAgB;EACtBC,YAAY,EAAE,wBAAwB;EACtCC,aAAa,EAAE,yBAAyB;EACxCC,SAAS,EAAE,qBAAqB;EAChCC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BAAwB,CAACS,UAAU,EAAEqE,UAAU,CAACrE,UAAU,EAAE,CAACkE,cAAc,GAAGJ,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAClE,UAAU,CAAC;IAChMQ,eAAe,EAAEzB,YAAY,CAACQ,wBAAwB,CAACiB,eAAe,EAAE6D,UAAU,CAAC7D,eAAe,CAAC,iCAAkC,CAAC;IACtIJ,OAAO,EAAErB,YAAY,CAACQ,wBAAwB,CAACa,OAAO,EAAEiE,UAAU,CAACjE,OAAO,CAAC,yBAA0B,CAAC;IACtGC,cAAc,EAAEtB,YAAY,CAACQ,wBAAwB,CAACc,cAAc,EAAEgE,UAAU,CAAChE,cAAc,CAAC;IAChGE,KAAK,EAAExB,YAAY,CAACQ,wBAAwB,CAACgB,KAAK,EAAE,CAAC4D,cAAc,GAAGL,KAAK,CAACQ,MAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC5D,KAAK;EAC7J,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { makeStyles, mergeClasses } from '@griffel/react';
|
|
3
3
|
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
4
|
-
import { HighContrastSelector, useRtl } from '../../utilities/utilities';
|
|
4
|
+
import { CARTESIAN_XAXIS_CLASSNAME, HighContrastSelector, useRtl } from '../../utilities/utilities';
|
|
5
5
|
import { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -10,7 +10,7 @@ import { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';
|
|
|
10
10
|
chartWrapper: 'fui-cart__chartWrapper',
|
|
11
11
|
plotContainer: 'fui-cart__plotContainer',
|
|
12
12
|
axisTitle: 'fui-cart__axisTitle',
|
|
13
|
-
xAxis:
|
|
13
|
+
xAxis: CARTESIAN_XAXIS_CLASSNAME,
|
|
14
14
|
yAxis: 'fui-cart__yAxis',
|
|
15
15
|
opacityChangeOnHover: 'fui-cart__opacityChangeOnHover',
|
|
16
16
|
legendContainer: 'fui-cart__legendContainer',
|
|
@@ -34,7 +34,8 @@ import { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';
|
|
|
34
34
|
height: '100%',
|
|
35
35
|
flexDirection: 'column',
|
|
36
36
|
overflow: 'hidden',
|
|
37
|
-
textAlign: 'left'
|
|
37
|
+
textAlign: 'left',
|
|
38
|
+
position: 'relative'
|
|
38
39
|
},
|
|
39
40
|
chartWrapper: {
|
|
40
41
|
position: 'relative'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CommonComponents/useCartesianChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { CartesianChartProps, CartesianChartStyles } from './CartesianChart.types';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector, useRtl } from '../../utilities/utilities';\nimport { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';\n\n/**\n * @internal\n */\nexport const cartesianchartClassNames: SlotClassNames<CartesianChartStyles> = {\n root: 'fui-cart__root',\n chartWrapper: 'fui-cart__chartWrapper',\n plotContainer: 'fui-cart__plotContainer',\n axisTitle: 'fui-cart__axisTitle',\n xAxis:
|
|
1
|
+
{"version":3,"sources":["../src/components/CommonComponents/useCartesianChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { CartesianChartProps, CartesianChartStyles } from './CartesianChart.types';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { CARTESIAN_XAXIS_CLASSNAME, HighContrastSelector, useRtl } from '../../utilities/utilities';\nimport { getAxisTitleStyle, getTooltipStyle } from '../../utilities/index';\n\n/**\n * @internal\n */\nexport const cartesianchartClassNames: SlotClassNames<CartesianChartStyles> = {\n root: 'fui-cart__root',\n chartWrapper: 'fui-cart__chartWrapper',\n plotContainer: 'fui-cart__plotContainer',\n axisTitle: 'fui-cart__axisTitle',\n xAxis: CARTESIAN_XAXIS_CLASSNAME,\n yAxis: 'fui-cart__yAxis',\n opacityChangeOnHover: 'fui-cart__opacityChangeOnHover',\n legendContainer: 'fui-cart__legendContainer',\n svgTooltip: 'fui-cart_svgTooltip',\n shapeStyles: 'fui-cart__shapeStyles',\n descriptionMessage: 'fui-cart__descriptionMessage',\n hover: 'fui-cart__hover',\n tooltip: 'fui-cart__tooltip',\n axisAnnotation: 'fui-cart__axisAnnotation',\n chartTitle: 'fui-cart__chartTitle',\n chart: 'fui-cart__chart',\n annotationLayer: 'fui-cart__annotationLayer',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n textAlign: 'left',\n position: 'relative',\n },\n chartWrapper: {\n position: 'relative',\n },\n chartWrapperMinWidth: {\n overflow: 'auto',\n },\n plotContainer: {\n position: 'relative',\n width: '100%',\n height: '100%',\n },\n axisTitle: getAxisTitleStyle() as GriffelStyle,\n axisAnnotation: getAxisTitleStyle() as GriffelStyle,\n xAxis: {\n '& text': {\n fill: tokens.colorNeutralForeground1,\n ...typographyStyles.caption2Strong,\n forcedColorAdjust: 'auto',\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n width: '1px',\n forcedColorAdjust: 'auto',\n },\n '& path': {\n display: 'none',\n },\n },\n yAxis: {\n '& text': {\n ...typographyStyles.caption2Strong,\n fill: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n '& line': {\n opacity: 0.2,\n stroke: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n '& path': {\n display: 'none',\n },\n },\n rtl: {\n '& g': {\n textAnchor: 'end',\n },\n },\n ltr: {},\n opacityChangeOnHover: {\n opacity: '0.1', //supports custom opacity ??\n cursor: 'default', //supports custom cursor ??\n },\n legendContainer: {\n marginTop: tokens.spacingVerticalS,\n marginLeft: tokens.spacingHorizontalXL,\n },\n svgTooltip: {\n fill: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n annotationLayer: {\n pointerEvents: 'none',\n },\n tooltip: getTooltipStyle() as GriffelStyle,\n});\n/**\n *\n * Apply styling to the Carousel slots based on the state\n */\nexport const useCartesianChartStyles = (props: CartesianChartProps): CartesianChartStyles => {\n const _useRtl = useRtl();\n const baseStyles = useStyles();\n return {\n root: mergeClasses(cartesianchartClassNames.root, baseStyles.root, props.styles?.root),\n chartWrapper: mergeClasses(\n cartesianchartClassNames.chartWrapper,\n baseStyles.chartWrapper,\n props.reflowProps?.mode === 'min-width' ? baseStyles.chartWrapperMinWidth : undefined,\n props.styles?.chartWrapper,\n ),\n plotContainer: mergeClasses(\n cartesianchartClassNames.plotContainer,\n baseStyles.plotContainer /*props.styles?.plotContainer*/,\n ),\n axisTitle: mergeClasses(cartesianchartClassNames.axisTitle, baseStyles.axisTitle /*props.styles?.axisTitle*/),\n xAxis: mergeClasses(cartesianchartClassNames.xAxis, baseStyles.xAxis /*props.styles?.xAxis*/),\n yAxis: mergeClasses(\n cartesianchartClassNames.yAxis,\n baseStyles.yAxis,\n _useRtl ? baseStyles.rtl : baseStyles.ltr /*props.styles?.yAxis*/,\n ),\n opacityChangeOnHover: mergeClasses(\n cartesianchartClassNames.opacityChangeOnHover,\n baseStyles.opacityChangeOnHover /*props.styles?.opacityChangeOnHover*/,\n ),\n legendContainer: mergeClasses(\n cartesianchartClassNames.legendContainer,\n baseStyles.legendContainer /*props.styles?.legendContainer*/,\n ),\n svgTooltip: mergeClasses(cartesianchartClassNames.svgTooltip, baseStyles.svgTooltip, props.styles?.svgTooltip),\n annotationLayer: mergeClasses(\n cartesianchartClassNames.annotationLayer,\n baseStyles.annotationLayer /*props.styles?.annotationLayer*/,\n ),\n tooltip: mergeClasses(cartesianchartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),\n axisAnnotation: mergeClasses(\n cartesianchartClassNames.axisAnnotation,\n baseStyles.axisAnnotation,\n /*props.styles?.axisAnnotation,*/\n ),\n chart: mergeClasses(cartesianchartClassNames.chart, props.styles?.chart),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","CARTESIAN_XAXIS_CLASSNAME","HighContrastSelector","useRtl","getAxisTitleStyle","getTooltipStyle","cartesianchartClassNames","root","chartWrapper","plotContainer","axisTitle","xAxis","yAxis","opacityChangeOnHover","legendContainer","svgTooltip","shapeStyles","descriptionMessage","hover","tooltip","axisAnnotation","chartTitle","chart","annotationLayer","useStyles","body1","display","width","height","flexDirection","overflow","textAlign","position","chartWrapperMinWidth","fill","colorNeutralForeground1","caption2Strong","forcedColorAdjust","opacity","stroke","rtl","textAnchor","ltr","cursor","marginTop","spacingVerticalS","marginLeft","spacingHorizontalXL","colorNeutralBackground1","pointerEvents","useCartesianChartStyles","props","_useRtl","baseStyles","styles","reflowProps","mode","undefined"],"mappings":"AAAA;AAEA,SAAuBA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAGxE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AACjE,SAASC,yBAAyB,EAAEC,oBAAoB,EAAEC,MAAM,QAAQ,4BAA4B;AACpG,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,wBAAwB;AAE3E;;CAEC,GACD,OAAO,MAAMC,2BAAiE;IAC5EC,MAAM;IACNC,cAAc;IACdC,eAAe;IACfC,WAAW;IACXC,OAAOV;IACPW,OAAO;IACPC,sBAAsB;IACtBC,iBAAiB;IACjBC,YAAY;IACZC,aAAa;IACbC,oBAAoB;IAC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,yBAAyBa,OAAO,EAAEkC,WAAWlC,OAAO,CAAC,uBAAuB;QAClGC,gBAAgBtB,aACdQ,yBAAyBc,cAAc,EACvCiC,WAAWjC,cAAc;QAG3BE,OAAOxB,aAAaQ,yBAAyBgB,KAAK,GAAE6B,iBAAAA,MAAMG,MAAM,cAAZH,qCAAAA,eAAc7B,KAAK;IACzE;AACF,EAAE"}
|
|
@@ -217,6 +217,62 @@ export const resolveXAxisPoint = (x, isXYearCategory, isXString, isXDate, isXNum
|
|
|
217
217
|
}
|
|
218
218
|
return x;
|
|
219
219
|
};
|
|
220
|
+
/**
|
|
221
|
+
* Formats text values according to the texttemplate specification
|
|
222
|
+
* Supports D3 format specifiers within %{text:format} patterns
|
|
223
|
+
* @param textValue The raw text value to format
|
|
224
|
+
* @param textTemplate The template string (e.g., "%{text:.1f}%", "%{text:.2%}", "%{text:,.0f}")
|
|
225
|
+
* @param index Optional index for array-based templates
|
|
226
|
+
* @returns Formatted text string
|
|
227
|
+
*
|
|
228
|
+
* Examples:
|
|
229
|
+
* - "%{text:.1f}%" → Formats number with 1 decimal place and adds % suffix
|
|
230
|
+
* - "%{text:.2%}" → Formats as percentage with 2 decimal places
|
|
231
|
+
* - "%{text:,.0f}" → Formats with thousands separator and no decimals
|
|
232
|
+
* - "%{text:$,.2f}" → Formats as currency with thousands separator and 2 decimals
|
|
233
|
+
*/ const formatTextWithTemplate = (textValue, textTemplate, index)=>{
|
|
234
|
+
if (!textTemplate) {
|
|
235
|
+
return String(textValue);
|
|
236
|
+
}
|
|
237
|
+
const numVal = typeof textValue === 'number' ? textValue : parseFloat(String(textValue));
|
|
238
|
+
if (isNaN(numVal)) {
|
|
239
|
+
return String(textValue);
|
|
240
|
+
}
|
|
241
|
+
const template = typeof textTemplate === 'string' ? textTemplate : textTemplate[index || 0] || '';
|
|
242
|
+
// Match Plotly's texttemplate pattern: %{text:format} or %{text}
|
|
243
|
+
// Can be followed by any literal text like %, $, etc.
|
|
244
|
+
const plotlyPattern = /%\{text(?::([^}]+))?\}(.*)$/;
|
|
245
|
+
const match = template.match(plotlyPattern);
|
|
246
|
+
if (match) {
|
|
247
|
+
const formatSpec = match[1]; // The format specifier (e.g., ".1f", ".2%", ",.0f") or undefined
|
|
248
|
+
const suffix = match[2]; // Any text after the closing brace (e.g., "%", " units")
|
|
249
|
+
// If no format specifier is provided (e.g., %{text}%), try to infer from suffix
|
|
250
|
+
if (!formatSpec) {
|
|
251
|
+
// Check if suffix starts with % - assume simple percentage with 1 decimal
|
|
252
|
+
if (suffix.startsWith('%')) {
|
|
253
|
+
return `${numVal.toFixed(1)}${suffix}`;
|
|
254
|
+
}
|
|
255
|
+
// No format specifier, just return the number with the suffix
|
|
256
|
+
return `${numVal}${suffix}`;
|
|
257
|
+
}
|
|
258
|
+
try {
|
|
259
|
+
// Use D3 format function to apply the format specifier
|
|
260
|
+
const formatter = d3Format(formatSpec);
|
|
261
|
+
const formattedValue = formatter(numVal);
|
|
262
|
+
return `${formattedValue}${suffix}`;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
// Try to extract precision for basic fallback
|
|
265
|
+
const precisionMatch = formatSpec.match(/\.(\d+)[f%]/);
|
|
266
|
+
const precision = precisionMatch ? parseInt(precisionMatch[1], 10) : 2;
|
|
267
|
+
// Check if it's a percentage format
|
|
268
|
+
if (formatSpec.includes('%')) {
|
|
269
|
+
return `${(numVal * 100).toFixed(precision)}%${suffix}`;
|
|
270
|
+
}
|
|
271
|
+
return `${numVal.toFixed(precision)}${suffix}`;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return String(textValue);
|
|
275
|
+
};
|
|
220
276
|
/**
|
|
221
277
|
* Extracts unique X-axis categories from Plotly data traces
|
|
222
278
|
* @param data Array of Plotly data traces
|
|
@@ -873,7 +929,8 @@ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, co
|
|
|
873
929
|
const hideLabels = firstData.textinfo ? ![
|
|
874
930
|
'value',
|
|
875
931
|
'percent',
|
|
876
|
-
'label+percent'
|
|
932
|
+
'label+percent',
|
|
933
|
+
'percent+label'
|
|
877
934
|
].includes(firstData.textinfo) : false;
|
|
878
935
|
const donutMarginHorizontal = hideLabels ? 0 : 80;
|
|
879
936
|
const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
|
|
@@ -906,14 +963,15 @@ export const transformPlotlyJsonToDonutProps = (input, isMultiPlot, colorMap, co
|
|
|
906
963
|
hideLabels,
|
|
907
964
|
showLabelsInPercent: firstData.textinfo ? [
|
|
908
965
|
'percent',
|
|
909
|
-
'label+percent'
|
|
966
|
+
'label+percent',
|
|
967
|
+
'percent+label'
|
|
910
968
|
].includes(firstData.textinfo) : true,
|
|
911
969
|
roundCorners: true,
|
|
912
970
|
order: 'sorted'
|
|
913
971
|
};
|
|
914
972
|
};
|
|
915
973
|
export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme, fallbackVSBC)=>{
|
|
916
|
-
var _input_layout, _input_layout1, _input_layout2
|
|
974
|
+
var _input_layout, _input_layout1, _input_layout2;
|
|
917
975
|
const mapXToDataPoints = {};
|
|
918
976
|
let yMaxValue = 0;
|
|
919
977
|
let yMinValue = 0;
|
|
@@ -933,6 +991,7 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
933
991
|
validXYRanges.forEach(([rangeStart, rangeEnd], rangeIdx)=>{
|
|
934
992
|
const rangeXValues = series.x.slice(rangeStart, rangeEnd);
|
|
935
993
|
const rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
994
|
+
const textValues = Array.isArray(series.text) ? series.text.slice(rangeStart, rangeEnd) : typeof series.text === 'string' ? series.text : undefined;
|
|
936
995
|
rangeXValues.forEach((x, index2)=>{
|
|
937
996
|
var _series_marker, _series_marker1, _series_marker_color, _series_marker2, _input_layout_template_layout, _input_layout_template, _input_layout;
|
|
938
997
|
if (!mapXToDataPoints[x]) {
|
|
@@ -948,6 +1007,11 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
948
1007
|
const opacity = getOpacity(series, index2);
|
|
949
1008
|
const yVal = rangeYValues[index2];
|
|
950
1009
|
const yAxisCalloutData = getFormattedCalloutYData(yVal, yAxisTickFormat);
|
|
1010
|
+
let barLabel = Array.isArray(textValues) ? textValues[index2] : textValues;
|
|
1011
|
+
// Apply texttemplate formatting if specified
|
|
1012
|
+
if (barLabel && series.texttemplate) {
|
|
1013
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index2);
|
|
1014
|
+
}
|
|
951
1015
|
if (series.type === 'bar') {
|
|
952
1016
|
var _rgb_copy_formatHex8;
|
|
953
1017
|
mapXToDataPoints[x].chartData.push({
|
|
@@ -956,7 +1020,10 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
956
1020
|
color: (_rgb_copy_formatHex8 = rgb(color).copy({
|
|
957
1021
|
opacity
|
|
958
1022
|
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color,
|
|
959
|
-
yAxisCalloutData
|
|
1023
|
+
yAxisCalloutData,
|
|
1024
|
+
...barLabel ? {
|
|
1025
|
+
barLabel: String(barLabel)
|
|
1026
|
+
} : {}
|
|
960
1027
|
});
|
|
961
1028
|
if (typeof yVal === 'number') {
|
|
962
1029
|
yMaxValue = Math.max(yMaxValue, yVal);
|
|
@@ -1065,7 +1132,6 @@ export const transformPlotlyJsonToVSBCProps = (input, isMultiPlot, colorMap, col
|
|
|
1065
1132
|
yMinValue,
|
|
1066
1133
|
mode: 'plotly',
|
|
1067
1134
|
...secondaryYAxisValues,
|
|
1068
|
-
wrapXAxisLables: typeof ((_vsbcData_ = vsbcData[0]) === null || _vsbcData_ === void 0 ? void 0 : _vsbcData_.xAxisPoint) === 'string',
|
|
1069
1135
|
hideTickOverlap: true,
|
|
1070
1136
|
barGapMax: 2,
|
|
1071
1137
|
hideLegend,
|
|
@@ -1143,6 +1209,12 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
1143
1209
|
const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[xIndex % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedBarColors, xIndex, legend, colorMap, (_processedInput_layout = processedInput.layout) === null || _processedInput_layout === void 0 ? void 0 : (_processedInput_layout_template = _processedInput_layout.template) === null || _processedInput_layout_template === void 0 ? void 0 : (_processedInput_layout_template_layout = _processedInput_layout_template.layout) === null || _processedInput_layout_template_layout === void 0 ? void 0 : _processedInput_layout_template_layout.colorway, isDarkTheme);
|
|
1144
1210
|
const opacity = getOpacity(series, xIndex);
|
|
1145
1211
|
const yVal = series.y[xIndex];
|
|
1212
|
+
// Extract text value for barLabel
|
|
1213
|
+
let barLabel = Array.isArray(series.text) ? series.text[xIndex] : series.text;
|
|
1214
|
+
// Apply texttemplate formatting if specified
|
|
1215
|
+
if (barLabel && series.texttemplate) {
|
|
1216
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, xIndex);
|
|
1217
|
+
}
|
|
1146
1218
|
var _rgb_copy_formatHex8;
|
|
1147
1219
|
return {
|
|
1148
1220
|
x: x.toString(),
|
|
@@ -1150,7 +1222,10 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
1150
1222
|
yAxisCalloutData: getFormattedCalloutYData(yVal, yAxisTickFormat),
|
|
1151
1223
|
color: (_rgb_copy_formatHex8 = rgb(color).copy({
|
|
1152
1224
|
opacity
|
|
1153
|
-
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color
|
|
1225
|
+
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color,
|
|
1226
|
+
...barLabel ? {
|
|
1227
|
+
barLabel: String(barLabel)
|
|
1228
|
+
} : {}
|
|
1154
1229
|
};
|
|
1155
1230
|
}).filter((item)=>typeof item !== 'undefined'),
|
|
1156
1231
|
useSecondaryYScale: usesSecondaryYScale(series, processedInput.layout)
|
|
@@ -1201,7 +1276,6 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
1201
1276
|
mode: 'plotly',
|
|
1202
1277
|
...secondaryYAxisValues,
|
|
1203
1278
|
hideTickOverlap: true,
|
|
1204
|
-
wrapXAxisLables: true,
|
|
1205
1279
|
hideLegend,
|
|
1206
1280
|
roundCorners: true,
|
|
1207
1281
|
showYAxisLables: true,
|
|
@@ -1220,7 +1294,7 @@ export const transformPlotlyJsonToGVBCProps = (input, isMultiPlot, colorMap, col
|
|
|
1220
1294
|
};
|
|
1221
1295
|
};
|
|
1222
1296
|
export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
1223
|
-
var _input_layout, _input_layout1
|
|
1297
|
+
var _input_layout, _input_layout1;
|
|
1224
1298
|
const vbcData = [];
|
|
1225
1299
|
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
|
|
1226
1300
|
let colorScale = undefined;
|
|
@@ -1267,6 +1341,11 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
1267
1341
|
const color = colorScale ? colorScale(isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color) ? (_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : (_series_marker_color = _series_marker2.color) === null || _series_marker_color === void 0 ? void 0 : _series_marker_color[index % ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color).length] : 0) : resolveColor(extractedColors, index, legend, colorMap, (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_template = _input_layout.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorway, isDarkTheme);
|
|
1268
1342
|
const opacity = getOpacity(series, index);
|
|
1269
1343
|
const yVal = calculateHistNorm(series.histnorm, y[index], total, isXString ? bin.length : getBinSize(bin));
|
|
1344
|
+
// Handle text values and texttemplate formatting for histogram bins
|
|
1345
|
+
let barLabel = Array.isArray(series.text) ? series.text[index] : series.text;
|
|
1346
|
+
if (barLabel && series.texttemplate) {
|
|
1347
|
+
barLabel = formatTextWithTemplate(barLabel, series.texttemplate, index);
|
|
1348
|
+
}
|
|
1270
1349
|
var _rgb_copy_formatHex8;
|
|
1271
1350
|
vbcData.push({
|
|
1272
1351
|
x: isXString ? bin.join(', ') : getBinCenter(bin),
|
|
@@ -1277,7 +1356,10 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
1277
1356
|
}).formatHex8()) !== null && _rgb_copy_formatHex8 !== void 0 ? _rgb_copy_formatHex8 : color,
|
|
1278
1357
|
...isXString ? {} : {
|
|
1279
1358
|
xAxisCalloutData: `[${bin.x0} - ${bin.x1})`
|
|
1280
|
-
}
|
|
1359
|
+
},
|
|
1360
|
+
...barLabel ? {
|
|
1361
|
+
barLabel: String(barLabel)
|
|
1362
|
+
} : {}
|
|
1281
1363
|
});
|
|
1282
1364
|
});
|
|
1283
1365
|
});
|
|
@@ -1289,7 +1371,6 @@ export const transformPlotlyJsonToVBCProps = (input, isMultiPlot, colorMap, colo
|
|
|
1289
1371
|
height: (_input_layout_height = (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
1290
1372
|
mode: 'histogram',
|
|
1291
1373
|
hideTickOverlap: true,
|
|
1292
|
-
wrapXAxisLables: typeof ((_vbcData_ = vbcData[0]) === null || _vbcData_ === void 0 ? void 0 : _vbcData_.x) === 'string',
|
|
1293
1374
|
maxBarWidth: 50,
|
|
1294
1375
|
hideLegend,
|
|
1295
1376
|
roundCorners: true,
|
|
@@ -1352,9 +1433,7 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1352
1433
|
let mode = 'tonexty';
|
|
1353
1434
|
const { legends, hideLegend } = getLegendProps(input.data, input.layout, isMultiPlot);
|
|
1354
1435
|
const yAxisTickFormat = getYAxisTickFormat(input.data[0], input.layout);
|
|
1355
|
-
const
|
|
1356
|
-
const resolveXValue = getAxisValueResolver(xAxisType);
|
|
1357
|
-
const shouldWrapLabels = xAxisType === 'category';
|
|
1436
|
+
const resolveXValue = getAxisValueResolver(getAxisType(input.data, getAxisObjects(input.data, input.layout).x));
|
|
1358
1437
|
const chartData = input.data.map((series, index)=>{
|
|
1359
1438
|
var _series_mode, _series_line, _series_marker, _series_line1, _input_layout_template_layout, _input_layout_template, _input_layout, _input_layout_template_layout1, _input_layout_template1, _input_layout1, _series_mode1;
|
|
1360
1439
|
const colors = isScatterMarkers ? (series === null || series === void 0 ? void 0 : (_series_mode = series.mode) === null || _series_mode === void 0 ? void 0 : _series_mode.includes('line')) ? (_series_line = series.line) === null || _series_line === void 0 ? void 0 : _series_line.color : (_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.color : (_series_line1 = series.line) === null || _series_line1 === void 0 ? void 0 : _series_line1.color;
|
|
@@ -1513,7 +1592,6 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
1513
1592
|
hideTickOverlap: true,
|
|
1514
1593
|
hideLegend,
|
|
1515
1594
|
useUTC: false,
|
|
1516
|
-
wrapXAxisLabels: shouldWrapLabels,
|
|
1517
1595
|
optimizeLargeData: numDataPoints > 1000,
|
|
1518
1596
|
showYAxisLables: true,
|
|
1519
1597
|
roundedTicks: true,
|
|
@@ -1694,11 +1772,53 @@ export const transformPlotlyJsonToGanttChartProps = (input, isMultiPlot, colorMa
|
|
|
1694
1772
|
};
|
|
1695
1773
|
};
|
|
1696
1774
|
export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap, colorwayType, isDarkTheme)=>{
|
|
1697
|
-
var _input_layout, _input_layout_coloraxis,
|
|
1775
|
+
var _input_layout, _input_layout1, _input_layout_coloraxis, _input_layout2, _input_layout_template_layout, _input_layout_template, _input_layout3, _input_layout_template_data_histogram2d_, _input_layout_template_data_histogram2d, _input_layout_template_data, _input_layout_template1, _input_layout4, _input_layout_template_data_heatmap_, _input_layout_template_data_heatmap, _input_layout_template_data1, _input_layout_template2, _input_layout5, _input_layout6, _input_layout7;
|
|
1698
1776
|
const firstData = input.data[0];
|
|
1699
1777
|
const heatmapDataPoints = [];
|
|
1700
1778
|
let zMin = Number.POSITIVE_INFINITY;
|
|
1701
1779
|
let zMax = Number.NEGATIVE_INFINITY;
|
|
1780
|
+
// Build a 2D array of annotations based on their grid position
|
|
1781
|
+
const annotationGrid = [];
|
|
1782
|
+
const rawAnnotations = (_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : _input_layout.annotations;
|
|
1783
|
+
if (rawAnnotations) {
|
|
1784
|
+
const annotationsArray = Array.isArray(rawAnnotations) ? rawAnnotations : [
|
|
1785
|
+
rawAnnotations
|
|
1786
|
+
];
|
|
1787
|
+
// Collect all unique x and y values from valid annotations
|
|
1788
|
+
const xSet = new Set();
|
|
1789
|
+
const ySet = new Set();
|
|
1790
|
+
const validAnnotations = [];
|
|
1791
|
+
annotationsArray.forEach((a)=>{
|
|
1792
|
+
if (a && typeof a.x === 'number' && typeof a.y === 'number' && typeof a.text === 'string' && (a.xref === 'x' || a.xref === undefined) && (a.yref === 'y' || a.yref === undefined)) {
|
|
1793
|
+
xSet.add(a.x);
|
|
1794
|
+
ySet.add(a.y);
|
|
1795
|
+
validAnnotations.push({
|
|
1796
|
+
x: a.x,
|
|
1797
|
+
y: a.y,
|
|
1798
|
+
text: cleanText(a.text)
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
if (validAnnotations.length > 0) {
|
|
1803
|
+
// Get sorted unique x and y values
|
|
1804
|
+
const xValues = Array.from(xSet).sort((a, b)=>a - b);
|
|
1805
|
+
const yValues = Array.from(ySet).sort((a, b)=>a - b);
|
|
1806
|
+
// Initialize 2D grid and populate
|
|
1807
|
+
validAnnotations.forEach((annotation)=>{
|
|
1808
|
+
const xIdx = xValues.indexOf(annotation.x);
|
|
1809
|
+
const yIdx = yValues.indexOf(annotation.y);
|
|
1810
|
+
if (!annotationGrid[yIdx]) {
|
|
1811
|
+
annotationGrid[yIdx] = [];
|
|
1812
|
+
}
|
|
1813
|
+
annotationGrid[yIdx][xIdx] = annotation.text;
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
// Helper function to get annotation from 2D grid by index
|
|
1818
|
+
const getAnnotationByIndex = (xIdx, yIdx)=>{
|
|
1819
|
+
var _annotationGrid_yIdx;
|
|
1820
|
+
return (_annotationGrid_yIdx = annotationGrid[yIdx]) === null || _annotationGrid_yIdx === void 0 ? void 0 : _annotationGrid_yIdx[xIdx];
|
|
1821
|
+
};
|
|
1702
1822
|
if (firstData.type === 'histogram2d') {
|
|
1703
1823
|
var _firstData_x, _firstData_xbins, _firstData_xbins1, _firstData_xbins2, _firstData_ybins, _firstData_ybins1, _firstData_ybins2;
|
|
1704
1824
|
const xValues = [];
|
|
@@ -1738,11 +1858,12 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
1738
1858
|
xBins.forEach((xBin, xIdx)=>{
|
|
1739
1859
|
yBins.forEach((yBin, yIdx)=>{
|
|
1740
1860
|
const zVal = calculateHistNorm(firstData.histnorm, z[yIdx][xIdx], total, isXString ? xBin.length : getBinSize(xBin), isYString ? yBin.length : getBinSize(yBin));
|
|
1861
|
+
const annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1741
1862
|
heatmapDataPoints.push({
|
|
1742
1863
|
x: isXString ? xBin.join(', ') : getBinCenter(xBin),
|
|
1743
1864
|
y: isYString ? yBin.join(', ') : getBinCenter(yBin),
|
|
1744
1865
|
value: zVal,
|
|
1745
|
-
rectText: zVal
|
|
1866
|
+
rectText: annotationText || zVal
|
|
1746
1867
|
});
|
|
1747
1868
|
if (typeof zVal === 'number') {
|
|
1748
1869
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1751,18 +1872,34 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
1751
1872
|
});
|
|
1752
1873
|
});
|
|
1753
1874
|
} else {
|
|
1754
|
-
var
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1875
|
+
var _zArray_;
|
|
1876
|
+
// If x and y are not provided, generate indices based on z dimensions
|
|
1877
|
+
const zArray = firstData.z;
|
|
1878
|
+
const xValues = firstData.x;
|
|
1879
|
+
const yValues = firstData.y;
|
|
1880
|
+
var _zArray_length;
|
|
1881
|
+
// Determine the dimensions from z array
|
|
1882
|
+
const yLength = (_zArray_length = zArray === null || zArray === void 0 ? void 0 : zArray.length) !== null && _zArray_length !== void 0 ? _zArray_length : 0;
|
|
1883
|
+
var _zArray__length;
|
|
1884
|
+
const xLength = (_zArray__length = zArray === null || zArray === void 0 ? void 0 : (_zArray_ = zArray[0]) === null || _zArray_ === void 0 ? void 0 : _zArray_.length) !== null && _zArray__length !== void 0 ? _zArray__length : 0;
|
|
1885
|
+
// Use provided x/y values or generate indices
|
|
1886
|
+
const xData = xValues !== null && xValues !== void 0 ? xValues : Array.from({
|
|
1887
|
+
length: xLength
|
|
1888
|
+
}, (_, i)=>i);
|
|
1889
|
+
const yData = yValues !== null && yValues !== void 0 ? yValues : Array.from({
|
|
1890
|
+
length: yLength
|
|
1891
|
+
}, (_, i)=>yLength - 1 - i);
|
|
1892
|
+
xData.forEach((xVal, xIdx)=>{
|
|
1893
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1894
|
+
yData.forEach((yVal, yIdx)=>{
|
|
1895
|
+
var _zArray_yIdx, _input_layout_xaxis, _input_layout, _input_layout_yaxis, _input_layout1;
|
|
1896
|
+
const zVal = zArray === null || zArray === void 0 ? void 0 : (_zArray_yIdx = zArray[yIdx]) === null || _zArray_yIdx === void 0 ? void 0 : _zArray_yIdx[xIdx];
|
|
1897
|
+
const annotationText = getAnnotationByIndex(xIdx, yIdx);
|
|
1761
1898
|
heatmapDataPoints.push({
|
|
1762
1899
|
x: ((_input_layout = input.layout) === null || _input_layout === void 0 ? void 0 : (_input_layout_xaxis = _input_layout.xaxis) === null || _input_layout_xaxis === void 0 ? void 0 : _input_layout_xaxis.type) === 'date' ? xVal : xVal !== null && xVal !== void 0 ? xVal : 0,
|
|
1763
1900
|
y: ((_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : (_input_layout_yaxis = _input_layout1.yaxis) === null || _input_layout_yaxis === void 0 ? void 0 : _input_layout_yaxis.type) === 'date' ? yVal : yVal,
|
|
1764
1901
|
value: zVal,
|
|
1765
|
-
rectText: zVal
|
|
1902
|
+
rectText: annotationText || zVal
|
|
1766
1903
|
});
|
|
1767
1904
|
if (typeof zVal === 'number') {
|
|
1768
1905
|
zMin = Math.min(zMin, zVal);
|
|
@@ -1789,7 +1926,7 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
1789
1926
|
getColorFromToken(DataVizPalette.color3)
|
|
1790
1927
|
];
|
|
1791
1928
|
var _firstData_colorscale, _ref, _ref1, _ref2, _ref3;
|
|
1792
|
-
let colorscale = (_ref3 = (_ref2 = (_ref1 = (_ref = (_firstData_colorscale = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _firstData_colorscale !== void 0 ? _firstData_colorscale : (
|
|
1929
|
+
let colorscale = (_ref3 = (_ref2 = (_ref1 = (_ref = (_firstData_colorscale = firstData === null || firstData === void 0 ? void 0 : firstData.colorscale) !== null && _firstData_colorscale !== void 0 ? _firstData_colorscale : (_input_layout1 = input.layout) === null || _input_layout1 === void 0 ? void 0 : _input_layout1.colorscale) !== null && _ref !== void 0 ? _ref : (_input_layout2 = input.layout) === null || _input_layout2 === void 0 ? void 0 : (_input_layout_coloraxis = _input_layout2.coloraxis) === null || _input_layout_coloraxis === void 0 ? void 0 : _input_layout_coloraxis.colorscale) !== null && _ref1 !== void 0 ? _ref1 : (_input_layout3 = input.layout) === null || _input_layout3 === void 0 ? void 0 : (_input_layout_template = _input_layout3.template) === null || _input_layout_template === void 0 ? void 0 : (_input_layout_template_layout = _input_layout_template.layout) === null || _input_layout_template_layout === void 0 ? void 0 : _input_layout_template_layout.colorscale) !== null && _ref2 !== void 0 ? _ref2 : firstData.type === 'histogram2d' && ((_input_layout4 = input.layout) === null || _input_layout4 === void 0 ? void 0 : (_input_layout_template1 = _input_layout4.template) === null || _input_layout_template1 === void 0 ? void 0 : (_input_layout_template_data = _input_layout_template1.data) === null || _input_layout_template_data === void 0 ? void 0 : (_input_layout_template_data_histogram2d = _input_layout_template_data.histogram2d) === null || _input_layout_template_data_histogram2d === void 0 ? void 0 : (_input_layout_template_data_histogram2d_ = _input_layout_template_data_histogram2d[0]) === null || _input_layout_template_data_histogram2d_ === void 0 ? void 0 : _input_layout_template_data_histogram2d_.colorscale)) !== null && _ref3 !== void 0 ? _ref3 : (_input_layout5 = input.layout) === null || _input_layout5 === void 0 ? void 0 : (_input_layout_template2 = _input_layout5.template) === null || _input_layout_template2 === void 0 ? void 0 : (_input_layout_template_data1 = _input_layout_template2.data) === null || _input_layout_template_data1 === void 0 ? void 0 : (_input_layout_template_data_heatmap = _input_layout_template_data1.heatmap) === null || _input_layout_template_data_heatmap === void 0 ? void 0 : (_input_layout_template_data_heatmap_ = _input_layout_template_data_heatmap[0]) === null || _input_layout_template_data_heatmap_ === void 0 ? void 0 : _input_layout_template_data_heatmap_.colorscale;
|
|
1793
1930
|
// determine if the types diverging, sequential or sequentialminus are present in colorscale
|
|
1794
1931
|
if (colorscale && typeof colorscale === 'object' && ('diverging' in colorscale || 'sequential' in colorscale || 'sequentialminus' in colorscale)) {
|
|
1795
1932
|
const isDivergent = zMin < 0 && zMax > 0; // Data spans both positive and negative values
|
|
@@ -1815,12 +1952,11 @@ export const transformPlotlyJsonToHeatmapProps = (input, isMultiPlot, colorMap,
|
|
|
1815
1952
|
hideLegend: true,
|
|
1816
1953
|
showYAxisLables: true,
|
|
1817
1954
|
sortOrder: 'none',
|
|
1818
|
-
width: (
|
|
1819
|
-
height: (_input_layout_height = (
|
|
1955
|
+
width: (_input_layout6 = input.layout) === null || _input_layout6 === void 0 ? void 0 : _input_layout6.width,
|
|
1956
|
+
height: (_input_layout_height = (_input_layout7 = input.layout) === null || _input_layout7 === void 0 ? void 0 : _input_layout7.height) !== null && _input_layout_height !== void 0 ? _input_layout_height : 350,
|
|
1820
1957
|
hideTickOverlap: true,
|
|
1821
1958
|
noOfCharsToTruncate: 20,
|
|
1822
1959
|
showYAxisLablesTooltip: true,
|
|
1823
|
-
wrapXAxisLables: true,
|
|
1824
1960
|
...getTitles(input.layout),
|
|
1825
1961
|
...getAxisCategoryOrderProps([
|
|
1826
1962
|
firstData
|
|
@@ -2670,7 +2806,10 @@ export const isNonPlotType = (chartType)=>{
|
|
|
2670
2806
|
'donut',
|
|
2671
2807
|
'sankey',
|
|
2672
2808
|
'pie',
|
|
2673
|
-
'annotation'
|
|
2809
|
+
'annotation',
|
|
2810
|
+
'table',
|
|
2811
|
+
'gauge',
|
|
2812
|
+
'funnel'
|
|
2674
2813
|
].includes(chartType);
|
|
2675
2814
|
};
|
|
2676
2815
|
export const getGridProperties = (schema, isMultiPlot, validTracesInfo)=>{
|
|
@@ -2933,16 +3072,23 @@ const getAxisScaleTypeProps = (data, layout)=>{
|
|
|
2933
3072
|
return;
|
|
2934
3073
|
}
|
|
2935
3074
|
const axType = getAxisType(data, ax);
|
|
3075
|
+
if (axId === 'x' && axType === 'category') {
|
|
3076
|
+
props.xAxis = {
|
|
3077
|
+
tickLayout: 'auto'
|
|
3078
|
+
};
|
|
3079
|
+
}
|
|
2936
3080
|
if ((!ax.tickmode || ax.tickmode === 'array') && isArrayOrTypedArray(ax.tickvals)) {
|
|
2937
3081
|
const tickValues = axType === 'date' ? ax.tickvals.map((v)=>new Date(v)) : ax.tickvals;
|
|
2938
3082
|
if (axId === 'x') {
|
|
2939
3083
|
props.tickValues = tickValues;
|
|
2940
3084
|
props.xAxis = {
|
|
3085
|
+
...props.xAxis,
|
|
2941
3086
|
tickText: ax.ticktext
|
|
2942
3087
|
};
|
|
2943
3088
|
} else if (axId === 'y') {
|
|
2944
3089
|
props.yAxisTickValues = tickValues;
|
|
2945
3090
|
props.yAxis = {
|
|
3091
|
+
...props.yAxis,
|
|
2946
3092
|
tickText: ax.ticktext
|
|
2947
3093
|
};
|
|
2948
3094
|
}
|
|
@@ -2953,11 +3099,13 @@ const getAxisScaleTypeProps = (data, layout)=>{
|
|
|
2953
3099
|
const tick0 = plotlyTick0(ax.tick0, axType, dtick);
|
|
2954
3100
|
if (axId === 'x') {
|
|
2955
3101
|
props.xAxis = {
|
|
3102
|
+
...props.xAxis,
|
|
2956
3103
|
tickStep: dtick,
|
|
2957
3104
|
tick0
|
|
2958
3105
|
};
|
|
2959
3106
|
} else if (axId === 'y') {
|
|
2960
3107
|
props.yAxis = {
|
|
3108
|
+
...props.yAxis,
|
|
2961
3109
|
tickStep: dtick,
|
|
2962
3110
|
tick0
|
|
2963
3111
|
};
|