visdesignlab / upset2

UpSet - Visualizing Intersecting Sets
https://upset.multinet.app/
BSD 3-Clause "New" or "Revised" License
54 stars 7 forks source link

Aggregate selection: Nested aggregation not selecting the right row (ID issue) #90

Closed JakeWags closed 1 year ago

JakeWags commented 1 year ago

When selecting a nested aggregate, intersectionCountSelector properly pulls the size of the selected row, but the intersection id corresponds to some premade value in intersections, so the value for all nested aggregate rows when selected is the same. image

JakeWags commented 1 year ago

in elementSelectors.ts, elementSelector function, intersections contains incorrect values for the second aggregate ids. This seems to be where the data is being pulled from when selecting the second aggregate.

The below block is a part of intersections for degree first aggregation and deviation second aggregation. Note the Agg_Positive and Agg_Negative values.

Object { Agg_Degree_1: {…}, Agg_Positive: {…}, Subset_Three: {…}, Subset_Two: {…}, Subset_Four: {…}, Agg_Negative: {…}, Subset_Five: {…}, Agg_Degree_2: {…}, Subset_Two_Seven: {…}, Subset_Three_Five: {…}, … }
​
Agg_Degree_1: Object { id: "Agg_Degree_1", elementName: "Degree 1", size: 76, … }
​
Agg_Degree_2: Object { id: "Agg_Degree_2", elementName: "Degree 2", size: 65, … }
​
Agg_Degree_3: Object { id: "Agg_Degree_3", elementName: "Degree 3", size: 25, … }
​
Agg_Degree_4: Object { id: "Agg_Degree_4", elementName: "Degree 4", size: 10, … }
​
Agg_Degree_5: Object { id: "Agg_Degree_5", elementName: "Degree 5", size: 1, … }
​
Agg_Degree_6: Object { id: "Agg_Degree_6", elementName: "Degree 6", size: 3, … }

​
Agg_Negative: Object { id: "Agg_Negative", elementName: "Negative", description: "Negative Expected Value", … }
​
Agg_Positive: Object { id: "Agg_Positive", elementName: "Positive", description: "Positive Expected Value", … }

​
Subset_Five: Object { id: "Subset_Five", elementName: "Five", size: 2, … }
​
Subset_Four: Object { id: "Subset_Four", elementName: "Four", size: 7, … }
​
Subset_Four_Five: Object { id: "Subset_Four_Five", elementName: "Four Five", size: 7, … }
​
"Subset_Four_Five Six": Object { id: "Subset_Four_Five Six", elementName: "Four Five Six", size: 1, … }
...
JakeWags commented 1 year ago

When bookmarking a nested aggregate selection, the element number value changes from the correct element count to the incorrect element count which is showing in the query table.

Nested aggregates: image

Query selection (pre-bookmark): image

Query selection (post-bookmark): image

Query Results: Incorrectly displays 1 item image

JakeWags commented 1 year ago

In flattenedRowsOnly, when nested aggregation is used, there are multiple rows with the same ID in the nested aggregate. For example, if sorting by degree and then deviation, for each degree, there will (likely) be both a positive and negative deviation. Each of these has the respective ID of Agg_Positive or Agg_Negative. Since there are duplicates, get(flattenedOnlyRows) is only returning the Agg_Positive and Agg_Negative objects which are the last to occur.