{"spec_id":"radar-innovation-timeline","library":"ggplot2","language":"r","code":"#' anyplot.ai\n#' radar-innovation-timeline: Innovation Radar with Time-Horizon Rings\n#' Library: ggplot2 4.0.3 | R 4.6.1\n#' Quality: 84/100 | Updated: 2026-11-27\n\nlibrary(ggplot2)\nlibrary(ragg)\n\n# Theme tokens — Imprint palette\nTHEME       <- Sys.getenv(\"ANYPLOT_THEME\", \"light\")\nPAGE_BG     <- if (THEME == \"light\") \"#FAF8F1\" else \"#1A1A17\"\nELEVATED_BG <- if (THEME == \"light\") \"#FFFDF6\" else \"#242420\"\nINK         <- if (THEME == \"light\") \"#1A1A17\" else \"#F0EFE8\"\nINK_SOFT    <- if (THEME == \"light\") \"#4A4A44\" else \"#B8B7B0\"\nINK_MUTED   <- if (THEME == \"light\") \"#6B6A63\" else \"#A8A79F\"\n\nIMPRINT_PALETTE <- c(\n  \"#009E73\",  # 1 — brand green → AI & ML\n  \"#C475FD\",  # 2 — lavender    → Cloud & Infra\n  \"#4467A3\",  # 3 — blue        → Security\n  \"#BD8233\"   # 4 — ochre       → Dev Tools\n)\n\nsector_names  <- c(\"AI & ML\", \"Cloud & Infra\", \"Security\", \"Dev Tools\")\nring_labels_v <- c(\"Now\", \"Near-term\", \"Mid-term\", \"Future\")\ncolor_map     <- setNames(IMPRINT_PALETTE, sector_names)\nsector_starts <- setNames(c(0, 67.5, 135, 202.5), sector_names)\n\n# Ring geometry: four equal-width horizons around a small open centre\nring_edges  <- c(0.2, 1.45, 2.45, 3.4, 4.3)\nring_mid    <- (ring_edges[1:4] + ring_edges[2:5]) / 2\nring_mid[1] <- 0.6  # the innermost band is narrow in pixels, so its markers sit closer to the centre\nSWEEP       <- 270  # three-quarter layout, the last quadrant stays open\n\n# 16 technology items: one per (sector x ring) cell, short names so each fits its cell\nitems <- tibble::tibble(\n  name = c(\n    \"LLM\\nServing\", \"Agentic AI\", \"Foundation\\nModels\", \"Spiking\\nChips\",\n    \"GitOps\", \"FinOps\", \"Edge ML\", \"Quantum\\nCloud\",\n    \"Zero\\nTrust\", \"AI-Powered\\nSIEM\", \"Homomorphic\\nEncryption\", \"Post-Quantum\\nCrypto\",\n    \"Copilot\", \"Platform\\nEng.\", \"Wasm\", \"Auto\\nTesting\"\n  ),\n  sector = rep(sector_names, each = 4),\n  ring_r = rep(1:4, times = 4),\n  # Angle inside the 67.5-degree sector and the side the label runs to, chosen so each label stays in its cell\n  angle_offset = c(30, 4, 26, 4,  50, 62, 62, 62,  45, 26, 34, 34,  60, 4, 56, 4),\n  right_side   = c(TRUE, TRUE, FALSE, TRUE,  TRUE, TRUE, TRUE, TRUE,  TRUE, FALSE, FALSE, FALSE,  FALSE, FALSE, TRUE, FALSE)\n)\n\nitems$angle <- sector_starts[items$sector] + items$angle_offset\nitems$y     <- ring_mid[items$ring_r]\nitems$label <- ifelse(\n  items$right_side,\n  gsub(\"(^|\\n)\", \"\\\\1   \", items$name),\n  gsub(\"($|\\n)\", \"   \\\\1\", items$name)\n)\n# Larger points for more-immediate rings to convey urgency/immediacy\nitems$point_size <- c(6.5, 5.5, 4.5, 3.5)[items$ring_r]\n\nRING_FILL <- if (THEME == \"light\") \"#E6E3DB\" else \"#232320\"\nedge_df   <- tibble::tibble(y = ring_edges)\nband_df   <- tibble::tibble(ymin = ring_edges[c(1, 3)], ymax = ring_edges[c(2, 4)])\nspoke_df  <- tibble::tibble(angle = c(sector_starts, SWEEP))\n\n# Ring names sit in the open quadrant, one per band\nring_ann_df <- tibble::tibble(angle = 350, y = ring_mid, label = ring_labels_v)\n\n# Sector headers outside the outermost ring boundary\nsector_hdr_df <- tibble::tibble(\n  angle = sector_starts + 33.75,\n  y     = ring_edges[5] + 0.22,\n  label = sector_names\n)\n\ntitle_str <- \"radar-innovation-timeline · r · ggplot2 · anyplot.ai\"\ntitle_sz  <- max(8L, round(12 * 67 / nchar(title_str)))\n\np <- ggplot() +\n  # Alternating ring fills (rings 1 and 3)\n  geom_rect(\n    data = band_df,\n    aes(xmin = 0, xmax = SWEEP, ymin = ymin, ymax = ymax),\n    fill = RING_FILL, color = NA, alpha = 0.75\n  ) +\n  # Ring boundary arcs\n  geom_segment(\n    data = edge_df,\n    aes(x = 0, xend = SWEEP, y = y, yend = y),\n    color = INK_SOFT, linewidth = 0.25, alpha = 0.5\n  ) +\n  # Sector divider spokes\n  geom_segment(\n    data = spoke_df,\n    aes(x = angle, xend = angle, y = ring_edges[1], yend = ring_edges[5]),\n    color = INK_SOFT, linewidth = 0.45, alpha = 0.6\n  ) +\n  # Sector header labels\n  geom_text(\n    data = sector_hdr_df,\n    aes(x = angle, y = y, label = label),\n    size = 3.6, fontface = \"bold\", color = INK, hjust = 0.5\n  ) +\n  # Ring names in the open quadrant\n  geom_text(\n    data = ring_ann_df,\n    aes(x = angle, y = y, label = label),\n    size = 3.4, color = INK_SOFT, fontface = \"bold\", hjust = 1\n  ) +\n  # Technology item points, larger for more-immediate rings\n  geom_point(\n    data = items,\n    aes(x = angle, y = y, color = sector, size = point_size),\n    alpha = 0.95\n  ) +\n  scale_size_identity(guide = \"none\") +\n  # Technology item labels beside each marker\n  geom_text(\n    data = items,\n    aes(x = angle, y = y, label = label, hjust = ifelse(right_side, 0, 1), color = sector),\n    size = 2.7, vjust = 0.5, lineheight = 0.85, show.legend = FALSE\n  ) +\n  coord_polar(theta = \"x\", start = 0) +\n  scale_x_continuous(limits = c(0, 360), breaks = NULL, expand = c(0, 0)) +\n  scale_y_continuous(limits = c(0, 4.7), breaks = NULL) +\n  scale_color_manual(values = color_map, guide = guide_legend(override.aes = list(size = 5))) +\n  labs(title = title_str, color = \"Sector\") +\n  theme_void(base_size = 8) +\n  theme(\n    plot.background   = element_rect(fill = PAGE_BG, color = PAGE_BG),\n    panel.background  = element_rect(fill = PAGE_BG, color = NA),\n    plot.title = element_text(\n      color = INK, size = title_sz, hjust = 0.5,\n      margin = margin(b = 4)\n    ),\n    legend.position   = \"inside\",\n    legend.position.inside = c(0.02, 0.9),\n    legend.justification = c(0, 1),\n    legend.direction  = \"vertical\",\n    legend.background = element_rect(\n      fill = ELEVATED_BG, color = INK_SOFT, linewidth = 0.3\n    ),\n    legend.text     = element_text(color = INK_SOFT, size = 10),\n    legend.title    = element_text(color = INK, size = 11),\n    legend.key       = element_blank(),\n    legend.margin    = margin(8, 10, 8, 8),\n    legend.key.size = unit(0.55, \"cm\"),\n    plot.margin     = margin(10, 10, 10, 10)\n  )\n\nggsave(\n  filename = sprintf(\"plot-%s.png\", THEME),\n  plot     = p,\n  device   = ragg::agg_png,\n  width    = 6,\n  height   = 6,\n  units    = \"in\",\n  dpi      = 400\n)\n"}