-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(frontend): generalise TooltipContent (#44)
* refactor(frontend): generalise TooltipContent Generalise TooltipContent with a `useTooltipLayers` hook, which supplies a map of layer IDs to their respective tooltip components and layer state. This should make it easier to add new layers, by extending the map. * refactor(frontend): interaction groups as a dynamic map Add/remove new interactive layers by adding entries to/removing entries from the Map in `src/config/interaction-groups`.
- Loading branch information
1 parent
98cf81d
commit 27ec7ba
Showing
13 changed files
with
219 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,51 @@ | ||
import { InteractionGroupConfig } from 'lib/data-map/interactions/use-interactions'; | ||
import { makeConfig } from 'lib/helpers'; | ||
|
||
export const INTERACTION_GROUPS = makeConfig<InteractionGroupConfig, string>([ | ||
{ | ||
id: 'assets', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
pickMultiple: false, | ||
usesAutoHighlight: true, | ||
}, | ||
{ | ||
id: 'hazards', | ||
type: 'raster', | ||
pickMultiple: true, | ||
}, | ||
{ | ||
id: 'regions', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
pickMultiple: false, | ||
}, | ||
{ | ||
id: 'solutions', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
usesAutoHighlight: true, | ||
pickMultiple: false, | ||
}, | ||
{ | ||
id: 'drought', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
usesAutoHighlight: true, | ||
pickMultiple: false, | ||
}, | ||
export const INTERACTION_GROUPS = new Map<string, InteractionGroupConfig>([ | ||
[ | ||
'assets', | ||
{ | ||
id: 'assets', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
pickMultiple: false, | ||
usesAutoHighlight: true, | ||
}, | ||
], | ||
[ | ||
'hazards', | ||
{ | ||
id: 'hazards', | ||
type: 'raster', | ||
pickMultiple: true, | ||
}, | ||
], | ||
[ | ||
'regions', | ||
{ | ||
id: 'regions', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
pickMultiple: false, | ||
}, | ||
], | ||
[ | ||
'solutions', | ||
{ | ||
id: 'solutions', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
usesAutoHighlight: true, | ||
pickMultiple: false, | ||
}, | ||
], | ||
[ | ||
'drought', | ||
{ | ||
id: 'drought', | ||
type: 'vector', | ||
pickingRadius: 8, | ||
usesAutoHighlight: true, | ||
pickMultiple: false, | ||
}, | ||
], | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.