Skip to content

Commit 89c6d2d

Browse files
WaylandYangclaude
andcommitted
docs(figures): add 1200x630 social preview + ship PDF artefacts
- New fig_social_preview() in make_figures.py renders a GitHub Social Preview / Twitter card / og:image. Brand block on the left ("DCP", tagline, repo URL, MIT + pip install) and three hero stats on the right: 19 bytes / <16 KB / MCP-compatible, each with a one-line descriptor. - Commit PDF versions of every figure too so the LaTeX build doesn't need a regen step on a fresh clone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e91dc9b commit 89c6d2d

8 files changed

Lines changed: 73 additions & 0 deletions

File tree

docs/paper/figures/arch.pdf

32 KB
Binary file not shown.

docs/paper/figures/footprint.pdf

18 KB
Binary file not shown.
30.8 KB
Binary file not shown.

docs/paper/figures/latency.pdf

23.2 KB
Binary file not shown.

docs/paper/figures/make_figures.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,86 @@ def fig_latency():
362362
# ---------------------------------------------------------------------------
363363
# Driver.
364364

365+
def fig_social_preview():
366+
"""1200x630 PNG for GitHub Social Preview / Twitter card / og:image.
367+
368+
Brand block left, three big stats right. No diagram — the goal is
369+
single-message recognition at thumbnail size.
370+
"""
371+
fig, ax = plt.subplots(figsize=(12, 6.3), facecolor="#0f1d2e")
372+
ax.set_xlim(0, 100); ax.set_ylim(0, 50); ax.axis("off")
373+
ax.set_facecolor("#0f1d2e")
374+
375+
# ── Left half: brand ───────────────────────────────────────────
376+
# "OPEN PROTOCOL" chip
377+
ax.add_patch(mpatches.FancyBboxPatch((4, 44), 28, 4,
378+
boxstyle="round,pad=0.3,rounding_size=0.8",
379+
facecolor="#1f4e79", edgecolor="none"))
380+
ax.text(18, 46, "AN OPEN PROTOCOL",
381+
fontsize=11, color="white", fontweight="bold",
382+
ha="center", va="center")
383+
384+
# Big "DCP" mark
385+
ax.text(8, 33, "DCP",
386+
fontsize=82, color="white", fontweight="bold",
387+
ha="left", va="center", family="serif")
388+
# Underline
389+
ax.add_patch(mpatches.Rectangle((8, 26), 22, 0.4,
390+
facecolor="#9fbedb", edgecolor="none"))
391+
# Subtitle
392+
ax.text(8, 23, "Device Context Protocol",
393+
fontsize=19, color="#9fbedb", ha="left", va="top",
394+
fontweight="bold")
395+
# Tagline
396+
ax.text(8, 16,
397+
"Let LLMs safely control",
398+
fontsize=21, color="white", ha="left", va="top")
399+
ax.text(8, 11.5,
400+
"dollar-class microcontrollers.",
401+
fontsize=21, color="white", ha="left", va="top")
402+
# Footer URL + install
403+
ax.text(8, 5, "github.com/device-context-protocol",
404+
fontsize=13, color="#9fbedb", ha="left", va="center",
405+
family="monospace")
406+
ax.text(8, 2, "MIT · pip install pydcp",
407+
fontsize=11, color="#7090a8", ha="left", va="center",
408+
family="monospace", style="italic")
409+
410+
# ── Right half: three stat rows ────────────────────────────────
411+
# Vertical separator
412+
ax.add_patch(mpatches.Rectangle((54, 6), 0.15, 38,
413+
facecolor="#2d4a6a", edgecolor="none"))
414+
415+
# Each stat: big hero number on row 1, single descriptor line on row 2.
416+
# Unit is baked into the descriptor so it can never collide with the number.
417+
stats = [
418+
(38, "19", "bytes — typical call on the wire"),
419+
(24, "<16 KB", "firmware footprint on an ESP32"),
420+
(10, "MCP", "compatible — zero-config in Claude Desktop"),
421+
]
422+
for y, num, desc in stats:
423+
# big hero number / word
424+
ax.text(58, y, num,
425+
fontsize=52,
426+
color="#9fbedb", fontweight="bold",
427+
ha="left", va="center")
428+
# descriptor line directly below
429+
ax.text(58, y - 6, desc,
430+
fontsize=13, color="white",
431+
ha="left", va="top", linespacing=1.3)
432+
433+
fig.subplots_adjust(left=0, right=1, top=1, bottom=0)
434+
save(fig, "social_preview")
435+
436+
365437
def main():
366438
print("Generating figures to", HERE)
367439
fig_architecture()
368440
fig_wire_format()
369441
fig_footprint()
370442
fig_hallucination()
371443
fig_latency()
444+
fig_social_preview()
372445
print("Done.")
373446

374447

36.4 KB
Binary file not shown.
147 KB
Loading

docs/paper/figures/wire_format.pdf

39.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)