- This topic has 2 replies, 2 voices, and was last updated 3 years, 7 months ago by Jonathan Sandoe.
-
AuthorPosts
-
Hi! My team is working on a CODAP plugin that adds several transformations of table data. One of these is a “group by” transformation which acts similarly to what happens when you drag an attribute to a new parent collection, but it effectively duplicates that attribute (so both the original data and the groupings can be seen at once).
When faced with grouping by an attribute that is formula-based, our plugin copies the values of that column, but does not have the new parent attribute copy the formula. This is because moving a formula to a parent collection may cause it to become invalid, since it may reference child attributes that used to be in the same collection.
This works great, but we noticed some odd behavior when grouping by an attribute that uses a formula that produces objects. For instance, using the Microdata Portal plugin, if we generate a People table and use our plugin to group by Boundaries, this creates a parent collection containing a single (non-formula) attribute that has a copy of all the values under the Boundaries attribute (which are
jsonBoundaryObjects
).However, CODAP does not recognize the
jsonBoundaryObject
s as distinct, but seems to treat them all as equivalent (though indeed, I can verify they are different), collapsing the view of the parent collection into a single case which takes the value of the first case’s boundary object.I know this may not be easy to reproduce in normal CODAP, but we thought it was worth reporting since it seems reasonable that distinct values under an attribute should be treated as distinct by CODAP, even when they are objects.
May 24, 2021 at 6:12 pm #6454Actually, I realized this isn’t that hard to reproduce in CODAP:
- Open the Microdata Portal plugin and create a People table.
- Click on the “Boundaries” attribute and click “Delete Formula (Keeping Values)”.
- Drag the (now non-formula) Boundaries attribute to the left into a new parent collection.
You’ll see that the Boundaries collapse into a single case, even though there are many distinct objects populating that attribute.
May 24, 2021 at 6:55 pm #6455Jonathan SandoeKeymasterHi Thomas,
I agree that this is a bug. Thank you for reporting it. I have logged it here: https://www.pivotaltracker.com/story/show/178273084. Your analysis of the problem looks pretty good, too. I hope we will be able to rectify it soon.
Jonathan
-
AuthorPosts
- You must be logged in to reply to this topic.