Jump to content

Sequential selection in table visualization creates a list in order of selection


kerrymcclain

Recommended Posts

Seems like this should be easier to crack, but I haven't put all the clues together yet and would appreciate any ideas...

Use case:  Assume a dataset that contains an arbitrary number of rows of data, with each row containing a unique identifier.  A user needs to be able to select (mark) one row at a time, on a map chart in this case.   With each successive marking, I'd like to dynamically generate a sequential list of the unique identifiers that will be *IN THE ORDER THAT THEY WERE SELECTED BY THE USER*.  This requirement seems to be the rub.  Native functionality using a child table visualization for the selected rows to show up in works for the first few rows, but as you add more selections, the rows will not stay in the sequential order in which they were selected. 

That's a messy explanation, but that's what I'm trying to achieve.  There's got to be a way to achieve this via IronPython, but I'm not sure how to go about it.  I've been using IronPython scripting for years, just haven't run into this particular puzzle before & I'm not sure how to tell which particular row was just marked (to be able to add just that unique ID to the derived, sequentially ordered list) + how to account for a user changing their mind about a marking and unmarking it (which should remove just that unique ID from the list).

Any ideas on an approach that might work?

Thank you,
Kerry

Link to comment
Share on other sites

Hi @kerrymcclain
If my understanding is correct you want to have a child table order by "click/selection ID"
Since the native limit "data by marking"  feature will always display the records as they were in the initial table, I'd suggest writing a data function that will add/update this extra column to your initial data table. The choice of a data function is justified by the fact that it can be triggered automatically by the marking.


There might be other approaches.

5omknfIODS-I?a=2002&x=23&y=-14&w=1233&h=727&store=1&accept=image%2F*&auth=LCA%208619cc98dc5960edb4cc622f7ce0f1a280bb43ba9de2f9a98767b6b4d4aacf7a-ts%3D1729629174

Link to comment
Share on other sites

Thanks for your quick response, Olivier.  I thought it might be good for me to clarify my use case, I think I may have not explained it clearly.  Here are some screenshots, and I'll walk through the use case for clarity...

On the map, we need to select a group of polygons (representing real estate parcels).  Each one of the parcels has a unique identifier, a Parcel ID.  As we go through the one-at-a-time selection process, I want to build a list of the Parcel ID's in the order that they were selected.  Conceptually similar to loading a LIFO queue. 

So...here's the first step.  The user marks the first parcel (R000069319), and that row shows up in the child table below.  I'll mark each row with a red number to denote which click it was:

image.png.e9f7271fbe30cabe164de520aa8cdb5d.png

Next, the user clicks parcel R000069142, and the second row appears in the child table as we had hoped:

image.png.ce1675fe1dc4e8c140966c198a1d34e2.png

So far, so good.  Now, the user clicks the third parcel (R000101858), and the issue appears:

image.png.06ab963474c3bc6b549ea8558da81c75.png

Instead of the rows in the table being in the click order of 3, 2, 1...we've now got 2,1,3.  If we carry this one more step, the 4th click also gets farther from what we want:

image.thumb.png.8c10ab25e122ee017ea5031c80a6eb32.png

Now the rows are in click order 2,4,1,3...when we need is 4,3,2,1 (the order they were selected in).

So...that's more detail about what I'm trying to achieve...hopefully this will make more sense than my first try.

Thanks again for any ideas you can throw out, I appreciate your time.

Kerry

Link to comment
Share on other sites

Thanks for these illustrations that make it clear.
This is what I understood and my suggestion should work with a data function. Indeed, the « problem » is that the table plot is displaying the rows in the order in which they are stored in the underlying data table, and not the order they are selected. By creating a dynamic selection_id or (click_id) column, you will achieve what you need. A small knowledge of python and data frames will be required. 
One last thing : your data table should have a key column (e.g. the parcel_id)

Edited by Olivier Keugue Tadaa
Link to comment
Share on other sites

Playing with it a little more, I've mapped the output parameter to a document property instead of a column, displayed in a label at the top of the text area shown below.  This makes me curious about when multiple ID's are already selected...the aggregation in the expression that should be creating our sort column is always going to be working with everything that's been marked (3 properties in this example)...how will we know which ID was just clicked/marked and which were already marked?  It almost seems like we need a timestamp in the mix somehow to identify when each click occurred in a temporal context to order them properly.  what do you think?
image.thumb.png.7bd45c7256c91f2e0ce017d97286adab.pngimage.thumb.png.4b065be82f523edb5103755c3af86a03.png

image.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...