Add column descriptions to DynamicTable HTML representation #1369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, there was no way to view column descriptions in the HTML display of DynamicTables. I think this will be useful to add. When working on conversion projects I use the HTML to check that everthing is as intended. In addition, this feature will be useful for people reading new NWBFiles through the notebok (e.g. from Dandi) as it improves the representation of common but important tables such as trials, electrodes, and units. This is especially important for custom-added columns, where most columns are hard to interpret without a description.
For the implementation, a new collapsible "columns" section is added to the
generate_html_repr()method inDynamicTable. Each column is displayed as an individually collapsible item (collapsed by default) that shows the column's description when expanded. Column names include an access code tooltip (e.g.,['column_name']) that can be clicked to copy to clipboard, consistent with other field displays in the HTML representation.This is how it looks:
Checklist
CHANGELOG.mdwith your changes?