From 8a627e255e23c3d96ec35fe9280f4361185532ec Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Thu, 2 Jan 2025 18:48:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20slightly=20more=20interesting=20?= =?UTF-8?q?crude=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/DataPageV2Content.tsx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/site/DataPageV2Content.tsx b/site/DataPageV2Content.tsx index 1427c7f002..9ed5d13f27 100644 --- a/site/DataPageV2Content.tsx +++ b/site/DataPageV2Content.tsx @@ -133,20 +133,28 @@ export const DataPageV2Content = ({ grapher1State.inputTable = inputTable grapher2State.inputTable = inputTable } + console.log( + "focused entity", + (grapher2State.chartInstance as MapChart).focusEntity + ) + console.log( + "chart projection", + (grapher2State.chartInstance as MapChart).projection + ) reaction( - () => grapher2State.yAxis.scaleType, + () => (grapher2State.chartInstance as MapChart).projection, () => { - console.log("rerunning reaction") + console.log( + "rerunning reaction", + (grapher2State.chartInstance as MapChart).projection + ) - // const focusedEntity = ( - // grapher2State.chartInstance as MapChart - // ).focusEntity?.id - // if (focusedEntity) - // grapher1State.selection.addToSelection([ - // focusedEntity.toString(), - // ]) - grapher1State.yAxis.scaleType = - grapher2State.yAxis.scaleType + const focusedEntity = ( + grapher2State.chartInstance as MapChart + ).projection + grapher1State.selection.clearSelection() + if (focusedEntity) + grapher1State.selection.addToSelection([projection]) } ) }