Closed interim17 closed 2 months ago
Status | Category | Percentage | Covered / Total |
---|---|---|---|
๐ด | Statements | 41% | 2049/4997 |
๐ด | Branches | 43.35% | 845/1949 |
๐ด | Functions | 36.98% | 419/1133 |
๐ด | Lines | 41.22% | 1962/4759 |
Status of coverage: ๐ข - ok, ๐ก - slightly more than threshold, ๐ด - under the threshold
Time Estimate or Size
small < 10 minutes
Problem
Advances website ticket: #411
We need to display metadata about selected/followed agents in the front end. That data doesn't currently leave the viewer so we need a way to get it to the front end.
Solution
This change set provides a method for retrieving data about the current
followObject
and a new optional viewer callbackonFollowObjectChanged
that handles that data.Made
NULL_AGENT
constant for use in constructor and when nothing is selected.The new code in the test-bed is a bare bones version of the meta data panel that is coming for the website, designs here.
Open questions: 1) Separate follow object and metadata selection? Clicking on an agent selects it to be camera followed and to have its metadata displayed, so it seemed obvious to use the existing
followObject
invisGeometry
for both. If we wanted the metadata panel to stay selected/active when the user clicks "home" and toggles follow mode off (aka camera reset), we would need to store two separate objects. Having them paired on a single selected object is the simplest, since most of the UI interactions for the two features are in sync.2) Typing was simplest if
getFollowObjectData
returned theNULL_AGENT
when there was no selected instance, I prefer that to returning undefined or null. It does require a function using that data to do a check likeagent.instanceID !== -1
when implementing.3) I am open to naming feedback on all these methods, wasn't 100% confident in
onFollowObjectChanged
,updateFollowObjectData
, andgetFollowObjectData
.4) There are some idiosyncrasies in how the
instanceIds
in some trajectories are assigned that affect the reliability of these features (both following and displaying metadata) that need to be discussed with UX before the final front end work is done, but we will need this ability to send this data about selected agents to the front end.Type of change
Steps to Verify: