lux.core package¶
Submodules¶
lux.core.frame module¶
-
class
lux.core.frame.
LuxDataFrame
(*args, **kw)[source]¶ A subclass of pd.DataFrame that supports all dataframe operations while housing other variables and functions for generating visual recommendations.
-
expire_metadata
()[source]¶ Expire all saved metadata to trigger a recomputation the next time the data is required.
-
render_widget
(renderer: str = 'altair', input_current_vis='')[source]¶ Generate a LuxWidget based on the LuxDataFrame
Structure of widgetJSON:
{
‘current_vis’: {}, ‘recommendation’: [
{
‘action’: ‘Correlation’, ‘description’: “some description”, ‘vspec’: [
{Vega-Lite spec for vis 1}, {Vega-Lite spec for vis 2}, …]
}, … repeat for other actions
]
}
Parameters: - renderer (str, optional) – Choice of visualization rendering library, by default “altair”
- input_current_vis (lux.LuxDataFrame, optional) – User-specified current vis to override default Current Vis, by default
-
save_as_html
(filename: str = 'export.html') → None[source]¶ Save dataframe widget as static HTML file
Parameters: filename (str) – Filename for the output HTML file
-
set_intent_as_vis
(vis: lux.vis.Vis.Vis)[source]¶ Set intent of the dataframe based on the intent of a Vis
Parameters: vis (Vis) – Input Vis object
-
exported
¶ 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: When there are no exported vis, return empty list -> [] When all the exported vis is from the same tab, return a VisList of selected visualizations. -> VisList(v1, v2…) When the exported vis is from the different tabs, return a dictionary with the action name as key and selected visualizations in the VisList. -> {“Enhance”: VisList(v1, v2…), “Filter”: VisList(v5, v7…), ..} Return type: Union[Dict[str,VisList], VisList]
-