- Changes the
stretchMetadataoption toextractMetadata. - Extends the
extractMetadatafunction to support placeholder text elements.
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 withgenerateLayout({format:false})but nowgenerateLayout({format:true})will provide both the data layout (as first arg) and the image layout (as the second arg).- Added new function
generateOptimizedImagewhich, compared togenerateImage, expects an options argument as the second option and returns a paletted PNG. Currently this options argument accepts aqualityproperty to control the quantization level of the resulting PNG.
- Optimized layout and image generation: 1.5x faster
generateLayout
- Adds
stretchMetadataoption (defaults to true) togenerateLayoutandgenerateLayoutUnique#75 - Removes xtend as a direct dependency
- Add methods to parse and validate metadata for stretchable icons from SVGs:
extractMetadataandvalidateMetadata - Drop support for Node < 10
- Updates Mapnik dependency to 4.4.0
- Check if SVG has width/height attributes before encoding as image in
generateLayout#69
- Check if SVG width/height are greater than zero before encoding as image in
generateLayout#62
- Updates to Mapnik dependency to 4.0.0
- Updates Mapnik dependency to 3.7.0
- Drops support for windows
- Added removeOversizedIcons boolean to the options args - if set to true, will filter out oversized icons from the response
⚠️ changegenerateLayoutandgenerateLayoutUniqueto accept options arguments and add functionality to pass optional max_size argument
- Updates Mapnik dependency to 3.6.0
- Bump ShelfPack dependency to 3.0.0
⚠️ spritezero now a scoped package under @mapbox namespace (#40)
- Update to mapnik 3.5.14 (#26)
- Pin mapnik dependency at version 3.5.13 (#33)
- Bump ShelfPack dependency to 2.0.0
- ShelfPack now trims sprite to minimum dimensions after a batch pack
- Make sure heightAscThanNameComparator is transitive (#29)
- Perf improvement, replace sort-by with custom comparator (#27)
- Add
generateLayoutUniquefunction - map identical images to multiple names (#25)
- Use ShelfPack binpacker (#22)
- Sort icons array to produce a more deterministic sprite sheet (#24)
- Updated to mapnik 3.5.0
- Add missing var (#20)
- Remove
bininpackage.json
⚠️ Remove cli, point to spritezero-cli (#19)
- Add executeable and documentation
- Update dependencies
- Update fixtures and tests
- Update dependencies
⚠️ Changes thegenerateLayoutfunction to be asynchronous (#14)
- No longer throws an error if
generateImage()is supplied with empty list (#13)
⚠️ 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.