@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;
@@ -2,7 +2,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
2
2
  "use strict";
3
3
  var _a;
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
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 = 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.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 = 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;
6
6
  exports.MIN_DOMAIN_MARGIN = 8;
7
7
  exports.MIN_DONUT_RADIUS = 1;
8
8
  var ChartTypes;
@@ -62,23 +62,23 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
62
62
  * @export
63
63
  * @param {IXAxisParams} xAxisParams
64
64
  */
65
- function createNumericXAxis(xAxisParams, tickParams, chartType, culture) {
65
+ function createNumericXAxis(xAxisParams, tickParams, chartType, culture, scaleType) {
66
66
  var _a;
67
67
  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;
68
- var xAxisScale = (0, d3_scale_1.scaleLinear)()
68
+ var xAxisScale = createNumericScale(scaleType)
69
69
  .domain([domainNRangeValues.dStartValue, domainNRangeValues.dEndValue])
70
70
  .range([domainNRangeValues.rStartValue, domainNRangeValues.rEndValue]);
71
71
  showRoundOffXTickValues && xAxisScale.nice();
72
72
  var tickCount = xAxisCount !== null && xAxisCount !== void 0 ? xAxisCount : 6;
73
- var tickFormat = function (domainValue, _index) {
73
+ var tickFormat = function (domainValue, _index, defaultFormat) {
74
74
  if (tickParams.tickFormat) {
75
75
  return (0, d3_format_1.format)(tickParams.tickFormat)(domainValue);
76
76
  }
77
77
  var xAxisValue = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
78
- return (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
78
+ return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(xAxisValue)) === '' ? '' : (0, chart_utilities_1.formatToLocaleString)(xAxisValue, culture);
79
79
  };
80
80
  if (hideTickOverlap && typeof xAxisCount === 'undefined') {
81
- var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(tickFormat)) + 20;
81
+ var longestLabelWidth = calcMaxLabelWidth(xAxisScale.ticks().map(function (v, i) { return tickFormat(v, i); })) + 20;
82
82
  var _e = xAxisScale.range(), start = _e[0], end = _e[1];
83
83
  tickCount = Math.min(Math.max(1, Math.floor(Math.abs(end - start) / longestLabelWidth)), 10);
84
84
  }
@@ -86,7 +86,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
86
86
  .tickSize(xAxistickSize)
87
87
  .tickPadding(tickPadding)
88
88
  .ticks(tickCount)
89
- .tickFormat(tickFormat);
89
+ .tickFormat(function (v, i) { return tickFormat(v, i, xAxisScale.tickFormat(tickCount)); });
90
90
  if ([ChartTypes.HorizontalBarChartWithAxis, ChartTypes.GanttChart].includes(chartType)) {
91
91
  xAxis.tickSizeInner(-(xAxisParams.containerHeight - xAxisParams.margins.top));
92
92
  }
@@ -394,7 +394,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
394
394
  return yAxisScale;
395
395
  }
396
396
  exports.createYAxisForHorizontalBarChartWithAxis = createYAxisForHorizontalBarChartWithAxis;
397
- function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale, supportNegativeData, roundedTicks) {
397
+ function createNumericYAxis(yAxisParams, isRtl, axisData, isIntegralDataset, useSecondaryYScale, supportNegativeData, roundedTicks, scaleType) {
398
398
  if (useSecondaryYScale === void 0) { useSecondaryYScale = false; }
399
399
  if (supportNegativeData === void 0) { supportNegativeData = false; }
400
400
  if (roundedTicks === void 0) { roundedTicks = false; }
@@ -408,15 +408,33 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
408
408
  ? 0
409
409
  : yMinValue;
410
410
  var domainValues = prepareDatapoints(finalYmax, finalYmin, yAxisTickCount, isIntegralDataset, roundedTicks);
411
- var yAxisScale = (0, d3_scale_1.scaleLinear)()
412
- .domain([supportNegativeData ? domainValues[0] : finalYmin, domainValues[domainValues.length - 1]])
411
+ var scaleDomain = [supportNegativeData ? domainValues[0] : finalYmin, domainValues[domainValues.length - 1]];
412
+ if (scaleType === 'log') {
413
+ var domainStart = yMinMaxValues.startValue;
414
+ var domainEnd = yMinMaxValues.endValue;
415
+ if (yMinValue > 0) {
416
+ domainStart = Math.min(domainStart, yMinValue);
417
+ }
418
+ if (yMaxValue > 0) {
419
+ domainEnd = Math.max(domainEnd, yMaxValue);
420
+ }
421
+ scaleDomain = [domainStart, domainEnd];
422
+ }
423
+ var yAxisScale = createNumericScale(scaleType)
424
+ .domain(scaleDomain)
413
425
  .range([containerHeight - margins.bottom, margins.top + (eventAnnotationProps ? eventLabelHeight : 0)]);
414
426
  var axis = (!isRtl && useSecondaryYScale) || (isRtl && !useSecondaryYScale) ? (0, d3_axis_1.axisRight)(yAxisScale) : (0, d3_axis_1.axisLeft)(yAxisScale);
415
- var yAxis = axis
416
- .tickPadding(tickPadding)
417
- .tickValues(domainValues)
418
- .tickSizeInner(-(containerWidth - margins.left - margins.right));
419
- yAxisTickFormat ? yAxis.tickFormat(yAxisTickFormat) : yAxis.tickFormat(defaultYAxisTickFormatter);
427
+ var yAxis = axis.tickPadding(tickPadding).tickSizeInner(-(containerWidth - margins.left - margins.right));
428
+ if (scaleType !== 'log') {
429
+ yAxis.tickValues(domainValues);
430
+ }
431
+ var tickFormat = function (domainValue, index, defaultFormat) {
432
+ var value = typeof domainValue === 'number' ? domainValue : domainValue.valueOf();
433
+ return (defaultFormat === null || defaultFormat === void 0 ? void 0 : defaultFormat(value)) === '' ? '' : defaultYAxisTickFormatter(value);
434
+ };
435
+ yAxisTickFormat
436
+ ? yAxis.tickFormat(yAxisTickFormat)
437
+ : yAxis.tickFormat(function (v, i) { return tickFormat(v, i, yAxisScale.tickFormat(yAxisTickCount)); });
420
438
  yAxisElement ? (0, d3_selection_1.select)(yAxisElement).call(yAxis).selectAll('text').attr('aria-hidden', 'true') : '';
421
439
  axisData.yAxisDomainValues = domainValues;
422
440
  return yAxisScale;
@@ -814,23 +832,21 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
814
832
  * @param {boolean} isRTL
815
833
  * @returns {IDomainNRange}
816
834
  */
817
- function domainRangeOfNumericForAreaChart(points, margins, width, isRTL) {
835
+ function domainRangeOfNumericForAreaLineScatterCharts(points, margins, width, isRTL, scaleType, hasMarkersMode) {
818
836
  var isScatterPolar = isScatterPolarSeries(points);
819
- var xMin = (0, d3_array_1.min)(points, function (point) {
820
- return (0, d3_array_1.min)(point.data, function (item) { return item.x; });
821
- });
822
- var xMax = (0, d3_array_1.max)(points, function (point) {
823
- return (0, d3_array_1.max)(point.data, function (item) {
824
- return item.x;
825
- });
826
- });
837
+ var _a = (0, exports.getScatterXDomainExtent)(points, scaleType), xMin = _a[0], xMax = _a[1];
838
+ if (hasMarkersMode) {
839
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(xMin, xMax, scaleType);
840
+ xMin = xMin - xPadding.start;
841
+ xMax = xMax + xPadding.end;
842
+ }
827
843
  var rStartValue = margins.left;
828
844
  var rEndValue = width - margins.right;
829
845
  return isRTL
830
846
  ? { dStartValue: isScatterPolar ? 1 : xMax, dEndValue: isScatterPolar ? -1 : xMin, rStartValue: rStartValue, rEndValue: rEndValue }
831
847
  : { dStartValue: isScatterPolar ? -1 : xMin, dEndValue: isScatterPolar ? 1 : xMax, rStartValue: rStartValue, rEndValue: rEndValue };
832
848
  }
833
- exports.domainRangeOfNumericForAreaChart = domainRangeOfNumericForAreaChart;
849
+ exports.domainRangeOfNumericForAreaLineScatterCharts = domainRangeOfNumericForAreaLineScatterCharts;
834
850
  /**
835
851
  * Groups HorizontalBarChart With Axis data based on YValue
836
852
  * Used for stacked case
@@ -938,29 +954,24 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
938
954
  * @param {Date[] | number[]} tickValues
939
955
  * @returns {IDomainNRange}
940
956
  */
941
- function domainRangeOfDateForAreaLineVerticalBarChart(points, margins, width, isRTL, tickValues, chartType, barWidth) {
957
+ function domainRangeOfDateForAreaLineScatterVerticalBarCharts(points, margins, width, isRTL, tickValues, chartType, barWidth, hasMarkersMode) {
958
+ var _a;
942
959
  if (tickValues === void 0) { tickValues = []; }
943
960
  var sDate;
944
961
  var lDate;
945
- if (chartType === ChartTypes.AreaChart || chartType === ChartTypes.LineChart) {
946
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
947
- sDate = (0, d3_array_1.min)(points, function (point) {
948
- return (0, d3_array_1.min)(point.data, function (item) {
949
- return item.x;
950
- });
951
- });
952
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
953
- lDate = (0, d3_array_1.max)(points, function (point) {
954
- return (0, d3_array_1.max)(point.data, function (item) {
955
- return item.x;
956
- });
957
- });
962
+ if ([ChartTypes.AreaChart, ChartTypes.LineChart, ChartTypes.ScatterChart].includes(chartType)) {
963
+ _a = (0, exports.getScatterXDomainExtent)(points), sDate = _a[0], lDate = _a[1];
958
964
  // Need to draw graph with given small and large date
959
965
  // (Which Involves customization of date axis tick values)
960
966
  // That may be Either from given graph data or from prop 'tickValues' date values.
961
967
  // So, Finding smallest and largest dates
962
968
  sDate = (0, d3_array_1.min)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [sDate], false));
963
969
  lDate = (0, d3_array_1.max)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [lDate], false));
970
+ if (hasMarkersMode || chartType === ChartTypes.ScatterChart) {
971
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(sDate.getTime(), lDate.getTime());
972
+ sDate = new Date(sDate.getTime() - xPadding.start);
973
+ lDate = new Date(lDate.getTime() + xPadding.end);
974
+ }
964
975
  }
965
976
  else {
966
977
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -974,7 +985,7 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
974
985
  ? { dStartValue: lDate, dEndValue: sDate, rStartValue: rStartValue, rEndValue: rEndValue }
975
986
  : { dStartValue: sDate, dEndValue: lDate, rStartValue: rStartValue, rEndValue: rEndValue };
976
987
  }
977
- exports.domainRangeOfDateForAreaLineVerticalBarChart = domainRangeOfDateForAreaLineVerticalBarChart;
988
+ exports.domainRangeOfDateForAreaLineScatterVerticalBarCharts = domainRangeOfDateForAreaLineScatterVerticalBarCharts;
978
989
  /**
979
990
  * Calculate domain and range values to the Vertical bar chart - For Numeric axis
980
991
  * @export
@@ -1001,12 +1012,14 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
1001
1012
  * @param {ILineChartPoints[]} points
1002
1013
  * @returns {{ startValue: number; endValue: number }}
1003
1014
  */
1004
- function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale) {
1015
+ function findNumericMinMaxOfY(points, yAxisType, useSecondaryYScale, scaleType) {
1005
1016
  var values = [];
1006
1017
  points.forEach(function (point) {
1007
1018
  if (!useSecondaryYScale === !point.useSecondaryYScale) {
1008
1019
  point.data.forEach(function (data) {
1009
- values.push(data.y);
1020
+ if ((0, exports.isValidDomainValue)(data.y, scaleType)) {
1021
+ values.push(data.y);
1022
+ }
1010
1023
  });
1011
1024
  }
1012
1025
  });
@@ -1373,77 +1386,6 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
1373
1386
  }
1374
1387
  }
1375
1388
  exports.getCurveFactory = getCurveFactory;
1376
- /**
1377
- * Calculates Domain and range values for Date X axis for scatter chart.
1378
- * @export
1379
- * @param {LineChartPoints[]} points
1380
- * @param {IMargins} margins
1381
- * @param {number} width
1382
- * @param {boolean} isRTL
1383
- * @param {Date[] | number[]} tickValues
1384
- * @returns {IDomainNRange}
1385
- */
1386
- function domainRangeOfDateForScatterChart(points, margins, width, isRTL, tickValues) {
1387
- if (tickValues === void 0) { tickValues = []; }
1388
- var sDate;
1389
- var lDate;
1390
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1391
- sDate = (0, d3_array_1.min)(points, function (point) {
1392
- return (0, d3_array_1.min)(point.data, function (item) {
1393
- return item.x;
1394
- });
1395
- });
1396
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1397
- lDate = (0, d3_array_1.max)(points, function (point) {
1398
- return (0, d3_array_1.max)(point.data, function (item) {
1399
- return item.x;
1400
- });
1401
- });
1402
- var xPadding = (lDate.getTime() - sDate.getTime()) * 0.1;
1403
- sDate = new Date(sDate.getTime() - xPadding);
1404
- lDate = new Date(lDate.getTime() + xPadding);
1405
- // Need to draw graph with given small and large date
1406
- // (Which Involves customization of date axis tick values)
1407
- // That may be Either from given graph data or from prop 'tickValues' date values.
1408
- // So, Finding smallest and largest dates
1409
- sDate = (0, d3_array_1.min)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [sDate], false));
1410
- lDate = (0, d3_array_1.max)(tslib_1.__spreadArray(tslib_1.__spreadArray([], tickValues, true), [lDate], false));
1411
- var rStartValue = margins.left;
1412
- var rEndValue = width - margins.right;
1413
- return isRTL
1414
- ? { dStartValue: lDate, dEndValue: sDate, rStartValue: rStartValue, rEndValue: rEndValue }
1415
- : { dStartValue: sDate, dEndValue: lDate, rStartValue: rStartValue, rEndValue: rEndValue };
1416
- }
1417
- exports.domainRangeOfDateForScatterChart = domainRangeOfDateForScatterChart;
1418
- /**
1419
- * Calculates Domain and range values for Numeric X axis for scatter chart.
1420
- * @export
1421
- * @param {LineChartPoints[]} points
1422
- * @param {IMargins} margins
1423
- * @param {number} width
1424
- * @param {boolean} isRTL
1425
- * @returns {IDomainNRange}
1426
- */
1427
- function domainRangeOfNumericForScatterChart(points, margins, width, isRTL) {
1428
- var isScatterPolar = isScatterPolarSeries(points);
1429
- var xMin = (0, d3_array_1.min)(points, function (point) {
1430
- return (0, d3_array_1.min)(point.data, function (item) { return item.x; });
1431
- });
1432
- var xMax = (0, d3_array_1.max)(points, function (point) {
1433
- return (0, d3_array_1.max)(point.data, function (item) {
1434
- return item.x;
1435
- });
1436
- });
1437
- var xPadding = (xMax - xMin) * 0.1;
1438
- xMin = xMin - xPadding;
1439
- xMax = xMax + xPadding;
1440
- var rStartValue = margins.left;
1441
- var rEndValue = width - margins.right;
1442
- return isRTL
1443
- ? { dStartValue: isScatterPolar ? 1 : xMax, dEndValue: isScatterPolar ? -1 : xMin, rStartValue: rStartValue, rEndValue: rEndValue }
1444
- : { dStartValue: isScatterPolar ? -1 : xMin, dEndValue: isScatterPolar ? 1 : xMax, rStartValue: rStartValue, rEndValue: rEndValue };
1445
- }
1446
- exports.domainRangeOfNumericForScatterChart = domainRangeOfNumericForScatterChart;
1447
1389
  var truncateString = function (str, maxLength, ellipsis) {
1448
1390
  if (ellipsis === void 0) { ellipsis = '...'; }
1449
1391
  if (str.length <= maxLength) {
@@ -1547,5 +1489,83 @@ define(["require", "exports", "tslib", "d3-axis", "d3-array", "d3-scale", "d3-se
1547
1489
  function (item) { var _a; return typeof ((_a = item.lineOptions) === null || _a === void 0 ? void 0 : _a.mode) === 'string' && item.lineOptions.mode === 'text'; });
1548
1490
  }
1549
1491
  exports.isTextMode = isTextMode;
1492
+ // TODO: Refactor to encapsulate the complete numeric scale creation logic here, including setting domain and range.
1493
+ var createNumericScale = function (scaleType) {
1494
+ if (scaleType === 'log') {
1495
+ return (0, d3_scale_1.scaleLog)();
1496
+ }
1497
+ else {
1498
+ return (0, d3_scale_1.scaleLinear)();
1499
+ }
1500
+ };
1501
+ var getDomainPaddingForMarkers = function (minVal, maxVal, scaleType) {
1502
+ if (scaleType === 'log') {
1503
+ return {
1504
+ start: minVal * 0.5,
1505
+ end: maxVal,
1506
+ };
1507
+ }
1508
+ var defaultPadding = (maxVal - minVal) * 0.1;
1509
+ return {
1510
+ start: defaultPadding,
1511
+ end: defaultPadding,
1512
+ };
1513
+ };
1514
+ exports.getDomainPaddingForMarkers = getDomainPaddingForMarkers;
1515
+ /**
1516
+ * Determines whether a value is valid for inclusion in the scale domain.
1517
+ * For log scales, ensures the value is strictly positive to prevent undefined scale behavior.
1518
+ */
1519
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1520
+ var isValidDomainValue = function (value, scaleType) {
1521
+ return typeof value !== 'number' || scaleType !== 'log' || value > 0;
1522
+ };
1523
+ exports.isValidDomainValue = isValidDomainValue;
1524
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1525
+ var isPlottable = function (x, y) {
1526
+ return !(0, chart_utilities_1.isInvalidValue)(x) && !(0, chart_utilities_1.isInvalidValue)(y);
1527
+ };
1528
+ exports.isPlottable = isPlottable;
1529
+ var getScatterXDomainExtent = function (points, scaleType) {
1530
+ var isValidDataPointForScale = function (item) {
1531
+ return (0, exports.isValidDomainValue)(item.x, scaleType);
1532
+ };
1533
+ var xMin = (0, d3_array_1.min)(points, function (point) {
1534
+ return (0, d3_array_1.min)(point.data.filter(isValidDataPointForScale), function (item) { return item.x; });
1535
+ });
1536
+ var xMax = (0, d3_array_1.max)(points, function (point) {
1537
+ return (0, d3_array_1.max)(point.data.filter(isValidDataPointForScale), function (item) {
1538
+ return item.x;
1539
+ });
1540
+ });
1541
+ return [xMin, xMax];
1542
+ };
1543
+ exports.getScatterXDomainExtent = getScatterXDomainExtent;
1544
+ var getRangeForScatterMarkerSize = function (_a) {
1545
+ 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;
1546
+ // Note: This function is executed after the scale is created, so the actual padding can be
1547
+ // obtained by calculating the difference between the respective minimums or maximums of the
1548
+ // scale domain and the data. However, doing so often causes the marker size to scale up
1549
+ // unnecessarily when the scale uses a wider domain than required (due to the use of D3's nice
1550
+ // function or our own tick value calculations).
1551
+ // A better approach could be to treat the marker size as a fixed pixel value and adjust the
1552
+ // scale domain with sufficient padding to accommodate the maximum marker size—instead of doing
1553
+ // it the other way around (i.e., adjusting the scale domain first with padding and then scaling
1554
+ // the markers to fit inside the plot area).
1555
+ var _b = (0, exports.getScatterXDomainExtent)(data, xScaleType), xMin = _b[0], xMax = _b[1];
1556
+ var xPadding = (0, exports.getDomainPaddingForMarkers)(+xMin, +xMax, xScaleType);
1557
+ var scaleXMin = xMin instanceof Date ? new Date(+xMin - xPadding.start) : xMin - xPadding.start;
1558
+ var scaleXMax = xMax instanceof Date ? new Date(+xMax + xPadding.end) : xMax + xPadding.end;
1559
+ var extraXPixels = Math.min(Math.abs(xScale(xMin) - xScale(scaleXMin)), Math.abs(xScale(scaleXMax) - xScale(xMax)));
1560
+ var yScaleType = useSecondaryYScale ? secondaryYScaleType : primaryYScaleType;
1561
+ var _c = findNumericMinMaxOfY(data, undefined, useSecondaryYScale, yScaleType), yMin = _c.startValue, yMax = _c.endValue;
1562
+ var yPadding = (0, exports.getDomainPaddingForMarkers)(yMin, yMax, yScaleType);
1563
+ var scaleYMin = yMin - yPadding.start;
1564
+ var scaleYMax = yMax + yPadding.end;
1565
+ var yScale = (useSecondaryYScale ? yScaleSecondary : yScalePrimary);
1566
+ var extraYPixels = Math.min(Math.abs(yScale(scaleYMin) - yScale(yMin)), Math.abs(yScale(yMax) - yScale(scaleYMax)));
1567
+ return Math.min(extraXPixels, extraYPixels);
1568
+ };
1569
+ exports.getRangeForScatterMarkerSize = getRangeForScatterMarkerSize;
1550
1570
  });
1551
1571
  //# sourceMappingURL=utilities.js.map