Sunburst Chart

Microservices Architecture

Dark-themed sunburst chart showing microservices architecture from domain boundaries to services to internal components.

Output
Microservices Architecture
Python
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(figsize=(12, 10), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

# Inner ring - Domain boundaries
domain_sizes = [30, 25, 25, 20]
domain_labels = ['User Domain', 'Order Domain', 'Product Domain', 'Payment']
domain_colors = ['#F5276C', '#27D3F5', '#6CF527', '#F5B027']

# Outer ring - Microservices
svc_sizes = [10, 10, 10, 10, 8, 7, 10, 8, 7, 10, 10]
svc_colors = ['#F5276C', '#FF5A94', '#FF8CB8',
              '#27D3F5', '#5CE8FF', '#8CF2FF',
              '#6CF527', '#8FFF5C', '#B2FF8C',
              '#F5B027', '#FFCC5C']

wedges_outer, _ = ax.pie(svc_sizes, radius=1, colors=svc_colors,
       wedgeprops=dict(width=0.3, edgecolor='#0a0a0f', linewidth=2))

wedges_inner, _ = ax.pie(domain_sizes, radius=0.7, colors=domain_colors,
       wedgeprops=dict(width=0.3, edgecolor='#0a0a0f', linewidth=2))

# Add domain labels
for i, (wedge, label) in enumerate(zip(wedges_inner, domain_labels)):
    ang = (wedge.theta2 - wedge.theta1) / 2 + wedge.theta1
    x = 0.52 * np.cos(np.radians(ang))
    y = 0.52 * np.sin(np.radians(ang))
    ax.text(x, y, label.replace(' ', '\n'), ha='center', va='center', fontsize=8, 
            color='white', fontweight='bold')

centre_circle = plt.Circle((0, 0), 0.4, fc='#0a0a0f', ec='#334155', linewidth=2)
ax.add_artist(centre_circle)
ax.text(0, 0, 'Platform\n11 Services', ha='center', va='center',
        fontsize=12, color='white', fontweight='bold')

# Legend
svc_labels = ['auth-svc', 'profile-svc', 'notif-svc', 'order-svc', 'inventory', 
              'shipping', 'catalog', 'search', 'recommend', 'billing', 'transactions']
ax.legend(wedges_outer, svc_labels, loc='center left', bbox_to_anchor=(1.05, 0.5),
          fontsize=9, frameon=True, facecolor='#1e293b', edgecolor='#334155',
          labelcolor='white', title='Services', title_fontsize=10)

ax.set_title('Microservices Architecture', fontsize=18, color='#f8fafc',
             fontweight='bold', pad=20)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Part-to-Whole

Did this help you?

Support PyLucid to keep it free & growing

Support