File tree Expand file tree Collapse file tree 3 files changed +37
-39
lines changed
Expand file tree Collapse file tree 3 files changed +37
-39
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import { useHighlight, useHighlightData } from '../../highlight/index.js';
77import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZonesViewState.js' ;
88import { useScale2DX , useScale2DY } from '../utilities/scale.js' ;
99
10- import SignalCrosshair from './SignalCrosshair.js' ;
11-
1210interface SignalProps {
1311 signal : Signal2D ;
1412}
@@ -52,24 +50,21 @@ function Signal({ signal }: SignalProps) {
5250 return (
5351 < g className = "zone-signal" >
5452 { showSignals && (
55- < g >
56- < SignalCrosshair signal = { signal } />
57- < circle
58- onMouseEnter = { ( ) => {
59- assignment ?. highlight ( ) ;
60- highlight . show ( ) ;
61- } }
62- onMouseLeave = { ( ) => {
63- assignment ?. clearHighlight ( ) ;
64- highlight . hide ( ) ;
65- } }
66- key = { signal . id }
67- cx = { scaleX ( signal . x . delta || 0 ) }
68- cy = { scaleY ( signal . y . delta || 0 ) }
69- r = { isHighlighted ? 6 : 4 }
70- fill = { isHighlighted ? 'green' : 'darkgreen' }
71- />
72- </ g >
53+ < circle
54+ onMouseEnter = { ( ) => {
55+ assignment ?. highlight ( ) ;
56+ highlight . show ( ) ;
57+ } }
58+ onMouseLeave = { ( ) => {
59+ assignment ?. clearHighlight ( ) ;
60+ highlight . hide ( ) ;
61+ } }
62+ key = { signal . id }
63+ cx = { scaleX ( signal . x . delta || 0 ) }
64+ cy = { scaleY ( signal . y . delta || 0 ) }
65+ r = { isHighlighted ? 6 : 4 }
66+ fill = { isHighlighted ? 'green' : 'darkgreen' }
67+ />
7368 ) }
7469 < g className = "zone-signal-peak" style = { { pointerEvents : 'none' } } >
7570 { showPeaks &&
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ interface SignalCrosshairProps {
99 signal : Signal2D ;
1010}
1111
12- function SignalCrosshair ( { signal } : SignalCrosshairProps ) {
12+ export function SignalCrosshair ( { signal } : SignalCrosshairProps ) {
1313 const highlightIDsX = useMemo ( ( ) => {
1414 return [ buildID ( signal . id , 'Crosshair' ) , buildID ( signal . id , 'Crosshair_X' ) ] ;
1515 } , [ signal . id ] ) ;
@@ -39,5 +39,3 @@ function SignalCrosshair({ signal }: SignalCrosshairProps) {
3939 </ g >
4040 ) ;
4141}
42-
43- export default SignalCrosshair ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { useActiveSpectrumZonesViewState } from '../../hooks/useActiveSpectrumZo
1212import { useScale2DX , useScale2DY } from '../utilities/scale.js' ;
1313
1414import Signal from './Signal.js' ;
15+ import { SignalCrosshair } from './SignalCrosshair.tsx' ;
1516
1617interface ZoneProps {
1718 zoneData : ZoneType ;
@@ -54,21 +55,25 @@ function Zone({ zoneData }: ZoneProps) {
5455 ] ;
5556
5657 return (
57- < ActionsButtonsPopover
58- buttons = { actionButtons }
59- targetTagName = "g"
60- { ...( assignment && { isOpen : false } ) }
58+ < g
59+ key = { id }
60+ onMouseEnter = { ( ) => {
61+ assignmentZone . highlight ( ) ;
62+ highlightZone . show ( ) ;
63+ } }
64+ onMouseLeave = { ( ) => {
65+ assignmentZone . clearHighlight ( ) ;
66+ highlightZone . hide ( ) ;
67+ } }
6168 >
62- < g
63- key = { id }
64- onMouseEnter = { ( ) => {
65- assignmentZone . highlight ( ) ;
66- highlightZone . show ( ) ;
67- } }
68- onMouseLeave = { ( ) => {
69- assignmentZone . clearHighlight ( ) ;
70- highlightZone . hide ( ) ;
71- } }
69+ { signals . map ( ( signal ) => (
70+ < SignalCrosshair key = { signal . id } signal = { signal } />
71+ ) ) }
72+
73+ < ActionsButtonsPopover
74+ buttons = { actionButtons }
75+ targetTagName = "g"
76+ { ...( assignment && { isOpen : false } ) }
7277 >
7378 { showZones && (
7479 < g transform = { `translate(${ scaleX ( x2 ) } ,${ scaleY ( y1 ) } )` } >
@@ -87,8 +92,8 @@ function Zone({ zoneData }: ZoneProps) {
8792 // eslint-disable-next-line react/no-array-index-key
8893 < Signal key = { id + i } signal = { _signal } />
8994 ) ) }
90- </ g >
91- </ ActionsButtonsPopover >
95+ </ ActionsButtonsPopover >
96+ </ g >
9297 ) ;
9398}
9499
You can’t perform that action at this time.
0 commit comments