@fluentui/react-charting 5.24.13 → 5.24.15

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 (65) hide show
  1. package/CHANGELOG.json +64 -1
  2. package/CHANGELOG.md +23 -2
  3. package/dist/react-charting.d.ts +26 -17
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +1 -0
  7. package/lib/Utilities.js +19 -1
  8. package/lib/Utilities.js.map +1 -1
  9. package/lib/components/CommonComponents/CartesianChart.base.js +6 -6
  10. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  11. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +45 -12
  12. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  13. package/lib/components/GanttChart/GanttChart.base.js +210 -158
  14. package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
  15. package/lib/components/GanttChart/GanttChart.types.d.ts +23 -13
  16. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  17. package/lib/components/LineChart/LineChart.base.js +6 -11
  18. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  19. package/lib/components/ScatterChart/ScatterChart.base.js +4 -9
  20. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  21. package/lib/types/IDataPoint.d.ts +3 -4
  22. package/lib/types/IDataPoint.js.map +1 -1
  23. package/lib/utilities/scatterpolar-utils.d.ts +7 -4
  24. package/lib/utilities/scatterpolar-utils.js +19 -2
  25. package/lib/utilities/scatterpolar-utils.js.map +1 -1
  26. package/lib-amd/Utilities.js +9 -0
  27. package/lib-amd/Utilities.js.map +1 -1
  28. package/lib-amd/components/CommonComponents/CartesianChart.base.js +6 -6
  29. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  30. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +45 -12
  31. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  32. package/lib-amd/components/GanttChart/GanttChart.base.js +210 -158
  33. package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
  34. package/lib-amd/components/GanttChart/GanttChart.types.d.ts +23 -13
  35. package/lib-amd/components/GanttChart/GanttChart.types.js.map +1 -1
  36. package/lib-amd/components/LineChart/LineChart.base.js +6 -11
  37. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  38. package/lib-amd/components/ScatterChart/ScatterChart.base.js +4 -9
  39. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  40. package/lib-amd/types/IDataPoint.d.ts +3 -4
  41. package/lib-amd/types/IDataPoint.js.map +1 -1
  42. package/lib-amd/utilities/scatterpolar-utils.d.ts +7 -4
  43. package/lib-amd/utilities/scatterpolar-utils.js +21 -3
  44. package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
  45. package/lib-commonjs/Utilities.js +9 -0
  46. package/lib-commonjs/Utilities.js.map +1 -1
  47. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +6 -6
  48. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  49. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +45 -12
  50. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  51. package/lib-commonjs/components/GanttChart/GanttChart.base.js +210 -158
  52. package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
  53. package/lib-commonjs/components/GanttChart/GanttChart.types.d.ts +23 -13
  54. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  55. package/lib-commonjs/components/LineChart/LineChart.base.js +6 -11
  56. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  57. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +4 -9
  58. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  59. package/lib-commonjs/types/IDataPoint.d.ts +3 -4
  60. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  61. package/lib-commonjs/utilities/scatterpolar-utils.d.ts +7 -4
  62. package/lib-commonjs/utilities/scatterpolar-utils.js +21 -3
  63. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
  64. package/package.json +2 -2
  65. package/src/components/GanttChart/GanttChart.types.ts +24 -13
