File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/app/components/StateRoute/AxMap Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
2+ import { useDispatch , useSelector } from 'react-redux' ;
23import { Group } from '@visx/group' ;
34import { hierarchy , Tree } from '@visx/hierarchy' ;
45import { LinearGradient } from '@visx/gradient' ;
56import { pointRadial } from 'd3-shape' ;
67import { useTooltipInPortal } from '@visx/tooltip' ;
78import LinkControls from './axLinkControls' ;
89import getLinkComponent from './getAxLinkComponents' ;
10+ import AxLegend from './axLegend' ;
11+ import { renderAxLegend } from '../../../slices/AxSlices/axLegendSlice' ;
12+ import type { RootState } from '../../../store' ;
913
1014const theme = {
1115 scheme : 'monokai' ,
@@ -274,6 +278,10 @@ export default function AxTree(props) {
274278 scroll : true , // when tooltip containers are scrolled, this will correctly update the Tooltip position
275279 } ) ;
276280
281+ // ax Legend
282+ const { axLegendButtonClicked } = useSelector ( ( state : RootState ) => state . axLegend ) ;
283+ const dispatch = useDispatch ( ) ;
284+
277285 return totalWidth < 10 ? null : (
278286 < div >
279287 < LinkControls
@@ -477,6 +485,16 @@ export default function AxTree(props) {
477485 </ Tree >
478486 </ Group >
479487 </ svg >
488+
489+ { /* ax Legend */ }
490+ < div >
491+ < button id = 'axLegendButton' style = { { position : 'absolute' } } onClick = { ( ) => dispatch ( renderAxLegend ( ) ) } > </ button >
492+
493+ { axLegendButtonClicked ?
494+ < AxLegend /> : ''
495+ }
496+ </ div >
497+
480498 </ div >
481499 ) ;
482500}
You can’t perform that action at this time.
0 commit comments