@elastic/maki

中文文档
6.3.0发布于 2020/04/24CC0-1.0CommonJS零依赖近 30 天下载 3万

Pixel-perfect icons for web cartography

原始使用文档
文档目录7 节
  1. Format
  2. For developers
  3. Note about branches
  4. Icon requests
  5. Workflow for contributing a new Maki icon
  6. Release procedures
  7. License

Travis status FOSSA Status

Maki

A pixel-aligned point of interest icon set made for cartographers.

This repo only contains the source SVG files. Check out maki website to use an icon editing tool and read detailed design guidelines.

Format

  • Source icons are in the SVG file format.
  • Icons are available in two sizes: 11px x 11px and 15px x 15px.
  • Icons should consist only of paths and groups. Paths should only have a d property.
  • Each icon's svg tag should have an id property that corresponds to its filename without the extension. This id property is added automatically as part of a pre-commit hook.

For developers

Maki is ready to be used by developers. Install Maki via NPM:

npm install @mapbox/maki --save

The maki module exports layouts which is an object that can be used to organize and display icons in your app or website. Here's an example usage in Node.js:

var maki = require('@mapbox/maki');

files.forEach(function(fileName, j) {
  maki.layouts.all.forEach(function(icon) {
    fs.readFile(maki.dirname + '/icons/' + icon + '-11.svg', 'utf8', function(err, file) {
      // Read icons as strings in node
      console.log(file);
    });
  });
});

Note about branches

The main branch for the Maki project is master.

The old version of Maki still exists in the mb-pages branch, which must remain intact because a number of old Mapbox projects depend on files it serves from its www/ directory.

Icon requests

Maki welcomes icon requests from people in need of points of interest icons. Open an issue to make a request, and make sure to provide the required information outlined in the issue template.

Workflow for contributing a new Maki icon

Maki also welcomes contributions from designers who need icons for specific points of interest. Check out the design guidelines before opening an issue.

Please follow these steps to contribute to Maki.

1: Create an issue

Open an issue and make sure to provide the required information outlined in the issue template. If your request is for a group of icons, create individual request issues for each icon. This ticket is where all communication and documentation regarding your icon design will occur and reside.

2: Create a branch

create a new branch from the master branch. Name the branch after the icon; for example if you are creating a new ‘garden’ icon, your branch name would be ‘garden’. If the icon request is a group of icons, create one branch for the icon group and name it something succinct and descriptive.

3: Icon design

You are now ready to design your icon. A good place to start is using one of our Illustrator or Inkscape templates, which have the 11 and 15 pixel dimensions set and .svg exporting notes. As you design your icon, post drafts to the ticket for feedback. It's recommended to post after every major draft so that at the end, the entire design process has been documented. This documentation will help future designers contribute to Maki.

If you are designing an icon for another individual, all communication between you and the requestor should occur on the ticket as well.

Finalize the icon design before creating a pull request. To reiterate: try and document from start to finish the design process on the ticket.

4: File check & test

Check your file(s) for extraneous anchor points, make sure the file is a single path and double check the .svg file in a text editor. Open the .svg file in the Maki editor to ensure it is compatible, or run npm test to make sure tests are passing. If the icon cannot be opened by the editor or tests are failing, it's most likely an issue with the geometry or unnecessary code such as css in your .svg file(s).

Every icon in Maki must pass the automated tests in tests/maki.test.js. These tests check the following:

  • Filename must end with '-11.svg' or '-15.svg'.
  • SVG file cannot contain the following elements: rectangle, circle, ellipse, line, polyline, polygon.
  • SVG file cannot contain transformed groups or paths.
  • Both height and width must equal 11 or 15, and height and width must be equal.
  • Height, width, and viewbox must use pixel units.

5: Create a pull request & final review

Create a pull request and if needed, a Maki team member will support you with technical feedback. Make sure to include a link to the relevant ticket in your pull request.

6: Merge to the master branch

After the final review approval, a Maki team member will merge the icon branch to the master branch and close your request ticket.

Release procedures

1: Changelog & publishing the Maki repository

Document all updates that occur in the CHANGELOG.md file under the version number used in the dev branch. Update the version number in the Maki repository package.json file, and run npm publish.

2: Update the Maki website

In the maki-icons repository, update the Maki dependency version number in the package.json file.

License

FOSSA Status

版本与发布记录

@elastic/maki 共发布 4 个版本,首次发布于 2019/08/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
6.3.0latest2020/04/246 年前
6.2.02020/03/216 年前
6.1.12020/03/216 年前
6.1.02019/08/067 年前

关于 @elastic/maki 的常见问题

@elastic/maki 是什么?

Pixel-perfect icons for web cartography

如何安装 @elastic/maki?

在项目目录运行 npm install @elastic/maki,或使用 pnpm add / yarn add / bun add。

@elastic/maki 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/elastic__maki 是否存在。

@elastic/maki 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@elastic/maki 可以商用吗?

@elastic/maki 使用 CC0-1.0 许可。作者放弃著作权,可不受限制地使用。以上为概括,不构成法律意见,请以许可原文为准。

@elastic/maki 的下载量有多少?

根据 npm 官方下载统计,@elastic/maki 在 2026/10/14 – 2026/11/12 这 30 天内被下载 30,069 次,日均约 1,002 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elastic/maki 还在维护吗?

最新版本 6.3.0 发布于 2020/04/24(6 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/08/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。