From e05a8d5545d3a311deeb3ee1b5e1b5d37828cb33 Mon Sep 17 00:00:00 2001 From: "Theo Sanderson (aider)" Date: Thu, 12 Dec 2024 19:31:33 +0000 Subject: [PATCH] feat: Add click handler to feature rectangles with feature details alert --- gensplore-component/src/components/SingleRow.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gensplore-component/src/components/SingleRow.jsx b/gensplore-component/src/components/SingleRow.jsx index a41abf6..b07ed47 100644 --- a/gensplore-component/src/components/SingleRow.jsx +++ b/gensplore-component/src/components/SingleRow.jsx @@ -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({ @@ -335,6 +340,7 @@ const SingleRow = ({ onMouseLeave={() => { if (zoomLevel < codonZoomThreshold) setHoveredInfo(null); }} + style={{cursor: 'pointer'}} /> ))}