Update radial_diagram_generator.py
Browse files- radial_diagram_generator.py +41 -28
radial_diagram_generator.py
CHANGED
@@ -12,47 +12,60 @@ def generate_radial_diagram(json_input: str) -> str: # Removed base_color parame
|
|
12 |
json_input (str): A JSON string describing the radial diagram structure.
|
13 |
It must follow the Expected JSON Format Example below.
|
14 |
|
15 |
-
Returns:
|
16 |
-
str: The filepath to the generated PNG image file.
|
17 |
-
|
18 |
Expected JSON Format Example:
|
19 |
{
|
20 |
-
"central_node": "
|
21 |
"nodes": [
|
22 |
{
|
23 |
-
"id": "
|
24 |
-
"label": "
|
25 |
-
"relationship": "
|
26 |
"subnodes": [
|
27 |
-
{
|
28 |
-
|
29 |
-
"label": "Equipment Needed",
|
30 |
-
"relationship": "Requires",
|
31 |
-
"subnodes": [
|
32 |
-
{"id": "coffee_maker", "label": "Coffee Maker", "relationship": "e.g."},
|
33 |
-
{"id": "mug", "label": "Mug", "relationship": "For"}
|
34 |
-
]
|
35 |
-
}
|
36 |
]
|
37 |
},
|
38 |
{
|
39 |
-
"id": "
|
40 |
-
"label": "
|
41 |
-
"relationship": "
|
42 |
"subnodes": [
|
43 |
-
{
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
]
|
53 |
}
|
54 |
]
|
55 |
}
|
|
|
|
|
|
|
56 |
"""
|
57 |
try:
|
58 |
if not json_input.strip():
|
|
|
12 |
json_input (str): A JSON string describing the radial diagram structure.
|
13 |
It must follow the Expected JSON Format Example below.
|
14 |
|
|
|
|
|
|
|
15 |
Expected JSON Format Example:
|
16 |
{
|
17 |
+
"central_node": "AI Core Concepts & Domains",
|
18 |
"nodes": [
|
19 |
{
|
20 |
+
"id": "foundational_ml",
|
21 |
+
"label": "Foundational ML",
|
22 |
+
"relationship": "builds on",
|
23 |
"subnodes": [
|
24 |
+
{"id": "supervised_l", "label": "Supervised Learning", "relationship": "e.g."},
|
25 |
+
{"id": "unsupervised_l", "label": "Unsupervised Learning", "relationship": "e.g."}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
]
|
27 |
},
|
28 |
{
|
29 |
+
"id": "dl_architectures",
|
30 |
+
"label": "Deep Learning Arch.",
|
31 |
+
"relationship": "evolved from",
|
32 |
"subnodes": [
|
33 |
+
{"id": "cnns_rad", "label": "CNNs", "relationship": "e.g."},
|
34 |
+
{"id": "rnns_rad", "label": "RNNs", "relationship": "e.g."}
|
35 |
+
]
|
36 |
+
},
|
37 |
+
{
|
38 |
+
"id": "major_applications",
|
39 |
+
"label": "Major AI Applications",
|
40 |
+
"relationship": "applied in",
|
41 |
+
"subnodes": [
|
42 |
+
{"id": "nlp_rad", "label": "Natural Language Processing", "relationship": "e.g."},
|
43 |
+
{"id": "cv_rad", "label": "Computer Vision", "relationship": "e.g."}
|
44 |
+
]
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"id": "ethical_concerns",
|
48 |
+
"label": "Ethical AI Concerns",
|
49 |
+
"relationship": "addresses",
|
50 |
+
"subnodes": [
|
51 |
+
{"id": "fairness_rad", "label": "Fairness & Bias", "relationship": "e.g."},
|
52 |
+
{"id": "explainability", "label": "Explainability (XAI)", "relationship": "e.g."}
|
53 |
+
]
|
54 |
+
},
|
55 |
+
{
|
56 |
+
"id": "future_trends",
|
57 |
+
"label": "Future AI Trends",
|
58 |
+
"relationship": "looking at",
|
59 |
+
"subnodes": [
|
60 |
+
{"id": "agi_future", "label": "AGI Development", "relationship": "e.g."},
|
61 |
+
{"id": "quantum_ai", "label": "Quantum AI", "relationship": "e.g."}
|
62 |
]
|
63 |
}
|
64 |
]
|
65 |
}
|
66 |
+
|
67 |
+
Returns:
|
68 |
+
str: The filepath to the generated PNG image file.
|
69 |
"""
|
70 |
try:
|
71 |
if not json_input.strip():
|