Skip to content

Commit 85ad59f

Browse files
committed
doc: 新增“可编辑”示例应用
1 parent ac9a8ed commit 85ad59f

4 files changed

Lines changed: 72 additions & 4 deletions

File tree

README-en_US.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ if __name__ == '__main__':
125125

126126
| Scenario | Description | Source Code |
127127
| :---: | :---: | :---: |
128-
| Stream Rendering | Demonstrates streaming updates of infographic syntax rendering based on the common `SSE` interface | [examples/stream_render_example](./examples/stream_render_example) |
128+
| Stream Rendering | Demonstrates streaming update rendering of infographic syntax based on common `SSE` services | [stream_render_example](./examples/stream_render_example) |
129+
| Editable | Main elements like text in the infographic can be further edited manually online | [editable_example](./examples/editable_example) |

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ if __name__ == '__main__':
131131

132132
## 7 进阶使用
133133

134-
| 场景 | 功能描述 | 源码 |
135-
| :------: | :-----------------------------------------------: | :----------------------------------------------------------------: |
136-
| 流式渲染 | 基于最常见的`SSE`接口演示信息图语法的流式更新渲染 | [examples/stream_render_example](./examples/stream_render_example) |
134+
| 场景 | 功能描述 | 源码 |
135+
| :------: | :-----------------------------------------------: | :-------------------------------------------------------: |
136+
| 流式渲染 | 基于最常见的`SSE`服务演示信息图语法的流式更新渲染 | [stream_render_example](./examples/stream_render_example) |
137+
| 可编辑 | 信息图中的文字等主要元素可进一步在线手动编辑 | [editable_example](./examples/editable_example) |
137138

138139
<a id="8-更多应用开发教程"></a>
139140

examples/editable_example/app.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import dash # noqa: I001
2+
from dash import html
3+
import feffery_infographic as fi
4+
import feffery_antd_components as fac
5+
from feffery_dash_utils.style_utils import style
6+
7+
app = dash.Dash(__name__)
8+
9+
syntax_demo = """
10+
infographic sequence-ascending-stairs-3d-simple
11+
data
12+
title 企业优势列表
13+
desc 展示企业在不同维度上的核心优势与表现值
14+
items
15+
- label 品牌影响力
16+
value 85
17+
desc 在目标用户群中具备较强认知与信任度
18+
time 2021
19+
icon mingcute/diamond-2-fill
20+
illus creative-experiment
21+
- label 技术研发力
22+
value 90
23+
desc 拥有自研核心系统与持续创新能力
24+
time 2022
25+
icon mingcute/code-fill
26+
illus code-thinking
27+
- label 市场增长快
28+
value 78
29+
desc 近一年用户规模实现快速增长
30+
time 2023
31+
icon mingcute/wallet-4-line
32+
illus business-analytics
33+
- label 服务满意度
34+
value 88
35+
desc 用户对服务体系整体评分较高
36+
time 2020
37+
icon mingcute/happy-line
38+
illus feeling-happy
39+
- label 数据资产全
40+
value 92
41+
desc 构建了完整用户标签与画像体系
42+
time 2022
43+
icon mingcute/user-4-line
44+
illus mobile-photos
45+
- label 创新能力强
46+
value 83
47+
desc 新产品上线频率高于行业平均
48+
time 2023
49+
icon mingcute/rocket-line
50+
illus creativity
51+
theme light
52+
palette antv
53+
"""
54+
55+
56+
app.layout = lambda: html.Div(
57+
[fac.AntdCenter(fi.Infographic(editable=True, syntax=syntax_demo, padding=25, height=800))],
58+
style=style(padding='100px 50px'),
59+
)
60+
61+
if __name__ == '__main__':
62+
app.run(debug=True)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dash>=3.3.0
2+
feffery_antd_components
3+
feffery_dash_utils
4+
feffery_infographic

0 commit comments

Comments
 (0)