Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .eslintrc

This file was deleted.

16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
extends: '@mapbox/eslint-config-mapbox',
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.nyc_output
coverage
package-*
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: node_js

node_js:
- 10
- 12
- 12
143 changes: 101 additions & 42 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,132 +1,191 @@
## 8.0.0

#### 2021-08-23
* Changes the `stretchMetadata` option to `extractMetadata`.
* Extends the `extractMetadata` function to support placeholder text elements.

- Changes the `stretchMetadata` option to `extractMetadata`.
- Extends the `extractMetadata` function to support placeholder text elements.

## 7.0.1
* `generateLayout({format:true})` now returns a second argument, which is a layout object that can be sent to generateImage to generate a final image. Normally users would generate this object with `generateLayout({format:false})` but now `generateLayout({format:true})` will provide both the data layout (as first arg) and the image layout (as the second arg).
* Added new function `generateOptimizedImage` which, compared to `generateImage`, expects an options argument as the second option and returns a paletted PNG. Currently this options argument accepts a `quality` property to control the quantization level of the resulting PNG.

- `generateLayout({format:true})` now returns a second argument, which is a layout object that can be sent to generateImage to generate a final image. Normally users would generate this object with `generateLayout({format:false})` but now `generateLayout({format:true})` will provide both the data layout (as first arg) and the image layout (as the second arg).
- Added new function `generateOptimizedImage` which, compared to `generateImage`, expects an options argument as the second option and returns a paletted PNG. Currently this options argument accepts a `quality` property to control the quantization level of the resulting PNG.

## 7.0.0

#### 2020-04-22
* Optimized layout and image generation: 1.5x faster `generateLayout`

- Optimized layout and image generation: 1.5x faster `generateLayout`

## 6.3.0

