grammar-of-graphics-and-declarative-visualization — скилл Codex
Скилл помогает строить визуализации табличных данных через Vega-Lite, Vega и Observable Plot. Подходит для декларативных графиков без низкоуровневого рендеринга.
npx skills add openai/plugins --skill grammar-of-graphics-and-declarative-visualization -a codexЧто делает grammar-of-graphics-and-declarative-visualization
Скилл настраивает работу с декларативной графикой на базе связки данных, меток и кодировок. Агент выбирает подходящий уровень абстракции под задачу. Для быстрого анализа на JavaScript применяется Observable Plot. Для переносимых спецификаций и композиции слоев выбирается Vega-Lite, а для более детального контроля используется Vega.
Перед генерацией кода агент приводит структуру таблицы к нужному виду. Скилл заставляет проверять мобильную адаптивность: уменьшение числа подписей, поведение меток на небольших экранах и реакцию на касания. Если графику требуется кастомный лейаут, отрисовка частиц или Canvas с WebGL из-за высокой плотности данных, скилл предписывает передавать задачу D3 или Three.js.
Ставьте этот инструмент, если создаете типовые графики для веб-интерфейсов и хотите получить чистые спецификации вместо ручной отрисовки элементов.
Какие задачи решает
- подобрать инструмент между Observable Plot, Vega-Lite и Vega
- составить декларативную спецификацию графика по табличным данным
- настроить адаптивное отображение диаграмм для мобильных экранов
- определить границу перехода от декларативных спецификаций к D3 и WebGL
Примеры запросов агенту
- Сделай спецификацию Vega-Lite для этого набора данных.
- Что выбрать для этого графика: Plot, Vega-Lite или D3?
- Собери многослойный декларативный график с фасетами и подсказками.
Как установить grammar-of-graphics-and-declarative-visualization
1Через Skills CLI (Vercel)
npx skills add openai/plugins --skill grammar-of-graphics-and-declarative-visualization -a codex2Вручную: положить файлы
.agents/skills/grammar-of-graphics-and-declarative-visualization/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add openai/plugins --skill grammar-of-graphics-and-declarative-visualization -a claude-code2Вручную: положить файлы
~/.claude/skills/grammar-of-graphics-and-declarative-visualization/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/grammar-of-graphics-and-declarative-visualization/
Вручную: положить файлы
.cursor/skills/grammar-of-graphics-and-declarative-visualization/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install openai/plugins grammar-of-graphics-and-declarative-visualization2Вручную: положить файлы
.github/skills/grammar-of-graphics-and-declarative-visualization/SKILL.mdКомандой платформы
gemini skills install https://github.com/openai/plugins --path plugins/build-web-data-visualization/skills/grammar-of-graphics-and-declarative-visualizationВручную: положить файлы
.devin/skills/grammar-of-graphics-and-declarative-visualization/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора201
Весь набор →Похожие
Вопросы о grammar-of-graphics-and-declarative-visualization
Как установить grammar-of-graphics-and-declarative-visualization в Codex?
Выполните команду npx skills add openai/plugins --skill grammar-of-graphics-and-declarative-visualization. Файл спецификации сохранится по пути .agents/skills/grammar-of-graphics-and-declarative-visualization/SKILL.md.
Для чего нужен этот скилл?
Он задаёт правила построения графиков через декларативные грамматики. Агент помогает генерировать спецификации для Vega-Lite, Vega или Observable Plot без написания низкоуровневого императивного кода.
Когда скилл рекомендует переходить на D3 или WebGL?
Переход нужен при нестандартных лейаутах, отрисовке 3D, частицах или экстремальной плотности точек на экране. В таких сценариях возможности декларативных грамматик исчерпываются.
Исходный текст
SKILL.md · MIT
--- name: grammar-of-graphics-and-declarative-visualization description: Build data visualizations with declarative grammars. Use when the user needs Vega-Lite, Vega, Observable Plot, or grammar-of-graphics reasoning, especially for tabular charts that do not require bespoke rendering. --- # Grammar of Graphics and Declarative Visualization ## Overview Use this skill as the default implementation path for many tabular charts. Declarative grammars are often the fastest, clearest, and most maintainable route when the chart can be expressed as data plus marks plus encodings plus transforms. This skill covers Vega-Lite, Vega, and Observable Plot. Default to the highest-level tool that cleanly expresses the needed chart and interaction. ## Selection Rules 1. Use Observable Plot for fast exploratory and explanatory charts in JavaScript when concise code is valuable. 2. Use Vega-Lite for portable, declarative specs, multi-view composition, transforms, and embed-friendly chart definitions. 3. Use Vega when the user needs lower-level control that still benefits from a declarative runtime. 4. Leave this skill and route to D3, Canvas, or the Three.js/WebGL skill only when the chart requires bespoke layout, extreme density, GPU-scale rendering, particles, true 3D, or rendering control that the grammar no longer expresses cleanly. ## Working Pattern 1. Normalize the table shape. 2. Name the mark, encodings, transforms, faceting, and interaction model explicitly. 3. Choose the highest-level grammar that supports the chart without contortions. 4. Keep specs readable and portable. 5. Check whether the declarative approach still fits the expected number of simultaneous chart instances on the page. 6. Check mobile portrait and optional landscape behavior: responsive spec, label/tick reduction, hover replacement, touch target policy, and whether the grammar can keep the main visualization visible around controls. 7. Use declarative composition before custom code. ## Output Expectations - Explain why the chosen grammar fits better than bespoke rendering. - Keep the spec readable enough to be reused, embedded, or translated across stacks. - Call out when the declarative path is reaching its limits and a lower-level skill should take over. - Call out whether the grammar can support the mobile concept contract or whether D3, Canvas, WebGL, or framework-owned layout should take over. - For new work, include a technical design section covering instance-count assumptions, performance implications, and the maintenance upside of staying declarative. ## References - Shared theory: - `../../references/foundations/task-abstraction-and-chart-selection.md` - `../../references/foundations/perception-color-and-encoding.md` - `../../references/foundations/mobile-first-responsive-visualization.md` - `../../references/foundations/implementation-design-and-tradeoffs.md` - Skill references: - `./references/vega-lite-and-vega.md` - `./references/observable-plot.md` - `./references/when-to-stay-declarative.md` ## Representative Prompts - "Write a Vega-Lite spec for this dataset." - "Should I use Plot, Vega-Lite, or D3 for this chart?" - "Build a layered declarative chart with faceting and tooltips." - "Tell me when this declarative approach stops being a good fit."
© OpenAI · MIT · openai/plugins