-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(website): support HTML custom display of table entries #3576
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy with this. I think if we decide to actually support tables we should actually implement a table feature directly - and I'd be uncertain as to whether Loculus should document the idea of using a custom element for this, but in terms of having the raw feature - sounds fair!
8a09e0d
to
17c4fca
Compare
Thanks for reviewing, @theosanderson! (As it's not urgent, I'll keep the PR open for another day to see whether someone else has comments.) |
In the files it seems like the config option is still called I see how this is useful for this JSON thing! Can you maybe come up with more examples? I think having more could be nice to document this feature better. |
@fhennig, I think it's fine to keep the value just This can be used for all kinds of things: to embed an image, a video, map, plot, tree – whatever you can imagine! |
additionalHeadHTML: '<script defer data-domain="loculus.org" src="https://plausible.io/js/script.js"></script>' | ||
additionalHeadHTML: '<script defer data-domain="loculus.org" src="https://plausible.io/js/script.js"></script><script src="https://chaoran-chen.github.io/test-custom-display/frequency-custom-display.js"></script>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert before merge
customDisplay: | ||
type: htmlTemplate | ||
html: "<frequency-custom-display>__value__</frequency-custom-display>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert before merge
preview URL: https://html-custom-display.loculus.org
Summary
This adds a new type of custom display "html" that allows the maintainer to provide an HTML template to render a table entry.
Background: I'd like to use that to improve the display of the frequency JSONs here.
To demonstrate the feature, the feature was used to make the country bold in the below screenshot.
Screenshot
PR Checklist
[ ] All necessary documentation has been adapted.Documentation is missing for the custom display feature and I propose adding it separately (Document customDisplay config #3574).[ ] The implemented feature is covered by an appropriate test.We don't have any tests for the other custom displays and I hope it's ok that we don't have one in this PR.