Skip to content

fix(event-display): fix track 'Color by' when loading JSON with linke… - #978

Open
valponce wants to merge 1 commit into
HSF:mainfrom
valponce:vponce_fix_ColorByVertex
Open

fix(event-display): fix track 'Color by' when loading JSON with linke…#978
valponce wants to merge 1 commit into
HSF:mainfrom
valponce:vponce_fix_ColorByVertex

Conversation

@valponce

@valponce valponce commented Aug 20, 2026

Copy link
Copy Markdown

How to reproduce the bug :

  • Phoenix is launched on the LHCb project, loading default JSON data that does not have linked tracks.
  • A second JSON file containing linked tracks is loaded right after (selectedEvents.json)
  • The "Color by: Vertex" option for the tracks stopped working.

Issue :
When loading the new JSON file, a new Phoenix menu node is created based on the new data and compared against the previous menu node (see loadStateFromJSON() in phoenix-menu-node.ts). For each configuration with the same label and type, the previous configuration's properties are kept, except for the property options, where the new one is adopted.
Consequently, for the "Color by" configuration (created in color-options.ts), the old version of the onChange function was retained instead of using the new one. However, this function relies on the colorByOptions attribute, which did not contain a "Vertex" option during the initial load since the data lacked linked tracks. Therefore, when switching "Color by" to Vertex in the new load, nothing happens.

Fix :
Keep not only the property options, but also the property onChange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant