from grplot.features.plot.plot_multi_def import plot_multi_def
from grplot.utils.arg_ax_type import arg_ax_type


def plot_type(plot,
              x,
              y, 
              ax,
              axes,
              hue, 
              size, 
              style, 
              data, 
              palette, 
              hue_order, 
              hue_norm, 
              sizes, 
              size_order, 
              size_norm, 
              markers, 
              dashes, 
              style_order, 
              legend, 
              height, 
              units, 
              x_bins,
              y_bins,
              estimator, 
              x_estimator,
              ci,
              n_boot,
              alpha,
              expand_margins,
              jitter,
              x_jitter,
              y_jitter,
              weights,
              color,
              seed,
              sort,
              err_style,
              err_kws,
              stat, 
              bins,
              binwidth,
              binrange,
              discrete,
              cumulative,
              common_bins,
              common_norm,
              common_grid,
              multiple,
              element,
              fill, 
              shrink,
              kde,
              kde_kws,
              line_kws,
              thresh, 
              pthresh,
              pmax,
              cbar,
              cbar_ax,
              cbar_kws,
              shade,
              vertical,
              kernel,
              bw, 
              gridsize, 
              cut, 
              clip, 
              shade_lowest,
              levels,
              bw_method,
              bw_adjust,
              data2,
              warn_singular,
              complementary,
              a,
              order, 
              orient,
              edgecolor,
              linewidth, 
              saturation,
              width,
              dodge, 
              fliersize,
              whis,
              scale, 
              scale_hue,
              inner,
              split,
              k_depth,
              outlier_prop,
              trust_alpha,
              showfliers,
              linestyles,
              join,
              errwidth,
              capsize,
              errcolor,
              x_ci,
              scatter,
              fit_reg,
              logistic,
              lowess,
              robust,
              regplot_logx,
              x_partial,
              y_partial,
              truncate,
              scatter_kws,
              marker,
              dropna, 
              label,
              zorder,
              color2,
              markersize,
              explode, 
              colors, 
              autopct, 
              pctdistance, 
              shadow, 
              labeldistance, 
              startangle, 
              radius, 
              counterclock, 
              wedgeprops, 
              textprops, 
              center, 
              frame, 
              rotatelabels, 
              normalize, 
              norm_x, 
              norm_y, 
              treemaps_pad, 
              bar_kwargs, 
              text_kwargs,
              bubble_spacing,
              text):
    plot = arg_ax_type(arg=plot, axes=axes)
    if plot is None:
        pass
    elif type(plot) == str:
        plot_multi_def(plot=plot, x=x, y=y, ax=ax, axes=axes, hue=hue, size=size, style=style, data=data, palette=palette, hue_order=hue_order, hue_norm=hue_norm, sizes=sizes, size_order=size_order, size_norm=size_norm, markers=markers, dashes=dashes, style_order=style_order, legend=legend, height=height, units=units, x_bins=x_bins, y_bins=y_bins, estimator=estimator, x_estimator=x_estimator, ci=ci, n_boot=n_boot, alpha=alpha, expand_margins=expand_margins, jitter=jitter, x_jitter=x_jitter, y_jitter=y_jitter, weights=weights, color=color, seed=seed, sort=sort, err_style=err_style, err_kws=err_kws, stat=stat, bins=bins, binwidth=binwidth, binrange=binrange, discrete=discrete, cumulative=cumulative, common_bins=common_bins, common_norm=common_norm, common_grid=common_grid, multiple=multiple, element=element, fill=fill, shrink=shrink, kde=kde, kde_kws=kde_kws, line_kws=line_kws, thresh=thresh, pthresh=pthresh, pmax=pmax, cbar=cbar, cbar_ax=cbar_ax, cbar_kws=cbar_kws, shade=shade, vertical=vertical, kernel=kernel, bw=bw, gridsize=gridsize, cut=cut, clip=clip, shade_lowest=shade_lowest, levels=levels, bw_method=bw_method, bw_adjust=bw_adjust, data2=data2, warn_singular=warn_singular, complementary=complementary, a=a, order=order, orient=orient, edgecolor=edgecolor, linewidth=linewidth, saturation=saturation, width=width, dodge=dodge, fliersize=fliersize, whis=whis, scale=scale, scale_hue=scale_hue, inner=inner, split=split, k_depth=k_depth, outlier_prop=outlier_prop, trust_alpha=trust_alpha, showfliers=showfliers, linestyles=linestyles, join=join, errwidth=errwidth, capsize=capsize, errcolor=errcolor, x_ci=x_ci, scatter=scatter, fit_reg=fit_reg, logistic=logistic, lowess=lowess, robust=robust, regplot_logx=regplot_logx, x_partial=x_partial, y_partial=y_partial, truncate=truncate, scatter_kws=scatter_kws, marker=marker, dropna=dropna, label=label, zorder=zorder, color2=color2, markersize=markersize, explode=explode, colors=colors, autopct=autopct, pctdistance=pctdistance, shadow=shadow, labeldistance=labeldistance, startangle=startangle, radius=radius, counterclock=counterclock, wedgeprops=wedgeprops, textprops=textprops, center=center, frame=frame, rotatelabels=rotatelabels, normalize=normalize, norm_x=norm_x, norm_y=norm_y, treemaps_pad=treemaps_pad, bar_kwargs=bar_kwargs, text_kwargs=text_kwargs, bubble_spacing=bubble_spacing, text=text)
    else:
        raise Exception('Unknown plot argument!')
    return ax