@@ -1 +1 @@
1
- {"version":3,"file":"GanttChart.base.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.base.tsx"],"names":[],"mappings":";;;;IAmCa,QAAA,cAAc,GAA8C,KAAK,CAAC,UAAU,CAGvF,UAAC,EAA2D,EAAE,YAAY;;QAAvE,IAAA,cAAa,EAAb,MAAM,mBAAG,IAAI,KAAA,EAAE,0BAA8B,EAA9B,kBAAkB,mBAAG,SAAS,KAAA,EAAK,KAAK,sBAAzD,gCAA2D,CAAF;QAC1D,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,CAAC,CAAC,CAAC;QAC3C,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,IAAA,aAAK,EAAC,SAAS,CAAC,CAAC,CAAC;QAC1D,IAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;QAC3C,IAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAsB,EAAE,CAAC,CAAC;QACpD,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAa,kBAAU,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAY,iBAAS,CAAC,UAAU,CAAC,CAAC;QACjE,IAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,CAA8B,IAAI,CAAC,CAAC;QAC5E,IAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAS,IAAI,CAAC,CAAC;QACtD,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;QACzD,IAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAS,yBAAiB,C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U;gBAC5B,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;YAEF,OAAO,CACL,oBAAC,sBAAc,uBACT,KAAK,IACT,YAAY,EAAE,aAAa,CAAC,OAAO,EACnC,UAAU,EAAE,cAAc,EAAE,EAC5B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,kBAAU,CAAC,UAAU,EAChC,SAAS,EAAE,UAAU,CAAC,OAAO,EAC7B,SAAS,EAAE,UAAU,CAAC,OAAO,EAC7B,2BAA2B,EAAE,WAAW,EACxC,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,gDAAwC,EACrD,qBAAqB,EAAE,sBAAsB,EAC7C,iBAAiB,EAAE,sDAA8C,EACjE,gBAAgB,EAAE,iCAAyB,EAC3C,kBAAkB,EAAE,0BAAkB,CAAC,QAAQ,EAC/C,iBAAiB,EAAE,qBAAqB,EAAE,EAC1C,UAAU,EAAE,WAAW,EACvB,iBAAiB,EAAE,kBAAkB,EACrC,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,sBAAsB,EACzC,GAAG,EAAE,kBAAkB,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,WAAW,IACrB,CACH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CACL,6BACE,EAAE,EAAE,aAAa,CAAC,OAAO,EACzB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,gBACX,8BAA8B,GAC1C,CACH,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,sBAAc,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, ScaleBand, ScaleTime } from 'd3-scale';\nimport { DirectionalHint, FocusZoneDirection, getId, getRTL } from '@fluentui/react';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { IMargins, IChart, IImageExportOptions, IGanttChartDataPoint } from '../../types/IDataPoint';\nimport { CartesianChart } from '../CommonComponents/index';\nimport { IGanttChartProps } from './GanttChart.types';\nimport {\n ChartHoverCard,\n ChartTypes,\n YAxisType,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n createStringYAxisForHorizontalBarChartWithAxis,\n getNextGradient,\n areArraysEqual,\n MIN_DOMAIN_MARGIN,\n sortAxisCategories,\n calculateAppropriateBarWidth,\n getColorFromToken,\n getScalePadding,\n getDateFormatLevel,\n} from '../../utilities/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';\n\ntype NumberScale = ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\ntype DateScale = ScaleTime<Date, number>;\n\nexport const GanttChartBase: React.FunctionComponent<IGanttChartProps> = React.forwardRef<\n HTMLDivElement,\n IGanttChartProps\n>(({ useUTC = true, yAxisCategoryOrder = 'default', ...props }, forwardedRef) => {\n const _barHeight = React.useRef<number>(0);\n const _calloutId = React.useRef<string>(getId('callout'));\n const margins = React.useRef<IMargins>({});\n const _bars = React.useRef<React.JSX.Element[]>([]);\n const _xAxisType = React.useRef<XAxisTypes>(XAxisTypes.DateAxis);\n const _yAxisType = React.useRef<YAxisType>(YAxisType.StringAxis);\n const _calloutAnchorPoint = React.useRef<IGanttChartDataPoint | null>(null);\n const _cartesianChartRef = React.useRef<IChart>(null);\n const _legendsRef = React.useRef<ILegendContainer>(null);\n const _domainMargin = React.useRef<number>(MIN_DOMAIN_MARGIN);\n const _yAxisPadding = React.useRef<number>(0);\n const _emptyChartId = React.useRef<string>(getId('Gantt_empty'));\n const _legendColorMap = React.useRef<Record<string, [string, string]>>({});\n const _gradientId = React.useRef<string>(getId('Gantt_gradient'));\n const prevProps = React.useRef<Partial<IGanttChartProps>>({});\n\n const [calloutColor, setCalloutColor] = React.useState<string>('');\n const [isCalloutVisible, setCalloutVisible] = React.useState<boolean>(false);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [calloutTarget, setCalloutTarget] = React.useState<SVGElement | null>(null);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [dataPointCalloutProps, setDataPointCalloutProps] = React.useState<IGanttChartDataPoint>();\n\n React.useEffect(() => {\n if (!areArraysEqual(prevProps.current.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n prevProps.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return toImage(_cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _points = React.useMemo(() => {\n _legendColorMap.current = {};\n let colorIndex = 0;\n\n return (\n props.data?.map(point => {\n const legend = `${point.legend}`;\n if (!_legendColorMap.current[legend]) {\n let startColor = point.color\n ? getColorFromToken(point.color, props.theme?.isInverted)\n : getNextColor(colorIndex, 0, props.theme?.isInverted);\n let endColor = startColor;\n\n if (props.enableGradient) {\n const nextGradient = getNextGradient(colorIndex, 0, props.theme?.isInverted);\n startColor = point.gradient?.[0] || nextGradient[0];\n endColor = point.gradient?.[1] || nextGradient[1];\n }\n\n _legendColorMap.current[legend] = [startColor, endColor];\n colorIndex += 1;\n }\n\n return {\n ...point,\n color: _legendColorMap.current[legend][0],\n ...(props.enableGradient ? { gradient: _legendColorMap.current[legend] } : {}),\n };\n }) ?? []\n );\n }, [props.data, props.theme?.isInverted, props.enableGradient]);\n\n const _dateFormatOptions = React.useMemo(() => {\n if (_xAxisType.current !== XAxisTypes.DateAxis) {\n return undefined;\n }\n\n let lowestFormatLevel = 100;\n let highestFormatLevel = -1;\n _points.forEach(p => {\n const startFormatLevel = getDateFormatLevel(p.x.start as Date, useUTC);\n const endFormatLevel = getDateFormatLevel(p.x.end as Date, useUTC);\n lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);\n highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);\n });\n\n return getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);\n }, [useUTC, _points]);\n\n const _getDomainNRangeValues = React.useCallback(\n (\n points: IGanttChartDataPoint[],\n _margins: IMargins,\n containerWidth: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ): IDomainNRange => {\n const xValues: (Date | number)[] = [];\n points.forEach(point => {\n xValues.push(point.x.start, point.x.end);\n });\n\n const xMin = d3Min(xValues) || 0;\n const xMax = d3Max(xValues) || 0;\n\n return {\n dStartValue: isRTL ? xMax : xMin,\n dEndValue: isRTL ? xMin : xMax,\n rStartValue: _margins.left! + (isRTL ? 0 : shiftX),\n rEndValue: containerWidth - _margins.right! - (isRTL ? shiftX : 0),\n };\n },\n [],\n );\n\n const _adjustProps = (): void => {\n _barHeight.current = Math.max(props.barHeight || 24, 1);\n\n if (props.data && props.data.length > 0) {\n _xAxisType.current = getTypeOfAxis(props.data[0].x.start, true) as XAxisTypes;\n _yAxisType.current = getTypeOfAxis(props.data[0].y, false) as YAxisType;\n }\n\n _yAxisPadding.current = getScalePadding(props.yAxisPadding, undefined, 1 / 2);\n };\n\n const _getMargins = React.useCallback((_margins: IMargins) => {\n margins.current = _margins;\n }, []);\n\n const _renderContentForOnlyBars = (point: IGanttChartDataPoint): React.JSX.Element => {\n return (\n <ChartHoverCard\n XValue={point.yAxisCalloutData || point.y.toString()}\n Legend={point.legend}\n YValue={point.xAxisCalloutData || _getFormattedXValue(point)}\n color={point.color}\n culture={props.culture}\n />\n );\n };\n\n const _renderCallout = (point?: IGanttChartDataPoint): React.JSX.Element | null => {\n return point ? _renderContentForOnlyBars(point) : null;\n };\n\n const _getCustomizedCallout = () => {\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps, _renderCallout)\n : null;\n };\n\n const _getFormattedXValue = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n let formattedStartX: string;\n let formattedEndX: string;\n\n if (_xAxisType.current === XAxisTypes.DateAxis) {\n formattedStartX = formatDateToLocaleString(\n point.x.start as Date,\n props.culture,\n useUTC,\n false,\n _dateFormatOptions,\n );\n formattedEndX = formatDateToLocaleString(point.x.end as Date, props.culture, useUTC, false, _dateFormatOptions);\n } else {\n formattedStartX = point.x.start.toString();\n formattedEndX = point.x.end.toString();\n }\n\n return `${formattedStartX} - ${formattedEndX}`;\n },\n [props.culture, useUTC, _dateFormatOptions],\n );\n\n const _getAriaLabel = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n const xValue = point.xAxisCalloutData || _getFormattedXValue(point);\n const yValue = point.yAxisCalloutData || point.y;\n return point.callOutAccessibilityData?.ariaLabel || `${yValue}. ` + `${xValue}.`;\n },\n [_getFormattedXValue],\n );\n\n const _getHighlightedLegend = React.useCallback(() => {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }, [hoveredLegend, selectedLegends]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = React.useCallback(\n (legend: string | undefined) => {\n return _getHighlightedLegend().includes(`${legend}`);\n },\n [_getHighlightedLegend],\n );\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = React.useCallback(() => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n const _showCallout = React.useCallback(\n (target: SVGElement, point: IGanttChartDataPoint) => {\n if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {\n return;\n }\n\n _calloutAnchorPoint.current = point;\n setCalloutTarget(target);\n setCalloutVisible(true);\n setCalloutLegend(point.legend!);\n setCalloutColor(point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || _getFormattedXValue(point));\n setDataPointCalloutProps(point);\n },\n [_getFormattedXValue, _legendHighlighted, _noLegendHighlighted],\n );\n\n const _onBarFocus = React.useCallback(\n (point: IGanttChartDataPoint, focusEvent: React.FocusEvent<SVGElement>): void => {\n _showCallout(focusEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _onBarHover = React.useCallback(\n (point: IGanttChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>): void => {\n _showCallout(mouseEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _createBars = React.useCallback(\n (xScale: DateScale | NumberScale, yScale: NumberScale | StringScale): React.JSX.Element[] => {\n const bars = _points.map((point: IGanttChartDataPoint, index: number) => {\n const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);\n\n let startColor = point.color!;\n let endColor = startColor;\n if (props.enableGradient) {\n startColor = point.gradient![0];\n endColor = point.gradient![1];\n }\n const gradientId = `${_gradientId.current}_${index}`;\n\n const startX = xScale(point.x.start);\n const endX = xScale(point.x.end);\n const y =\n (_yAxisType.current === YAxisType.StringAxis\n ? (yScale as StringScale)(point.y as string)! + (yScale as StringScale).bandwidth() / 2\n : (yScale as NumberScale)(point.y as number)) -\n _barHeight.current / 2;\n\n return (\n <React.Fragment key={index}>\n {props.enableGradient && (\n <defs>\n <linearGradient id={gradientId}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>\n </defs>\n )}\n <rect\n x={Math.min(startX, endX)}\n y={y}\n width={Math.abs(endX - startX)}\n height={_barHeight.current}\n rx={props.roundCorners ? 3 : 0}\n fill={props.enableGradient ? `url(#${gradientId})` : startColor}\n opacity={shouldHighlight ? 1 : 0.1}\n onClick={point.onClick}\n onMouseOver={event => _onBarHover(point, event)}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(point, event)}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n />\n </React.Fragment>\n );\n });\n return bars;\n },\n [\n _getAriaLabel,\n _legendHighlighted,\n _noLegendHighlighted,\n _onBarFocus,\n _onBarHover,\n props.enableGradient,\n props.roundCorners,\n _points,\n ],\n );\n\n const _getGraphData = React.useCallback(\n (\n xScale: DateScale | NumberScale,\n yScale: NumberScale | StringScale,\n containerHeight: number,\n containerWidth: number,\n xAxisElement: SVGElement | null,\n yAxisElement: SVGElement | null,\n ) => {\n return (_bars.current = _createBars(xScale, yScale));\n },\n [_createBars],\n );\n\n const _onBarLeave = (): void => {\n // do nothing\n };\n\n const _handleChartMouseLeave = React.useCallback((): void => {\n _calloutAnchorPoint.current = null;\n setCalloutTarget(null);\n setCalloutVisible(false);\n setCalloutLegend('');\n setCalloutColor('');\n setXCalloutValue('');\n setYCalloutValue('');\n setDataPointCalloutProps(undefined);\n }, []);\n\n const _closeCallout = () => {\n setCalloutVisible(false);\n };\n\n const _onLegendHover = (legend: string): void => {\n setHoveredLegend(legend);\n };\n\n const _onLegendLeave = (): void => {\n setHoveredLegend('');\n };\n\n const _getLegendData = (): React.JSX.Element => {\n const actions: ILegend[] = [];\n\n Object.keys(_legendColorMap.current).forEach((legendTitle: string) => {\n const legend: ILegend = {\n title: legendTitle,\n color: _legendColorMap.current[legendTitle][0],\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n onChange={_onLegendSelectionChange}\n ref={_legendsRef}\n {...props.legendProps}\n />\n );\n return legends;\n };\n\n const _onLegendSelectionChange = (\n _selectedLegends: string[],\n event: React.MouseEvent<HTMLButtonElement>,\n currentLegend?: ILegend,\n ): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n };\n\n const _getChartTitle = (): string => {\n const { chartTitle } = props;\n return (chartTitle ? `${chartTitle}. ` : '') + `Gantt chart with ${_points.length} bars. `;\n };\n\n const _isChartEmpty = (): boolean => {\n return !(props.data && props.data.length > 0);\n };\n\n const _getYDomainMargins = React.useCallback(\n (containerHeight: number): IMargins => {\n _domainMargin.current = MIN_DOMAIN_MARGIN;\n\n const ySet = new Set<string | number>();\n _points.forEach((point: IGanttChartDataPoint) => {\n ySet.add(point.y);\n });\n const uniqueY = Array.from(ySet);\n\n /** Total height available to render the bars */\n const totalHeight =\n containerHeight - (margins.current.top! + MIN_DOMAIN_MARGIN) - (margins.current.bottom! + MIN_DOMAIN_MARGIN);\n\n if (_yAxisType.current !== YAxisType.StringAxis) {\n _barHeight.current = Math.max(\n props.barHeight ||\n calculateAppropriateBarWidth(uniqueY as number[] | Date[], totalHeight, _yAxisPadding.current),\n 1,\n );\n _domainMargin.current += _barHeight.current / 2;\n }\n\n return {\n ...margins.current,\n top: margins.current.top! + _domainMargin.current,\n bottom: margins.current.bottom! + _domainMargin.current,\n };\n },\n [props.barHeight, _points],\n );\n\n const _getOrderedYAxisLabels = () => {\n return sortAxisCategories(_mapCategoryToValues(), yAxisCategoryOrder);\n };\n\n const _mapCategoryToValues = () => {\n const categoryToValues: Record<string, number[]> = {};\n _points.forEach(point => {\n if (!categoryToValues[point.y]) {\n categoryToValues[point.y] = [];\n }\n // FIXME\n // categoryToValues[point.y].push(point.x.end - point.x.start);\n });\n return categoryToValues;\n };\n\n const _renderBars = React.useCallback(() => {\n return <g>{_bars.current}</g>;\n }, []);\n\n if (!_isChartEmpty()) {\n _adjustProps();\n\n const yAxisLabels = _getOrderedYAxisLabels();\n const legendBars: React.JSX.Element = _getLegendData();\n const calloutProps = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${_calloutId.current}`,\n target: calloutTarget,\n isBeakVisible: false,\n gapSpace: 15,\n color: calloutColor,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue,\n onDismiss: _closeCallout,\n preventDismissOnLostFocus: true,\n ...props.calloutProps,\n };\n const tickParams = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n return (\n <CartesianChart\n {...props}\n yAxisPadding={_yAxisPadding.current}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.GanttChart}\n xAxisType={_xAxisType.current}\n yAxisType={_yAxisType.current}\n stringDatasetForYAxisDomain={yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={legendBars}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n focusZoneDirection={FocusZoneDirection.vertical}\n customizedCallout={_getCustomizedCallout()}\n getmargins={_getMargins}\n getYDomainMargins={_getYDomainMargins}\n getGraphData={_getGraphData}\n onChartMouseLeave={_handleChartMouseLeave}\n ref={_cartesianChartRef}\n useUTC={useUTC}\n children={_renderBars}\n />\n );\n } else {\n return (\n <div\n id={_emptyChartId.current}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n});\n\nGanttChartBase.display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,YAAY,CAAC","sourcesContent":["import * as React from 'react';\nimport { max as d3Max, min as d3Min } from 'd3-array';\nimport { ScaleLinear, ScaleBand, ScaleTime } from 'd3-scale';\nimport { DirectionalHint, FocusZoneDirection, getId, getRTL } from '@fluentui/react';\nimport { ILegend, ILegendContainer, Legends } from '../Legends/index';\nimport { IMargins, IChart, IImageExportOptions, IGanttChartDataPoint } from '../../types/IDataPoint';\nimport { CartesianChart, IModifiedCartesianChartProps } from '../CommonComponents/index';\nimport { IGanttChartProps } from './GanttChart.types';\nimport {\n ChartHoverCard,\n ChartTypes,\n YAxisType,\n XAxisTypes,\n getTypeOfAxis,\n getNextColor,\n findHBCWANumericMinMaxOfY,\n createYAxisForHorizontalBarChartWithAxis,\n IDomainNRange,\n createStringYAxisForHorizontalBarChartWithAxis,\n getNextGradient,\n areArraysEqual,\n MIN_DOMAIN_MARGIN,\n sortAxisCategories,\n calculateAppropriateBarWidth,\n getColorFromToken,\n getScalePadding,\n getDateFormatLevel,\n} from '../../utilities/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { formatDateToLocaleString, getMultiLevelDateTimeFormatOptions } from '@fluentui/chart-utilities';\n\ntype NumberScale = ScaleLinear<number, number>;\ntype StringScale = ScaleBand<string>;\ntype DateScale = ScaleTime<Date, number>;\n\nconst DEFAULT_BAR_HEIGHT = 24;\nconst MIN_BAR_HEIGHT = 1;\n\nexport const GanttChartBase: React.FunctionComponent<IGanttChartProps> = React.forwardRef<\n HTMLDivElement,\n IGanttChartProps\n>(({ useUTC = true, yAxisCategoryOrder = 'default', maxBarHeight = 24, ...props }, forwardedRef) => {\n const _barHeight = React.useRef<number>(DEFAULT_BAR_HEIGHT);\n const _calloutId = React.useRef<string>(getId('callout'));\n const _margins = React.useRef<IMargins>({});\n const _calloutAnchorPoint = React.useRef<IGanttChartDataPoint | null>(null);\n const _cartesianChartRef = React.useRef<IChart>(null);\n const _legendsRef = React.useRef<ILegendContainer>(null);\n const _emptyChartId = React.useRef<string>(getId('Gantt_empty'));\n const _legendMap = React.useRef<Record<string, { id: string; startColor: string; endColor: string }>>({});\n const _prevProps = React.useRef<Partial<IGanttChartProps>>({});\n\n const [calloutColor, setCalloutColor] = React.useState<string>('');\n const [isCalloutVisible, setCalloutVisible] = React.useState<boolean>(false);\n const [hoveredLegend, setHoveredLegend] = React.useState<string>('');\n const [calloutTarget, setCalloutTarget] = React.useState<SVGElement | null>(null);\n const [calloutLegend, setCalloutLegend] = React.useState<string>('');\n const [xCalloutValue, setXCalloutValue] = React.useState<string>('');\n const [yCalloutValue, setYCalloutValue] = React.useState<string>('');\n const [selectedLegends, setSelectedLegends] = React.useState<string[]>(props.legendProps?.selectedLegends || []);\n const [calloutDataPoint, setCalloutDataPoint] = React.useState<IGanttChartDataPoint>();\n\n React.useEffect(() => {\n if (!areArraysEqual(_prevProps.current.legendProps?.selectedLegends, props.legendProps?.selectedLegends)) {\n setSelectedLegends(props.legendProps?.selectedLegends || []);\n }\n _prevProps.current = props;\n }, [props]);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _cartesianChartRef.current?.chartContainer ?? null,\n toImage: (opts?: IImageExportOptions): Promise<string> => {\n return toImage(_cartesianChartRef.current?.chartContainer, _legendsRef.current?.toSVG, getRTL(), opts);\n },\n }),\n [],\n );\n\n const _points = React.useMemo(() => {\n _legendMap.current = {};\n let colorIndex = 0;\n\n return (\n props.data?.map(point => {\n const legend = `${point.legend}`;\n if (!_legendMap.current[legend]) {\n let startColor = point.color\n ? getColorFromToken(point.color, props.theme?.isInverted)\n : getNextColor(colorIndex, 0, props.theme?.isInverted);\n let endColor = startColor;\n\n if (props.enableGradient) {\n const nextGradient = getNextGradient(colorIndex, 0, props.theme?.isInverted);\n startColor = point.gradient?.[0] || nextGradient[0];\n endColor = point.gradient?.[1] || nextGradient[1];\n }\n\n _legendMap.current[legend] = { id: getId('legend'), startColor, endColor };\n colorIndex += 1;\n }\n\n const { startColor, endColor } = _legendMap.current[legend];\n return {\n ...point,\n color: startColor,\n ...(props.enableGradient ? { gradient: [startColor, endColor] as [string, string] } : {}),\n };\n }) ?? []\n );\n }, [props.data, props.theme?.isInverted, props.enableGradient]);\n\n const _xAxisType = React.useMemo(() => {\n if (_points.length > 0) {\n return getTypeOfAxis(_points[0].x.start, true) as XAxisTypes;\n }\n return XAxisTypes.DateAxis;\n }, [_points]);\n\n const _yAxisType = React.useMemo(() => {\n if (_points.length > 0) {\n return getTypeOfAxis(_points[0].y, false) as YAxisType;\n }\n return YAxisType.StringAxis;\n }, [_points]);\n\n const _yAxisPadding = React.useMemo(() => {\n return getScalePadding(props.yAxisPadding, undefined, 1 / 2);\n }, [props.yAxisPadding]);\n\n const _dateFormatOptions = React.useMemo(() => {\n if (_xAxisType !== XAxisTypes.DateAxis) {\n return undefined;\n }\n\n let lowestFormatLevel = 100;\n let highestFormatLevel = -1;\n _points.forEach(p => {\n const startFormatLevel = getDateFormatLevel(p.x.start as Date, useUTC);\n const endFormatLevel = getDateFormatLevel(p.x.end as Date, useUTC);\n lowestFormatLevel = Math.min(lowestFormatLevel, startFormatLevel, endFormatLevel);\n highestFormatLevel = Math.max(highestFormatLevel, startFormatLevel, endFormatLevel);\n });\n\n return getMultiLevelDateTimeFormatOptions(lowestFormatLevel, highestFormatLevel);\n }, [useUTC, _points, _xAxisType]);\n\n const _mapYValueToXValues = React.useCallback(() => {\n const yValueToXValues: Record<string, number[]> = {};\n _points.forEach(point => {\n if (!yValueToXValues[point.y]) {\n yValueToXValues[point.y] = [];\n }\n yValueToXValues[point.y].push(+point.x.end - +point.x.start);\n });\n return yValueToXValues;\n }, [_points]);\n\n const _getOrderedYAxisLabels = React.useCallback(() => {\n const yValueToXValues = _mapYValueToXValues();\n\n if (_yAxisType !== YAxisType.StringAxis) {\n return Object.keys(yValueToXValues).sort((a, b) => +a - +b);\n }\n\n if (yAxisCategoryOrder === 'default') {\n return Object.keys(yValueToXValues).reverse();\n }\n return sortAxisCategories(yValueToXValues, yAxisCategoryOrder);\n }, [_mapYValueToXValues, _yAxisType, yAxisCategoryOrder]);\n\n const _yAxisLabels = React.useMemo(() => _getOrderedYAxisLabels(), [_getOrderedYAxisLabels]);\n\n const _getDomainNRangeValues = React.useCallback(\n (\n points: IGanttChartDataPoint[],\n margins: IMargins,\n containerWidth: number,\n chartType: ChartTypes,\n isRTL: boolean,\n xAxisType: XAxisTypes,\n barWidth: number,\n tickValues: Date[] | number[] | undefined,\n shiftX: number,\n ): IDomainNRange => {\n const xValues: (Date | number)[] = [];\n points.forEach(point => {\n xValues.push(point.x.start, point.x.end);\n });\n\n const xMin = d3Min(xValues) || 0;\n const xMax = d3Max(xValues) || 0;\n\n return {\n dStartValue: isRTL ? xMax : xMin,\n dEndValue: isRTL ? xMin : xMax,\n rStartValue: margins.left! + (isRTL ? 0 : shiftX),\n rEndValue: containerWidth - margins.right! - (isRTL ? shiftX : 0),\n };\n },\n [],\n );\n\n const _getMargins = React.useCallback((margins: IMargins) => {\n _margins.current = margins;\n }, []);\n\n const _getFormattedXValue = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n let formattedStartX: string;\n let formattedEndX: string;\n\n if (_xAxisType === XAxisTypes.DateAxis) {\n formattedStartX = formatDateToLocaleString(\n point.x.start as Date,\n props.culture,\n useUTC,\n false,\n _dateFormatOptions,\n );\n formattedEndX = formatDateToLocaleString(point.x.end as Date, props.culture, useUTC, false, _dateFormatOptions);\n } else {\n formattedStartX = point.x.start.toString();\n formattedEndX = point.x.end.toString();\n }\n\n return `${formattedStartX} - ${formattedEndX}`;\n },\n [props.culture, useUTC, _dateFormatOptions, _xAxisType],\n );\n\n const _getCustomizedCallout = React.useCallback(() => {\n const defaultRender = (point?: IGanttChartDataPoint): React.JSX.Element | null => {\n return point ? (\n <ChartHoverCard\n XValue={point.yAxisCalloutData || point.y.toString()}\n Legend={point.legend}\n YValue={point.xAxisCalloutData || _getFormattedXValue(point)}\n color={point.color}\n culture={props.culture}\n />\n ) : null;\n };\n\n return props.onRenderCalloutPerDataPoint\n ? props.onRenderCalloutPerDataPoint(calloutDataPoint, defaultRender)\n : null;\n //eslint-disable-next-line react-hooks/exhaustive-deps\n }, [_getFormattedXValue, calloutDataPoint, props.culture, props.onRenderCalloutPerDataPoint]);\n\n const _getAriaLabel = React.useCallback(\n (point: IGanttChartDataPoint): string => {\n const xValue = point.xAxisCalloutData || _getFormattedXValue(point);\n const yValue = point.yAxisCalloutData || point.y;\n return (\n point.callOutAccessibilityData?.ariaLabel ||\n `${yValue}. ` + (point.legend ? `${point.legend}, ` : '') + `${xValue}.`\n );\n },\n [_getFormattedXValue],\n );\n\n const _getHighlightedLegend = React.useCallback(() => {\n return selectedLegends.length > 0 ? selectedLegends : hoveredLegend ? [hoveredLegend] : [];\n }, [hoveredLegend, selectedLegends]);\n\n /**\n * This function checks if the given legend is highlighted or not.\n * A legend can be highlighted in 2 ways:\n * 1. selection: if the user clicks on it\n * 2. hovering: if there is no selected legend and the user hovers over it\n */\n const _legendHighlighted = React.useCallback(\n (legend: string | undefined) => {\n return _getHighlightedLegend().includes(`${legend}`);\n },\n [_getHighlightedLegend],\n );\n\n /**\n * This function checks if none of the legends is selected or hovered.\n */\n const _noLegendHighlighted = React.useCallback(() => {\n return _getHighlightedLegend().length === 0;\n }, [_getHighlightedLegend]);\n\n const _showCallout = React.useCallback(\n (target: SVGElement, point: IGanttChartDataPoint) => {\n if (!(_noLegendHighlighted() || _legendHighlighted(point.legend)) || _calloutAnchorPoint.current === point) {\n return;\n }\n\n _calloutAnchorPoint.current = point;\n setCalloutTarget(target);\n setCalloutVisible(true);\n setCalloutLegend(point.legend!);\n setCalloutColor(point.color!);\n setXCalloutValue(point.yAxisCalloutData || point.y.toString());\n setYCalloutValue(point.xAxisCalloutData! || _getFormattedXValue(point));\n setCalloutDataPoint(point);\n },\n [_getFormattedXValue, _legendHighlighted, _noLegendHighlighted],\n );\n\n const _onBarFocus = React.useCallback(\n (point: IGanttChartDataPoint, focusEvent: React.FocusEvent<SVGElement>): void => {\n _showCallout(focusEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _onBarHover = React.useCallback(\n (point: IGanttChartDataPoint, mouseEvent: React.MouseEvent<SVGElement>): void => {\n _showCallout(mouseEvent.currentTarget, point);\n },\n [_showCallout],\n );\n\n const _onBarLeave = React.useCallback((): void => {\n // do nothing\n }, []);\n\n const _handleChartMouseLeave = React.useCallback((): void => {\n _calloutAnchorPoint.current = null;\n setCalloutTarget(null);\n setCalloutVisible(false);\n setCalloutLegend('');\n setCalloutColor('');\n setXCalloutValue('');\n setYCalloutValue('');\n setCalloutDataPoint(undefined);\n }, []);\n\n const _closeCallout = React.useCallback(() => {\n setCalloutVisible(false);\n }, []);\n\n const _getBarHeight = React.useCallback(\n (adjustedValue: number): number => {\n let barHeight: number;\n if (typeof props.barHeight === 'number') {\n barHeight = props.barHeight;\n } else {\n barHeight = adjustedValue;\n }\n if (typeof maxBarHeight === 'number') {\n barHeight = Math.min(barHeight, maxBarHeight);\n }\n barHeight = Math.max(barHeight, MIN_BAR_HEIGHT);\n return barHeight;\n },\n [maxBarHeight, props.barHeight],\n );\n\n const _getOrderedDataPoints = React.useCallback(() => {\n const result: IGanttChartDataPoint[] = [];\n\n const yValueToPoints: Record<string, IGanttChartDataPoint[]> = {};\n _points.forEach(point => {\n if (!yValueToPoints[point.y]) {\n yValueToPoints[point.y] = [];\n }\n yValueToPoints[point.y].push(point);\n });\n\n for (let i = _yAxisLabels.length - 1; i >= 0; i--) {\n const yValue = _yAxisLabels[i];\n if (yValueToPoints[yValue]) {\n result.push(...yValueToPoints[yValue].sort((a, b) => +a.x.start - +b.x.start));\n }\n }\n\n return result;\n }, [_points, _yAxisLabels]);\n\n const _createBars = React.useCallback(\n ({\n xScale,\n yScalePrimary: yScale,\n }: {\n xScale: DateScale | NumberScale;\n yScalePrimary: NumberScale | StringScale;\n }): React.JSX.Element => {\n const getGradientId = (legend: string | undefined) => {\n const legendId = _legendMap.current[`${legend}`].id;\n return `${legendId}_gradient`;\n };\n\n const gradientDefs: React.JSX.Element[] = [];\n if (props.enableGradient) {\n Object.keys(_legendMap.current).forEach((legend: string, index: number) => {\n const { startColor, endColor } = _legendMap.current[legend];\n gradientDefs.push(\n <linearGradient key={index} id={getGradientId(legend)}>\n <stop offset=\"0\" stopColor={startColor} />\n <stop offset=\"100%\" stopColor={endColor} />\n </linearGradient>,\n );\n });\n }\n\n let scaleBandwidth = 0;\n if (_yAxisType === YAxisType.StringAxis) {\n scaleBandwidth = (yScale as StringScale).bandwidth();\n _barHeight.current = _getBarHeight(scaleBandwidth);\n }\n\n const points = _getOrderedDataPoints();\n const bars = points.map((point: IGanttChartDataPoint, index: number) => {\n const rectStartX = xScale(point.x.start);\n const rectEndX = xScale(point.x.end);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const rectY = yScale(point.y as any)! + (scaleBandwidth - _barHeight.current) / 2;\n\n const shouldHighlight = _noLegendHighlighted() || _legendHighlighted(point.legend);\n\n return (\n <rect\n key={index}\n x={Math.min(rectStartX, rectEndX)}\n y={rectY}\n width={Math.abs(rectEndX - rectStartX)}\n height={_barHeight.current}\n rx={props.roundCorners ? 3 : 0}\n fill={props.enableGradient ? `url(#${getGradientId(point.legend)})` : point.color}\n opacity={shouldHighlight ? 1 : 0.1}\n onClick={point.onClick}\n onMouseOver={event => _onBarHover(point, event)}\n onMouseLeave={_onBarLeave}\n onFocus={event => _onBarFocus(point, event)}\n onBlur={_onBarLeave}\n data-is-focusable={shouldHighlight}\n role=\"img\"\n aria-label={_getAriaLabel(point)}\n />\n );\n });\n return (\n <g>\n {gradientDefs.length > 0 ? <defs>{gradientDefs}</defs> : null}\n {bars}\n </g>\n );\n },\n [\n _getAriaLabel,\n _getBarHeight,\n _getOrderedDataPoints,\n _legendHighlighted,\n _noLegendHighlighted,\n _onBarFocus,\n _onBarHover,\n _onBarLeave,\n _yAxisType,\n props.enableGradient,\n props.roundCorners,\n ],\n );\n\n const _onLegendHover = React.useCallback((legend: string): void => {\n setHoveredLegend(legend);\n }, []);\n\n const _onLegendLeave = React.useCallback((): void => {\n setHoveredLegend('');\n }, []);\n\n const _onLegendSelectionChange = React.useCallback(\n (_selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: ILegend): void => {\n if (props.legendProps?.canSelectMultipleLegends) {\n setSelectedLegends(_selectedLegends);\n } else {\n setSelectedLegends(_selectedLegends.slice(-1));\n }\n if (props.legendProps?.onChange) {\n props.legendProps.onChange(_selectedLegends, event, currentLegend);\n }\n },\n [props.legendProps],\n );\n\n const _getLegendData = React.useCallback((): React.JSX.Element => {\n const actions: ILegend[] = [];\n\n Object.keys(_legendMap.current).forEach((legendTitle: string) => {\n const legend: ILegend = {\n title: legendTitle,\n color: _legendMap.current[legendTitle].startColor,\n hoverAction: () => {\n _handleChartMouseLeave();\n _onLegendHover(legendTitle);\n },\n onMouseOutAction: () => {\n _onLegendLeave();\n },\n };\n\n actions.push(legend);\n });\n\n const legends = (\n <Legends\n legends={actions}\n enabledWrapLines={props.enabledLegendsWrapLines}\n overflowProps={props.legendsOverflowProps}\n focusZonePropsInHoverCard={props.focusZonePropsForLegendsInHoverCard}\n overflowText={props.legendsOverflowText}\n onChange={_onLegendSelectionChange}\n ref={_legendsRef}\n {...props.legendProps}\n />\n );\n return legends;\n }, [\n _handleChartMouseLeave,\n _onLegendHover,\n _onLegendLeave,\n _onLegendSelectionChange,\n props.enabledLegendsWrapLines,\n props.focusZonePropsForLegendsInHoverCard,\n props.legendProps,\n props.legendsOverflowProps,\n props.legendsOverflowText,\n ]);\n\n const _getChartTitle = React.useCallback((): string => {\n return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Gantt chart with ${_points.length} data points. `;\n }, [_points.length, props.chartTitle]);\n\n const _isChartEmpty = React.useCallback((): boolean => {\n return _points.length === 0;\n }, [_points.length]);\n\n const _getYDomainMargins = React.useCallback(\n (containerHeight: number): IMargins => {\n let domainMargin = MIN_DOMAIN_MARGIN;\n\n const ySet = new Set<string | number>();\n _points.forEach((point: IGanttChartDataPoint) => {\n ySet.add(point.y);\n });\n const uniqueY = Array.from(ySet);\n\n /** Total height available to render the bars */\n const totalHeight =\n containerHeight - (_margins.current.top! + MIN_DOMAIN_MARGIN) - (_margins.current.bottom! + MIN_DOMAIN_MARGIN);\n\n if (_yAxisType !== YAxisType.StringAxis) {\n _barHeight.current = _getBarHeight(\n calculateAppropriateBarWidth(uniqueY as number[] | Date[], totalHeight, _yAxisPadding),\n );\n domainMargin += _barHeight.current / 2;\n }\n\n return {\n ..._margins.current,\n top: _margins.current.top! + domainMargin,\n bottom: _margins.current.bottom! + domainMargin,\n };\n },\n [_getBarHeight, _points, _yAxisPadding, _yAxisType],\n );\n\n if (!_isChartEmpty()) {\n _barHeight.current = _getBarHeight(DEFAULT_BAR_HEIGHT);\n\n const calloutProps: IModifiedCartesianChartProps['calloutProps'] = {\n isCalloutVisible,\n directionalHint: DirectionalHint.topAutoEdge,\n id: `toolTip${_calloutId.current}`,\n target: calloutTarget,\n isBeakVisible: false,\n gapSpace: 15,\n color: calloutColor,\n legend: calloutLegend,\n XValue: xCalloutValue,\n YValue: yCalloutValue,\n onDismiss: _closeCallout,\n preventDismissOnLostFocus: true,\n ...props.calloutProps,\n };\n const tickParams: IModifiedCartesianChartProps['tickParams'] = {\n tickValues: props.tickValues,\n tickFormat: props.tickFormat,\n };\n\n return (\n <CartesianChart\n {...props}\n yAxisPadding={_yAxisPadding}\n chartTitle={_getChartTitle()}\n points={_points}\n chartType={ChartTypes.GanttChart}\n xAxisType={_xAxisType}\n yAxisType={_yAxisType}\n stringDatasetForYAxisDomain={_yAxisLabels}\n calloutProps={calloutProps}\n tickParams={tickParams}\n legendBars={_getLegendData()}\n createYAxis={createYAxisForHorizontalBarChartWithAxis}\n getDomainNRangeValues={_getDomainNRangeValues}\n createStringYAxis={createStringYAxisForHorizontalBarChartWithAxis}\n getMinMaxOfYAxis={findHBCWANumericMinMaxOfY}\n focusZoneDirection={FocusZoneDirection.bidirectional}\n customizedCallout={_getCustomizedCallout()}\n getmargins={_getMargins}\n getYDomainMargins={_getYDomainMargins}\n onChartMouseLeave={_handleChartMouseLeave}\n ref={_cartesianChartRef}\n useUTC={useUTC}\n children={_createBars}\n />\n );\n } else {\n return (\n <div\n id={_emptyChartId.current}\n role={'alert'}\n style={{ opacity: '0' }}\n aria-label={'Graph has no data to display'}\n />\n );\n }\n});\n\nGanttChartBase.displayName = 'GanttChart';\n"]}
@@ -6,52 +6,62 @@ import { ICartesianChartProps, ICartesianChartStyleProps, ICartesianChartStyles,
6
6
  */
7
7
  export interface IGanttChartProps extends ICartesianChartProps {
8
8
  /**
9
- * Data to render in the chart.
9
+ * An array of data points to be rendered in the chart.
10
10
  */
11
11
  data?: IGanttChartDataPoint[];
12
12
  /**
13
- * Define a custom callout renderer for a data point.
13
+ * Callback function to render a custom callout for each data point.
14
14
  */
15
15
  onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;
16
16
  /**
17
- * Width of each bar in the chart.
17
+ * Height of each bar, in pixels.
18
18
  */
19
19
  barHeight?: number;
20
20
  /**
21
- * chart title for the chart
21
+ * Title of the chart.
22
22
  */
23
23
  chartTitle?: string;
24
24
  /**
25
- * Call to provide customized styling that will layer on top of the variant rules.
25
+ * Custom styles that are applied on top of the default chart styles.
26
26
  */
27
27
  styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;
28
28
  /**
29
- * The prop used to define the culture to localized the numbers
29
+ * Locale identifier string used to format numbers and dates according to the specified culture.
30
+ * Example: 'en-US', 'fr-FR'.
30
31
  */
31
32
  culture?: string;
32
33
  /**
33
- * it's padding between bar's or lines in the graph
34
+ * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).
35
+ * Takes a number in the range [0, 1].
36
+ * @default 1/2
34
37
  */
35
38
  yAxisPadding?: number;
36
39
  /**
37
- *@default false
38
- *Used for to elipse y axis labes and show tooltip on x axis labels
40
+ * If true, truncates y-axis tick labels longer than `noOfCharsToTruncate` with ellipses
41
+ * and displays them in a tooltip on hover.
42
+ * @default false
39
43
  */
40
44
  showYAxisLablesTooltip?: boolean;
41
45
  /**
42
- *@default false
43
- *Used for showing complete y axis lables */
46
+ * If true, renders full y-axis tick labels without truncation.
47
+ * @default false
48
+ */
44
49
  showYAxisLables?: boolean;
45
50
  /**
51
+ * If true, enables gradient fills for the bars.
46
52
  * @default false
47
- * The prop used to enable gradient fill color for the chart.
48
53
  */
49
54
  enableGradient?: boolean;
50
55
  /**
56
+ * If true, applies rounded corners to the bars.
51
57
  * @default false
52
- * The prop used to enable rounded corners for the bars.
53
58
  */
54
59
  roundCorners?: boolean;
60
+ /**
61
+ * Maximum height of each bar, in pixels.
62
+ * @default 24
63
+ */
64
+ maxBarHeight?: number;
55
65
  }
56
66
  /**
57
67
  * Gantt Chart style properties
@@ -1 +1 @@
1
- {"version":3,"file":"GanttChart.types.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IGanttChartDataPoint,\n} from '../../index';\n\n/**\n * Gantt Chart properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IGanttChartDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n\n /**\n * @default false\n * The prop used to enable gradient fill color for the chart.\n */\n enableGradient?: boolean;\n\n /**\n * @default false\n * The prop used to enable rounded corners for the bars.\n */\n roundCorners?: boolean;\n}\n\n/**\n * Gantt Chart style properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyleProps extends ICartesianChartStyleProps {}\n\n/**\n * Gantt Chart styles\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyles extends ICartesianChartStyles {}\n"]}
1
+ {"version":3,"file":"GanttChart.types.js","sourceRoot":"../src/","sources":["components/GanttChart/GanttChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IGanttChartDataPoint,\n} from '../../index';\n\n/**\n * Gantt Chart properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartProps extends ICartesianChartProps {\n /**\n * An array of data points to be rendered in the chart.\n */\n data?: IGanttChartDataPoint[];\n\n /**\n * Callback function to render a custom callout for each data point.\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IGanttChartDataPoint>;\n\n /**\n * Height of each bar, in pixels.\n */\n barHeight?: number;\n\n /**\n * Title of the chart.\n */\n chartTitle?: string;\n\n /**\n * Custom styles that are applied on top of the default chart styles.\n */\n styles?: IStyleFunctionOrObject<IGanttChartStyleProps, IGanttChartStyles>;\n\n /**\n * Locale identifier string used to format numbers and dates according to the specified culture.\n * Example: 'en-US', 'fr-FR'.\n */\n culture?: string;\n\n /**\n * Padding between bars as a fraction of the [step](https://d3js.org/d3-scale/band#band_step).\n * Takes a number in the range [0, 1].\n * @default 1/2\n */\n yAxisPadding?: number;\n\n /**\n * If true, truncates y-axis tick labels longer than `noOfCharsToTruncate` with ellipses\n * and displays them in a tooltip on hover.\n * @default false\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n * If true, renders full y-axis tick labels without truncation.\n * @default false\n */\n showYAxisLables?: boolean;\n\n /**\n * If true, enables gradient fills for the bars.\n * @default false\n */\n enableGradient?: boolean;\n\n /**\n * If true, applies rounded corners to the bars.\n * @default false\n */\n roundCorners?: boolean;\n\n /**\n * Maximum height of each bar, in pixels.\n * @default 24\n */\n maxBarHeight?: number;\n}\n\n/**\n * Gantt Chart style properties\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyleProps extends ICartesianChartStyleProps {}\n\n/**\n * Gantt Chart styles\n * {@docCategory GanttChart}\n */\nexport interface IGanttChartStyles extends ICartesianChartStyles {}\n"]}
@@ -855,7 +855,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
855
855
  // eslint-disable-next-line @typescript-eslint/no-deprecated
