chart_me.charting_assembly_strategy.univariate
Default implementation for single variable charting
This module contains all the logic to go from Metadata to actual charts See supporting documentation that discusses the rules engine.
Typical usage example:
charts = assemble_univariate_charts(df, [col1], infered_data_types)
Classes
Defines Normalized Metadata about Datatypes |
|
Core Object Returned for Assembler - column level specifications |
Functions
|
Delegated Function to Manage Univariate Use Cases |
|
An implementation of horizontal bar chart |
|
An implementation of vertical bar chart |
|
An implementation of histogram chart |
Module Contents
- class chart_me.charting_assembly_strategy.univariate.ChartMeDataTypeMetaType(*args, **kwds)[source]
Bases:
enum.EnumDefines Normalized Metadata about Datatypes
Defines Key, Boolean, Quantitative, Categorical High Cardinality, Categorical Low Cardinality, Temporal, Not Supported
- KEY = ('K',)
- BOOLEAN = ('B',)
- QUANTITATIVE = ('Q',)
- CATEGORICAL_HIGH_CARDINALITY = ('C-HC',)
- CATEGORICAL_LOW_CARDINALITY = ('C-LC',)
- TEMPORAL = ('T',)
- NOT_SUPPORTED_TYPE = 'NA'
- class chart_me.charting_assembly_strategy.univariate.InferedDataTypes[source]
Core Object Returned for Assembler - column level specifications
- preaggregated: bool
- chart_me_data_types: Dict[str, ChartMeDataType]
- chart_me_data_types_meta: Dict[str, ChartMeDataTypeMetaType]
- chart_me.charting_assembly_strategy.univariate.assemble_univariate_charts(df: pandas.DataFrame, cols: List[str], infered_data_types: chart_me.datatype_infer_strategy.InferedDataTypes, **kwargs) List[altair.Chart | altair.HConcatChart][source]
Delegated Function to Manage Univariate Use Cases
- Parameters:
df – dataframe
cols – a single column name in a list
infered_data_types – An instance of InferedDataTypes object
- Returns:
List of altair charts or compounds charts
- Raises:
ValueError if called with more then one column –
- chart_me.charting_assembly_strategy.univariate.build_hbar_agg(df: pandas.DataFrame, col_name: str, agg_name: str) altair.Chart[source]
An implementation of horizontal bar chart