{"id":13726973,"url":"https://github.com/antvis/scale","last_synced_at":"2025-04-06T06:14:32.513Z","repository":{"id":32657307,"uuid":"138319745","full_name":"antvis/scale","owner":"antvis","description":"📦 Toolkit for mapping abstract data into visual representation.","archived":false,"fork":false,"pushed_at":"2024-05-13T10:16:43.000Z","size":657,"stargazers_count":57,"open_issues_count":0,"forks_count":17,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-10-29T21:05:31.341Z","etag":null,"topics":["mapping","scale","ticks","visualization"],"latest_commit_sha":null,"homepage":"https://observablehq.com/@antv/aloha-antv-scale","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-22T15:37:21.000Z","updated_at":"2024-10-23T09:23:10.000Z","dependencies_parsed_at":"2023-12-13T18:19:07.992Z","dependency_job_id":"6a25ce8c-1768-4797-9361-ae30d3126dcb","html_url":"https://github.com/antvis/scale","commit_stats":{"total_commits":86,"total_committers":9,"mean_commits":9.555555555555555,"dds":0.4883720930232558,"last_synced_commit":"bce6b2022c0e81c1c899707f9c57ca25682f127c"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fscale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fscale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fscale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antvis%2Fscale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antvis","download_url":"https://codeload.github.com/antvis/scale/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441063,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["mapping","scale","ticks","visualization"],"created_at":"2024-08-03T01:03:33.910Z","updated_at":"2025-04-06T06:14:32.479Z","avatar_url":"https://github.com/antvis.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\u003cb\u003e@antv/scale\u003c/b\u003e\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003e Toolkit for mapping abstract data into visual representation. [Living Demo](https://observablehq.com/@pearmini/antv-scale) · [中文文档](./README.md)\n\n![scale mapping](https://user-images.githubusercontent.com/7856674/116353528-85644a80-a829-11eb-85e4-3463a29000a9.png)\n\n[![Build Status](https://github.com/antvis/scale/workflows/build/badge.svg?branch=master)](https://github.com/antvis/scale/actions)\n[![Coverage Status](https://img.shields.io/coveralls/github/antvis/scale/master.svg)](https://coveralls.io/github/antvis/scale?branch=master)\n[![npm Version](https://img.shields.io/npm/v/@antv/scale.svg)](https://www.npmjs.com/package/@antv/scale)\n[![npm Download](https://img.shields.io/npm/dm/@antv/scale.svg)](https://www.npmjs.com/package/@antv/scale)\n[![npm License](https://img.shields.io/npm/l/@antv/scale.svg)](https://www.npmjs.com/package/@antv/scale)\n\n\u003c/div\u003e\n\n## ✨ Features\n\n- **Powerful**: Ability to customize tickMethod are offered with abundant kinds of scales.\n- **High performance**: Use different methods to cache some state of scales to improve performance.\n- **Fully embrace TypeScript**: All code are written in TypeScript and complete type definition files are provided.\n\n![scale examples](https://gw.alipayobjects.com/mdn/rms_40052e/afts/img/A*Usg2S685JQkAAAAAAAAAAAAAARQnAQ)\n\n## 📦 Installation\n\n```bash\n$ npm install @antv/scale\n```\n\n## 🔨 Getting Started\n\n- Basic usage\n\n```ts\nimport { Linear, LinearOptions } from '@antv/scale';\n\nconst options: LinearOptions = {\n  domain: [0, 10],\n  range: [0, 100],\n};\nconst x = new Linear(options);\n\nx.map(2); // 20\nx.invert(20); // 2\nx.getTicks(); // [0, 2.5, 5, 7.5, 10]\n```\n\n- Customize tickMethod\n\n```ts\nimport { Linear } from '@antv/scale';\n\nconst x = new Linear({\n  domain: [0, 10],\n  range: [0, 100],\n  tickCount: 3,\n  tickMethod: () =\u003e [0, 5, 10],\n});\n\nx.getTicks(); // [0, 5, 10]\n```\n\n## 📎 Links\n\n- [Introduction](https://observablehq.com/@pearmini/antv-scale)\n- [API Reference](./docs/api/readme.md)\n\n## 📮 Contribution\n\n```bash\n$ git clone git@github.com:antvis/scale.git\n\n$ cd scale\n\n$ npm i\n\n$ npm t\n```\n\nThen send a pull request after coding.\n\n## 📄 License\n\nMIT@[AntV](https://github.com/antvis).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fscale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantvis%2Fscale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantvis%2Fscale/lists"}