1
1
2
2
import { useEffect , useRef , useState } from 'react' ;
3
- import gosling , { GoslingComponent , GoslingSpec , HiGlassSpec } from 'gosling.js' ;
3
+ import { GoslingComponent , type GoslingRef , type GoslingSpec , type HiGlassSpec , type Theme , type TemplateTrackDef } from 'gosling.js' ;
4
4
import type { Datum , AltGoslingSpec , PreviewAlt , AltTrack , AltDataStatistics , AltTrackOverlaidByData , AltTrackOverlaidByMark , AltTrackSingle } from '@alt-gosling/schema/alt-gosling-schema' ;
5
5
6
6
import { getAlt , updateAlt } from './alt-gosling-model' ;
@@ -11,14 +11,15 @@ import Grid from '@mui/material/Grid';
11
11
// todo: add goslingcompprops as 1 attribute and add others for altgoslingprops e.g. padding and size
12
12
// then if compiled in goslingcompprops is defined, raise error that this is overridden
13
13
interface AltGoslingCompProps {
14
- spec ?: gosling . GoslingSpec ;
14
+ spec ?: GoslingSpec ;
15
15
padding ?: number ;
16
16
margin ?: number ;
17
17
border ?: string ;
18
18
id ?: string ;
19
19
className ?: string ;
20
- theme ?: gosling . Theme ;
21
- templates ?: gosling . TemplateTrackDef [ ] ;
20
+ theme ?: Theme ;
21
+ templates ?: TemplateTrackDef [ ] ;
22
+ // @ts -expect-error `gosling.UrlToFetchOptions` does not exist I think
22
23
urlToFetchOptions ?: gosling . UrlToFetchOptions ;
23
24
experimental ?: {
24
25
reactive ?: boolean ;
@@ -32,7 +33,7 @@ interface DataPanelInformation {
32
33
}
33
34
34
35
export const AltGoslingComponent = ( props : AltGoslingCompProps ) => {
35
- const gosRef = useRef < gosling . GoslingRef > ( null ) ;
36
+ const gosRef = useRef < GoslingRef > ( null ) ;
36
37
37
38
const [ specProcessed , setSpecProcessed ] = useState < any > ( ) ;
38
39
0 commit comments