$ show antvis/antvis.github.io
This repository contains the official AntV website, built with Astro and React islands. It serves as the primary marketing and documentation portal for AntV's data visualization libraries (G2, G6, L7, etc.), featuring a hero section, interactive chart demos, a theme customizer that generates downloadable JSON palettes, and a wealth of bilingual (Chinese/English) specification documents covering design principles, chart types, components, and interaction patterns. The site is a static Jekyll-like documentation site, but with substantial client-side interactivity delivered through React components that embed G2Plot and G6 charts. The architecture is a typical modern static site: Astro handles content collections and build, React components are mounted as islands for interactive sections, and JSON files drive most of the home page content. The docs are written in Markdown with frontmatter and use a custom Astro loader to integrate with the @antv/astro-theme-antv theme package. The code is clean and well-organized, with a clear separation between data, libs, and components. The most reusable component is an overflow text truncation utility that gracefully degrades to a tooltip on overflow, demonstrating good engineering practices. While the repository is primarily a content and marketing site, it contains a few genuinely reusable patterns, though most are tightly coupled to the AntV ecosystem. The lack of a lockfile and the use of an older G6 version indicate some technical drift, but the project appears actively maintained with recent commits and CI/CD deployment.
The LLM identified 2 files worth highlighting for reuse:
A React component that automatically detects text overflow (horizontally or vertically) and wraps the content in an Ant Design Tooltip showing the full text when truncated. It uses a ref and componentDidUpdate to re-evaluate overflow on text or style changes, and supports both single-line and multi-line clamping with line-height calculation. This is a self-contained, dependency-light utility that can be extracted to any React project needing robust text ellipsis with a hover tooltip.
An Astro component that renders a color palette grid from a comma-separated string of hex colors, optionally grouped and labeled. It validates colors, supports a sudoku layout, and is used in documentation pages to showcase AntV's color palettes. Though specific to the documentation domain, it's a clean, self-contained utility for displaying color swatches and could be reused in any design system or documentation site.