Skip to content
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

Updating the LuxSQLTable Frontend #314

Merged
merged 5 commits into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions lux/core/sqltable.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,23 @@ def _repr_html_(self):
self._widget.observe(self.set_intent_on_click, names="selectedIntentIndex")

button = widgets.Button(
description="Toggle Data Preview/Lux",
layout=widgets.Layout(width="200px", top="5px"),
description="Toggle Table/Lux",
layout=widgets.Layout(width="200px", top="6px", bottom="6px"),
)
self.output = widgets.Output()
lux.config.executor.execute_preview(self)
notice = HTML(
"""<style>
body
{
background-color:#aa0000;
}
</style>
Please note, the data shown here is just a preview of the database table. You will be unable to perform Pandas functionality on this data."""
)

display(button, notice, self.output)
display(button, self.output)

def on_button_clicked(b):
with self.output:
if b:
self._toggle_pandas_display = not self._toggle_pandas_display
clear_output()
if self._toggle_pandas_display:
display(self._sampled.display_pandas())
notification = widgets.Label(
value="Preview of the database table: " + self.table_name
)
display(notification, self._sampled.display_pandas())
else:
# b.layout.display = "none"
display(self._widget)
Expand Down