@fluentui/react-charting 5.24.21 → 5.24.23

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.
Files changed (109) hide show
  1. package/CHANGELOG.json +55 -1
  2. package/CHANGELOG.md +24 -2
  3. package/bundle-size/ScatterChart.fixture.js +7 -0
  4. package/dist/react-charting.d.ts +29 -4
  5. package/dist/react-charting.js +1 -1
  6. package/dist/react-charting.min.js +1 -1
  7. package/etc/react-charting.api.md +10 -4
  8. package/lib/components/AreaChart/AreaChart.base.js +3 -3
  9. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  10. package/lib/components/CommonComponents/CartesianChart.base.js +4 -4
  11. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  12. package/lib/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  13. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  14. package/lib/components/DeclarativeChart/DeclarativeChart.js +2 -1
  15. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  16. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  17. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +187 -11
  18. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  19. package/lib/components/HeatMapChart/HeatMapChart.base.js +1 -1
  20. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  21. package/lib/components/HeatMapChart/HeatMapChart.styles.js +1 -8
  22. package/lib/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
  23. package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
  24. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  25. package/lib/components/LineChart/LineChart.base.d.ts +0 -9
  26. package/lib/components/LineChart/LineChart.base.js +82 -138
  27. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  28. package/lib/components/ScatterChart/ScatterChart.base.js +37 -62
  29. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  30. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +2 -2
  31. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  32. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +2 -2
  33. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  34. package/lib/index.d.ts +1 -1
  35. package/lib/index.js.map +1 -1
  36. package/lib/types/IDataPoint.d.ts +9 -0
  37. package/lib/types/IDataPoint.js.map +1 -1
  38. package/lib/utilities/utilities.d.ts +29 -28
  39. package/lib/utilities/utilities.js +127 -110
  40. package/lib/utilities/utilities.js.map +1 -1
  41. package/lib-amd/components/AreaChart/AreaChart.base.js +2 -2
  42. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  43. package/lib-amd/components/CommonComponents/CartesianChart.base.js +4 -4
  44. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  45. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  46. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  47. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +2 -1
  48. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  49. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  50. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +188 -11
  51. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  52. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +1 -1
  53. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  54. package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js +1 -8
  55. package/lib-amd/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
  56. package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
  57. package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  58. package/lib-amd/components/LineChart/LineChart.base.d.ts +0 -9
  59. package/lib-amd/components/LineChart/LineChart.base.js +80 -136
  60. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  61. package/lib-amd/components/ScatterChart/ScatterChart.base.js +35 -60
  62. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  63. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  64. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  65. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  66. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  67. package/lib-amd/index.d.ts +1 -1
  68. package/lib-amd/index.js.map +1 -1
  69. package/lib-amd/types/IDataPoint.d.ts +9 -0
  70. package/lib-amd/types/IDataPoint.js.map +1 -1
  71. package/lib-amd/utilities/utilities.d.ts +29 -28
  72. package/lib-amd/utilities/utilities.js +133 -113
  73. package/lib-amd/utilities/utilities.js.map +1 -1
  74. package/lib-commonjs/components/AreaChart/AreaChart.base.js +2 -2
  75. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  76. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +4 -4
  77. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  78. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +18 -3
  79. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  80. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +2 -1
  81. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  82. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +10 -0
  83. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +188 -11
  84. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  85. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +1 -1
  86. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  87. package/lib-commonjs/components/HeatMapChart/HeatMapChart.styles.js +1 -8
  88. package/lib-commonjs/components/HeatMapChart/HeatMapChart.styles.js.map +1 -1
  89. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +2 -2
  90. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  91. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +0 -9
  92. package/lib-commonjs/components/LineChart/LineChart.base.js +80 -136
  93. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  94. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +35 -60
  95. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  96. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +1 -1
  97. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  98. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +1 -1
  99. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  100. package/lib-commonjs/index.d.ts +1 -1
  101. package/lib-commonjs/index.js.map +1 -1
  102. package/lib-commonjs/types/IDataPoint.d.ts +9 -0
  103. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  104. package/lib-commonjs/utilities/utilities.d.ts +29 -28
  105. package/lib-commonjs/utilities/utilities.js +134 -114
  106. package/lib-commonjs/utilities/utilities.js.map +1 -1
  107. package/package.json +4 -4
  108. package/src/components/CommonComponents/CartesianChart.types.ts +22 -2
  109. package/src/components/HeatMapChart/HeatMapChart.types.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SankeyLink, SankeyNode } from 'd3-sankey';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalStackedBarDataPoint extends Omit<IDataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IBaseDataPoint {\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface ILineChartLineOptions extends React.SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text'\n | 'lines+text'\n | 'lines+markers+text';\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the scatter chart\n */\n scatterChartData?: IScatterChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: React.SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: React.SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = SankeyLink<ISNodeExtra, ISLinkExtra>;\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IChart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: IImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\n/**\n * {@docCategory IChartData}\n * ScatterChartDataPoint interface.\n */\nexport interface IScatterChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IScatterChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: IScatterChartDataPoint[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * Specifies the ordering options for axis categories in Cartesian charts.\n *\n * - `'default'`: Uses the original order before custom ordering was supported.\n * In some charts, this behaves the same as `'data'`.\n * - `'data'`: Preserves the order of categories as provided in the input data.\n * - `string[]`: Explicitly defines the custom order of categories as an array of category names.\n * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.\n * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.\n * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.\n * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.\n * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').\n * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.\n * - `'median ascending' | 'median descending'`: Orders by the median value of each category.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisCategoryOrder =\n | 'default'\n | 'data'\n | string[]\n | 'category ascending'\n | 'category descending'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGanttChartDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n * `start` and `end` represent the beginning and end of the data point.\n */\n x: {\n start: Date | number;\n end: Date | number;\n };\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Optional label shown in place of `x` in the callout.\n */\n xAxisCalloutData?: string;\n\n /**\n * Optional label shown in place of `y` in the callout.\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n"]}
1
+ {"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { SankeyLink, SankeyNode } from 'd3-sankey';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number | string;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number | string; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalStackedBarDataPoint extends Omit<IDataPoint, 'x'> {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n * If data type on x is Date, then the data is spaced evenly by d3-scale.\n */\n x: number | string | Date;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IBaseDataPoint {\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Marker size of the points\n */\n markerSize?: number;\n\n /**\n * text labels of marker points\n */\n text?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface ILineChartLineOptions extends React.SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n\n /**\n * Defines the type of interpolation used to render the line.\n * @default 'linear'\n */\n curve?: 'linear' | 'natural' | 'step' | 'stepAfter' | 'stepBefore' | CurveFactory;\n\n /**\n * Defines the mode of points to be rendered.\n */\n mode?:\n | 'lines'\n | 'markers'\n | 'text'\n | 'lines+markers'\n | 'text+markers'\n | 'text+lines'\n | 'text+lines+markers'\n | 'none'\n | 'gauge'\n | 'number'\n | 'delta'\n | 'number+delta'\n | 'gauge+number'\n | 'gauge+number+delta'\n | 'gauge+delta'\n | 'markers+text'\n | 'lines+text'\n | 'lines+markers+text';\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the scatter chart\n */\n scatterChartData?: IScatterChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: React.SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: React.SVGProps<SVGLineElement>;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n /**\n * A unique identifier for this node.\n */\n nodeId: number | string;\n /**\n * The display name for this node in the UX.\n */\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n /**\n * The index within `ISankeyChartData.nodes` of the source node.\n */\n source: number;\n /**\n * The index within `ISankeyChartData.nodes` of the target node.\n */\n target: number;\n /**\n * The weight of this link between the two nodes.\n */\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = SankeyLink<ISNodeExtra, ISLinkExtra>;\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartProps}\n */\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string | Date;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ILineDataInVerticalStackedBarChart {\n y: number | string;\n color: string;\n legend: string;\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n /**\n * Data to show in callout\n */\n data?: number | string;\n yAxisCalloutData?: string;\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n * {@docCategory IChartData}\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IChart {\n chartContainer: HTMLElement | null;\n toImage?: (opts?: IImageExportOptions) => Promise<string>;\n}\n\n/**\n * {@docCategory Chart}\n */\nexport interface IImageExportOptions {\n width?: number;\n height?: number;\n scale?: number;\n background?: string;\n}\n\n/**\n * {@docCategory IChartData}\n * ScatterChartDataPoint interface.\n */\nexport interface IScatterChartDataPoint extends IBaseDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n */\n x: number | Date | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IScatterChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: IScatterChartDataPoint[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Whether to use the secondary y scale or not\n * False by default.\n */\n useSecondaryYScale?: boolean;\n}\n\n/**\n * Specifies the ordering options for axis categories in Cartesian charts.\n *\n * - `'default'`: Uses the original order before custom ordering was supported.\n * In some charts, this behaves the same as `'data'`.\n * - `'data'`: Preserves the order of categories as provided in the input data.\n * - `string[]`: Explicitly defines the custom order of categories as an array of category names.\n * - `'category ascending' | 'category descending'`: Orders categories alphanumerically.\n * - `'total ascending' | 'total descending'`: Orders categories by the total of their associated values.\n * - `'min ascending' | 'min descending'`: Orders by the minimum value within each category.\n * - `'max ascending' | 'max descending'`: Orders by the maximum value within each category.\n * - `'sum ascending' | 'sum descending'`: Orders by the sum of values for each category (same as 'total').\n * - `'mean ascending' | 'mean descending'`: Orders by the average of values in each category.\n * - `'median ascending' | 'median descending'`: Orders by the median value of each category.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisCategoryOrder =\n | 'default'\n | 'data'\n | string[]\n | 'category ascending'\n | 'category descending'\n | 'total ascending'\n | 'total descending'\n | 'min ascending'\n | 'min descending'\n | 'max ascending'\n | 'max descending'\n | 'sum ascending'\n | 'sum descending'\n | 'mean ascending'\n | 'mean descending'\n | 'median ascending'\n | 'median descending';\n\n/**\n * {@docCategory IChartData}\n */\nexport interface IGanttChartDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n * `start` and `end` represent the beginning and end of the data point.\n */\n x: {\n start: Date | number;\n end: Date | number;\n };\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Gradient for the legend in the chart. If not provided, it will fallback on the default color palette.\n * If provided, it will override the color prop. granted `enableGradient` is set to true for the chart.\n */\n gradient?: [string, string];\n\n /**\n * Optional label shown in place of `x` in the callout.\n */\n xAxisCalloutData?: string;\n\n /**\n * Optional label shown in place of `y` in the callout.\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\n/**\n * Available scale types for axes.\n *\n * - `'default'`: Uses an automatic scale (linear, band, or time) based on axis data type.\n * - `'log'`: Uses a logarithmic scale. Only supported for numeric axes in LineChart and ScatterChart.\n *\n * {@docCategory CartesianChart}\n */\nexport type AxisScaleType = 'default' | 'log';\n"]}
@@ -1,9 +1,10 @@
1
1
  import { Axis as D3Axis } from 'd3-axis';
2
+ import { ScaleContinuousNumeric as IScaleContinuousNumeric, ScaleTime as IScaleTime } from 'd3-scale';
2
3
  import { TimeLocaleDefinition as d3TimeLocaleDefinition } from 'd3-time-format';
3
4
  import { IAccessibilityProps, IEventsAnnotationProps, ILineChartPoints, IDataPoint, IVerticalStackedBarDataPoint, IVerticalBarChartDataPoint, IHorizontalBarChartWithAxisDataPoint, ILineChartLineOptions, AxisCategoryOrder } from '../index';
4
5
  import { ITheme } from '@fluentui/react';
5
6
  import { CurveFactory } from 'd3-shape';
6
- import { IGanttChartDataPoint, IScatterChartPoints } from '../types/IDataPoint';
7
+ import { AxisScaleType, IGanttChartDataPoint, IScatterChartPoints } from '../types/IDataPoint';
7
8
  export declare const MIN_DOMAIN_MARGIN = 8;
8
9
  export declare const MIN_DONUT_RADIUS = 1;
9
10
  export type NumericAxis = D3Axis<number | {
@@ -123,7 +124,7 @@ export declare function defaultYAxisTickFormatter(value: number): string;
123
124
  * @export
124
125
  * @param {IXAxisParams} xAxisParams
125
126
  */
126
- export declare function createNumericXAxis(xAxisParams: IXAxisParams, tickParams: ITickParams, chartType: ChartTypes, culture?: string): {
127
+ export declare function createNumericXAxis(xAxisParams: IXAxisParams, tickParams: ITickParams, chartType: ChartTypes, culture?: string, scaleType?: AxisScaleType): {
127
128
  xScale: import("d3-scale").ScaleLinear<number, number, never>;
128
129
  tickValues: string[];
129
130
  };
@@ -135,7 +136,7 @@ export declare function getDateFormatLevel(date: Date, useUTC?: boolean): number
135
136
  * @param {ITickParams} tickParams
136
137
  */
137
138
  export declare function createDateXAxis(xAxisParams: IXAxisParams, tickParams: ITickParams, culture?: string, options?: Intl.DateTimeFormatOptions, timeFormatLocale?: d3TimeLocaleDefinition, customDateTimeFormatter?: (dateTime: Date) => string, useUTC?: boolean, chartType?: ChartTypes): {
138
- xScale: import("d3-scale").ScaleTime<number, number, never>;
139
+ xScale: IScaleTime<number, number, never>;
139
140
  tickValues: string[];
140
141
  };
141
142
  /**
@@ -162,7 +163,7 @@ export declare function createStringXAxis(xAxisParams: IXAxisParams, tickParams:
162
163
  */
163
164
  export declare function prepareDatapoints(maxVal: number, minVal: number, splitInto: number, isIntegralDataset: boolean, roundedTicks?: boolean): number[];
164
165
  export declare function createYAxisForHorizontalBarChartWithAxis(yAxisParams: IYAxisParams, isRtl: boolean): import("d3-scale").ScaleLinear<number, number, never>;
165
- export declare function createNumericYAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, isIntegralDataset: boolean, useSecondaryYScale?: boolean, supportNegativeData?: boolean, roundedTicks?: boolean): import("d3-scale").ScaleLinear<number, number, never>;
166
+ export declare function createNumericYAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, isIntegralDataset: boolean, useSecondaryYScale?: boolean, supportNegativeData?: boolean, roundedTicks?: boolean, scaleType?: AxisScaleType): import("d3-scale").ScaleLinear<number, number, never>;
166
167
  /**
167
168
  * Creating String Y axis of the chart for Horizontal Bar Chart With Axis
168
169
  * @param yAxisParams
@@ -265,7 +266,7 @@ export declare function getXAxisType(points: ILineChartPoints[]): boolean;
265
266
  * @param {boolean} isRTL
266
267
  * @returns {IDomainNRange}
267
268
  */
268
- export declare function domainRangeOfNumericForAreaChart(points: ILineChartPoints[], margins: IMargins, width: number, isRTL: boolean): IDomainNRange;
269
+ export declare function domainRangeOfNumericForAreaLineScatterCharts(points: ILineChartPoints[] | IScatterChartPoints[], margins: IMargins, width: number, isRTL: boolean, scaleType?: AxisScaleType, hasMarkersMode?: boolean): IDomainNRange;
269
270
  /**
270
271
  * Groups HorizontalBarChart With Axis data based on YValue
271
272
  * Used for stacked case
@@ -328,7 +329,7 @@ export declare function domainRangeOfVSBCNumeric(points: IDataPoint[], margins:
328
329
  * @param {Date[] | number[]} tickValues
329
330
  * @returns {IDomainNRange}
330
331
  */
331
- export declare function domainRangeOfDateForAreaLineVerticalBarChart(points: ILineChartPoints[] | IVerticalBarChartDataPoint[] | IVerticalStackedBarDataPoint[], margins: IMargins, width: number, isRTL: boolean, tickValues: Date[] | undefined, chartType: ChartTypes, barWidth?: number): IDomainNRange;
332
+ export declare function domainRangeOfDateForAreaLineScatterVerticalBarCharts(points: ILineChartPoints[] | IScatterChartPoints[] | IVerticalBarChartDataPoint[] | IVerticalStackedBarDataPoint[], margins: IMargins, width: number, isRTL: boolean, tickValues: Date[] | undefined, chartType: ChartTypes, barWidth?: number, hasMarkersMode?: boolean): IDomainNRange;
332
333
  /**
333
334
  * Calculate domain and range values to the Vertical bar chart - For Numeric axis
334
335
  * @export
@@ -346,7 +347,7 @@ export declare function domainRageOfVerticalNumeric(points: IDataPoint[], margin
346
347
  * @param {ILineChartPoints[]} points
347
348
  * @returns {{ startValue: number; endValue: number }}
348
349
  */
349
- export declare function findNumericMinMaxOfY(points: ILineChartPoints[] | IScatterChartPoints[], yAxisType?: YAxisType, useSecondaryYScale?: boolean): {
350
+ export declare function findNumericMinMaxOfY(points: ILineChartPoints[] | IScatterChartPoints[], yAxisType?: YAxisType, useSecondaryYScale?: boolean, scaleType?: AxisScaleType): {
350
351
  startValue: number;
351
352
  endValue: number;
352
353
  };
@@ -447,27 +448,6 @@ export declare function resolveCSSVariables(chartContainer: HTMLElement, styleRu
447
448
  export declare function copyStyle(properties: string[] | Record<string, string>, fromEl: Element, toEl: Element): void;
448
449
  export declare const createMeasurementSpan: (text: string | number, className: string, parentElement?: HTMLElement | null) => HTMLElement;
449
450
  export declare function getCurveFactory(curve: ILineChartLineOptions['curve'], defaultFactory?: CurveFactory): CurveFactory;
450
- /**
451
- * Calculates Domain and range values for Date X axis for scatter chart.
452
- * @export
453
- * @param {LineChartPoints[]} points
454
- * @param {IMargins} margins
455
- * @param {number} width
456
- * @param {boolean} isRTL
457
- * @param {Date[] | number[]} tickValues
458
- * @returns {IDomainNRange}
459
- */
460
- export declare function domainRangeOfDateForScatterChart(points: IScatterChartPoints[], margins: IMargins, width: number, isRTL: boolean, tickValues?: Date[]): IDomainNRange;
461
- /**
462
- * Calculates Domain and range values for Numeric X axis for scatter chart.
463
- * @export
464
- * @param {LineChartPoints[]} points
465
- * @param {IMargins} margins
466
- * @param {number} width
467
- * @param {boolean} isRTL
468
- * @returns {IDomainNRange}
469
- */
470
- export declare function domainRangeOfNumericForScatterChart(points: IScatterChartPoints[], margins: IMargins, width: number, isRTL: boolean): IDomainNRange;
471
451
  export declare const truncateString: (str: string, maxLength: number, ellipsis?: string) => string;
472
452
  /**
473
453
  * @see {@link https://github.com/plotly/plotly.js/blob/master/src/plots/plots.js#L3041}
@@ -487,3 +467,24 @@ export declare function isScatterPolarSeries(points: (ILineChartPoints | IScatte
487
467
  * @returns true if any point has lineOptions.mode as 'text'
488
468
  */
489
469
  export declare function isTextMode(points: (ILineChartPoints | IScatterChartPoints)[]): boolean;
470
+ export declare const getDomainPaddingForMarkers: (minVal: number, maxVal: number, scaleType?: AxisScaleType) => {
471
+ start: number;
472
+ end: number;
473
+ };
474
+ /**
475
+ * Determines whether a value is valid for inclusion in the scale domain.
476
+ * For log scales, ensures the value is strictly positive to prevent undefined scale behavior.
477
+ */
478
+ export declare const isValidDomainValue: (value: any, scaleType?: AxisScaleType) => boolean;
479
+ export declare const isPlottable: (x: any, y: any) => boolean;
480
+ export declare const getScatterXDomainExtent: (points: ILineChartPoints[] | IScatterChartPoints[], scaleType?: AxisScaleType) => (number | Date)[];
481
+ export declare const getRangeForScatterMarkerSize: ({ data, xScale, yScalePrimary, yScaleSecondary, useSecondaryYScale, xScaleType, yScaleType: primaryYScaleType, secondaryYScaleType, }: {
482
+ data: ILineChartPoints[] | IScatterChartPoints[];
483
+ xScale: IScaleContinuousNumeric<number, number> | IScaleTime<number, number>;
484
+ yScalePrimary: IScaleContinuousNumeric<number, number>;
485
+ yScaleSecondary?: IScaleContinuousNumeric<number, number, never> | undefined;
486
+ useSecondaryYScale?: boolean | undefined;
487
+ xScaleType?: AxisScaleType | undefined;
488
+ yScaleType?: AxisScaleType | undefined;
489
+ secondaryYScaleType?: AxisScaleType | undefined;
490
+ }) => number;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.areArraysEqual = exports.getSecureProps = exports.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.formatScientificLimitWidth = exports.wrapTextInsideDonut = exports.rotateXAxisLabels = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.findHBCWANumericMinMaxOfY = exports.findVerticalNumericMinMaxOfY = exports.findVSBCNumericMinMaxOfY = exports.findNumericMinMaxOfY = exports.domainRageOfVerticalNumeric = exports.domainRangeOfDateForAreaLineVerticalBarChart = exports.domainRangeOfVSBCNumeric = exports.domainRangeOfXStringAxis = exports.domainRangeOfNumericForHorizontalBarChartWithAxis = exports.computeLongestBars = exports.groupChartDataByYValue = exports.domainRangeOfNumericForAreaChart = exports.getXAxisType = exports.tooltipOfAxislabels = exports.calculateLongestLabelWidth = exports.wrapContent = exports.createYAxisLabels = exports.createWrapOfXLabels = exports.DEFAULT_WRAP_WIDTH = exports.silceOrAppendToArray = exports.getUnique = exports.calloutData = exports.createStringYAxis = exports.createStringYAxisForHorizontalBarChartWithAxis = exports.createNumericYAxis = exports.createYAxisForHorizontalBarChartWithAxis = exports.prepareDatapoints = exports.createStringXAxis = exports.createDateXAxis = exports.getDateFormatLevel = exports.createNumericXAxis = exports.defaultYAxisTickFormatter = exports.YAxisType = exports.XAxisTypes = exports.ChartTypes = exports.MIN_DONUT_RADIUS = exports.MIN_DOMAIN_MARGIN = void 0;
5
- exports.isTextMode = exports.isScatterPolarSeries = exports.getContrastTextColor = exports.getInvertedTextColor = exports.sortAxisCategories = exports.truncateString = exports.domainRangeOfNumericForScatterChart = exports.domainRangeOfDateForScatterChart = exports.getCurveFactory = exports.createMeasurementSpan = exports.copyStyle = exports.resolveCSSVariables = void 0;
4
+ exports.areArraysEqual = exports.getSecureProps = exports.isScalePaddingDefined = exports.getScalePadding = exports.getBarWidth = exports.formatScientificLimitWidth = exports.wrapTextInsideDonut = exports.rotateXAxisLabels = exports.getAccessibleDataObject = exports.pointTypes = exports.CustomPoints = exports.Points = exports.getTypeOfAxis = exports.findHBCWANumericMinMaxOfY = exports.findVerticalNumericMinMaxOfY = exports.findVSBCNumericMinMaxOfY = exports.findNumericMinMaxOfY = exports.domainRageOfVerticalNumeric = exports.domainRangeOfDateForAreaLineScatterVerticalBarCharts = exports.domainRangeOfVSBCNumeric = exports.domainRangeOfXStringAxis = exports.domainRangeOfNumericForHorizontalBarChartWithAxis = exports.computeLongestBars = exports.groupChartDataByYValue = exports.domainRangeOfNumericForAreaLineScatterCharts = exports.getXAxisType = exports.tooltipOfAxislabels = exports.calculateLongestLabelWidth = exports.wrapContent = exports.createYAxisLabels = exports.createWrapOfXLabels = exports.DEFAULT_WRAP_WIDTH = exports.silceOrAppendToArray = exports.getUnique = exports.calloutData = exports.createStringYAxis = exports.createStringYAxisForHorizontalBarChartWithAxis = exports.createNumericYAxis = exports.createYAxisForHorizontalBarChartWithAxis = exports.prepareDatapoints = exports.createStringXAxis = exports.createDateXAxis = exports.getDateFormatLevel = exports.createNumericXAxis = exports.defaultYAxisTickFormatter = exports.YAxisType = exports.XAxisTypes = exports.ChartTypes = exports.MIN_DONUT_RADIUS = exports.MIN_DOMAIN_MARGIN = void 0;
5
+ exports.getRangeForScatterMarkerSize = exports.getScatterXDomainExtent = exports.isPlottable = exports.isValidDomainValue = exports.getDomainPaddingForMarkers = exports.isTextMode = exports.isScatterPolarSeries = exports.getContrastTextColor = exports.getInvertedTextColor = exports.sortAxisCategories = exports.truncateString = exports.getCurveFactory = exports.createMeasurementSpan = exports.copyStyle = exports.resolveCSSVariables = void 0;
6
6
  var tslib_1 = require("tslib");
7
7
  var d3_axis_1 = require("d3-axis");
8
8
  var d3_array_1 = require("d3-array");
@@ -75,23 +75,23 @@ exports.defaultYAxisTickFormatter = defaultYAxisTickFormatter;
75
75
  * @export
76
76
  * @param {IXAxisParams} xAxisParams
77
77
  */
78
- function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
78
+ function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType) {
79
79
  var _a;
80
80
  var domainNRangeValues = xAxisParams.domainNRangeValues, _b = xAxisParams.showRoundOffXTickValues, showRoundOffXTickValues = _b === void 0 ? true : _b, _c = xAxisParams.xAxistickSize, xAxistickSize = _c === void 0 ? 6 : _c, _d = xAxisParams.tickPadding, tickPadding = _d === void 0 ? 10 : _d, xAxisCount = xAxisParams.xAxisCount, xAxisElement = xAxisParams.xAxisElement, hideTickOverlap = xAxisParams.hideTickOverlap, calcMaxLabelWidth = xAxisParams.calcMaxLabelWidth;
81
- var xAxisScale = (0, d3_scale_1.scaleLinear)()
81
+ var xAxisScale = createNumericScale(scaleType)
82
82
  .domain([domainNRangeValues.dStartValue, domainNRangeValues.dEndValue])
83
83
  .range([domainNRangeValues.rStartValue, domainNRangeValues.rEndValue]);
84
84
  showRoundOffXTickValues && xAxisScale.nice();
85
85
  var tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
86
- var tickFormat = function (domainValue, _index) {
86
+ var tickFormat = function (domainValue, _index, defaultFormat) {
87
87
  if (tickParams.tickFormat) {
88
88
  return (0, d3_format_1.format)(tickParams.tickFormat)(domainValue);
89
89
  }
90
90
  var xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
91
- return (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
91
+ return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
92
92
  };
93
93
  if (hideTickOverlap && typeof xAxisCount === 'undefined') {
94
- var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 20;
94
+ var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(function (v, i) { return tickFormat(v, i); })) + 20;
95
95
  var _e = xAxisScale.range(), start = _e[0], end = _e[1];
96
96
  tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
97
97
  }
@@ -99,7 +99,7 @@ function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
99
99
  .tickSize(xAxistickSize)
100
100
  .tickPadding(tickPadding)
101
101
  .ticks(tickCount)
102
- .tickFormat(tickFormat);
102
+ .tickFormat(function (v, i) { return tickFormat(v, i, xAxisScale.tickFormat(tickCount)); });
103
103
  if ([ChartTypes.HorizontalBarChartWithAxis, ChartTypes.GanttChart].includes(chartType)) {
104
104
  xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
105
105
  }
@@ -407,7 +407,7 @@ function createYAxisForHorizontalBarChartWithAxis(yAxisParams, isRtl) {
407
407
  return yAxisScale;
408
408
  }
409
409
  exports.createYAxisForHorizontalBarChartWithAxis = createYAxisForHorizontalBarChartWithAxis;
410
- function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale, supportNegativeData, roundedTicks) {
410
+ function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale, supportNegativeData, roundedTicks, scaleType) {
411
411
  if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
412
412
  if (supportNegativeData === void 0) { supportNegativeData = false; }
413
413
  if (roundedTicks === void 0) { roundedTicks = false; }
@@ -421,15 +421,33 @@ function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, use
421
421
  ? 0
422
422
  : yMinValue;
423
423
  var domainValues = prepareDatapoints(finalYmax, finalYmin, yAxisTickCount, isIntegralDataset, roundedTicks);
424
- var yAxisScale = (0, d3_scale_1.scaleLinear)()
425
- .domain([supportNegativeData ? domainValues[0] : finalYmin, domainValues[domainValues.length - 1]])
424
+ var scaleDomain = [supportNegativeData ? domainValues[0] : finalYmin, domainValues[domainValues.length - 1]];
425
+ if (scaleType === 'log') {
426
+ var domainStart = yMinMaxValues.startValue;
427
+ var domainEnd = yMinMaxValues.endValue;
428
+ if (yMinValue > 0) {
429
+ domainStart = Math.min(domainStart, yMinValue);
430
+ }
431
+ if (yMaxValue > 0) {
432
+ domainEnd = Math.max(domainEnd, yMaxValue);
433
+ }
434
+ scaleDomain = [domainStart, domainEnd];
435
+ }
436
+ var yAxisScale = createNumericScale(scaleType)
437
+ .domain(scaleDomain)
426
438
  .range([containerHeight - margins.bottom, margins.top + (eventAnnotationProps ? eventLabelHeight : 0)]);
427
439
  var axis = (!isRtl && useSecondaryYScale) || (isRtl && !useSecondaryYScale) ? (0, d3_axis_1.axisRight)(yAxisScale) : (0, d3_axis_1.axisLeft)(yAxisScale);
428
- var yAxis = axis
429
- .tickPadding(tickPadding)
430
- .tickValues(domainValues)
431
- .tickSizeInner(-(containerWidth - margins.left - margins.right));
432
- yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat(defaultYAxisTickFormatter);
440
+ var yAxis = axis.tickPadding(tickPadding).tickSizeInner(-(containerWidth - margins.left - margins.right));
441
+ if (scaleType !== 'log') {
442
+ yAxis.tickValues(domainValues);
443
+ }
444
+ var tickFormat = function (domainValue, index, defaultFormat) {
445
+ var value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
446
+ return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(value)) === '' ? '' : defaultYAxisTickFormatter(value);
447
+ };
448
+ yAxisTickFormat
449
+ ? yAxis.tickFormat(yAxisTickFormat)
450
+ : yAxis.tickFormat(function (v, i) { return tickFormat(v, i, yAxisScale.tickFormat(yAxisTickCount)); });
433
451
  yAxisElement ? (0, d3_selection_1.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
434
452
  axisData.yAxisDomainValues = domainValues;
435
453
  return yAxisScale;
@@ -827,23 +845,21 @@ exports.getXAxisType = getXAxisType;
827
845
  * @param {boolean} isRTL
828
846
  * @returns {IDomainNRange}
829
847
  */
830
- function domainRangeOfNumericForAreaChart(points, margins, width, isRTL) {
848
+ function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode) {
831
849
  var isScatterPolar = isScatterPolarSeries(points);
832
- var xMin = (0, d3_array_1.min)(points, function (point) {
833
- return (0, d3_array_1.min)(point.data, function (item) { return item.x; });
834
- });
835
- var xMax = (0, d3_array_1.max)(points, function (point) {
836
- return (0, d3_array_1.max)(point.data, function (item) {
837
- return item.x;
838
- });
839
- });
850
+ var _a = (0, exports.getScatterXDomainExtent)(points, scaleType), xMin = _a[0], xMax = _a[1];
851
+ if (hasMarkersMode) {
852
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType);
853
+ xMin = xMin - xPadding.start;
854
+ xMax = xMax + xPadding.end;
855
+ }
840
856
  var rStartValue = margins.left;
841
857
  var rEndValue = width - margins.right;
842
858
  return isRTL
843
859
  ? { dStartValue: isScatterPolar ? 1 : xMax, dEndValue: isScatterPolar ? -1 : xMin, rStartValue: rStartValue, rEndValue: rEndValue }
844
860
  : { dStartValue: isScatterPolar ? -1 : xMin, dEndValue: isScatterPolar ? 1 : xMax, rStartValue: rStartValue, rEndValue: rEndValue };
845
861
  }
846
- exports.domainRangeOfNumericForAreaChart = domainRangeOfNumericForAreaChart;
862
+ exports.domainRangeOfNumericForAreaLineScatterCharts = domainRangeOfNumericForAreaLineScatterCharts;
847
863
  /**
848
864
  * Groups HorizontalBarChart With Axis data based on YValue
849
865
  * Used for stacked case
@@ -951,29 +967,24 @@ exports.domainRangeOfVSBCNumeric = domainRangeOfVSBCNumeric;
951
967
  * @param {Date[] | number[]} tickValues
952
968
  * @returns {IDomainNRange}
953
969
  */
954
- function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth) {
970
+ function domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues, chartType, barWidth, hasMarkersMode) {
971
+ var _a;
955
972
  if (tickValues === void 0) { tickValues = []; }
956
973
  var sDate;
957
974
  var lDate;
958
- if (chartType === ChartTypes.AreaChart || chartType === ChartTypes.LineChart) {
959
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
960
- sDate = (0, d3_array_1.min)(points, function (point) {
961
- return (0, d3_array_1.min)(point.data, function (item) {
962
- return item.x;
963
- });
964
- });
965
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
966
- lDate = (0, d3_array_1.max)(points, function (point) {
967
- return (0, d3_array_1.max)(point.data, function (item) {
968
- return item.x;
969
- });
970
- });
975
+ if ([ChartTypes.AreaChart, ChartTypes.LineChart, ChartTypes.ScatterChart].includes(chartType)) {
976
+ _a = (0, exports.getScatterXDomainExtent)(points), sDate = _a[0], lDate = _a[1];
971
977
  // Need to draw graph with given small and large date
972
978
  // (Which Involves customization of date axis tick values)
973
979
  // That may be Either from given graph data or from prop 'tickValues' date values.
974
980
  // So, Finding smallest and largest dates
975
981
  sDate = (0, d3_array_1.min)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [sDate], false));
976
982
  lDate = (0, d3_array_1.max)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [lDate], false));
983
+ if (hasMarkersMode || chartType === ChartTypes.ScatterChart) {
984
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(sDate.getTime(), lDate.getTime());
985
+ sDate = new Date(sDate.getTime() - xPadding.start);
986
+ lDate = new Date(lDate.getTime() + xPadding.end);
987
+ }
977
988
  }
