@@ -28,6 +28,7 @@ import { ScatterPlotFields } from "@/configurator";
2828import { mkNumber } from "@/configurator/components/ui-helpers" ;
2929import { DimensionValue , Observation } from "@/domain/data" ;
3030import { useFormatNumber } from "@/formatters" ;
31+ import { DimensionMetadataFragment } from "@/graphql/query-hooks" ;
3132import { getPalette } from "@/palettes" ;
3233import { estimateTextWidth } from "@/utils/estimate-text-width" ;
3334
@@ -43,9 +44,9 @@ export interface ScatterplotState extends CommonChartState {
4344 getSegment : ( d : Observation ) => string ;
4445 colors : ScaleOrdinal < string , string > ;
4546 xAxisLabel : string ;
46- xAxisDescription : string | undefined ;
47+ xAxisDimension : DimensionMetadataFragment ;
4748 yAxisLabel : string ;
48- yAxisDescription : string | undefined ;
49+ yAxisDimension : DimensionMetadataFragment ;
4950 getSegmentLabel : ( s : string ) => string ;
5051 getAnnotationInfo : ( d : Observation , values : Observation [ ] ) => TooltipInfo ;
5152}
@@ -93,7 +94,6 @@ const useScatterplotState = ({
9394 }
9495
9596 const xAxisLabel = getLabelWithUnit ( xMeasure ) ;
96- const xAxisDescription = xMeasure . description || undefined ;
9797
9898 const xMinValue = Math . min ( mkNumber ( min ( preparedData , ( d ) => getX ( d ) ) ) , 0 ) ;
9999 const xMaxValue = max ( preparedData , ( d ) => getX ( d ) ) as number ;
@@ -107,7 +107,6 @@ const useScatterplotState = ({
107107 }
108108
109109 const yAxisLabel = getLabelWithUnit ( yMeasure ) ;
110- const yAxisDescription = yMeasure . description || undefined ;
111110
112111 const yMinValue = Math . min ( mkNumber ( min ( preparedData , ( d ) => getY ( d ) ) ) , 0 ) ;
113112 const yMaxValue = max ( preparedData , getY ) as number ;
@@ -243,9 +242,9 @@ const useScatterplotState = ({
243242 getSegment,
244243 colors,
245244 xAxisLabel,
246- xAxisDescription ,
245+ xAxisDimension : xMeasure ,
247246 yAxisLabel,
248- yAxisDescription ,
247+ yAxisDimension : yMeasure ,
249248 getAnnotationInfo,
250249 getSegmentLabel,
251250 } ;
0 commit comments