@@ -3,14 +3,19 @@ import { type Dispatch, type StateUpdater, useMemo, useState, useRef } from 'pre
33import z from 'zod' ;
44
55import { computeWastewaterMutationsOverTimeDataPerLocation } from './computeWastewaterMutationsOverTimeDataPerLocation' ;
6+ import { type ProportionValue } from '../../../query/queryMutationsOverTime' ;
67import { lapisFilterSchema , type SequenceType , sequenceTypeSchema } from '../../../types' ;
78import { Map2dView } from '../../../utils/map2d' ;
9+ import { type Deletion , type Substitution } from '../../../utils/mutations' ;
10+ import { type Temporal } from '../../../utils/temporalClass' ;
811import { useDispatchFinishedLoadingEvent } from '../../../utils/useDispatchFinishedLoadingEvent' ;
912import { useLapisUrl } from '../../LapisUrlContext' ;
1013import { useMutationAnnotationsProvider } from '../../MutationAnnotationsContext' ;
14+ import { AnnotatedMutation } from '../../components/annotated-mutation' ;
1115import { type ColorScale } from '../../components/color-scale-selector' ;
1216import { ColorScaleSelectorDropdown } from '../../components/color-scale-selector-dropdown' ;
1317import { ErrorBoundary } from '../../components/error-boundary' ;
18+ import FeaturesOverTimeGrid from '../../components/features-over-time-grid' ;
1419import { Fullscreen } from '../../components/fullscreen' ;
1520import Info , { InfoComponentCode , InfoHeadline1 , InfoParagraph } from '../../components/info' ;
1621import { LoadingDisplay } from '../../components/loading-display' ;
@@ -24,15 +29,10 @@ import {
2429 type MutationFilter ,
2530 mutationOrAnnotationDoNotMatchFilter ,
2631} from '../../mutationsOverTime/getFilteredMutationsOverTimeData' ;
27- import FeaturesOverTimeGrid , { FeatureRenderer } from '../../components/features -over-time-grid' ;
32+ import { MutationsOverTimeGridTooltip } from '../../mutationsOverTime/mutations -over-time-grid-tooltip ' ;
2833import { pageSizesSchema } from '../../shared/tanstackTable/pagination' ;
2934import { PageSizeContextProvider } from '../../shared/tanstackTable/pagination-context' ;
3035import { useQuery } from '../../useQuery' ;
31- import { Deletion , Substitution } from '../../../utils/mutations' ;
32- import { AnnotatedMutation } from '../../components/annotated-mutation' ;
33- import { MutationsOverTimeGridTooltip } from '../../mutationsOverTime/mutations-over-time-grid-tooltip' ;
34- import { Temporal } from '../../../utils/temporalClass' ;
35- import { ProportionValue } from '../../../query/queryMutationsOverTime' ;
3636
3737const wastewaterMutationOverTimeSchema = z . object ( {
3838 lapisFilter : lapisFilterSchema ,
@@ -166,18 +166,6 @@ const MutationsOverTimeTabs: FunctionComponent<MutationOverTimeTabsProps> = ({
166166 const [ colorScale , setColorScale ] = useState < ColorScale > ( { min : 0 , max : 1 , color : 'indigo' } ) ;
167167 const [ displayedSegments , setDisplayedSegments ] = useDisplayedSegments ( mutationOverTimeDataPerLocation ) ;
168168
169- const mutationRenderer : FeatureRenderer < Substitution | Deletion > = {
170- asString : ( value : Substitution | Deletion ) => value . code ,
171- renderRowLabel : ( value : Substitution | Deletion ) => (
172- < div className = { 'text-center' } >
173- < AnnotatedMutation mutation = { value } sequenceType = { originalComponentProps . sequenceType } />
174- </ div >
175- ) ,
176- renderTooltip : ( value : Substitution | Deletion , temporal : Temporal , proportionValue : ProportionValue ) => (
177- < MutationsOverTimeGridTooltip mutation = { value } date = { temporal } value = { proportionValue } />
178- ) ,
179- } ;
180-
181169 const tabs = useMemo (
182170 ( ) =>
183171 mutationOverTimeDataPerLocation . map ( ( { location, data } ) => ( {
@@ -194,7 +182,17 @@ const MutationsOverTimeTabs: FunctionComponent<MutationOverTimeTabsProps> = ({
194182 } ) }
195183 colorScale = { colorScale }
196184 pageSizes = { originalComponentProps . pageSizes }
197- featureRenderer = { mutationRenderer }
185+ featureRenderer = { {
186+ asString : ( value : Substitution | Deletion ) => value . code ,
187+ renderRowLabel : ( value : Substitution | Deletion ) => (
188+ < div className = { 'text-center' } >
189+ < AnnotatedMutation mutation = { value } sequenceType = { originalComponentProps . sequenceType } />
190+ </ div >
191+ ) ,
192+ renderTooltip : ( value : Substitution | Deletion , temporal : Temporal , proportionValue : ProportionValue ) => (
193+ < MutationsOverTimeGridTooltip mutation = { value } date = { temporal } value = { proportionValue } />
194+ ) ,
195+ } }
198196 tooltipPortalTarget = { tooltipPortalTargetRef . current }
199197 />
200198 ) ,
0 commit comments