def plot_h_cluster(dataframe, in1, in2): if dataframe == "shipments": pca_df = data.get_pca(dataframe) else: kmeans = Process() all_df = kmeans.K_means(in1, in2) pca_df = all_df[0] chart = Chart() return chart.plot_h_bar(pca_df)
def render_cluster_plots_worst(cluster_panel, dataframe, worst_worst, in1, in2): if dataframe == "shipments": d = data.get_shp_cluster_name(cluster_panel, dataframe) else: kmeans = Process() all_df = kmeans.K_means(in1, in2) df = all_df[1] kk = df.groupby('cluster') d = kk.get_group(int(cluster_panel)) if worst_worst == "TOTAL KG": details = data.get_buttom_kgs(d) chart = Chart() return chart.plot_h_top(details, False) elif worst_worst == "TOTAL VOLUME": details = data.get_buttom_volume(d) chart = Chart() return chart.plot_h_top(details, False) elif worst_worst == "TOTAL PRICE": details = data.get_buttom_price(d) chart = Chart() return chart.plot_h_top(details, False) else: details = data.get_buttom_shps(d) chart = Chart() return chart.plot_h_top(details, False)
def plot_pie(customer): data = Data() df = data.get_product_customer().groupby('CUST_NAME') df_cust = df.get_group(customer) chart = Chart() return chart.plot_pie(df_cust, customer)
def plot_map(map_feature): df = data.get_map_data_sender() chart = Chart() return chart.plot_map(df, map_feature)
def render_cluster_plots_products(name, filtre): data = Data() df = data.get_product_data(name) chart = Chart() return chart.plot_time_series(df, filtre)