Skip to content

Conversation

@melange396
Copy link
Contributor

@melange396 melange396 commented Dec 4, 2024

currently testing with:
https://deploy-preview-79--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6WzczNzQ1MS41LC0xNDcxLDczOTIwOS41LDE0NTI5XSwic2hvd1BvaW50cyI6ZmFsc2V9LCJkYXRhc2V0cyI6W3siY29sb3IiOiIjMzlhYTljIiwidGl0bGUiOiJ2YWx1ZSIsInBhcmFtcyI6eyJ4eHgiOiJ5eXkiLCJfY3VzdG9tX3RpdGxlIjoiQUJDRCIsIl9lbmRwb2ludCI6ImNvdmlkY2FzdCIsImRhdGFfc291cmNlIjoibmNocy1tb3J0YWxpdHkiLCJzaWduYWwiOiJkZWF0aHNfYWxsY2F1c2VfaW5jaWRlbmNlX251bSIsInRpbWVfdHlwZSI6IndlZWsiLCJnZW9fdHlwZSI6InN0YXRlIiwiZ2VvX3ZhbHVlIjoibnkifX0seyJjb2xvciI6IiM0MzRkNmIiLCJ0aXRsZSI6InZhbHVlIiwicGFyYW1zIjp7Il9lbmRwb2ludCI6ImNvdmlkY2FzdCIsImRhdGFfc291cmNlIjoibmNocy1tb3J0YWxpdHkiLCJzaWduYWwiOiJkZWF0aHNfYWxsY2F1c2VfaW5jaWRlbmNlX251bSIsInRpbWVfdHlwZSI6IndlZWsiLCJnZW9fdHlwZSI6InN0YXRlIiwiZ2VvX3ZhbHVlIjoicGEiLCJfY3VzdG9tX3RpdGxlIjoiRUZHSCIsImN1c3RvbV90aXRsZSI6IklKS0wifX1dfQ==

which encodes:

{"chart":{"viewport":[737451.5,-1471,739209.5,14529],"showPoints":false},"datasets":[{"color":"#39aa9c","title":"value","params":{"xxx":"yyy","_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","custom_title":"IJKL"}}]}

Comment on lines +159 to +160
console.log(d)
console.log(JSON.stringify(d))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At this point in the execution, d.params no longer includes a number of the keys+values that are passed in via the base64-encoded url string, as you might expect... Its because (as best as i can tell) only the parameters that match function argument names are allowed through the call in loadImpl() that sneakily proxies to an appropriate importXYZendpoint() method. However, _endpoint is added back to the params map where loadDataSet() calls loadEpidata().

The current state of code in this PR might work work if we modify the kludge patchDataSet() above to accept another argument for a custom title that can then be added back into the .params of the DataSet returned (it is already populating the .color attribute). A less hacky way to handle this would be to make the custom title into a proper first-order member of the DataSet class, the way .color and .params are -- but so much of this code is already unsightly, i dont know how much i care about that.

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.

2 participants