lux.action package

Submodules

lux.action.column_group module

lux.action.column_group.column_group(ldf)[source]

lux.action.correlation module

lux.action.correlation.check_transpose_not_computed(vlist: lux.vis.VisList.VisList, a: str, b: str)[source]
lux.action.correlation.correlation(ldf: lux.core.frame.LuxDataFrame, ignore_transpose: bool = True)[source]

Generates bivariate visualizations that represent all pairwise relationships in the data.

Parameters:
  • ldf (LuxDataFrame) – LuxDataFrame with underspecified intent.
  • ignore_transpose (bool) – Boolean flag to ignore pairs of attributes whose transpose are already computed (i.e., {X,Y} will be ignored if {Y,X} is already computed)
Returns:

recommendations – object with a collection of visualizations that result from the Correlation action.

Return type:

Dict[str,obj]

lux.action.custom module

lux.action.custom.custom(ldf)[source]

Generates user-defined vis based on the intent.

Parameters:ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
Returns:recommendations – object with a collection of visualizations that result from the Distribution action.
Return type:Dict[str,obj]
lux.action.custom.custom_actions(ldf)[source]

Generates user-defined vis based on globally defined actions.

Parameters:ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
Returns:recommendations – object with a collection of visualizations that were previously registered.
Return type:Dict[str,obj]

lux.action.enhance module

lux.action.enhance.enhance(ldf)[source]

Given a set of vis, generates possible visualizations when an additional attribute is added to the current vis.

Parameters:ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
Returns:recommendations – object with a collection of visualizations that result from the Enhance action.
Return type:Dict[str,obj]

lux.action.filter module

lux.action.filter.filter(ldf)[source]

Iterates over all possible values of a categorical variable and generates visualizations where each categorical value filters the data.

Parameters:ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
Returns:recommendations – object with a collection of visualizations that result from the Filter action.
Return type:Dict[str,obj]

lux.action.generalize module

lux.action.generalize.generalize(ldf)[source]

Generates all possible visualizations when one attribute or filter from the current vis is removed.

Parameters:ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
Returns:recommendations – object with a collection of visualizations that result from the Generalize action.
Return type:Dict[str,obj]

lux.action.row_group module

lux.action.row_group.row_group(ldf)[source]

lux.action.similarity module

lux.action.similarity.aggregate(vis)[source]

Aggregates data values on the y axis so that the vis is a time series

Parameters:vis (lux.vis.Vis) – vis that represents the candidate visualization
Returns:
Return type:None
lux.action.similarity.euclidean_dist(query_vis, vis)[source]

Calculates euclidean distance score for similarity between two visualizations

Parameters:
  • query_vis (lux.vis.Vis) – vis that represents the query pattern
  • vis (lux.vis.Vis) – vis that represents the candidate visualization
Returns:

score – euclidean distance score

Return type:

float

lux.action.similarity.interpolate(vis, length)[source]

Interpolates the vis data so that the number of data points is fixed to a constant

Parameters:
  • vis (lux.vis.Vis) – vis that represents the candidate visualization
  • length (int) – number of points a vis should have
Returns:

Return type:

None

lux.action.similarity.normalize(vis)[source]

Normalizes the vis data so that the range of values is 0 to 1 for the vis

Parameters:vis (lux.vis.Vis) – vis that represents the candidate visualization
Returns:
Return type:None
lux.action.similarity.preprocess(vis)[source]

Processes vis data to allow similarity comparisons between visualizations

Parameters:vis (lux.vis.Vis) – vis that represents the candidate visualization
Returns:
Return type:None
lux.action.similarity.similar_pattern(ldf, intent, topK=-1)[source]

Generates visualizations with similar patterns to a query visualization.

Parameters:
  • ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
  • intent (list[lux.Clause]) – intent for specifying the visual query for the similarity search.
  • topK (int) – number of visual recommendations to return.
Returns:

recommendations – object with a collection of visualizations that result from the Similarity action

Return type:

Dict[str,obj]

lux.action.univariate module

lux.action.univariate.univariate(ldf, *args)[source]

Generates bar chart distributions of different attributes in the dataframe.

Parameters:
  • ldf (lux.core.frame) – LuxDataFrame with underspecified intent.
  • data_type_constraint (str) – Controls the type of distribution chart that will be rendered.
Returns:

recommendations – object with a collection of visualizations that result from the Distribution action.

Return type:

Dict[str,obj]

Module contents