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
Add ability to run field formatters on the feature details panel #3003
Conversation
earlier pr #1987 |
cdf0346
to
4ea1188
Compare
plugins/linear-genome-view/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx
Outdated
Show resolved
Hide resolved
f08d936
to
4cc02f4
Compare
4cc02f4
to
3b43885
Compare
the concept of origName/origId/origType was removed, now just dumps the HTML "innerText" of whatever is used for id/name/type into the accordion titles |
68c0974
to
35a0d11
Compare
35a0d11
to
2ae48d6
Compare
Codecov Report
@@ Coverage Diff @@
## main #3003 +/- ##
==========================================
+ Coverage 61.33% 61.36% +0.02%
==========================================
Files 584 584
Lines 26589 26609 +20
Branches 6439 6445 +6
==========================================
+ Hits 16309 16328 +19
- Misses 9973 9974 +1
Partials 307 307
Continue to review full report at Codecov.
|
77f79cb
to
0b510e4
Compare
made a slightly new alternative approach in this PR the original concept completely overwrote the original feature data fields, so it replaced feature.name with a customized content I wanted to avoid totally overwriting the feature data such as feature.name though, because for example, if it contained a hyperlink then it would get displayed badly in accordion headers or the sequence feature detail FASTA output so, this PR now retains the old data but puts the formatted data in a field called _fmt on the feature object so for example if I have a jexl callback that customizes name it might say
Then, the core details and the attributes display the merged object data from basically |
0b510e4
to
6626a98
Compare
also now uses a nested subschema for the config so we have
This helps organize the related set of config slots! |
6626a98
to
90765ea
Compare
should be good to go |
4b4934d
to
e5ee9c3
Compare
e5ee9c3
to
b09eca0
Compare
Fixes #1981
This is a possible proposal for adding field formatters on the feature detail panel
Overview
Examples:
The above updates all name fields to be google links
And if you had a complicated callback you could create a custom jexl callback e.g.
The above only updates the top level feature to a google link, and adds a new field called newfield with the text Wow :)
Implementation
It is a little tricky but you can see that the jexl callback returns an object containing multiple fields which are merged directly onto the featureData
One other design I considered was something like
This may be easier for the developer, and if needed, we can consider it, but the getConf would be evaluated in a non-standard way to achieve this (e.g. I'd have to manually run stringToJexlExpression and evaluate on the children of formatFields.