Skip to content

Commit 733587a

Browse files
jules-psubatoi
andauthored
Cookbook article on using Chat to create diagrams (#56907)
Co-authored-by: Jules Porter <[email protected]> Co-authored-by: Ben Ahmady <[email protected]>
1 parent a7e37b6 commit 733587a

File tree

4 files changed

+76
-0
lines changed

4 files changed

+76
-0
lines changed
20.1 KB
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Creating diagrams
3+
shortTitle: Create diagrams
4+
intro: GitHub Copilot Chat can help you create diagrams to better understand your data and communicate insights.
5+
versions:
6+
feature: copilot
7+
complexity:
8+
- Simple
9+
octicon: copilot
10+
topics:
11+
- Copilot
12+
contentType: tutorials
13+
---
14+
15+
{% data variables.copilot.copilot_chat %} can help you create mermaid diagrams to visualize data, making it easier to understand and communicate insights. You can ask {% data variables.copilot.copilot_chat_short %} to generate diagrams based on your data or code, and it will provide you with the necessary code to create those diagrams.
16+
17+
## Example scenario
18+
19+
You want to create a Gantt chart to visualize the timeline of a project. You can ask {% data variables.copilot.copilot_chat_short %} to generate the mermaid code for the Gantt chart, with specific details about the project phases and their durations. You can then use this code in any Markdown file that supports mermaid syntax, such as issues, discussions, or pull requests on {% data variables.product.github %}.
20+
21+
## Example prompt
22+
23+
`Create a mermaid gantt diagram that covers the period August 1st 2025 until January 31st, 2025. Include 5 phases, each taking 6 weeks, and overlapping equally.`
24+
25+
## Example response
26+
27+
{% data reusables.copilot.example-prompts.response-is-an-example %}
28+
29+
{% data variables.product.prodname_copilot_short %} will provide you with the mermaid code to create the flowchart. You can copy the code {% data variables.copilot.copilot_chat_short %} provides and paste it anywhere on {% data variables.product.github %} that supports Markdown, such as an issue or discussion.
30+
31+
Ensure you include the correct mermaid syntax of `` ```mermaid `` before and `` ``` `` after the code block to render the diagram correctly.
32+
33+
````text
34+
```mermaid
35+
gantt
36+
title Project Timeline: Aug 2025 - Jan 2026
37+
dateFormat YYYY-MM-DD
38+
axisFormat %b %d
39+
40+
section Phase 1
41+
Phase 1 :a1, 2025-08-01, 42d
42+
43+
section Phase 2
44+
Phase 2 :a2, 2025-09-07, 42d
45+
46+
section Phase 3
47+
Phase 3 :a3, 2025-10-13, 42d
48+
49+
section Phase 4
50+
Phase 4 :a4, 2025-11-18, 42d
51+
52+
section Phase 5
53+
Phase 5 :a5, 2025-12-24, 42d
54+
```
55+
````
56+
57+
This Mermaid code would generate the following diagram:
58+
59+
![Screenshot of a rendered Mermaid gantt chart.](/assets/images/help/copilot/mermaid-gantt-chart-example.png)
60+
61+
## Further reading
62+
63+
* [Mermaid documentation](https://mermaid-js.github.io/mermaid/#/)
64+
* [GitHub Copilot Chat documentation](/copilot/how-tos/use-chat)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Communicate effectively
3+
intro: 'Discover ways that you can use {% data variables.product.prodname_copilot %} to communicate effectively with your team and stakeholders.'
4+
versions:
5+
feature: copilot
6+
topics:
7+
- Copilot
8+
children:
9+
- /creating-diagrams
10+
contentType: tutorials
11+
---

content/copilot/tutorials/copilot-chat-cookbook/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ spotlight:
2121
- article: /debug-errors/debug-invalid-json
2222
image: /assets/images/copilot-landing/debugging_invalid_json.png
2323
children:
24+
- /communicate-effectively
2425
- /debug-errors
2526
- /analyze-functionality
2627
- /refactor-code

0 commit comments

Comments
 (0)