Skip to content

Commit

Permalink
dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesun committed Nov 23, 2023
1 parent 8ea5d9f commit fb2ddf4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ RUN echo "Asia/Shanghai" > /etc/timezone && \
apt-get install -y tzdata && \
dpkg-reconfigure --frontend noninteractive tzdata

RUN apt-get update && \
apt-get install -y tesseract-ocr tesseract-ocr-chi-sim && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# 安装 Graphviz
# 安装 Tesseract-OCR、Graphviz 和字体
RUN apt-get update && \
apt-get install -y graphviz && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# 安装中文字体
RUN apt-get update && apt-get install -y fonts-wqy-microhei && \
apt-get install -y \
tesseract-ocr \
tesseract-ocr-chi-sim \
graphviz \
fonts-wqy-microhei \
fonts-noto && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
8 changes: 4 additions & 4 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,21 @@ def build_mind_map(graph, node, parent, structure, level=0, parent_color=None):
# 根据层级设置样式
if level == 0: # 根节点
node_color = generate_random_dark_color()
graph.node(node, style='filled', color=node_color, fontsize="21", fontname='WenQuanYi Micro Hei',
graph.node(node, style='filled', color=node_color, fontsize="21", fontname='Noto Sans',
fontcolor='white',
shape='tripleoctagon', peripheries="2", label=node)
elif level == 1: # 第二层节点
node_color = generate_random_dark_color()
graph.node(node, style='filled', color=node_color, fontsize="18", fontname='WenQuanYi Micro Hei',
graph.node(node, style='filled', color=node_color, fontsize="18", fontname='Noto Sans',
fontcolor='white',
shape='hexagon', peripheries="2", label=node)
elif level == 2: # 第三层节点
node_color = generate_light_color(parent_color)
graph.node(node, style='filled', color=node_color, fontsize="16", shape='note', fontname='WenQuanYi Micro Hei',
graph.node(node, style='filled', color=node_color, fontsize="16", shape='note', fontname='Noto Sans',
label=node)
else: # 其他层级
node_color = generate_light_color(parent_color)
graph.node(node, style='solid', color=node_color, fontsize="14", shape='egg', fontname='WenQuanYi Micro Hei',
graph.node(node, style='filled', color=node_color, fontsize="14", shape='egg', fontname='Noto Sans',
label=node)

# 连接节点
Expand Down
4 changes: 2 additions & 2 deletions tools/generate_mindmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from main import MindmapItem


async def generate_mindmap():
def generate_mindmap():
try:
airesp = await create_mindma_data_by_openai("根据微积分基础整理一个学习计划思维导图")
airesp = create_mindma_data_by_openai("根据微积分基础整理一个学习计划思维导图")
# 创建并构建思维导图
data = json.loads(airesp)
item = MindmapItem.model_validate(data)
Expand Down

0 comments on commit fb2ddf4

Please sign in to comment.