字体大小修改,问题图删除,第一版logo测试。
This commit is contained in:
417
chart/charts.py
417
chart/charts.py
@@ -752,55 +752,6 @@ def Stacked_Histogram_for_Continuous_Variable(file_path, chart_out_path, out_pat
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 23、密度图(Density_Plot)
|
||||
# 测试文件 mpg.csv
|
||||
# 基础参数 图片的长/宽/分辨率/字号/x轴字号/标题的字号、xy轴限制/颜色
|
||||
|
||||
def Density_Plot(file_path, chart_out_path, x_scale_font_angle, y_scale_font_angle, y_name, x_name, y_font_size,
|
||||
x_font_size, out_path,
|
||||
scale_font_size, title, title_font_size, column_name):
|
||||
df = pd.read_csv(file_path)
|
||||
|
||||
# Draw Plot
|
||||
plt.figure(figsize=(9.4, 4.25), dpi=180)
|
||||
sns.kdeplot(df.loc[df[column_name] == 4, column_name],
|
||||
shade=True,
|
||||
color="#01a2d9",
|
||||
label=f"{column_name}=4",
|
||||
alpha=.7)
|
||||
sns.kdeplot(df.loc[df[column_name] == 5, column_name],
|
||||
shade=True,
|
||||
color="#dc2624",
|
||||
label=f"{column_name}=5",
|
||||
alpha=.7)
|
||||
sns.kdeplot(df.loc[df[column_name] == 6, column_name],
|
||||
shade=True,
|
||||
color="#C89F91",
|
||||
label=f"{column_name}=6",
|
||||
alpha=.7)
|
||||
sns.kdeplot(df.loc[df[column_name] == 8, column_name],
|
||||
shade=True,
|
||||
color="#649E7D",
|
||||
label=f"{column_name}=8",
|
||||
alpha=.7)
|
||||
|
||||
# Decoration
|
||||
sns.set(style="whitegrid", font_scale=scale_font_size)
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
plt.legend()
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=y_font_size)
|
||||
plt.ylabel(x_name, fontsize=x_font_size)
|
||||
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 25、山峰叠峦图(Joy_Plot)
|
||||
# 测试文件 mpg.csv
|
||||
# 基础参数 图片的长/宽/分辨率/字号/x轴字号/标题的字号、xy轴限制/颜色
|
||||
@@ -834,103 +785,7 @@ def Joy_Plot(file_path, chart_out_path, out_path, title, title_font_size, x_scal
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 27、箱图(boxplot)
|
||||
|
||||
# 测试文件 mpg.csv
|
||||
# 基础参数 图片的长/宽/分辨率/字号/x轴字号/标题的字号、xy轴限制/颜色
|
||||
|
||||
def boxplot(file_path, chart_out_path, out_path,
|
||||
scale_font_size, title, title_font_size, font_size, font_color, y_scale_min, y_scale_max, x_column_name,
|
||||
y_column_name, x_scale_font_angle, y_scale_font_angle, y_name, x_name, color):
|
||||
df = pd.read_csv(file_path)
|
||||
# Draw Plot
|
||||
plt.figure(figsize=(9.4, 4.25), dpi=180)
|
||||
sns.boxplot(
|
||||
x=x_column_name,
|
||||
y=y_column_name,
|
||||
data=df,
|
||||
notch=False,
|
||||
palette=color,
|
||||
)
|
||||
|
||||
# Add N Obs inside boxplot (optional)
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
def add_n_obs(df, group_col, y):
|
||||
medians_dict = {
|
||||
grp[0]: grp[1][y].median()
|
||||
for grp in df.groupby(group_col)
|
||||
}
|
||||
xticklabels = [x.get_text() for x in plt.gca().get_xticklabels()]
|
||||
n_obs = df.groupby(group_col)[y].size().values
|
||||
for (x, xticklabel), n_ob in zip(enumerate(xticklabels), n_obs):
|
||||
plt.text(x,
|
||||
medians_dict[xticklabel] * 1.01,
|
||||
"#obs : " + str(n_ob),
|
||||
horizontalalignment='center',
|
||||
fontdict={'size': font_size},
|
||||
color=font_color)
|
||||
|
||||
add_n_obs(df, group_col=x_column_name, y=y_column_name)
|
||||
|
||||
# Decoration
|
||||
sns.set(style="whitegrid", font_scale=scale_font_size)
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
plt.ylim(y_scale_min, y_scale_max)
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 28、箱图结合点图(Dot_Box_Plot)
|
||||
# 测试文件 mpg.csv
|
||||
|
||||
|
||||
def Dot_Box_Plot(file_path, chart_out_path, out_path,
|
||||
title, title_font_size, point_size, line_color, x_scale_font_angle, y_scale_font_angle, y_name, x_name,
|
||||
x_column_name, y_column_name, group_by_column, legend_name, color):
|
||||
df = pd.read_csv(file_path)
|
||||
plt.figure(figsize=(9.4, 4.25), dpi=180)
|
||||
sns.boxplot(
|
||||
x=x_column_name,
|
||||
y=y_column_name,
|
||||
data=df,
|
||||
hue=legend_name,
|
||||
palette=color,
|
||||
)
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
plt.legend(loc=9)
|
||||
sns.stripplot(x=x_column_name,
|
||||
y=y_column_name,
|
||||
data=df,
|
||||
color='#dc2624',
|
||||
size=point_size,
|
||||
jitter=1)
|
||||
|
||||
for i in range(len(df[group_by_column].unique()) - 1):
|
||||
plt.vlines(i + .5, 10, 45, linestyles='solid', colors=line_color, alpha=0.2)
|
||||
|
||||
# Decoration
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 28、箱图结合点图(Dot_Box_Plot)
|
||||
# 28、箱图结合点图(Violin_Plot)
|
||||
# 测试文件 mpg.csv
|
||||
|
||||
|
||||
@@ -1007,58 +862,6 @@ def Population_Pyramid(file_path, chart_out_path, out_path,
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 32、华夫饼图(Waffle_Chart)
|
||||
|
||||
# 测试文件 mpg.csv
|
||||
|
||||
|
||||
def Waffle_Chart(file_path, chart_out_path, out_path, rows_number, group_by_column, x_scale_font_angle,
|
||||
y_scale_font_angle, y_name, x_name,
|
||||
title_font_size, title):
|
||||
df_raw = pd.read_csv(file_path)
|
||||
|
||||
from pywaffle import Waffle
|
||||
|
||||
# Prepare Data
|
||||
df = df_raw.groupby(group_by_column).size().reset_index(name='counts')
|
||||
n_categories = df.shape[0]
|
||||
colors = [plt.cm.Set1(i / float(n_categories))
|
||||
for i in range(n_categories)]
|
||||
|
||||
# Draw Plot and Decorate
|
||||
plt.figure(FigureClass=Waffle,
|
||||
plots={
|
||||
'111': {
|
||||
'values':
|
||||
df['counts'],
|
||||
'labels': [
|
||||
"{0} ({1})".format(n[0], n[1])
|
||||
for n in df[[group_by_column, 'counts']].itertuples()
|
||||
],
|
||||
'legend': {
|
||||
'loc': 'upper left',
|
||||
'bbox_to_anchor': (1.05, 1),
|
||||
'fontsize': 12
|
||||
},
|
||||
},
|
||||
},
|
||||
rows=rows_number,
|
||||
colors=colors,
|
||||
dpi=180,
|
||||
figsize=(9.4, 4.25))
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 33、饼图(Pie_Chart)
|
||||
# 测试文件 mpg.csv
|
||||
|
||||
@@ -1110,177 +913,6 @@ def Treemap(file_path, chart_out_path, out_path, title, group_by_column, title_f
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 35、柱状图(Bar_Chart
|
||||
# 测试文件 mpg.csv
|
||||
|
||||
|
||||
def Bar_Chart(file_path, chart_out_path, out_path, title, title_font_size, font_size, y_scale_min, y_scale_max, width,
|
||||
group_by_column, x_scale_font_angle,
|
||||
y_scale_font_angle, y_name, x_name):
|
||||
import random
|
||||
df_raw = pd.read_csv(file_path)
|
||||
|
||||
df = df_raw.groupby(group_by_column).size().reset_index(name='counts')
|
||||
n = df[group_by_column].unique().__len__() + 1
|
||||
all_colors = list(plt.cm.colors.cnames.keys())
|
||||
random.seed(100)
|
||||
c = random.choices(all_colors, k=n)
|
||||
|
||||
# Plot Bars
|
||||
plt.figure(figsize=(9.4, 4.25), dpi=180)
|
||||
plt.bar(df[group_by_column], df['counts'], color=c, width=width)
|
||||
for i, val in enumerate(df['counts'].values):
|
||||
plt.text(i,
|
||||
val,
|
||||
float(val),
|
||||
horizontalalignment='center',
|
||||
verticalalignment='bottom',
|
||||
fontdict={
|
||||
'fontweight': 500,
|
||||
'size': font_size
|
||||
})
|
||||
|
||||
# Decoration
|
||||
plt.gca().set_xticklabels(df[group_by_column],
|
||||
rotation=60,
|
||||
horizontalalignment='right')
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
plt.ylim(y_scale_min, y_scale_max)
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 36、时间序列图(Time_Series_Plot)
|
||||
# 测试文件 AirPassengers.csv
|
||||
|
||||
|
||||
def Time_Series_Plot(file_path, chart_out_path, out_path,
|
||||
polt_color, title, title_font_size, x_column, y_column, x_font_size, y_font_size, y_scale_min,
|
||||
y_scale_max, x_scale_font_angle,
|
||||
y_scale_font_angle, y_name, x_name):
|
||||
df = pd.read_csv(file_path)
|
||||
|
||||
# Draw Plot
|
||||
plt.figure(figsize=(9.4, 4.25), dpi=180)
|
||||
plt.plot(df[x_column], df[y_column], color=polt_color)
|
||||
# plt.plot(df['date'], df['value'], color='#365770')
|
||||
# print(file_path)
|
||||
# Decoration
|
||||
plt.ylim(y_scale_min, y_scale_max)
|
||||
xtick_location = df.index.tolist()[::12]
|
||||
xtick_labels = [x[-4:] for x in df.date.tolist()[::12]]
|
||||
plt.xticks(ticks=xtick_location,
|
||||
labels=xtick_labels,
|
||||
rotation=0,
|
||||
fontsize=x_font_size,
|
||||
horizontalalignment='center',
|
||||
alpha=.7)
|
||||
plt.yticks(fontsize=y_font_size, alpha=.7)
|
||||
plt.title(title, fontsize=title_font_size)
|
||||
plt.grid(axis='both', alpha=.3)
|
||||
plt.show()
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
# Remove borders
|
||||
plt.gca().spines["top"].set_alpha(0.0)
|
||||
plt.gca().spines["bottom"].set_alpha(0.3)
|
||||
plt.gca().spines["right"].set_alpha(0.0)
|
||||
plt.gca().spines["left"].set_alpha(0.3)
|
||||
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 41、多重时间序列图(Multiple_Time_Series)!!!
|
||||
# 测试文件 mortality.csv
|
||||
|
||||
def Multiple_Time_Series(file_path, chart_out_path, out_path,
|
||||
font_size, title, title_font_size, x_font_size, y_font_size, x_scale_min, x_scale_max,
|
||||
x_scale_font_angle, y_scale_font_angle, y_name,
|
||||
x_name):
|
||||
df = pd.read_csv(file_path)
|
||||
|
||||
y_LL = 100
|
||||
y_UL = int(df.iloc[:, 1:].max().max() * 1.1)
|
||||
y_interval = 400
|
||||
mycolors = ['tab:red', 'tab:blue', 'tab:green', 'tab:orange']
|
||||
|
||||
fig, ax = plt.subplots(1, 1, figsize=(9.4, 4.25), dpi=180)
|
||||
|
||||
columns = df.columns[1:]
|
||||
for i, column in enumerate(columns):
|
||||
plt.plot(df.date.values, df[column].values, lw=1.5, color=mycolors[i])
|
||||
plt.text(df.shape[0] + 1,
|
||||
df[column].values[-1],
|
||||
column,
|
||||
fontsize=font_size,
|
||||
color=mycolors[i])
|
||||
|
||||
for y in range(y_LL, y_UL, y_interval):
|
||||
plt.hlines(y,
|
||||
xmin=0,
|
||||
xmax=71,
|
||||
colors='black',
|
||||
alpha=0.3,
|
||||
linestyles="--",
|
||||
lw=0.5)
|
||||
|
||||
# Decorations
|
||||
plt.tick_params(axis="both",
|
||||
which="both",
|
||||
bottom=False,
|
||||
top=False,
|
||||
labelbottom=True,
|
||||
left=False,
|
||||
right=False,
|
||||
labelleft=True)
|
||||
|
||||
# Lighten borders
|
||||
plt.gca().spines["top"].set_alpha(.3)
|
||||
plt.gca().spines["bottom"].set_alpha(.3)
|
||||
plt.gca().spines["right"].set_alpha(.3)
|
||||
plt.gca().spines["left"].set_alpha(.3)
|
||||
|
||||
plt.title(title,
|
||||
fontsize=title_font_size)
|
||||
plt.yticks(range(y_LL, y_UL, y_interval),
|
||||
[str(y) for y in range(y_LL, y_UL, y_interval)],
|
||||
fontsize=y_font_size)
|
||||
plt.xticks(range(0, df.shape[0], 12),
|
||||
df.date.values[::12],
|
||||
horizontalalignment='left',
|
||||
rotation=45,
|
||||
fontsize=x_font_size)
|
||||
plt.ylim(y_LL, y_UL)
|
||||
plt.xlim(x_scale_min, x_scale_max)
|
||||
|
||||
plt.xticks(rotation=x_scale_font_angle, fontsize=10)
|
||||
plt.yticks(rotation=y_scale_font_angle, fontsize=10)
|
||||
|
||||
plt.ylabel(y_name, fontsize=12)
|
||||
plt.ylabel(x_name, fontsize=12)
|
||||
|
||||
plt.savefig(f"{chart_out_path}") # 保存图片
|
||||
plt.savefig(f"{out_path}.png")
|
||||
plt.savefig(f"{out_path}.svg")
|
||||
plt.savefig(f"{out_path}.pdf")
|
||||
|
||||
|
||||
# 42、双坐标系时间序列图(Plotting_with_different_scales_using_secondary_Y_axis)
|
||||
# 测试文件 economics.csv
|
||||
|
||||
@@ -1541,6 +1173,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
def Composition_BarOfColorsDataByGroup(file_path, chart_out_path, out_path, title, caption, subtitle, x_name, y_name,
|
||||
@@ -1598,6 +1231,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -1658,6 +1292,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -1722,6 +1357,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, model2, model3, model4, model5
|
||||
@@ -1804,6 +1440,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -1863,6 +1500,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -1919,6 +1557,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -1973,6 +1612,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2030,6 +1670,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2095,6 +1736,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2157,6 +1799,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2220,6 +1863,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2282,6 +1926,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -2341,6 +1986,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, line_color, point_color
|
||||
@@ -2406,6 +2052,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, line_color
|
||||
@@ -2458,6 +2105,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, line_color
|
||||
@@ -2518,6 +2166,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, line_color
|
||||
@@ -2577,6 +2226,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, model
|
||||
@@ -2651,6 +2301,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -2711,6 +2362,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, color
|
||||
@@ -2777,6 +2429,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, color
|
||||
@@ -2839,6 +2492,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position, line_color
|
||||
@@ -2897,6 +2551,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
# 基础参数 file_path, chart_out_path, out_path, title, caption, subtitle, title_font_size,
|
||||
|
||||
@@ -2942,6 +2597,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -3008,6 +2664,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, species_1, species_2
|
||||
@@ -3091,6 +2748,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -3153,6 +2811,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3213,6 +2872,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3281,6 +2941,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color, legend_name, legend_position
|
||||
@@ -3362,6 +3023,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3418,6 +3080,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3475,6 +3138,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3546,6 +3210,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3600,6 +3265,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3665,6 +3331,7 @@ dev.off()
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 x_font_color, y_font_color, x_scale_font_color, y_scale_font_color, title_font_color
|
||||
@@ -3729,6 +3396,7 @@ dev.off()
|
||||
"""
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 最后一组
|
||||
@@ -3862,6 +3530,7 @@ def Aggregated_Pyramids(file_path, char_out_path, out_path, title, caption, subt
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 基础参数 file_path, char_out_path, out_path, title, caption, subtitle, title_font_size, x_name, x_font_size, x_scale_font_size, y_name, y_font_size, y_scale_font_size, event_1, event_2, event_3, font_size
|
||||
@@ -3989,6 +3658,7 @@ def Areas_Under_a_Time_Series(file_path, char_out_path, out_path, title, caption
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 基础参数 file_path, char_out_path, out_path, title, caption_1, caption_2, subtitle, title_font_size, font_size
|
||||
@@ -4084,7 +3754,7 @@ def Balloon_Plot(file_path, char_out_path, out_path, title, caption_1, caption_2
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R") # 基础参数 file_path, char_out_path, out_path, title, caption, subtitle, title_font_size, x_name, x_font_size, x_scale_font_size, y_name, y_font_size, y_scale_font_size, image_name_font_size, mark_country_1, mark_country_2, average_font_size
|
||||
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 title_font_color, x_font_color, x_scale_font_color, y_font_color, y_scale_font_color, image_name_font_color, average_font_color, mark_color, color
|
||||
@@ -4787,8 +4457,8 @@ def Comparison_with_Bar_Chart_1(file_path, char_out_path, out_path, title, capti
|
||||
"""
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(
|
||||
f"Rscript {out_path}.R") # 基础参数 file_path, char_out_path, out_path, title, caption, subtitle, title_font_size, x_name, x_font_size, x_scale_font_size, y_scale_font_size, ruler_name, max_number_size, ruler_name_font_size, ruler_number_font_size, country_1, country_2, country_3, country_1_time_1, country_1_time_2, country_2_time_1, country_2_time_2, country_3_time_1, country_3_time_2
|
||||
os.system(f"Rscript {out_path}.R") # 基础参数 file_path, char_out_path, out_path, title, caption, subtitle, title_font_size, x_name, x_font_size, x_scale_font_size, y_scale_font_size, ruler_name, max_number_size, ruler_name_font_size, ruler_number_font_size, country_1, country_2, country_3, country_1_time_1, country_1_time_2, country_2_time_1, country_2_time_2, country_3_time_1, country_3_time_2
|
||||
os.remove(f"{out_path}.R")
|
||||
|
||||
|
||||
# 高级参数 title_font_color, x_font_color, x_scale_font_color, ruler_color, y_scale_font_color, zero_graduation_color, color_1, color_2, max_number_font_color, ruler_number_font_color
|
||||
@@ -7558,4 +7228,5 @@ def chord_Diagram(file_path, file_path_2, char_out_path, out_path, title, captio
|
||||
"""
|
||||
|
||||
keep_txt_to_file(code, f"{out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.system(f"Rscript {out_path}.R")
|
||||
os.remove(f"{out_path}.R")
|
||||
@@ -357,13 +357,16 @@ class="layui-input" style="height: 25px; width:80px;margin-top: 6px">
|
||||
|
||||
def color_js(self):
|
||||
code = ""
|
||||
init_color = ""
|
||||
for i in self.colors_dict.keys():
|
||||
if self.colors_dict[i] == "rgb":
|
||||
fl = "rgb"
|
||||
init_color = "rgb(0,0,0)"
|
||||
else:
|
||||
fl = "hex"
|
||||
init_color = "#000000"
|
||||
code += """
|
||||
%s = "#000000"
|
||||
%s = "%s"
|
||||
layui.use('colorpicker', function()
|
||||
{
|
||||
var $ = layui.$
|
||||
@@ -381,7 +384,7 @@ class="layui-input" style="height: 25px; width:80px;margin-top: 6px">
|
||||
|
||||
});
|
||||
})
|
||||
""" % (i + '_', i, random_color(), fl, i + "_")
|
||||
""" % (i + '_', init_color, i, random_color(), fl, i + "_")
|
||||
|
||||
return code
|
||||
|
||||
|
||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
BIN
static/logo改_3.png
Normal file
BIN
static/logo改_3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -81,7 +81,7 @@
|
||||
{# // 留言#}
|
||||
<div class="LeavingAessage_box" id="LeavingAessage_box">
|
||||
<div class="input_text">
|
||||
<textarea name="desc" placeholder="请输入内容" class="layui-textarea" id="message"></textarea>
|
||||
<textarea name="desc" placeholder="input" class="layui-textarea" id="message"></textarea>
|
||||
<button class="layui-btn" lay-submit lay-filter="formDemo" onclick="send()">立即提交</button>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<body>
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<div class="layui-header">
|
||||
<div class="layui-logo layui-hide-xs layui-bg-black">Simple Drawing</div>
|
||||
<div class="layui-logo layui-hide-xs layui-bg-black"><img src="/static/logo改_3.png" height="60px"></div>
|
||||
|
||||
<!-- 头部区域(可配合layui 已有的水平导航) -->
|
||||
|
||||
|
||||
@@ -41,27 +41,26 @@
|
||||
<li style="margin-top: 20px;" class="layui-nav-item">
|
||||
<a style="font-size: 25px;" class="" href="javascript:;">Basics</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a onclick=blast()>blast</a></dd>
|
||||
<dd><a onclick="genbank_to_fasta()">genbank to fasta</a></dd>
|
||||
<dd><a onclick=gff_to_gtf()>gff to gtf</a></dd>
|
||||
<dd><a onclick=orf()>orf</a></dd>
|
||||
<dd><a onclick=Basics()>序列基础</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick=blast()>blast</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick="genbank_to_fasta()">gbk to fa</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick=gff_to_gtf()>gff to gtf</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick=orf()>orf</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick=Basics()>seq basics</a></dd>
|
||||
|
||||
</dl>
|
||||
</li>
|
||||
<li style="margin-top: 10px;" class="layui-nav-item">
|
||||
<a style="font-size: 25px;" href="javascript:;">Gene Family</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a onclick=pfam()>pfam</a></dd>
|
||||
<dd><a style="font-size: 20px;" onclick=pfam()>pfam</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li style="margin-top: 10px;" class="layui-nav-item">
|
||||
<a style="font-size: 25px;" href="javascript:;">Omics</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd><a href="javascript:;" onclick=Differential_expression_analysis()>Differential expression
|
||||
analysis</a></dd>
|
||||
<dd><a href="javascript:;" style="font-size: 20px;" onclick=Differential_expression_analysis()>deg</a></dd>
|
||||
|
||||
<dd><a href="javascript:;" onclick=fastqc()>fastqc</a></dd>
|
||||
<dd><a href="javascript:;" style="font-size: 20px;" onclick=fastqc()>fastqc</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<form class="layui-form" action="">
|
||||
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-normal" id="testList">选择多文件</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal" id="testList">select files</button>
|
||||
<div type="button" class="example_box" style="float: right;margin-top: 14px;" id="example_blast_seq">
|
||||
<a href="#">
|
||||
<span>example seq file</span>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">outfmt</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="outfmt" placeholder="请输入"
|
||||
<input type="text" name="username" id="outfmt" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,7 +57,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">evalue</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="evalue" placeholder="请输入"
|
||||
<input type="text" name="username" id="evalue" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">num_descriptions</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="num_descriptions" placeholder="请输入"
|
||||
<input type="text" name="username" id="num_descriptions" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -75,7 +75,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">Software type</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="type" placeholder="请输入"
|
||||
<input type="text" name="username" id="type" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">format</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="format" id="format" lay-verify="number" placeholder="请输入"
|
||||
<input type="text" name="format" id="format" lay-verify="number" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">begin</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="begin" lay-verify="number" placeholder="请输入"
|
||||
<input type="text" name="username" id="begin" lay-verify="number" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,7 +44,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">end</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="end" lay-verify="number" placeholder="请输入"
|
||||
<input type="text" name="username" id="end" lay-verify="number" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">clan_overlap</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="clan_overlap" placeholder="请输入"
|
||||
<input type="text" name="username" id="clan_overlap" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">align</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="align" placeholder="请输入"
|
||||
<input type="text" name="username" id="align" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">e_seq</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="e_seq" placeholder="请输入"
|
||||
<input type="text" name="username" id="e_seq" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">e_dom</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="e_dom" placeholder="请输入"
|
||||
<input type="text" name="username" id="e_dom" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">b_seq</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="b_seq" placeholder="请输入"
|
||||
<input type="text" name="username" id="b_seq" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">b_dom</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" id="b_dom" placeholder="请输入"
|
||||
<input type="text" name="username" id="b_dom" placeholder="input"
|
||||
autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user