-
Notifications
You must be signed in to change notification settings - Fork 26
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 document viewer to dataset explorer #666
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.
Thanks @PhilippeMoussalli! Will this be the only way to view text that is too long to display, or will you still add a tooltip as well?
e68dc38
to
126d63d
Compare
I was trying to include it but did not manage to get it working (requires some custom java script). Someone posted a solution recently but It did not work on my end. I asked them for more info |
Just did a quick test, and this seems to work: for field in fields:
options_builder.configure_column(field=field, tooltipField=field) It's quite slow to show up the first time though. |
Seems like the delay might be configurable: |
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.
I think you accidentally removed the document viewer 😅
data_explorer/app/pages/dataset.py
Outdated
|
||
|
||
class DatasetExplorerApp(DatasetLoaderApp): | ||
@staticmethod | ||
def setup_app_page(dataframe, fields): | ||
def _get_hover_vis_script(field: str) -> JsCode: |
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.
Is there a reason to add this custom javascript? I think the original style fits better with the style of the data explorer.
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.
Removed it, I thought having some contrast might be a bit nicer but we can keep it simple
woops, readded it! |
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.
Thanks @PhilippeMoussalli!
PR that adds document viewer to data explorer. The viewer attempts to automatically detect the string type and render it to its most appropriate format. Note that the normal string value does not get rendered to a pdf value but rather a normal text/markdown.
I don't think it makes a lot of sense to render normal unformated text to pdf. We can still detect whether a strings is a base64 pdf encoded string and render that to it's original pdf format.