From a2419d0f1247821583e48a8bde412672cb9a2baa Mon Sep 17 00:00:00 2001 From: CloudLun Date: Thu, 14 Dec 2023 07:17:48 +0800 Subject: [PATCH] change the hover to sync for viz --- components/SidePanel/LegislationColumns.tsx | 4 ++-- components/SidePanel/VotesVisualization.tsx | 21 ++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/components/SidePanel/LegislationColumns.tsx b/components/SidePanel/LegislationColumns.tsx index b4fd2ea..f035d28 100644 --- a/components/SidePanel/LegislationColumns.tsx +++ b/components/SidePanel/LegislationColumns.tsx @@ -17,7 +17,7 @@ type Props = { const LegislationColumns = ({ legislation, name, number, content, expand, calulated, legislationsClickHandler }: Props) => { return ( -
+

{name}

{ @@ -32,7 +32,7 @@ const LegislationColumns = ({ legislation, name, number, content, expand, calula | "Winter Eviction Moratorium"} /> } -
+

{name}

({number})

{content}

diff --git a/components/SidePanel/VotesVisualization.tsx b/components/SidePanel/VotesVisualization.tsx index 648f549..ff18d43 100644 --- a/components/SidePanel/VotesVisualization.tsx +++ b/components/SidePanel/VotesVisualization.tsx @@ -176,12 +176,12 @@ const VotesVisualization = ({ legislation }: Props) => { .on("mouseover", () => setLabelShown({ senateDemoVotes: true, senateRepVotes: false, - assemblyDemoVotes: false, + assemblyDemoVotes: true, assemblyRepVotes: false, simpleMajority: false, superMajority: false, senateTotalVotes: false, - assemblyTotalVotes: true + assemblyTotalVotes: false })) senateSvg @@ -198,11 +198,11 @@ const VotesVisualization = ({ legislation }: Props) => { senateDemoVotes: false, senateRepVotes: true, assemblyDemoVotes: false, - assemblyRepVotes: false, + assemblyRepVotes: true, simpleMajority: false, superMajority: false, senateTotalVotes: false, - assemblyTotalVotes: true + assemblyTotalVotes: false })) assemblySvg @@ -216,13 +216,13 @@ const VotesVisualization = ({ legislation }: Props) => { .attr('height', barChartHeight) .attr('fill', "#007CEE") .on("mouseover", () => setLabelShown({ - senateDemoVotes: false, + senateDemoVotes: true, senateRepVotes: false, assemblyDemoVotes: true, assemblyRepVotes: false, simpleMajority: false, superMajority: false, - senateTotalVotes: true, + senateTotalVotes: false, assemblyTotalVotes: false })) @@ -238,16 +238,15 @@ const VotesVisualization = ({ legislation }: Props) => { .attr('fill', "#D04E40") .on("mouseover", () => setLabelShown({ senateDemoVotes: false, - senateRepVotes: false, + senateRepVotes: true, assemblyDemoVotes: false, assemblyRepVotes: true, simpleMajority: false, superMajority: false, - senateTotalVotes: true, + senateTotalVotes: false, assemblyTotalVotes: false })) - senateSvg .append("line") .attr("x1", (width) / 2) @@ -404,10 +403,6 @@ const VotesVisualization = ({ legislation }: Props) => { }) - - - - return (