lux.vis.Vis.Clause

class lux.vis.Vis.Clause(description: Union[str, list] = '', attribute: Union[str, list] = '', value: Union[str, list] = '', filter_op: str = '=', channel: str = '', data_type: str = '', data_model: str = '', aggregation: Union[str, callable] = '', bin_size: int = 0, weight: float = 1, sort: str = '', exclude: Union[str, list] = '')[source]

Clause is the object representation of a single unit of the specification.

__init__(description: Union[str, list] = '', attribute: Union[str, list] = '', value: Union[str, list] = '', filter_op: str = '=', channel: str = '', data_type: str = '', data_model: str = '', aggregation: Union[str, callable] = '', bin_size: int = 0, weight: float = 1, sort: str = '', exclude: Union[str, list] = '')[source]
Parameters
  • description (typing.Union[str,list], optional) – Convenient shorthand description of specification, parser parses description into other properties (attribute, value, filter_op), by default “”

  • attribute (typing.Union[str,list], optional) – Specified attribute(s) of interest, by default “” By providing a list of attributes (e.g., [Origin,Brand]), user is interested in either one of the attribute (i.e., Origin or Brand).

  • value (typing.Union[str,list], optional) – Specified value(s) of interest, by default “” By providing a list of values (e.g., [“USA”,”Europe”]), user is interested in either one of the attribute (i.e., USA or Europe).

  • filter_op (str, optional) – Filter operation of interest. Possible values: ‘=’, ‘<’, ‘>’, ‘<=’, ‘>=’, ‘!=’, by default “=”

  • channel (str, optional) – Encoding channel where the specified attribute should be placed. Possible values: ‘x’,’y’,’color’, by default “”

  • data_type (str, optional) – Data type for the specified attribute. Possible values: ‘nominal’, ‘quantitative’,’temporal’, by default “”

  • data_model (str, optional) – Data model for the specified attribute Possible values: ‘dimension’, ‘measure’, by default “”

  • aggregation (typing.Union[str,callable], optional) – Aggregation function for specified attribute, by default “” set as ‘mean’ Possible values: ‘sum’,’mean’, and others string shorthand or functions supported by Pandas.aggregate (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.aggregate.html), including numpy aggregation functions (e.g., np.ptp), by default “” Input None means no aggregation should be applied (e.g., data has been pre-aggregated)

  • bin_size (int, optional) – Number of bins for histograms, by default 0

  • weight (float, optional) – A number between 0 and 1 indicating the importance of this Clause, by default 1

  • sort (str, optional) – Specifying whether and how the bar chart should be sorted Possible values: ‘ascending’, ‘descending’, by default “”

Methods

__init__([description, attribute, value, …])

param description

Convenient shorthand description of specification, parser parses description into other properties (attribute, value, filter_op), by default “”

copy_clause()

set_aggregation(aggregation)

Sets the aggregation function of Clause, while updating _aggregation_name internally

to_string()