#### 2020-04-10
* Adds `stretchMetadata` option (defaults to true) to `generateLayout` and `generateLayoutUnique` [#75](https://github.com/mapbox/spritezero/pull/75)
* Removes xtend as a direct dependency

- Adds `stretchMetadata` option (defaults to true) to `generateLayout` and `generateLayoutUnique` [#75](https://github.com/mapbox/spritezero/pull/75)
- Removes xtend as a direct dependency

## 6.2.0

#### 2020-03-09
* Add methods to parse and validate metadata for stretchable icons from SVGs: `extractMetadata` and `validateMetadata`
* Drop support for Node < 10
* Updates Mapnik dependency to 4.4.0

- Add methods to parse and validate metadata for stretchable icons from SVGs: `extractMetadata` and `validateMetadata`
- Drop support for Node < 10
- Updates Mapnik dependency to 4.4.0

## 6.1.2

##### 2019-11-11
* Check if SVG has width/height attributes before encoding as image in `generateLayout` [#69](https://github.com/mapbox/spritezero/pull/69)

- Check if SVG has width/height attributes before encoding as image in `generateLayout` [#69](https://github.com/mapbox/spritezero/pull/69)

## 6.1.1

##### 2019-05-20
* Check if SVG width/height are greater than zero before encoding as image in `generateLayout` [#62](https://github.com/mapbox/spritezero/pull/62)

- Check if SVG width/height are greater than zero before encoding as image in `generateLayout` [#62](https://github.com/mapbox/spritezero/pull/62)

## 6.1.0

##### 2018-06-28
* Updates to Mapnik dependency to 4.0.0

- Updates to Mapnik dependency to 4.0.0

:warning: = breaking change

## 6.0.0

##### 2018-02-22
* Updates Mapnik dependency to 3.7.0
* Drops support for windows

- Updates Mapnik dependency to 3.7.0
- Drops support for windows

## 5.1.0

##### 2017-05-25
* Added removeOversizedIcons boolean to the options args - if set to true, will filter out oversized icons from the response

- Added removeOversizedIcons boolean to the options args - if set to true, will filter out oversized icons from the response

## 5.0.0

##### 2017-04-19
* :warning: change `generateLayout` and `generateLayoutUnique` to accept options arguments and add functionality to pass optional max_size argument

- :warning: change `generateLayout` and `generateLayoutUnique` to accept options arguments and add functionality to pass optional max_size argument

## 4.1.0

##### 2017-04-19
* Updates Mapnik dependency to 3.6.0

- Updates Mapnik dependency to 3.6.0

## 4.0.1

##### 2017-02-13
* Bump ShelfPack dependency to 3.0.0

- Bump ShelfPack dependency to 3.0.0

## 4.0.0

##### 2017-02-12
* :warning: spritezero now a scoped package under @mapbox namespace (#40)

- :warning: spritezero now a scoped package under @mapbox namespace (#40)

## 3.8.0

##### 2016-09-15
* Update to mapnik 3.5.14 (#26)

- Update to mapnik 3.5.14 (#26)

## 3.7.1

##### 2016-09-14
* Pin mapnik dependency at version 3.5.13 (#33)

- Pin mapnik dependency at version 3.5.13 (#33)

## 3.7.0

##### 2016-08-10
* Bump ShelfPack dependency to 2.0.0
* ShelfPack now trims sprite to minimum dimensions after a batch pack
* Make sure heightAscThanNameComparator is transitive (#29)

- Bump ShelfPack dependency to 2.0.0
- ShelfPack now trims sprite to minimum dimensions after a batch pack
- Make sure heightAscThanNameComparator is transitive (#29)

## 3.6.0

##### 2016-06-05
* Perf improvement, replace sort-by with custom comparator (#27)
* Add `generateLayoutUnique` function - map identical images to multiple names (#25)

- Perf improvement, replace sort-by with custom comparator (#27)
- Add `generateLayoutUnique` function - map identical images to multiple names (#25)

## 3.5.0

##### 2016-03-30
* Use ShelfPack binpacker (#22)

- Use ShelfPack binpacker (#22)

## 3.4.0

##### 2016-03-08
* Sort icons array to produce a more deterministic sprite sheet (#24)

- Sort icons array to produce a more deterministic sprite sheet (#24)

## 3.3.0

##### 2016-02-27
* Updated to mapnik 3.5.0

- Updated to mapnik 3.5.0

## 3.2.2

##### 2016-02-03
* Add missing var (#20)

- Add missing var (#20)

## 3.2.1

##### 2016-01-19
* Remove `bin` in `package.json`

- Remove `bin` in `package.json`

## 3.2.0

##### 2016-01-19
* :warning: Remove cli, point to spritezero-cli (#19)

- :warning: Remove cli, point to spritezero-cli (#19)

## 3.1.0

##### 2016-01-13
* Add executeable and documentation

- Add executeable and documentation

## 3.0.2

##### 2016-01-09
* Update dependencies
* Update fixtures and tests

- Update dependencies
- Update fixtures and tests

## 3.0.1

##### 2015-10-10
* Update dependencies

- Update dependencies

## 3.0.0

##### 2015-09-03
* :warning: Changes the `generateLayout` function to be asynchronous (#14)

- :warning: Changes the `generateLayout` function to be asynchronous (#14)

## 2.1.0

##### 2015-08-13
* No longer throws an error if `generateImage()` is supplied with empty list (#13)

- No longer throws an error if `generateImage()` is supplied with empty list (#13)

## 2.0.0

##### 2015-08-05
* :warning: In the second major version, spritezero makes a big pivot: instead of
positioning and compositing raster sprites, it receives and composites vector
sprites composed of SVG data.

- :warning: In the second major version, spritezero makes a big pivot: instead of
positioning and compositing raster sprites, it receives and composites vector
sprites composed of SVG data.
43 changes: 21 additions & 22 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@

#### Guidelines

* Please be respectful to one another.
* Many contributors are volunteering their time. We might not get to your
issue right away. Be patient.
* Other contributors have different backgrounds and perspectives than you do.
Diversity is a community strength.
* We will disagree sometimes. That's ok. When this happens, assume that the
person with whom you disagree is a smart person with good reasons for believing
something different.
* Everyone has bad days. If you find yourself about to be mean to someone,
take a break and cool off. This project will still be here later.
* When you make a mistake, apologize.

- Please be respectful to one another.
- Many contributors are volunteering their time. We might not get to your
issue right away. Be patient.
- Other contributors have different backgrounds and perspectives than you do.
Diversity is a community strength.
- We will disagree sometimes. That's ok. When this happens, assume that the
person with whom you disagree is a smart person with good reasons for believing
something different.
- Everyone has bad days. If you find yourself about to be mean to someone,
take a break and cool off. This project will still be here later.
- When you make a mistake, apologize.

#### We will not tolerate

* Sexualized language or imagery
* Hate speech
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information
* Plagiarism
* Other unethical or unprofessional conduct
- Sexualized language or imagery
- Hate speech
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information
- Plagiarism
- Other unethical or unprofessional conduct

#### Enforcement

Project maintainers commit themselves to fairly enforcing this Code of Conduct.
This means we may:

* Edit or delete harmful comments, code, issues, or other contributions
* Ban harmful users from the project, temporarily or permanently
- Edit or delete harmful comments, code, issues, or other contributions
- Ban harmful users from the project, temporarily or permanently

This Code of Conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community.
Expand Down
3 changes: 1 addition & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Internet Systems Consortium license
===================================
# Internet Systems Consortium license

Copyright (c) 2016, Mapbox

Expand Down
Loading