chart_me.charting_assembly_strategy.bivariate

Default implementation for bivariate 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_bivariate_charts(df, [col1, col2], infered_data_types)

Module Contents

Functions

assemble_bivariate_charts(df: pandas.DataFrame, cols: List[str], infered_data_types: chart_me.datatype_infer_strategy.InferedDataTypes, **kwargs) → List[Union[altair.Chart, altair.HConcatChart]]

Delegated Function to Manage Bivariate Use Cases

build_scatter_plot(df: pandas.DataFrame, col_name1: str, col_name2: str) → altair.Chart

An implementation of scatter plot

build_hbar_value(df: pandas.DataFrame, col_name_x: str, col_name_y: str) → altair.Chart

An implementation of horizontal bar chart

build_facet_histogram(df: pandas.DataFrame, col_name_facet: str, col_name_hist_q: str) → altair.Chart

An implementation of histogram faceted by nominal variable

build_facet_hbars(df: pandas.DataFrame, col_name_facet: str, col_name_y: str, col_name_x: str) → altair.Chart

An implementation of horizontal bar graph faceted by nominal variable

build_hconcat_temp_charts(df: pandas.DataFrame, col_name_y_m, col_name_q, col_name_measure: str = 'measures') → altair.HConcatChart

An implementation of horizontal bar graph faceted by nominal variable

build_heatmap(df: pandas.DataFrame, col_name_x: str, col_name_y: str, col_name_q: str) → altair.Chart

An implementation of heatmap

build_hconcat_temp_lc_charts(df: pandas.DataFrame, col_name_t_y_m: str, col_name_n: str, col_name_q: str) → altair.HConcatChart

An implementation that returns two charts to trend nominal and relative values

chart_me.charting_assembly_strategy.bivariate.assemble_bivariate_charts(df: pandas.DataFrame, cols: List[str], infered_data_types: chart_me.datatype_infer_strategy.InferedDataTypes, **kwargs) List[Union[altair.Chart, altair.HConcatChart]][source]

Delegated Function to Manage Bivariate Use Cases

Parameters
  • df – dataframe

  • cols – a list of two columns

  • infered_data_types – An instance of InferedDataTypes object

Returns

List of altair charts or compounds charts

Raises

ValueError if called with len of cols != 2

chart_me.charting_assembly_strategy.bivariate.build_scatter_plot(df: pandas.DataFrame, col_name1: str, col_name2: str) altair.Chart[source]

An implementation of scatter plot

chart_me.charting_assembly_strategy.bivariate.build_hbar_value(df: pandas.DataFrame, col_name_x: str, col_name_y: str) altair.Chart[source]

An implementation of horizontal bar chart

chart_me.charting_assembly_strategy.bivariate.build_facet_histogram(df: pandas.DataFrame, col_name_facet: str, col_name_hist_q: str) altair.Chart[source]

An implementation of histogram faceted by nominal variable

chart_me.charting_assembly_strategy.bivariate.build_facet_hbars(df: pandas.DataFrame, col_name_facet: str, col_name_y: str, col_name_x: str) altair.Chart[source]

An implementation of horizontal bar graph faceted by nominal variable

chart_me.charting_assembly_strategy.bivariate.build_hconcat_temp_charts(df: pandas.DataFrame, col_name_y_m, col_name_q, col_name_measure: str = 'measures') altair.HConcatChart[source]

An implementation of horizontal bar graph faceted by nominal variable

WARNING: Function assumes processing through pd_group_me to separate count from other aggregations

chart_me.charting_assembly_strategy.bivariate.build_heatmap(df: pandas.DataFrame, col_name_x: str, col_name_y: str, col_name_q: str) altair.Chart[source]

An implementation of heatmap

chart_me.charting_assembly_strategy.bivariate.build_hconcat_temp_lc_charts(df: pandas.DataFrame, col_name_t_y_m: str, col_name_n: str, col_name_q: str) altair.HConcatChart[source]

An implementation that returns two charts to trend nominal and relative values

chart 1-> bar trend chart chart 2-> stacked bar chart