978
989
  else {
979
990
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -987,7 +998,7 @@ function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, is
987
998
  ? { dStartValue: lDate, dEndValue: sDate, rStartValue: rStartValue, rEndValue: rEndValue }
988
999
  : { dStartValue: sDate, dEndValue: lDate, rStartValue: rStartValue, rEndValue: rEndValue };
989
1000
  }
990
- exports.domainRangeOfDateForAreaLineVerticalBarChart = domainRangeOfDateForAreaLineVerticalBarChart;
1001
+ exports.domainRangeOfDateForAreaLineScatterVerticalBarCharts = domainRangeOfDateForAreaLineScatterVerticalBarCharts;
991
1002
  /**
992
1003
  * Calculate domain and range values to the Vertical bar chart - For Numeric axis
993
1004
  * @export
@@ -1014,12 +1025,14 @@ exports.domainRageOfVerticalNumeric = domainRageOfVerticalNumeric;
1014
1025
  * @param {ILineChartPoints[]} points
1015
1026
  * @returns {{ startValue: number; endValue: number }}
1016
1027
  */
1017
- function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
1028
+ function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale, scaleType) {
1018
1029
  var values = [];
1019
1030
  points.forEach(function (point) {
1020
1031
  if (!useSecondaryYScale === !point.useSecondaryYScale) {
1021
1032
  point.data.forEach(function (data) {
1022
- values.push(data.y);
1033
+ if ((0, exports.isValidDomainValue)(data.y, scaleType)) {
1034
+ values.push(data.y);
1035
+ }
1023
1036
  });
1024
1037
  }
1025
1038
  });
@@ -1386,77 +1399,6 @@ function getCurveFactory(curve, defaultFactory) {
1386
1399
  }
1387
1400
  }
