Row State Handler stops firing after the first selection - how do I keep it persistent?I'm building linked selection across a set of By-group Bivariate plots. The plots come from a long-format table (one row per ID per Mode):</CODE></P>
<P> </P>
<P> </P>
<P> </P>
<PRE><CODE class=" language-jsl">dt << Bivariate(
Y( dt:Y ),
X( dt:X ),
By( :MODE )
);
What I want: when I click a point in one of the By-group graphs, I want every point in the other graphs that shares the same :ID to also become selected. I'd like to do this without reshaping the table to wide format (one row per ID).
What I tried: I found that a row state handler can re-select all rows for the matching IDs. My current implementation:
f = Function( {row},
rows = dt << Get Selected Rows;
units = Associative Array( dt:ID[rows] ) << Get Keys;
dt << Select Where( Contains( units, :ID ) );
);
rs = dt << Make Row State Handler( f );
The problem: this works for the first selection only in the data table. After that the handler behaves as if it no longer exists.
My questions:
1. Why does the row state handler stop firing after the first selection? (I'm wondering whether changing row states inside the handler is what's tearing it down.)
2. Is there a way to fix this so the handler stays active across repeated selections?
3. Are there better approaches to ID-linked selection across By-group plots that I should consider instead?
Thanks in advance.
Automation and ScriptingRe: Row State Handler stops firing after the first selection - how do I keep it persistent?You are most likely getting a message to log which kinda tells you what is going on
Loop detected earlier
and sometimes more helpful one
Row State Handler is in a loop
Row States should not be changed by Row State Handler.
Re: Row State Handler stops firing after the first selection - how do I keep it persistent?Yes, I'm getting the message
Loop detected earlier
is there a better way to approach this problem?
Re: Row State Handler stops firing after the first selection - how do I keep it persistent?No good ideas quickly come to my mind when using bivariate + by + stacked data table.
Using split (wide) format table would be the best option. If you can use Graph Builder for the plot, it can be used with a formula to do something like this using overlay/color (it won't select the rows).