Skip to content

Commit

Permalink
Merge pull request #314 from sophiahhuang/sql-engine
Browse files Browse the repository at this point in the history
Updating the LuxSQLTable Frontend
  • Loading branch information
thyneb19 committed Mar 19, 2021
2 parents c8a9471 + f190a55 commit fcad97a
Showing 1 changed file with 7 additions and 14 deletions.
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

0 comments on commit fcad97a

Please sign in to comment.