Spaces:
Sleeping
Sleeping
Update modules/field_visualizer.py
Browse files- modules/field_visualizer.py +19 -10
modules/field_visualizer.py
CHANGED
|
@@ -1,29 +1,38 @@
|
|
| 1 |
# Author: Liam Grinstead
|
| 2 |
-
#
|
| 3 |
|
| 4 |
def render_fields(agent):
|
| 5 |
tier = agent.get("tier", "Tier_1")
|
|
|
|
| 6 |
Φᵢ_svg = f"""
|
| 7 |
-
<svg width="300" height="
|
| 8 |
<text x="10" y="30" font-size="20">Φᵢ Awareness Field</text>
|
| 9 |
-
<circle cx="150" cy="70" r="20" fill="purple"
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
</svg>
|
| 12 |
"""
|
| 13 |
|
| 14 |
Kᵢⱼ_svg = f"""
|
| 15 |
-
<svg width="300" height="
|
| 16 |
<text x="10" y="30" font-size="20">Kᵢⱼ Correlation Kernel</text>
|
| 17 |
-
<line x1="50" y1="70" x2="250" y2="70" stroke="blue" stroke-width="2"
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
</svg>
|
| 20 |
"""
|
| 21 |
|
| 22 |
Φ_col_svg = f"""
|
| 23 |
-
<svg width="300" height="
|
| 24 |
<text x="10" y="30" font-size="20">Φ_col Coherence Field</text>
|
| 25 |
-
<rect x="100" y="
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
| 27 |
</svg>
|
| 28 |
"""
|
| 29 |
|
|
|
|
| 1 |
# Author: Liam Grinstead
|
| 2 |
+
# Animated SVGs for Φᵢ, Kᵢⱼ, Φ_col symbolic fields
|
| 3 |
|
| 4 |
def render_fields(agent):
|
| 5 |
tier = agent.get("tier", "Tier_1")
|
| 6 |
+
|
| 7 |
Φᵢ_svg = f"""
|
| 8 |
+
<svg width="300" height="120">
|
| 9 |
<text x="10" y="30" font-size="20">Φᵢ Awareness Field</text>
|
| 10 |
+
<circle cx="150" cy="70" r="20" fill="purple">
|
| 11 |
+
<animate attributeName="r" values="20;25;20" dur="2s" repeatCount="indefinite" />
|
| 12 |
+
</circle>
|
| 13 |
+
<text x="130" y="115" font-size="12">{tier}</text>
|
| 14 |
</svg>
|
| 15 |
"""
|
| 16 |
|
| 17 |
Kᵢⱼ_svg = f"""
|
| 18 |
+
<svg width="300" height="120">
|
| 19 |
<text x="10" y="30" font-size="20">Kᵢⱼ Correlation Kernel</text>
|
| 20 |
+
<line x1="50" y1="70" x2="250" y2="70" stroke="blue" stroke-width="2">
|
| 21 |
+
<animate attributeName="x1" values="50;60;50" dur="1.5s" repeatCount="indefinite" />
|
| 22 |
+
<animate attributeName="x2" values="250;240;250" dur="1.5s" repeatCount="indefinite" />
|
| 23 |
+
</line>
|
| 24 |
+
<text x="100" y="100" font-size="12">Operators Coupled</text>
|
| 25 |
</svg>
|
| 26 |
"""
|
| 27 |
|
| 28 |
Φ_col_svg = f"""
|
| 29 |
+
<svg width="300" height="120">
|
| 30 |
<text x="10" y="30" font-size="20">Φ_col Coherence Field</text>
|
| 31 |
+
<rect x="100" y="60" width="100" height="30" fill="green">
|
| 32 |
+
<animateTransform attributeName="transform" attributeType="XML"
|
| 33 |
+
type="scale" values="1;1.1;1" begin="0s" dur="2s" repeatCount="indefinite"/>
|
| 34 |
+
</rect>
|
| 35 |
+
<text x="105" y="105" font-size="12">Collective Awareness</text>
|
| 36 |
</svg>
|
| 37 |
"""
|
| 38 |
|