Skip to content

Commit

Permalink
feat: Add click handler to feature rectangles with feature details alert
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson committed Dec 12, 2024
1 parent 2156a19 commit e05a8d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gensplore-component/src/components/SingleRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ const SingleRow = ({
width={(block.end - block.start) * sep + extraFeat * 2}
height={10}
fill={getColor(feature, product)}
onClick={() => {
alert(`Feature: ${feature.name}\nType: ${feature.type}${product ? '\nProduct: ' + product : ''}${
feature.notes && feature.notes.locus_tag ? '\nLocus Tag: ' + feature.notes.locus_tag : ''
}`);
}}
onMouseEnter={() => {
if (zoomLevel < codonZoomThreshold)
setHoveredInfo({
Expand All @@ -335,6 +340,7 @@ const SingleRow = ({
onMouseLeave={() => {
if (zoomLevel < codonZoomThreshold) setHoveredInfo(null);
}}
style={{cursor: 'pointer'}}
/>
))}

Expand Down

0 comments on commit e05a8d5

Please sign in to comment.