1388
1401
  exports.getCurveFactory = getCurveFactory;
1389
- /**
1390
- * Calculates Domain and range values for Date X axis for scatter chart.
1391
- * @export
1392
- * @param {LineChartPoints[]} points
1393
- * @param {IMargins} margins
1394
- * @param {number} width
1395
- * @param {boolean} isRTL
1396
- * @param {Date[] | number[]} tickValues
1397
- * @returns {IDomainNRange}
1398
- */
1399
- function domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues) {
1400
- if (tickValues === void 0) { tickValues = []; }
1401
- var sDate;
1402
- var lDate;
1403
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1404
- sDate = (0, d3_array_1.min)(points, function (point) {
1405
- return (0, d3_array_1.min)(point.data, function (item) {
1406
- return item.x;
1407
- });
1408
- });
1409
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1410
- lDate = (0, d3_array_1.max)(points, function (point) {
1411
- return (0, d3_array_1.max)(point.data, function (item) {
1412
- return item.x;
1413
- });
1414
- });
1415
- var xPadding = (lDate.getTime() - sDate.getTime()) * 0.1;
1416
- sDate = new Date(sDate.getTime() - xPadding);
1417
- lDate = new Date(lDate.getTime() + xPadding);
1418
- // Need to draw graph with given small and large date
1419
- // (Which Involves customization of date axis tick values)
1420
- // That may be Either from given graph data or from prop 'tickValues' date values.
1421
- // So, Finding smallest and largest dates
1422
- sDate = (0, d3_array_1.min)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [sDate], false));
1423
- lDate = (0, d3_array_1.max)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [lDate], false));
1424
- var rStartValue = margins.left;
1425
- var rEndValue = width - margins.right;
1426
- return isRTL
1427
- ? { dStartValue: lDate, dEndValue: sDate, rStartValue: rStartValue, rEndValue: rEndValue }
1428
- : { dStartValue: sDate, dEndValue: lDate, rStartValue: rStartValue, rEndValue: rEndValue };
1429
- }
1430
- exports.domainRangeOfDateForScatterChart = domainRangeOfDateForScatterChart;
1431
- /**
1432
- * Calculates Domain and range values for Numeric X axis for scatter chart.
1433
- * @export
1434
- * @param {LineChartPoints[]} points
1435
- * @param {IMargins} margins
1436
- * @param {number} width
1437
- * @param {boolean} isRTL
1438
- * @returns {IDomainNRange}
1439
- */
1440
- function domainRangeOfNumericForScatterChart(points, margins, width, isRTL) {
1441
- var isScatterPolar = isScatterPolarSeries(points);
1442
- var xMin = (0, d3_array_1.min)(points, function (point) {
1443
- return (0, d3_array_1.min)(point.data, function (item) { return item.x; });
1444
- });
1445
- var xMax = (0, d3_array_1.max)(points, function (point) {
1446
- return (0, d3_array_1.max)(point.data, function (item) {
1447
- return item.x;
1448
- });
1449
- });
1450
- var xPadding = (xMax - xMin) * 0.1;
1451
- xMin = xMin - xPadding;
1452
- xMax = xMax + xPadding;
1453
- var rStartValue = margins.left;
1454
- var rEndValue = width - margins.right;
1455
- return isRTL
1456
- ? { dStartValue: isScatterPolar ? 1 : xMax, dEndValue: isScatterPolar ? -1 : xMin, rStartValue: rStartValue, rEndValue: rEndValue }
1457
- : { dStartValue: isScatterPolar ? -1 : xMin, dEndValue: isScatterPolar ? 1 : xMax, rStartValue: rStartValue, rEndValue: rEndValue };
1458
- }
1459
- exports.domainRangeOfNumericForScatterChart = domainRangeOfNumericForScatterChart;
1460
1402
  var truncateString = function (str, maxLength, ellipsis) {
1461
1403
  if (ellipsis === void 0) { ellipsis = '...'; }
1462
1404
  if (str.length <= maxLength) {
@@ -1560,4 +1502,82 @@ function isTextMode(points) {
1560
1502
  function (item) { var _a; return typeof ((_a = item.lineOptions) === null || _a === void 0 ? void 0 : _a.mode) === 'string' && item.lineOptions.mode === 'text'; });
1561
1503
  }
1562
1504
  exports.isTextMode = isTextMode;
1505
+ // TODO: Refactor to encapsulate the complete numeric scale creation logic here, including setting domain and range.
1506
+ var createNumericScale = function (scaleType) {
1507
+ if (scaleType === 'log') {
1508
+ return (0, d3_scale_1.scaleLog)();
1509
+ }
1510
+ else {
1511
+ return (0, d3_scale_1.scaleLinear)();
1512
+ }
1513
+ };
1514
+ var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType) {
1515
+ if (scaleType === 'log') {
1516
+ return {
1517
+ start: minVal * 0.5,
1518
+ end: maxVal,
1519
+ };
1520
+ }
1521
+ var defaultPadding = (maxVal - minVal) * 0.1;
1522
+ return {
1523
+ start: defaultPadding,
1524
+ end: defaultPadding,
1525
+ };
1526
+ };
1527
+ exports.getDomainPaddingForMarkers = getDomainPaddingForMarkers;
1528
+ /**
1529
+ * Determines whether a value is valid for inclusion in the scale domain.
1530
+ * For log scales, ensures the value is strictly positive to prevent undefined scale behavior.
1531
+ */
1532
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1533
+ var isValidDomainValue = function (value, scaleType) {
1534
+ return typeof value !== 'number' || scaleType !== 'log' || value > 0;
1535
+ };
1536
+ exports.isValidDomainValue = isValidDomainValue;
1537
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1538
+ var isPlottable = function (x, y) {
1539
+ return !(0, chart_utilities_1.isInvalidValue)(x) && !(0, chart_utilities_1.isInvalidValue)(y);
1540
+ };
1541
+ exports.isPlottable = isPlottable;
1542
+ var getScatterXDomainExtent = function (points, scaleType) {
1543
+ var isValidDataPointForScale = function (item) {
1544
+ return (0, exports.isValidDomainValue)(item.x, scaleType);
1545
+ };
1546
+ var xMin = (0, d3_array_1.min)(points, function (point) {
1547
+ return (0, d3_array_1.min)(point.data.filter(isValidDataPointForScale), function (item) { return item.x; });
1548
+ });
1549
+ var xMax = (0, d3_array_1.max)(points, function (point) {
1550
+ return (0, d3_array_1.max)(point.data.filter(isValidDataPointForScale), function (item) {
1551
+ return item.x;
1552
+ });
1553
+ });
1554
+ return [xMin, xMax];
1555
+ };
1556
+ exports.getScatterXDomainExtent = getScatterXDomainExtent;
1557
+ var getRangeForScatterMarkerSize = function (_a) {
1558
+ var data = _a.data, xScale = _a.xScale, yScalePrimary = _a.yScalePrimary, yScaleSecondary = _a.yScaleSecondary, useSecondaryYScale = _a.useSecondaryYScale, xScaleType = _a.xScaleType, primaryYScaleType = _a.yScaleType, secondaryYScaleType = _a.secondaryYScaleType;
1559
+ // Note: This function is executed after the scale is created, so the actual padding can be
1560
+ // obtained by calculating the difference between the respective minimums or maximums of the
1561
+ // scale domain and the data. However, doing so often causes the marker size to scale up
1562
+ // unnecessarily when the scale uses a wider domain than required (due to the use of D3's nice
1563
+ // function or our own tick value calculations).
1564
+ // A better approach could be to treat the marker size as a fixed pixel value and adjust the
1565
+ // scale domain with sufficient padding to accommodate the maximum marker size—instead of doing
1566
+ // it the other way around (i.e., adjusting the scale domain first with padding and then scaling
1567
+ // the markers to fit inside the plot area).
1568
+ var _b = (0, exports.getScatterXDomainExtent)(data, xScaleType), xMin = _b[0], xMax = _b[1];
1569
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(+xMin, +xMax, xScaleType);
1570
+ var scaleXMin = xMin instanceof Date ? new Date(+xMin - xPadding.start) : xMin - xPadding.start;
1571
+ var scaleXMax = xMax instanceof Date ? new Date(+xMax + xPadding.end) : xMax + xPadding.end;
1572
+ var extraXPixels = Math.min(Math.abs(xScale(xMin) - xScale(scaleXMin)), Math.abs(xScale(scaleXMax) - xScale(xMax)));
1573
+ var yScaleType = useSecondaryYScale ? secondaryYScaleType : primaryYScaleType;
1574
+ var _c = findNumericMinMaxOfY(data, undefined, useSecondaryYScale, yScaleType), yMin = _c.startValue, yMax = _c.endValue;
1575
+ var yPadding = (0, exports.getDomainPaddingForMarkers)(yMin, yMax, yScaleType);
1576
+ var scaleYMin = yMin - yPadding.start;
1577
+ var scaleYMax = yMax + yPadding.end;
1578
+ var yScale = (useSecondaryYScale ? yScaleSecondary : yScalePrimary);
1579
+ var extraYPixels = Math.min(Math.abs(yScale(scaleYMin) - yScale(yMin)), Math.abs(yScale(yMax) - yScale(scaleYMax)));
1580
+ return Math.min(extraXPixels, extraYPixels);
1581
+ };
1582
+ exports.getRangeForScatterMarkerSize = getRangeForScatterMarkerSize;
1563
1583
  //# sourceMappingURL=utilities.js.map