diff --git a/lux/core/frame.py b/lux/core/frame.py index 6e45621b..60753fb1 100644 --- a/lux/core/frame.py +++ b/lux/core/frame.py @@ -203,7 +203,6 @@ def plot_config(self, config_func: Callable): ---------- config_func : Callable A function that takes in an AltairChart (https://altair-viz.github.io/user_guide/generated/toplevel/altair.Chart.html) as input and returns an AltairChart as output - Example ---------- Changing the color of marks and adding a title for all charts displayed for this dataframe @@ -255,12 +254,10 @@ def set_intent(self, intent: List[Union[str, Clause]]): """ Main function to set the intent of the dataframe. The intent input goes through the parser, so that the string inputs are parsed into a lux.Clause object. - Parameters ---------- intent : List[str,Clause] intent list, can be a mix of string shorthand or a lux.Clause object - Notes ----- :doc:`../guide/clause` @@ -291,7 +288,6 @@ def copy_intent(self): def set_intent_as_vis(self, vis: Vis): """ Set intent of the dataframe as the Vis - Parameters ---------- vis : Vis @@ -568,14 +564,12 @@ def widget(self): def exported(self) -> Union[Dict[str, VisList], VisList]: """ Get selected visualizations as exported Vis List - Notes ----- Convert the _selectedVisIdxs dictionary into a programmable VisList Example _selectedVisIdxs : {'Correlation': [0, 2], 'Occurrence': [1]} indicating the 0th and 2nd vis from the `Correlation` tab is selected, and the 1st vis from the `Occurrence` tab is selected. - Returns ------- Union[Dict[str,VisList], VisList] @@ -660,9 +654,7 @@ def set_intent_on_click(self, change): self.current_vis = Compiler.compile_intent(self, self._intent) self.maintain_recs() - with self.output: - clear_output() - display(self._widget) + self._toggle_pandas_display = not self._toggle_pandas_display self._widget.observe(self.remove_deleted_recs, names="deletedIndices") self._widget.observe(self.set_intent_on_click, names="selectedIntentIndex") @@ -726,30 +718,24 @@ def _repr_html_(self): ) if len(self.recommendation) > 0: - # box = widgets.Box(layout=widgets.Layout(display='inline')) button = widgets.Button( description="Toggle Pandas/Lux", layout=widgets.Layout(width="140px", top="5px"), ) - self.output = widgets.Output() - # box.children = [button,output] - # output.children = [button] - # display(box) - display(button, self.output) + # self.output = widgets.Output() + # display(button, self.output) def on_button_clicked(b): - with self.output: - if b: - self._toggle_pandas_display = ( - not self._toggle_pandas_display - ) + if b: + self._toggle_pandas_display = ( + not self._toggle_pandas_display + ) clear_output() - if self._toggle_pandas_display: - display(self.display_pandas()) - else: - # b.layout.display = "none" - display(self._widget) - # b.layout.display = "inline-block" + display(button) + if self._toggle_pandas_display: + display(self.display_pandas()) + else: + display(self._widget) button.on_click(on_button_clicked) on_button_clicked(None) @@ -777,7 +763,6 @@ def display_pandas(self): def render_widget(self, renderer: str = "altair", input_current_vis=""): """ Generate a LuxWidget based on the LuxDataFrame - Structure of widgetJSON: { 'current_vis': {}, @@ -893,4 +878,4 @@ def info(self, *args, **kwargs): def describe(self, *args, **kwargs): self._pandas_only = True self._history.append_event("describe", *args, **kwargs) - return super(LuxDataFrame, self).describe(*args, **kwargs) + return super(LuxDataFrame, self).describe(*args, **kwargs) \ No newline at end of file