Skip to content

Conversation

@rzats
Copy link
Contributor

@rzats rzats commented Dec 3, 2024

See #42 (comment):

Accepts a new optional field (called custom_title) in any signal entry found in the JSON structure that is encoded in sharable epivis URLs. When this field is present, the specified value should override the normal signal title.

@rzats
Copy link
Contributor Author

rzats commented Dec 3, 2024

URL for testing:

https://deploy-preview-78--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6WzcyOTI5Ni41LC0wLjg3NTMyMjQ2MjcwOTk1NDUsNzM5MjA5LjUsOC45NDIzMDU4MzQ3MDg2NzhdLCJzaG93UG9pbnRzIjpmYWxzZX0sImRhdGFzZXRzIjpbeyJjb2xvciI6IiM0ZGIxMmUiLCJ0aXRsZSI6IiV3SUxJIiwicGFyYW1zIjp7Il9lbmRwb2ludCI6ImZsdXZpZXciLCJyZWdpb25zIjoibmF0IiwgImN1c3RvbV90aXRsZSI6IkN1c3RvbSBUaXRsZSBIZXJlIn19XX0=

This represents the following JSON:

{"chart":{"viewport":[729296.5,-0.8753224627099545,739209.5,8.942305834708678],"showPoints":false},"datasets":[{"color":"#4db12e","title":"%wILI","params":{"_endpoint":"fluview","regions":"nat", "custom_title":"Custom Title Here"}}]}

@melange396
Copy link
Contributor

Theres an issue with this: with two covidcast signals, a title is being overwritten...

this url:
https://deploy-preview-78--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6WzczNzQ1MS41LC0xNDcxLDczOTIwOS41LDE0NTI5XSwic2hvd1BvaW50cyI6ZmFsc2V9LCJkYXRhc2V0cyI6W3siY29sb3IiOiIjMzlhYTljIiwidGl0bGUiOiJ2YWx1ZSIsInBhcmFtcyI6eyJjdXN0b21fdGl0bGUiOiJBQkNEIiwiX2VuZHBvaW50IjoiY292aWRjYXN0IiwiZGF0YV9zb3VyY2UiOiJuY2hzLW1vcnRhbGl0eSIsInNpZ25hbCI6ImRlYXRoc19hbGxjYXVzZV9pbmNpZGVuY2VfbnVtIiwidGltZV90eXBlIjoid2VlayIsImdlb190eXBlIjoic3RhdGUiLCJnZW9fdmFsdWUiOiJueSJ9fSx7ImNvbG9yIjoiIzQzNGQ2YiIsInRpdGxlIjoidmFsdWUiLCJwYXJhbXMiOnsiX2VuZHBvaW50IjoiY292aWRjYXN0IiwiZGF0YV9zb3VyY2UiOiJuY2hzLW1vcnRhbGl0eSIsInNpZ25hbCI6ImRlYXRoc19hbGxjYXVzZV9pbmNpZGVuY2VfbnVtIiwidGltZV90eXBlIjoid2VlayIsImdlb190eXBlIjoic3RhdGUiLCJnZW9fdmFsdWUiOiJwYSIsImN1c3RvbV90aXRsZSI6IkVGR0gifX1dfQ==
with a payload that decodes to:
{"chart":{"viewport":[737451.5,-1471,739209.5,14529],"showPoints":false},"datasets":[{"color":"#39aa9c","title":"value","params":{"custom_title":"ABCD","_endpoint":"covidcast","data_source":"nchs-mortality","signal":"deaths_allcause_incidence_num","time_type":"week","geo_type":"state","geo_value":"ny"}},{"color":"#434d6b","title":"value","params":{"_endpoint":"covidcast","data_source":"nchs-mortality","signal":"deaths_allcause_incidence_num","time_type":"week","geo_type":"state","geo_value":"pa","custom_title":"EFGH"}}]}
that represents two entries of the same signal, identical except for geo_value and custom_title, shows up with the same custom title for each ("EFGH"):
image

it also happens without custom titles specified; note that both show up with the same state in the title using the netlify preview url for this PR, but are differentiated on production epivis (with the same payload).

@melange396
Copy link
Contributor

Copy link
Contributor

@melange396 melange396 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works!

@melange396 melange396 merged commit 9079eaa into dev Mar 6, 2025
6 checks passed
@melange396 melange396 deleted the rzatserkovnyi/left-menu branch March 6, 2025 04:09
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.

3 participants