{"id":20461381,"url":"https://github.com/antvis/antv-spec","last_synced_at":"2026-02-28T05:09:21.744Z","repository":{"id":46026651,"uuid":"386198695","full_name":"antvis/antv-spec","owner":"antvis","description":"A declarative grammar that supports various technology stacks of AntV.","archived":false,"fork":false,"pushed_at":"2022-04-26T14:25:01.000Z","size":9257,"stargazers_count":12,"open_issues_count":8,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-13T00:21:30.609Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://antv.vision/antv-spec/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antvis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-15T07:10:53.000Z","updated_at":"2023-11-06T03:30:15.000Z","dependencies_parsed_at":"2022-08-19T01:11:11.346Z","dependency_job_id":null,"html_url":"https://github.com/antvis/antv-spec","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/antvis/antv-spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fantv-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fantv-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fantv-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fantv-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/antv-spec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fantv-spec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29925683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T12:25:07.910Z","updated_at":"2026-02-28T05:09:21.716Z","avatar_url":"https://github.com/antvis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# antv-spec\nA declarative grammar that supports various technology stacks of AntV.\n\n\u003e WIP: This is still an experimental project. Its purpose is to build a low-level declarative language that can support all AntV visualization libraries(statistic chart, graph, map, etc.) as an infrastructure for intelligent visualization.\n\n## Features\n**schema**: uniform visualization schema for AntV  \n**adaptor**: translate schema to chart library\n\n## Installation\n\n```bash\nnpm install @antv/antv-spec\n```\n\n## Example\n\n```ts\nimport { useEffect } from \"react\";\nimport { AntVSpec, specToG2Plot } from \"@antv/antv-spec\";\n\nexport default function App() {\n  const chartSpec: AntVSpec = {\n    basis: {\n      type: \"chart\"\n    },\n    data: {\n      type: \"json-array\",\n      values: [\n        { year: \"2007\", sales: 28, type: \"A\" },\n        { year: \"2008\", sales: 55, type: \"A\" },\n        { year: \"2009\", sales: 43, type: \"A\" },\n        { year: \"2010\", sales: 91, type: \"A\" },\n        { year: \"2011\", sales: 81, type: \"A\" },\n        { year: \"2012\", sales: 53, type: \"A\" },\n        { year: \"2013\", sales: 19, type: \"A\" },\n        { year: \"2014\", sales: 87, type: \"A\" },\n        { year: \"2015\", sales: 52, type: \"A\" },\n\n        { year: \"2007\", sales: 34, type: \"B\" },\n        { year: \"2008\", sales: 52, type: \"B\" },\n        { year: \"2009\", sales: 70, type: \"B\" },\n        { year: \"2010\", sales: 11, type: \"B\" },\n        { year: \"2011\", sales: 46, type: \"B\" },\n        { year: \"2012\", sales: 79, type: \"B\" },\n        { year: \"2013\", sales: 23, type: \"B\" },\n        { year: \"2014\", sales: 54, type: \"B\" },\n        { year: \"2015\", sales: 99, type: \"B\" }\n      ]\n    },\n    layer: [\n      {\n        mark: {\n          type: \"line\",\n          style: { color: \"#444444\" }\n        },\n        encoding: {\n          x: {\n            field: \"year\",\n            type: \"temporal\"\n          },\n          y: {\n            field: \"sales\",\n            type: \"quantitative\"\n          },\n          color: {\n            field: \"type\",\n            type: \"nominal\",\n            scale: {\n              range: [\"#5c0011\", \"#ffec3d\", \"#7cb305\", \"#08979c\", \"#003a8c\"]\n            }\n          }\n        }\n      }\n    ]\n  };\n\n  useEffect(() =\u003e {\n    specToG2Plot(chartSpec, document.getElementById(\"container\"));\n  });\n\n  return \u003cdiv className=\"container\"\u003e\u003c/div\u003e;\n}\n\n```\n\n\n## Documentation\n\nThis project is still an alpha version. We eagerly welcome any contribution.\n\nFor more usages, please check the [Quick API](./API.md).\n\n## Inspiration\n\n[Vega](https://vega.github.io/vega/) - Vega is a visualization grammar, a declarative language for creating, saving, and sharing interactive visualization designs.\n\n[Vega-Lite](https://vega.github.io/vega-lite/) - Vega-Lite is a high-level grammar of interactive graphics. It provides a concise, declarative JSON syntax to create an expressive range of visualizations for data analysis and presentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fantv-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fantv-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fantv-spec/lists"}