├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── RELEASE.md ├── docs ├── assets │ ├── anchor.js │ ├── bass-addons.css │ ├── bass.css │ ├── fonts │ │ ├── EOT │ │ │ ├── SourceCodePro-Bold.eot │ │ │ └── SourceCodePro-Regular.eot │ │ ├── LICENSE.txt │ │ ├── OTF │ │ │ ├── SourceCodePro-Bold.otf │ │ │ └── SourceCodePro-Regular.otf │ │ ├── TTF │ │ │ ├── SourceCodePro-Bold.ttf │ │ │ └── SourceCodePro-Regular.ttf │ │ ├── WOFF │ │ │ ├── OTF │ │ │ │ ├── SourceCodePro-Bold.otf.woff │ │ │ │ └── SourceCodePro-Regular.otf.woff │ │ │ └── TTF │ │ │ │ ├── SourceCodePro-Bold.ttf.woff │ │ │ │ └── SourceCodePro-Regular.ttf.woff │ │ ├── WOFF2 │ │ │ ├── OTF │ │ │ │ ├── SourceCodePro-Bold.otf.woff2 │ │ │ │ └── SourceCodePro-Regular.otf.woff2 │ │ │ └── TTF │ │ │ │ ├── SourceCodePro-Bold.ttf.woff2 │ │ │ │ └── SourceCodePro-Regular.ttf.woff2 │ │ └── source-code-pro.css │ ├── github.css │ ├── site.js │ └── style.css └── index.html ├── index.js ├── package-lock.json ├── package.json └── test ├── fixture ├── relative-dimensions.svg ├── sprite-uniq@1.json ├── sprite-uniq@1.png ├── sprite-uniq@2.json ├── sprite-uniq@2.png ├── sprite-uniq@4.json ├── sprite-uniq@4.png ├── sprite@1.json ├── sprite@1.png ├── sprite@2.json ├── sprite@2.png ├── sprite@4.json ├── sprite@4.png └── svg │ ├── aerialway-12.svg │ ├── aerialway-18.svg │ ├── aerialway-24.svg │ ├── airfield-12.svg │ ├── airfield-18.svg │ ├── airfield-24.svg │ ├── airport-12.svg │ ├── airport-18.svg │ ├── airport-24.svg │ ├── alcohol-shop-12.svg │ ├── alcohol-shop-18.svg │ ├── alcohol-shop-24.svg │ ├── america-football-12.svg │ ├── america-football-18.svg │ ├── america-football-24.svg │ ├── art-gallery-12.svg │ ├── art-gallery-18.svg │ ├── art-gallery-24.svg │ ├── bakery-12.svg │ ├── bakery-18.svg │ ├── bakery-24.svg │ ├── bank-12.svg │ ├── bank-18.svg │ ├── bank-24.svg │ ├── bar-12.svg │ ├── bar-18.svg │ ├── bar-24.svg │ ├── baseball-12.svg │ ├── baseball-18.svg │ ├── baseball-24.svg │ ├── basketball-12.svg │ ├── basketball-18.svg │ ├── basketball-24.svg │ ├── beer-12.svg │ ├── beer-18.svg │ ├── beer-24.svg │ ├── bicycle-12.svg │ ├── bicycle-18.svg │ ├── bicycle-24.svg │ ├── building-12.svg │ ├── building-18.svg │ ├── building-24.svg │ ├── bus-12.svg │ ├── bus-18.svg │ ├── bus-24.svg │ ├── cafe-12.svg │ ├── cafe-18.svg │ ├── cafe-24.svg │ ├── camera-12.svg │ ├── camera-18.svg │ ├── camera-24.svg │ ├── campsite-12.svg │ ├── campsite-18.svg │ ├── campsite-24.svg │ ├── car-12.svg │ ├── car-18.svg │ ├── car-24.svg │ ├── cemetery-12.svg │ ├── cemetery-18.svg │ ├── cemetery-24.svg │ ├── chemist-12.svg │ ├── chemist-18.svg │ ├── chemist-24.svg │ ├── cinema-12.svg │ ├── cinema-18.svg │ ├── cinema-24.svg │ ├── circle-12.svg │ ├── circle-18.svg │ ├── circle-24.svg │ ├── circle-stroked-12.svg │ ├── circle-stroked-18.svg │ ├── circle-stroked-24.svg │ ├── city-12.svg │ ├── city-18.svg │ ├── city-24.svg │ ├── clothing-store-12.svg │ ├── clothing-store-18.svg │ ├── clothing-store-24.svg │ ├── college-12.svg │ ├── college-18.svg │ ├── college-24.svg │ ├── commercial-12.svg │ ├── commercial-18.svg │ ├── commercial-24.svg │ ├── cricket-12.svg │ ├── cricket-18.svg │ ├── cricket-24.svg │ ├── cross-12.svg │ ├── cross-18.svg │ ├── cross-24.svg │ ├── dam-12.svg │ ├── dam-18.svg │ ├── dam-24.svg │ ├── danger-12.svg │ ├── danger-18.svg │ ├── danger-24.svg │ ├── dentist-12.svg │ ├── dentist-18.svg │ ├── dentist-24.svg │ ├── disability-12.svg │ ├── disability-18.svg │ ├── disability-24.svg │ ├── dog-park-12.svg │ ├── dog-park-18.svg │ ├── dog-park-24.svg │ ├── embassy-12.svg │ ├── embassy-18.svg │ ├── embassy-24.svg │ ├── emergency-telephone-12.svg │ ├── emergency-telephone-18.svg │ ├── emergency-telephone-24.svg │ ├── entrance-12.svg │ ├── entrance-18.svg │ ├── entrance-24.svg │ ├── farm-12.svg │ ├── farm-18.svg │ ├── farm-24.svg │ ├── fast-food-12.svg │ ├── fast-food-18.svg │ ├── fast-food-24.svg │ ├── ferry-12.svg │ ├── ferry-18.svg │ ├── ferry-24.svg │ ├── fire-station-12.svg │ ├── fire-station-18.svg │ ├── fire-station-24.svg │ ├── fuel-12.svg │ ├── fuel-18.svg │ ├── fuel-24.svg │ ├── garden-12.svg │ ├── garden-18.svg │ ├── garden-24.svg │ ├── gift-12.svg │ ├── gift-18.svg │ ├── gift-24.svg │ ├── golf-12.svg │ ├── golf-18.svg │ ├── golf-24.svg │ ├── grocery-12.svg │ ├── grocery-18.svg │ ├── grocery-24.svg │ ├── hairdresser-12.svg │ ├── hairdresser-18.svg │ ├── hairdresser-24.svg │ ├── harbor-12.svg │ ├── harbor-18.svg │ ├── harbor-24.svg │ ├── heart-12.svg │ ├── heart-18.svg │ ├── heart-24.svg │ ├── heliport-12.svg │ ├── heliport-18.svg │ ├── heliport-24.svg │ ├── hospital-12.svg │ ├── hospital-18.svg │ ├── hospital-24.svg │ ├── ice-cream-12.svg │ ├── ice-cream-18.svg │ ├── ice-cream-24.svg │ ├── industrial-12.svg │ ├── industrial-18.svg │ ├── industrial-24.svg │ ├── land-use-12.svg │ ├── land-use-18.svg │ ├── land-use-24.svg │ ├── laundry-12.svg │ ├── laundry-18.svg │ ├── laundry-24.svg │ ├── library-12.svg │ ├── library-18.svg │ ├── library-24.svg │ ├── lighthouse-12.svg │ ├── lighthouse-18.svg │ ├── lighthouse-24.svg │ ├── lodging-12.svg │ ├── lodging-18.svg │ ├── lodging-24.svg │ ├── logging-12.svg │ ├── logging-18.svg │ ├── logging-24.svg │ ├── london-underground-12.svg │ ├── london-underground-18.svg │ ├── london-underground-24.svg │ ├── maki-12-base.svg │ ├── maki-18-base.svg │ ├── maki-24-base.svg │ ├── maki-icons.svg │ ├── marker-12.svg │ ├── marker-18.svg │ ├── marker-24.svg │ ├── marker-stroked-12.svg │ ├── marker-stroked-18.svg │ ├── marker-stroked-24.svg │ ├── minefield-12.svg │ ├── minefield-18.svg │ ├── minefield-24.svg │ ├── mobilephone-12.svg │ ├── mobilephone-18.svg │ ├── mobilephone-24.svg │ ├── monument-12.svg │ ├── monument-18.svg │ ├── monument-24.svg │ ├── museum-12.svg │ ├── museum-18.svg │ ├── museum-24.svg │ ├── music-12.svg │ ├── music-18.svg │ ├── music-24.svg │ ├── oil-well-12.svg │ ├── oil-well-18.svg │ ├── oil-well-24.svg │ ├── park-12.svg │ ├── park-18.svg │ ├── park-24.svg │ ├── park2-12.svg │ ├── park2-18.svg │ ├── park2-24.svg │ ├── parking-12.svg │ ├── parking-18.svg │ ├── parking-24.svg │ ├── parking-garage-12.svg │ ├── parking-garage-18.svg │ ├── parking-garage-24.svg │ ├── pharmacy-12.svg │ ├── pharmacy-18.svg │ ├── pharmacy-24.svg │ ├── pitch-12.svg │ ├── pitch-18.svg │ ├── pitch-24.svg │ ├── place-of-worship-12.svg │ ├── place-of-worship-18.svg │ ├── place-of-worship-24.svg │ ├── playground-12.svg │ ├── playground-18.svg │ ├── playground-24.svg │ ├── police-12.svg │ ├── police-18.svg │ ├── police-24.svg │ ├── polling-place-12.svg │ ├── polling-place-18.svg │ ├── polling-place-24.svg │ ├── post-12.svg │ ├── post-18.svg │ ├── post-24.svg │ ├── prison-12.svg │ ├── prison-18.svg │ ├── prison-24.svg │ ├── rail-12.svg │ ├── rail-18.svg │ ├── rail-24.svg │ ├── rail-above-12.svg │ ├── rail-above-18.svg │ ├── rail-above-24.svg │ ├── rail-light-12.svg │ ├── rail-light-18.svg │ ├── rail-light-24.svg │ ├── rail-metro-12.svg │ ├── rail-metro-18.svg │ ├── rail-metro-24.svg │ ├── rail-underground-12.svg │ ├── rail-underground-18.svg │ ├── rail-underground-24.svg │ ├── religious-christian-12.svg │ ├── religious-christian-18.svg │ ├── religious-christian-24.svg │ ├── religious-jewish-12.svg │ ├── religious-jewish-18.svg │ ├── religious-jewish-24.svg │ ├── religious-muslim-12.svg │ ├── religious-muslim-18.svg │ ├── religious-muslim-24.svg │ ├── restaurant-12.svg │ ├── restaurant-18.svg │ ├── restaurant-24.svg │ ├── roadblock-12.svg │ ├── roadblock-18.svg │ ├── roadblock-24.svg │ ├── rocket-12.svg │ ├── rocket-18.svg │ ├── rocket-24.svg │ ├── sample.svg │ ├── school-12.svg │ ├── school-18.svg │ ├── school-24.svg │ ├── scooter-12.svg │ ├── scooter-18.svg │ ├── scooter-24.svg │ ├── shop-12.svg │ ├── shop-18.svg │ ├── shop-24.svg │ ├── skiing-12.svg │ ├── skiing-18.svg │ ├── skiing-24.svg │ ├── slaughterhouse-12.svg │ ├── slaughterhouse-18.svg │ ├── slaughterhouse-24.svg │ ├── soccer-12.svg │ ├── soccer-18.svg │ ├── soccer-24.svg │ ├── square-12.svg │ ├── square-18.svg │ ├── square-24.svg │ ├── square-stroked-12.svg │ ├── square-stroked-18.svg │ ├── square-stroked-24.svg │ ├── star-12.svg │ ├── star-18.svg │ ├── star-24.svg │ ├── star-stroked-12.svg │ ├── star-stroked-18.svg │ ├── star-stroked-24.svg │ ├── suitcase-12.svg │ ├── suitcase-18.svg │ ├── suitcase-24.svg │ ├── swimming-12.svg │ ├── swimming-18.svg │ ├── swimming-24.svg │ ├── telephone-12.svg │ ├── telephone-18.svg │ ├── telephone-24.svg │ ├── tennis-12.svg │ ├── tennis-18.svg │ ├── tennis-24.svg │ ├── theatre-12.svg │ ├── theatre-18.svg │ ├── theatre-24.svg │ ├── toilets-12.svg │ ├── toilets-18.svg │ ├── toilets-24.svg │ ├── town-12.svg │ ├── town-18.svg │ ├── town-24.svg │ ├── town-hall-12.svg │ ├── town-hall-18.svg │ ├── town-hall-24.svg │ ├── triangle-12.svg │ ├── triangle-18.svg │ ├── triangle-24.svg │ ├── triangle-stroked-12.svg │ ├── triangle-stroked-18.svg │ ├── triangle-stroked-24.svg │ ├── unique-24-copy.svg │ ├── unique-24.svg │ ├── village-12.svg │ ├── village-18.svg │ ├── village-24.svg │ ├── warehouse-12.svg │ ├── warehouse-18.svg │ ├── warehouse-24.svg │ ├── waste-basket-12.svg │ ├── waste-basket-18.svg │ ├── waste-basket-24.svg │ ├── water-12.svg │ ├── water-18.svg │ ├── water-24.svg │ ├── wetland-12.svg │ ├── wetland-18.svg │ ├── wetland-24.svg │ ├── width-height.svg │ ├── zoo-12.svg │ ├── zoo-18.svg │ └── zoo-24.svg ├── regenerate.js └── test.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true 4 | }, 5 | "extends": [ 6 | "eslint:recommended" 7 | ], 8 | "rules": { 9 | "dot-notation": 2, 10 | "eqeqeq": [2, "smart"], 11 | "indent": [0, 4], 12 | "keyword-spacing": 2, 13 | "linebreak-style": [2, "unix"], 14 | "no-caller": 2, 15 | "no-catch-shadow": 2, 16 | "no-div-regex": 2, 17 | "no-extend-native": 2, 18 | "no-extra-bind": 2, 19 | "no-floating-decimal": 2, 20 | "no-implied-eval": 2, 21 | "no-invalid-this": 2, 22 | "no-iterator": 2, 23 | "no-labels": 2, 24 | "no-label-var": 2, 25 | "no-lone-blocks": 2, 26 | "no-loop-func": 2, 27 | "no-multi-str": 2, 28 | "no-native-reassign": 2, 29 | "no-new": 2, 30 | "no-new-func": 2, 31 | "no-new-wrappers": 2, 32 | "no-octal": 2, 33 | "no-octal-escape": 2, 34 | "no-process-env": 2, 35 | "no-proto": 2, 36 | "no-return-assign": 0, 37 | "no-script-url": 2, 38 | "no-self-compare": 2, 39 | "no-sequences": 2, 40 | "no-shadow": 0, 41 | "no-shadow-restricted-names": 2, 42 | "no-throw-literal": 2, 43 | "no-unneeded-ternary": 2, 44 | "no-unused-expressions": 2, 45 | "no-unexpected-multiline": 2, 46 | "no-unused-vars": 1, 47 | "no-void": 2, 48 | "no-warning-comments": 1, 49 | "no-with": 2, 50 | "no-use-before-define": [0, "nofunc"], 51 | "semi": [2, "always"], 52 | "semi-spacing": 2, 53 | "space-unary-ops": 2, 54 | "wrap-regex": 0, 55 | "quotes": [2, "single"] 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .nyc_output 3 | coverage/ 4 | node_modules/ 5 | npm-debug.log 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .nyc_output 3 | .travis.yml 4 | coverage/ 5 | node_modules/ 6 | npm-debug.log 7 | test/ 8 | docs 9 | .eslintrc 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - '10' 5 | env: 6 | - CXX=g++-4.8 7 | addons: 8 | apt: 9 | sources: 10 | - ubuntu-toolchain-r-test 11 | packages: 12 | - g++-4.8 13 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | #### Guidelines 4 | 5 | * Please be respectful to one another. 6 | * Many contributors are volunteering their time. We might not get to your 7 | issue right away. Be patient. 8 | * Other contributors have different backgrounds and perspectives than you do. 9 | Diversity is a community strength. 10 | * We will disagree sometimes. That's ok. When this happens, assume that the 11 | person with whom you disagree is a smart person with good reasons for believing 12 | something different. 13 | * Everyone has bad days. If you find yourself about to be mean to someone, 14 | take a break and cool off. This project will still be here later. 15 | * When you make a mistake, apologize. 16 | 17 | 18 | #### We will not tolerate 19 | 20 | * Sexualized language or imagery 21 | * Hate speech 22 | * Personal attacks 23 | * Trolling or insulting/derogatory comments 24 | * Public or private harassment 25 | * Publishing other's private information 26 | * Plagiarism 27 | * Other unethical or unprofessional conduct 28 | 29 | #### Enforcement 30 | 31 | Project maintainers commit themselves to fairly enforcing this Code of Conduct. 32 | This means we may: 33 | 34 | * Edit or delete harmful comments, code, issues, or other contributions 35 | * Ban harmful users from the project, temporarily or permanently 36 | 37 | This Code of Conduct applies both within project spaces and in public spaces when an 38 | individual is representing the project or its community. 39 | 40 | Instances of unacceptable behavior may be reported privately to the project maintainers. 41 | 42 | #### See Also 43 | 44 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org). 45 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Internet Systems Consortium license 2 | =================================== 3 | 4 | Copyright (c) 2016, Mapbox 5 | 6 | Permission to use, copy, modify, and/or distribute this software for any purpose 7 | with or without fee is hereby granted, provided that the above copyright notice 8 | and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 11 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 12 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 13 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 14 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 16 | THIS SOFTWARE. 17 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | ## Release Checklist 2 | 3 | #### Update version, docs, tag, and publish 4 | - [ ] git checkout master 5 | - [ ] npm install 6 | - [ ] npm run test 7 | - [ ] Update CHANGELOG 8 | - [ ] Update version number in `package.json` 9 | - [ ] npm run docs 10 | - [ ] git add . 11 | - [ ] git commit -m 'vA.B.C' 12 | - [ ] git tag vA.B.C 13 | - [ ] git push origin master vA.B.C 14 | - [ ] npm publish 15 | -------------------------------------------------------------------------------- /docs/assets/bass-addons.css: -------------------------------------------------------------------------------- 1 | .input { 2 | font-family: inherit; 3 | display: block; 4 | width: 100%; 5 | height: 2rem; 6 | padding: .5rem; 7 | margin-bottom: 1rem; 8 | border: 1px solid #ccc; 9 | font-size: .875rem; 10 | border-radius: 3px; 11 | box-sizing: border-box; 12 | } 13 | -------------------------------------------------------------------------------- /docs/assets/fonts/EOT/SourceCodePro-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/EOT/SourceCodePro-Bold.eot -------------------------------------------------------------------------------- /docs/assets/fonts/EOT/SourceCodePro-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/EOT/SourceCodePro-Regular.eot -------------------------------------------------------------------------------- /docs/assets/fonts/OTF/SourceCodePro-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/OTF/SourceCodePro-Bold.otf -------------------------------------------------------------------------------- /docs/assets/fonts/OTF/SourceCodePro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/OTF/SourceCodePro-Regular.otf -------------------------------------------------------------------------------- /docs/assets/fonts/TTF/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/TTF/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 -------------------------------------------------------------------------------- /docs/assets/fonts/source-code-pro.css: -------------------------------------------------------------------------------- 1 | @font-face{ 2 | font-family: 'Source Code Pro'; 3 | font-weight: 400; 4 | font-style: normal; 5 | font-stretch: normal; 6 | src: url('EOT/SourceCodePro-Regular.eot') format('embedded-opentype'), 7 | url('WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'), 8 | url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'), 9 | url('OTF/SourceCodePro-Regular.otf') format('opentype'), 10 | url('TTF/SourceCodePro-Regular.ttf') format('truetype'); 11 | } 12 | 13 | @font-face{ 14 | font-family: 'Source Code Pro'; 15 | font-weight: 700; 16 | font-style: normal; 17 | font-stretch: normal; 18 | src: url('EOT/SourceCodePro-Bold.eot') format('embedded-opentype'), 19 | url('WOFF2/TTF/SourceCodePro-Bold.ttf.woff2') format('woff2'), 20 | url('WOFF/OTF/SourceCodePro-Bold.otf.woff') format('woff'), 21 | url('OTF/SourceCodePro-Bold.otf') format('opentype'), 22 | url('TTF/SourceCodePro-Bold.ttf') format('truetype'); 23 | } 24 | -------------------------------------------------------------------------------- /docs/assets/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .diff .hljs-header, 18 | .hljs-javadoc { 19 | color: #998; 20 | font-style: italic; 21 | } 22 | 23 | .hljs-keyword, 24 | .css .rule .hljs-keyword, 25 | .hljs-winutils, 26 | .nginx .hljs-title, 27 | .hljs-subst, 28 | .hljs-request, 29 | .hljs-status { 30 | color: #1184CE; 31 | } 32 | 33 | .hljs-number, 34 | .hljs-hexcolor, 35 | .ruby .hljs-constant { 36 | color: #ed225d; 37 | } 38 | 39 | .hljs-string, 40 | .hljs-tag .hljs-value, 41 | .hljs-phpdoc, 42 | .hljs-dartdoc, 43 | .tex .hljs-formula { 44 | color: #ed225d; 45 | } 46 | 47 | .hljs-title, 48 | .hljs-id, 49 | .scss .hljs-preprocessor { 50 | color: #900; 51 | font-weight: bold; 52 | } 53 | 54 | .hljs-list .hljs-keyword, 55 | .hljs-subst { 56 | font-weight: normal; 57 | } 58 | 59 | .hljs-class .hljs-title, 60 | .hljs-type, 61 | .vhdl .hljs-literal, 62 | .tex .hljs-command { 63 | color: #458; 64 | font-weight: bold; 65 | } 66 | 67 | .hljs-tag, 68 | .hljs-tag .hljs-title, 69 | .hljs-rules .hljs-property, 70 | .django .hljs-tag .hljs-keyword { 71 | color: #000080; 72 | font-weight: normal; 73 | } 74 | 75 | .hljs-attribute, 76 | .hljs-variable, 77 | .lisp .hljs-body { 78 | color: #008080; 79 | } 80 | 81 | .hljs-regexp { 82 | color: #009926; 83 | } 84 | 85 | .hljs-symbol, 86 | .ruby .hljs-symbol .hljs-string, 87 | .lisp .hljs-keyword, 88 | .clojure .hljs-keyword, 89 | .scheme .hljs-keyword, 90 | .tex .hljs-special, 91 | .hljs-prompt { 92 | color: #990073; 93 | } 94 | 95 | .hljs-built_in { 96 | color: #0086b3; 97 | } 98 | 99 | .hljs-preprocessor, 100 | .hljs-pragma, 101 | .hljs-pi, 102 | .hljs-doctype, 103 | .hljs-shebang, 104 | .hljs-cdata { 105 | color: #999; 106 | font-weight: bold; 107 | } 108 | 109 | .hljs-deletion { 110 | background: #fdd; 111 | } 112 | 113 | .hljs-addition { 114 | background: #dfd; 115 | } 116 | 117 | .diff .hljs-change { 118 | background: #0086b3; 119 | } 120 | 121 | .hljs-chunk { 122 | color: #aaa; 123 | } 124 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@elastic/spritezero", 3 | "version": "6.2.1", 4 | "main": "index.js", 5 | "description": "small opinionated sprites", 6 | "author": "Tom MacWright", 7 | "license": "ISC", 8 | "repository": "elastic/spritezero", 9 | "bugs": "https://github.com/mapbox/spritezero/issues", 10 | "keywords": [ 11 | "sprite", 12 | "images", 13 | "icons", 14 | "json" 15 | ], 16 | "dependencies": { 17 | "@elastic/fontnik": "0.1.0", 18 | "@mapbox/shelf-pack": "~3.0.0", 19 | "jsdom": "^15.1.1", 20 | "json-stable-stringify": "^1.0.1", 21 | "mapnik": "^4.4.0", 22 | "pngjs": "^3.4.0", 23 | "queue-async": "^1.2.1", 24 | "svgpath": "^2.2.2", 25 | "xtend": "^4.0.1" 26 | }, 27 | "devDependencies": { 28 | "documentation": "4.0.0-beta10", 29 | "eslint": "^3.9.0", 30 | "glob": "^7.1.0", 31 | "greenkeeper-postpublish": "^1.0.1", 32 | "tap": "^10.1.0" 33 | }, 34 | "engines": { 35 | "node": ">=10.0.0" 36 | }, 37 | "scripts": { 38 | "docs": "documentation build index.js --lint --github --format html --output docs/", 39 | "lint": "eslint index.js test/", 40 | "regenerate-fixtures": "node test/regenerate.js", 41 | "test": "npm run lint && tap --cov test/test.js", 42 | "postpublish": "greenkeeper-postpublish" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /test/fixture/sprite-uniq@1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite-uniq@1.png -------------------------------------------------------------------------------- /test/fixture/sprite-uniq@2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite-uniq@2.png -------------------------------------------------------------------------------- /test/fixture/sprite-uniq@4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite-uniq@4.png -------------------------------------------------------------------------------- /test/fixture/sprite@1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite@1.png -------------------------------------------------------------------------------- /test/fixture/sprite@2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite@2.png -------------------------------------------------------------------------------- /test/fixture/sprite@4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/spritezero/f770658b647ee2e2dbf52e3a581419a2d985bb94/test/fixture/sprite@4.png -------------------------------------------------------------------------------- /test/fixture/svg/aerialway-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 17 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/fixture/svg/aerialway-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 17 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/fixture/svg/airport-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/airport-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/alcohol-shop-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 42 | 47 | 48 | 49 | 56 | 57 | -------------------------------------------------------------------------------- /test/fixture/svg/bakery-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 33 | 35 | 40 | 45 | 46 | 47 | 54 | 55 | -------------------------------------------------------------------------------- /test/fixture/svg/beer-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/beer-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/building-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/building-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/bus-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/camera-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/camera-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/camera-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/cemetery-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/cemetery-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/chemist-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 38 | 44 | 45 | 52 | 53 | -------------------------------------------------------------------------------- /test/fixture/svg/chemist-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/circle-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 16 | 17 | 19 | image/svg+xml 20 | 22 | 23 | 24 | 25 | 26 | 29 | 33 | 35 | 40 | 45 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/circle-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 16 | 17 | 19 | image/svg+xml 20 | 22 | 23 | 24 | 25 | 26 | 29 | 33 | 36 | 41 | 46 | 47 | 48 | 49 | 56 | 57 | -------------------------------------------------------------------------------- /test/fixture/svg/clothing-store-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 33 | 35 | 41 | 47 | 48 | 49 | 56 | 57 | -------------------------------------------------------------------------------- /test/fixture/svg/clothing-store-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/college-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/commercial-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 42 | 47 | 48 | 49 | 56 | 57 | -------------------------------------------------------------------------------- /test/fixture/svg/dentist-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 14 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/fixture/svg/dentist-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 14 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/fixture/svg/dentist-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 14 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/fixture/svg/dog-park-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 15 | 17 | image/svg+xml 18 | 20 | 21 | 22 | 23 | 24 | 26 | 30 | 34 | 41 | 42 | -------------------------------------------------------------------------------- /test/fixture/svg/dog-park-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 15 | 17 | image/svg+xml 18 | 20 | 21 | 22 | 23 | 24 | 26 | 30 | 34 | 41 | 42 | -------------------------------------------------------------------------------- /test/fixture/svg/embassy-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/embassy-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/entrance-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 36 | 41 | 42 | 49 | 50 | -------------------------------------------------------------------------------- /test/fixture/svg/entrance-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/farm-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 42 | 48 | 49 | 50 | 57 | 58 | -------------------------------------------------------------------------------- /test/fixture/svg/farm-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/fire-station-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/fire-station-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/fire-station-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/laundry-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/library-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/lighthouse-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/lighthouse-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/lighthouse-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/logging-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/marker-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/marker-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/mobilephone-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/mobilephone-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/park-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/park-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/place-of-worship-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/place-of-worship-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/post-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-light-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-metro-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-metro-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/rail-metro-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/religious-christian-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/religious-jewish-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/religious-jewish-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/religious-jewish-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/roadblock-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/roadblock-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/roadblock-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/rocket-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/rocket-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/sample.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 20 | 27 | 28 | -------------------------------------------------------------------------------- /test/fixture/svg/scooter-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 37 | 42 | 43 | 50 | 51 | -------------------------------------------------------------------------------- /test/fixture/svg/square-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 35 | 37 | 46 | 55 | 56 | 57 | 58 | 65 | 66 | -------------------------------------------------------------------------------- /test/fixture/svg/square-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 48 | 53 | 54 | 55 | 56 | 63 | 64 | -------------------------------------------------------------------------------- /test/fixture/svg/star-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 39 | 44 | 49 | 50 | 51 | 52 | 59 | 60 | -------------------------------------------------------------------------------- /test/fixture/svg/star-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 38 | 43 | 48 | 49 | 50 | 51 | 58 | 59 | -------------------------------------------------------------------------------- /test/fixture/svg/suitcase-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/suitcase-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/suitcase-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /test/fixture/svg/telephone-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/town-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/town-hall-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/town-hall-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 32 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /test/fixture/svg/unique-24-copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /test/fixture/svg/unique-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /test/fixture/svg/village-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/village-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 47 | 48 | 49 | 56 | 57 | -------------------------------------------------------------------------------- /test/fixture/svg/warehouse-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/warehouse-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/waste-basket-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/water-12.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/water-18.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/water-24.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 32 | 36 | 41 | 46 | 47 | 48 | 55 | 56 | -------------------------------------------------------------------------------- /test/fixture/svg/width-height.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/regenerate.js: -------------------------------------------------------------------------------- 1 | var spritezero = require('..'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | var queue = require('queue-async'); 5 | 6 | function filepaths (dir) { 7 | return fs.readdirSync(dir) 8 | .filter(function (d) { 9 | return !d.match(/^\./); 10 | }) 11 | .map(function (d) { 12 | return path.join(dir, d); 13 | }); 14 | } 15 | 16 | function loadFile (file, callback) { 17 | fs.readFile(file, function (err, res) { 18 | return callback(err, { 19 | svg: res, 20 | id: path.basename(file).replace('.svg', '') 21 | }); 22 | }); 23 | } 24 | 25 | var q = queue(16); 26 | 27 | filepaths(path.resolve(__dirname, 'fixture', 'svg')).forEach(function (file) { 28 | q.defer(loadFile, file); 29 | }); 30 | 31 | q.awaitAll(function (err, buffers) { 32 | [1, 2, 4].forEach(function (ratio) { 33 | spritezero.generateLayout({ imgs: buffers, pixelRatio: ratio, unique: true }, function (err, formattedLayout) { 34 | if (err) throw err; 35 | fs.writeFile( 36 | path.resolve(__dirname, 'fixture', 'sprite@' + ratio + '.json'), 37 | JSON.stringify(formattedLayout, null, 2), 38 | 'utf8', 39 | function (err) { 40 | if (err) throw err; 41 | } 42 | ); 43 | }); 44 | spritezero.generateLayout({ imgs: buffers, pixelRatio: ratio, unique: false }, function (err, layout) { 45 | if (err) throw err; 46 | spritezero.generateImage(layout, function (err, image) { 47 | if (err) throw err; 48 | fs.writeFile( 49 | path.resolve(__dirname, 'fixture', 'sprite@' + ratio + '.png'), 50 | image, 51 | function (err) { 52 | if (err) throw err; 53 | } 54 | ); 55 | }); 56 | }); 57 | }); 58 | }); 59 | --------------------------------------------------------------------------------