d3 = require("d3@7")
// Define concept nodes with categories and difficulty
conceptNodes = [
// Fundamentals (center/foundation)
{id: "data-rep", name: "Data Representation", category: "Fundamentals", difficulty: 1, description: "Binary, hex, and data encoding basics"},
{id: "signals", name: "Signal Processing", category: "Fundamentals", difficulty: 1, description: "Sampling, filtering, and analog/digital conversion"},
{id: "networking", name: "Networking Basics", category: "Fundamentals", difficulty: 1, description: "OSI model, packets, addressing"},
{id: "wireless", name: "Wireless Fundamentals", category: "Fundamentals", difficulty: 2, description: "RF propagation, link budgets, interference"},
// Protocols
{id: "mqtt", name: "MQTT", category: "Protocols", difficulty: 2, description: "Pub/sub messaging for IoT"},
{id: "coap", name: "CoAP", category: "Protocols", difficulty: 2, description: "Lightweight REST for constrained devices"},
{id: "http", name: "HTTP/REST", category: "Protocols", difficulty: 1, description: "Web protocols for IoT"},
{id: "ble", name: "Bluetooth LE", category: "Protocols", difficulty: 2, description: "Short-range low-power wireless"},
{id: "zigbee", name: "Zigbee", category: "Protocols", difficulty: 2, description: "Mesh networking for smart home"},
{id: "lora", name: "LoRa/LoRaWAN", category: "Protocols", difficulty: 2, description: "Long-range low-power WAN"},
{id: "wifi", name: "Wi-Fi", category: "Protocols", difficulty: 1, description: "High-bandwidth local wireless"},
{id: "cellular", name: "Cellular IoT", category: "Protocols", difficulty: 3, description: "NB-IoT, LTE-M for wide area"},
// Architecture
{id: "edge", name: "Edge Computing", category: "Architecture", difficulty: 2, description: "Processing data near the source"},
{id: "cloud", name: "Cloud Integration", category: "Architecture", difficulty: 2, description: "Cloud platforms and services"},
{id: "gateway", name: "Gateways", category: "Architecture", difficulty: 2, description: "Protocol translation and aggregation"},
{id: "mesh", name: "Mesh Networks", category: "Architecture", difficulty: 3, description: "Multi-hop routing topologies"},
{id: "fog", name: "Fog Computing", category: "Architecture", difficulty: 3, description: "Distributed edge-cloud architecture"},
// Hardware
{id: "sensors", name: "Sensors", category: "Hardware", difficulty: 1, description: "Measuring the physical world"},
{id: "actuators", name: "Actuators", category: "Hardware", difficulty: 1, description: "Affecting the physical world"},
{id: "mcu", name: "Microcontrollers", category: "Hardware", difficulty: 2, description: "ESP32, Arduino, STM32, etc."},
{id: "adc", name: "ADC/DAC", category: "Hardware", difficulty: 2, description: "Analog-digital conversion"},
{id: "power", name: "Power Management", category: "Hardware", difficulty: 2, description: "Batteries, sleep modes, energy harvesting"},
// Data
{id: "timeseries", name: "Time-Series Data", category: "Data", difficulty: 2, description: "Temporal data storage and analysis"},
{id: "databases", name: "IoT Databases", category: "Data", difficulty: 2, description: "Choosing the right data store"},
{id: "analytics", name: "Data Analytics", category: "Data", difficulty: 3, description: "ML, anomaly detection, predictions"},
{id: "streaming", name: "Stream Processing", category: "Data", difficulty: 3, description: "Real-time data pipelines"},
// Security
{id: "encryption", name: "Encryption", category: "Security", difficulty: 2, description: "TLS, AES, securing data in transit"},
{id: "auth", name: "Authentication", category: "Security", difficulty: 2, description: "Device identity and access control"},
{id: "privacy", name: "Privacy", category: "Security", difficulty: 2, description: "GDPR, data minimization, consent"},
{id: "zerotrust", name: "Zero Trust", category: "Security", difficulty: 3, description: "Never trust, always verify"},
// Applications
{id: "smarthome", name: "Smart Home", category: "Applications", difficulty: 1, description: "Home automation and monitoring"},
{id: "industrial", name: "Industrial IoT", category: "Applications", difficulty: 3, description: "Factory automation, IIoT"},
{id: "agriculture", name: "Smart Agriculture", category: "Applications", difficulty: 2, description: "Precision farming, monitoring"},
{id: "healthcare", name: "Healthcare IoT", category: "Applications", difficulty: 3, description: "Wearables, remote monitoring"}
]
// Define edges (prerequisite relationships)
conceptEdges = [
// Fundamentals build up
{source: "data-rep", target: "signals", type: "prerequisite"},
{source: "data-rep", target: "networking", type: "prerequisite"},
{source: "networking", target: "wireless", type: "prerequisite"},
{source: "signals", target: "adc", type: "prerequisite"},
// Protocol prerequisites
{source: "networking", target: "mqtt", type: "prerequisite"},
{source: "networking", target: "coap", type: "prerequisite"},
{source: "networking", target: "http", type: "prerequisite"},
{source: "wireless", target: "ble", type: "prerequisite"},
{source: "wireless", target: "zigbee", type: "prerequisite"},
{source: "wireless", target: "lora", type: "prerequisite"},
{source: "wireless", target: "wifi", type: "prerequisite"},
{source: "wireless", target: "cellular", type: "prerequisite"},
// Protocol relationships
{source: "mqtt", target: "coap", type: "related"},
{source: "ble", target: "zigbee", type: "related"},
{source: "zigbee", target: "mesh", type: "related"},
// Architecture relationships
{source: "gateway", target: "edge", type: "prerequisite"},
{source: "edge", target: "fog", type: "prerequisite"},
{source: "edge", target: "cloud", type: "related"},
{source: "zigbee", target: "mesh", type: "prerequisite"},
{source: "lora", target: "gateway", type: "related"},
// Hardware relationships
{source: "sensors", target: "adc", type: "prerequisite"},
{source: "adc", target: "mcu", type: "prerequisite"},
{source: "mcu", target: "power", type: "related"},
{source: "actuators", target: "mcu", type: "related"},
// Data relationships
{source: "mqtt", target: "timeseries", type: "related"},
{source: "timeseries", target: "databases", type: "prerequisite"},
{source: "databases", target: "analytics", type: "prerequisite"},
{source: "timeseries", target: "streaming", type: "related"},
// Security relationships
{source: "networking", target: "encryption", type: "prerequisite"},
{source: "encryption", target: "auth", type: "prerequisite"},
{source: "auth", target: "zerotrust", type: "prerequisite"},
{source: "auth", target: "privacy", type: "related"},
// Application relationships
{source: "ble", target: "smarthome", type: "related"},
{source: "zigbee", target: "smarthome", type: "related"},
{source: "lora", target: "agriculture", type: "related"},
{source: "cellular", target: "industrial", type: "related"},
{source: "ble", target: "healthcare", type: "related"},
{source: "analytics", target: "industrial", type: "related"}
]
// Category colors
categoryColors = ({
"Fundamentals": "#2C3E50",
"Protocols": "#16A085",
"Architecture": "#E67E22",
"Hardware": "#9B59B6",
"Data": "#3498DB",
"Security": "#E74C3C",
"Applications": "#27AE60"
})
// Filter controls
categories = [...new Set(conceptNodes.map(n => n.category))]
viewof selectedCategory = Inputs.select(["All Categories", ...categories], {
label: "Filter by Category:",
value: "All Categories"
})
viewof selectedDifficulty = Inputs.select(["All Levels", "Beginner (1)", "Intermediate (2)", "Advanced (3)"], {
label: "Filter by Difficulty:",
value: "All Levels"
})