{"spec_id":"venn-labeled-items","library":"makie","language":"julia","code":"# anyplot.ai\n# venn-labeled-items: Chartgeist-Style Venn Diagram with Labeled Items\n# Library: makie 0.21.9 | Julia 1.11.9\n# Quality: 85/100 | Created: 2026-06-25\n\nusing CairoMakie\nusing Colors\nusing Random\n\nRandom.seed!(42)\n\nconst THEME       = get(ENV, \"ANYPLOT_THEME\", \"light\")\nconst PAGE_BG     = THEME == \"light\" ? colorant\"#FAF8F1\" : colorant\"#1A1A17\"\nconst ELEVATED_BG = THEME == \"light\" ? colorant\"#FFFDF6\" : colorant\"#242420\"\nconst INK         = THEME == \"light\" ? colorant\"#1A1A17\" : colorant\"#F0EFE8\"\nconst INK_SOFT    = THEME == \"light\" ? colorant\"#4A4A44\" : colorant\"#B8B7B0\"\nconst INK_MUTED   = THEME == \"light\" ? colorant\"#6B6A63\" : colorant\"#A8A79F\"\n\nconst IMPRINT_PALETTE = [\n    colorant\"#009E73\",  # 1 brand green\n    colorant\"#C475FD\",  # 2 lavender\n    colorant\"#4467A3\",  # 3 blue\n    colorant\"#BD8233\",\n    colorant\"#AE3030\",\n    colorant\"#2ABCCD\",\n    colorant\"#954477\",\n    colorant\"#99B314\",\n]\n\n# Circle geometry (data-unit coordinates, range 0–1)\nconst r    = 0.25f0\nconst CX_A = 0.50f0;  const CY_A = 0.62f0   # top: \"Goes Viral\"\nconst CX_B = 0.325f0; const CY_B = 0.40f0   # bottom-left: \"Actually Works\"\nconst CX_C = 0.675f0; const CY_C = 0.40f0   # bottom-right: \"Still Around in 5 Years\"\n\nfunction circle_poly(cx, cy, r; n=200)\n    θ = range(0, 2π, length=n + 1)\n    return Point2f.(cx .+ r .* cos.(θ), cy .+ r .* sin.(θ))\nend\n\nconst col_A = IMPRINT_PALETTE[1]   # green — Goes Viral\nconst col_B = IMPRINT_PALETTE[2]   # lavender — Actually Works\nconst col_C = IMPRINT_PALETTE[3]   # blue — Still Around in 5 Years\n\n# Items: (x, y, label, overlap) — overlap: 0=outside, 1=single-circle, 2=pair, 3=triple\nconst items = [\n    (0.50f0,  0.83f0, \"NFTs\",         1),\n    (0.50f0,  0.78f0, \"Metaverse\",    1),\n    (0.50f0,  0.73f0, \"Clubhouse\",    1),\n    (0.155f0, 0.47f0, \"PostgreSQL\",   1),\n    (0.145f0, 0.40f0, \"Nginx\",        1),\n    (0.155f0, 0.33f0, \"Bash\",         1),\n    (0.845f0, 0.47f0, \"Email\",        1),\n    (0.855f0, 0.40f0, \"Excel\",        1),\n    (0.845f0, 0.33f0, \"PDF\",          1),\n    (0.385f0, 0.58f0, \"ChatGPT\",      2),\n    (0.38f0,  0.53f0, \"Figma\",        2),\n    (0.615f0, 0.58f0, \"Agile\",        2),\n    (0.62f0,  0.53f0, \"The Cloud\",    2),\n    (0.50f0,  0.35f0, \"Git\",          2),\n    (0.50f0,  0.30f0, \"Docker\",       2),\n    (0.50f0,  0.48f0, \"JavaScript\",   3),\n    (0.15f0,  0.10f0, \"Google+\",      0),\n    (0.85f0,  0.10f0, \"Vine\",         0),\n]\n\nconst title_str    = \"Tech Taxonomy · venn-labeled-items · julia · makie · anyplot.ai\"\nconst subtitle_str = \"Going viral is easy. Actually working is hard. Surviving is rarer still.\"\n\nfig = Figure(\n    resolution      = (1200, 1200),\n    fontsize        = 14,\n    backgroundcolor = PAGE_BG,\n)\n\nax = Axis(\n    fig[1, 1];\n    title           = title_str,\n    titlesize       = 20,\n    titlecolor      = INK,\n    backgroundcolor = PAGE_BG,\n    aspect          = DataAspect(),\n)\n\nxlims!(ax, -0.15f0, 1.15f0)\nylims!(ax, -0.05f0, 1.05f0)\nhidexdecorations!(ax)\nhideydecorations!(ax)\nhidespines!(ax)\n\n# Three Venn circles: semi-transparent fill + coloured outline\npoly!(ax, circle_poly(CX_A, CY_A, r);\n      color = (col_A, 0.18f0), strokecolor = (col_A, 0.90f0), strokewidth = 2.5f0)\npoly!(ax, circle_poly(CX_B, CY_B, r);\n      color = (col_B, 0.18f0), strokecolor = (col_B, 0.90f0), strokewidth = 2.5f0)\npoly!(ax, circle_poly(CX_C, CY_C, r);\n      color = (col_C, 0.18f0), strokecolor = (col_C, 0.90f0), strokewidth = 2.5f0)\n\n# Category labels — outside each circle on its outer edge\ntext!(ax, CX_A, CY_A + r + 0.05f0;\n      text = \"Goes Viral\", color = col_A,\n      align = (:center, :bottom), fontsize = 18)\ntext!(ax, CX_B - r * 0.70f0 - 0.05f0, CY_B + 0.07f0;\n      text = \"Actually\\nWorks\", color = col_B,\n      align = (:right, :center), fontsize = 18)\ntext!(ax, CX_C + r * 0.70f0 + 0.05f0, CY_C + 0.07f0;\n      text = \"Still Around\\nin 5 Years\", color = col_C,\n      align = (:left, :center), fontsize = 18)\n\n# Editorial subtitle — below the title, above the diagram\ntext!(ax, 0.50f0, 0.98f0;\n      text = subtitle_str, color = INK_SOFT,\n      align = (:center, :center), fontsize = 12)\n\n# Item labels with visual hierarchy: larger font for items in more overlapping zones\nfor (x, y, label, overlap) in items\n    fs    = overlap == 0 ? 13 : overlap == 1 ? 14 : overlap == 2 ? 15 : 16\n    color = overlap == 0 ? INK_MUTED : INK\n    text!(ax, x, y; text = label, color = color, align = (:center, :center), fontsize = fs)\nend\n\n# Separator for outside items\ntext!(ax, 0.50f0, 0.07f0;\n      text = \"— already gone —\", color = INK_MUTED,\n      align = (:center, :center), fontsize = 11)\n\nsave(\"plot-$(THEME).png\", fig; px_per_unit = 2)\n"}