856
856
  LineChartBase.prototype._createLines = function (xElement, containerHeight) {
857
857
  var _this_1 = this;
858
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
858
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
859
859
  // eslint-disable-next-line @typescript-eslint/no-deprecated
860
860
  var lines = [];
861
861
  if (this.state.isSelectedLegend) {
@@ -888,7 +888,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
888
888
  var yPadding = this_1._points[i].useSecondaryYScale && this_1._yScaleSecondary ? this_1._yPaddingSecondary : this_1._yPaddingPrimary;
889
889
  var extraMaxPixels = this_1._hasMarkersMode ? this_1._getRangeForScatterMarkerSize(yScale, yPadding) : 0;
890
890
  if (this_1._points[i].data.length === 1) {
891
- var _19 = this_1._points[i].data[0], x1_1 = _19.x, y1 = _19.y, xAxisCalloutData_1 = _19.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _19.xAxisCalloutAccessibilityData;
891
+ var _18 = this_1._points[i].data[0], x1_1 = _18.x, y1 = _18.y, xAxisCalloutData_1 = _18.xAxisCalloutData, xAxisCalloutAccessibilityData_1 = _18.xAxisCalloutAccessibilityData;
892
892
  var circleId_1 = "".concat(this_1._circleId, "_").concat(i);
893
893
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
894
894
  var currentMarkerSize = this_1._points[i].data[0].markerSize;
@@ -953,8 +953,8 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
953
953
  var lineId = "".concat(this_1._lineId, "_").concat(i, "_").concat(j);
954
954
  var borderId = "".concat(this_1._borderId, "_").concat(i, "_").concat(j);
955
955
  var circleId = "".concat(this_1._circleId, "_").concat(i, "_").concat(j);
956
- var _20 = this_1._points[i].data[j - 1], x1 = _20.x, y1 = _20.y, xAxisCalloutData = _20.xAxisCalloutData, xAxisCalloutAccessibilityData = _20.xAxisCalloutAccessibilityData;
957
- var _21 = this_1._points[i].data[j], x2 = _21.x, y2 = _21.y;
956
+ var _19 = this_1._points[i].data[j - 1], x1 = _19.x, y1 = _19.y, xAxisCalloutData = _19.xAxisCalloutData, xAxisCalloutAccessibilityData = _19.xAxisCalloutAccessibilityData;
957
+ var _20 = this_1._points[i].data[j], x2 = _20.x, y2 = _20.y;
958
958
  var path = this_1._getPath(this_1._xAxisScale(x1), yScale(y1), circleId, j, false, this_1._points[i].index);
959
959
  var strokeWidth = ((_s = this_1._points[i].lineOptions) === null || _s === void 0 ? void 0 : _s.strokeWidth) || this_1.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
960
960
  var isLegendSelected = this_1._legendHighlighted(legendVal) || this_1._noLegendHighlighted() || this_1.state.isSelectedLegend;
@@ -975,7 +975,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
975
975
  var hiddenHoverCircleId = "".concat(circleId).concat(j, "D");
976
976
  var lastPointHidden = this_1._points[i].hideNonActiveDots && activePoint !== lastCircleId_1;
977
977
  path = this_1._getPath(this_1._xAxisScale(x2), yScale(y2), lastCircleId_1, j, true, this_1._points[i].index);
978
- var _22 = this_1._points[i].data[j], lastCirlceXCallout_1 = _22.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _22.xAxisCalloutAccessibilityData;
978
+ var _21 = this_1._points[i].data[j], lastCirlceXCallout_1 = _21.xAxisCalloutData, lastCirlceXCalloutAccessibilityData_1 = _21.xAxisCalloutAccessibilityData;
979
979
  currentMarkerSize = this_1._points[i].data[j].markerSize;
980
980
  var lastSupportsTextMode = (_z = (_y = this_1._points[i].lineOptions) === null || _y === void 0 ? void 0 : _y.mode) === null || _z === void 0 ? void 0 : _z.includes('text');
981
981
  var lastText = this_1._points[i].data[j].text;
@@ -1029,12 +1029,7 @@ define(["require", "exports", "tslib", "react", "d3-selection", "d3-array", "../
1029
1029
  xAxisScale: this_1._xAxisScale,
1030
1030
  yAxisScale: yScale,
1031
1031
  className: classNames.markerLabel || '',
1032
- maybeLineOptions: ((_17 = this_1._points[i]) === null || _17 === void 0 ? void 0 : _17.lineOptions)
1033
- ? {
1034
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1035
- originXOffset: (_18 = this_1._points[i].lineOptions) === null || _18 === void 0 ? void 0 : _18.originXOffset,
1036
- }
1037
- : undefined,
1032
+ lineOptions: (_17 = this_1._points[i]) === null || _17 === void 0 ? void 0 : _17.lineOptions,
1038
1033
  }));
1039
1034
  }
1040
1035
  lines.push(React.createElement("g", { key: "line_".concat(i), role: "region", "aria-label": "".concat(legendVal, ", line ").concat(i + 1, " of ").concat(this_1._points.length, " with ").concat(this_1._points[i].data.length, " data points.") },