Recent Releases of svgtiler

svgtiler - v3.4.1

  • New --use-defs option wraps <symbol>s etc. in <defs>, which shouldn't be necessary but works around an Inkscape bug with <symbol>s nested inside <symbol>s, which arise e.g. when combining SVG Tiler outputs together with SVG Tiler.

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.4.0...v3.4.1

- CoffeeScript
Published by edemaine 6 months ago

svgtiler - v3.4.0

  • External SVG files (loaded via either a mapping to filename.svg or by calling require("filename.svg")) get their ids/hrefs automatically prefixed by a globally unique prefix based on the filename, to avoid id collisions especially between multiple included files.
    • In particular, this makes it easy to use SVG Tiler to combine together other SVG Tiler outputs, such as when drawing gadgets and then gadget assemblies.
    • Thanks to @slef for finding this issue and helping write the fix.
  • SVG Tiler now warns if the output SVG has duplicate ids, which is invalid XML/SVG. This will help with future debugging, such as when manually building ids in mappings.

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.3.0...v3.4.0

- CoffeeScript
Published by edemaine 6 months ago

svgtiler - v3.3.0

  • New file type: .psv is Pipe-Separated Values which uses separator |. This separator is both uncommon and looks nice to humans (unlike tabs in .tsv). It also looks like Markdown tables (but keys aren't automatically trimmed of whitespace).
  • New example: Mario crossover gadget
  • Easier debugging of SVG parse errors on the web: detect and display <parseerror>s generated by web platform's XML parser
  • Fix --margin without --uneven (previously added an extra blank row at the end) (#110)
  • Fix path handling on Windows (previously, absolute paths with drive names sometimes got directories such as ./ prepended, which in particular made require buggy)
  • Fix handling of absent boundingBox/overflowBox (probably just occurred on web)
  • Fix documentation (links, Mario palettes)

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.2.1...v3.3.0

- CoffeeScript
Published by edemaine 9 months ago

svgtiler - v3.2.1

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.2.0...v3.2.1

- CoffeeScript
Published by edemaine over 1 year ago

svgtiler - v3.2.0

  • LaTeX <text> alignment (with -t / --tex) improvements:
    • Fix text-align support: previously, the emitted \llap/\rlap was backwards
    • Use \makebox(0,0)[...] instead of \llap/\rlap to enable:
    • Support alignment-baseline, specifically top/text-top for t, middle/central for vertical centering behavior of \makebox, and anything else for b (effectively the default, as before).

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.8...v3.2.0

- CoffeeScript
Published by edemaine over 1 year ago

svgtiler - v3.1.8

  • Support non-.xls* files (such as .ods files) which lack sheet metadata, but warn that such files don't support "hidden sheet" detection. (#108)

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.7...v3.1.8

- CoffeeScript
Published by edemaine over 1 year ago

svgtiler - v3.1.7

  • Fix bug with global defs not getting assigned the correct id when re-used

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.6...v3.1.7

- CoffeeScript
Published by edemaine almost 2 years ago

svgtiler - v3.1.6

  • The Witness definitions are now much more extensive, thanks to the corresponding paper, with several more examples
  • API documentation fleshed out more, in particular relating to DOM methods
  • Fix handling of spaces in JSX (#107)
  • Upgrade babel, glob, preact, stylus, xmldom dependencies

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.5...v3.1.6

- CoffeeScript
Published by edemaine over 2 years ago

svgtiler - v3.1.5

  • Update dependencies, in particular removing some (unlikely) security issues
  • Examples improvements
    • Mario tileset now includes items and allows for firebars made of multiple fires. Example of Mario clause gadget.
    • Fix tests of unevenLengths

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.4...v3.1.5

- CoffeeScript
Published by edemaine over 2 years ago

svgtiler - v3.1.4

  • Fix re-use of global svgtiler.defs in multiple drawings

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.3...v3.1.4

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v3.1.3

  • Fix wrapping to keep z-index, boundingBox, overflow properties of top-level tag. This is useful with layer stacking via arrays, for example, where we don't need a viewBox in any but the first layer.
  • Fix paths for re-used (cached) mapping files from multiple directories. Previously, if you re-used a file from multiple directories (when recursing into directories), relative paths might not work.
  • Improve "bad SVG Tiler version number" error message to say how to upgrade (npm install -g svgtiler@latest).

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.2...v3.1.3

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v3.1.2

  • Fix: Don't automatically set viewBox of svgtiler.added content. This was causing issues from <rect> or <image> with width and height setting the wrong bounding box (because x and y was ignored).
  • Fix global svgtiler.def content used in svgtiler.add content (which previously wasn't getting checked so the def didn't get included).

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.1...v3.1.2

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v3.1.1

  • Fix boundingBox handling of null values to have zero impact on x or y dimensions of bounding box

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.1.0...v3.1.1

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v3.1.0

  • Render gains forEach helper that iterates over all cells with a Context
  • Render gains context helper to make new Context instances at arbitrary locations
  • Context gains startsWith/endsWith shortcut helpers (to query the key even when it might be undefined)
  • Empty fragments returned from mapping now treated like empty symbols (just like empty-string SVG content); previously crashed (#104)
  • Empty content returned from mapping always treated as having width/height 0 instead of warning
  • Not-first symbols in an array stack no longer warn about missing width/height (#105)
  • Documentation improvements:
    • Render class
    • key is undefined, not null, when out of bounds
    • How to upgrade with NPM

Full Changelog: https://github.com/edemaine/svgtiler/compare/v3.0.0...v3.1.0

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v3.0.0

  • Major rewrite to improve usage and add a ton of features, including Maketiles, stacked symbols in a single tile, automatically dynamic map functions, arbitrary pre/postprocessing, global underlays/overlays, <def>s support, better SVG cropping, improved performance, and smaller SVG outputs.
  • New "Maketile" feature for setting default svgtiler command-line arguments (replacing the need for Makefiles and make). (#84, #99)
    • Maketile.args can specify default command-line arguments, as if they were in a shell. In particular, you can use glob patterns like **/*.asc, quotes and backslash escapes, and comments via #. Unlike shells, you can freely use multiple lines.
    • Maketile.js or Maketile.coffee can export make (or export default) with a function that runs svgtiler with computed arguments.
    • svgtiler(...args) is like running svgtiler on the command line with the specified arguments. String arguments are parsed as in .args, while Array arguments are treated as is without further processing. You can also pass in already loaded Drawing, Mapping, or Style objects.
    • You can write multiple make rules (chosen on the command line) by wrapping functions in an object or Map (similar to mapping files), or write a generic function that takes the rule name as an argument.
    • You can loop over files matching a glob pattern via svgtiler.glob, and check for additional glob pattern matches via svgtiler.match.
    • If you specify an actual file (mapping and/or drawing), default Maketiles get ignored.
    • You can still specify additional arguments to add to what's run by the Maketile, e.g. svgtiler -v.
    • You can specify a differently named Maketile via --maketile.
  • Other command-line changes: (#84, #99)
    • Specifying a directory name on the command line recurses into that directory, running the Maketile within.
    • -O lets you override the generated output filename stem (sans extension), including specifying patterns like prefix_*_suffix (#84)
    • -s key=value sets share.key to the string "value", as shorthand for creating a mapping file that sets share.
    • ( ... ) contains mapping files, -s share settings, and other command-line options to within the parentheses.
    • --bg color for specifying background color. (#57)
    • --use-data adds data-{key,i,j,k} attributes to <use> tags. (#48)
    • --use-href uses href attributes instead of xlink:href
    • --clean for deleting files that would be generated.
    • Support multiple single-dash arguments like -pP as shorthand for -p -P.
    • -v/--verbose option to help debug e.g. Babel processing.
  • Generalized mappings (#13)
    • All function mappings are now automatically dynamic; no need to wrap in a second layer of function.
    • For efficiency, you can force a function (or any mapping) to be treated as static (dependent only on key, not e.g. neighbors) via svgtiler.static wrapper.
    • Function mappings get context as a second argument (after key) in addition to this, which is helpful for passing context around or when using => arrow functions (which can't receive this). Current context can also be found via getContext().
    • Mapping can defined by Map or WeakMap as alternative to raw object.
    • Sequential composition mapping via new Mappings map1, map2 applies both maps and takes the first match, as if two maps were specified on the command line. (#89)
    • Can nest functions, objects, Maps, Mappings, or Arrays (see below) arbitrarily deep.
  • Tiles can stack multiple <symbol>s on top of each other, by returning an array of SVG content from a mapping function (#33). The first non-null symbol defines defines the tile size.
    • Each <symbol> can have its own z-index, for proper component stacking.
    • Deduplication of the individual <symbol>s makes for smaller SVG output.
    • Parallel composition mapping via [map1, map2] applies both maps and stacks one on top of the other (depending on z-index). (#83)
  • <symbol>s in mappings no longer need viewBox; you can simply specify width and height and the viewBox will default to 0 0 width height. You can also specify both and it behaves as in SVG. (#44)
  • boundingBox is the new name for the overflowBox attribute (though the old name is still supported). The box can now be smaller than the layout box (specified via width/height or viewBox), which trims the overall bounding box when possible (#86). Technically this is a BREAKING CHANGE if your overflowBox is smaller than the layout box, but this is what it ought to happen then.
  • .js/.coffee mapping files can now have many new exports:
    • init is useful for applying side effects to the shared object; it runs once per "load" of the mapping file, with mapping files always initing in command-line order (but sometimes more than once to restore an old state).
    • preprocess lets you scan and/or modify the tile keys in a drawing (#79)
    • postprocess lets you draw global content after tiles have been rendered (#81)
    • The mapping object can be exported as map, as a more descriptive name than default.
    • For the final expression to be implicitly exported as the default, it must be an object expression (literal) or function expression; in particular, it cannot be an assignment or function call. Potentially BREAKING CHANGE, but fixes the behavior in many other files.
  • You can specify a background fill (drawn via a big backing rectangle) via the --bg command-line option, or via svgtiler.background(color). (#57) This is a helpful special case of postprocessing.
  • Tiles causing errors in your .js/.coffee code now render as a warning symbol, and will no longer prevent the rest of the drawing from rendering. This makes it easier to see where your mapping code is crashing, and helps you write mappings incrementally. (#49)
  • Drawing file behavior tweaks (BREAKING CHANGES)
    • Lines in ASCII art and CSV/TSV/SSV files are automatically normalized to have the same length, by appending blank strings ('') to short lines (same as XLSX files were). You can get the old behavior via --uneven. (#85)
    • A blank sheet name in a spreadsheet file no longer has _ in the generated filename.
    • If a spreadsheet file has only one sheet and it has a nonblank name, it will be in the generated filename.
  • Examples
    • New grid-graph example, including <marker> demonstration
    • Chess examples with attack graph via postprocess
    • Tilt example modernized to use Preact
    • Improve mario example to use tile arrays to reduce duplication and demonstrate background feature.
    • Modernize to new generalized mappings, e.g. avoiding excess function wrappers and using svgtiler.static
  • API changes:
    • renderDOM (and other render methods) now take mappings and styles as part of general settings object, instead of as separate arguments. These mappings and styles are now automatically cast into Mapping and Style objects if needed. But mappings can no longer be a map object; it needs to be of the form {map: ...} (or {default: ...}), just like what would be import *ed from a mapping file. BREAKING CHANGES
    • svgtiler.def lets you build markers, gradients, clip masks, etc. with automatically generated IDs, with automatic deduplication and removal of unused defs, and makes it easy to reference them. (#38)
    • svgtiler.id lets you build unique IDs, e.g. to re-use a graphical object (#38). (svgtiler.def also uses this internally.)
    • svgtiler.add(svg) to add SVG content to the current rendering, e.g., in a preprocess or postprocess function. This also enables adding metadata like <title> (#94).
    • svgtiler.require(filename) loads a file (including drawings like ASCII art or spreadsheets, mappings, etc.) as if it were on the command line, producing a Mapping, Drawing, Drawings, Style, Args, or SVGFile object.
    • svgtiler.needVersion for specifying version constraints on SVG Tiler, e.g. svgtiler.needVersion('3.x') in your Maketile.coffee. (#99)
    • svgtiler.getContext() to find the current Context for a tile rendering, so you don't need to pass it through to auxiliary functions. svgtiler.runWithContext() allows you to override the result of svgtiler.getContext().
    • Context has new at method for absolute indexing (#78) and set method for modifying keys (#69)
    • Context no longer has symbols or symbol attributes (as cells are now rendered one at a time, instead of all ahead of time).
    • Context object now shared throughout each drawing, so you could store extra drawing-specific data there.
    • Context has render attribute pointing to current Render instance, in addition to drawing attribute pointer to current Drawing instance.
    • Drawing keys are now allowed to be objects other than Strings, e.g., via preprocessing or when creating manually via new Drawing.
    • Drawing has new at, get, and set methods.
    • Drawing's main attribute renamed from data to keys, and Mapping's main attribute renamed from data to map. (#88)
    • Drawing has new margins and unevenLengths attributes for understanding what happened during margin trimming and uneven length fixing.
    • Mapping's module attribute renamed to exports.
    • New Render class represents a rendering task for one Drawing, including all render parameters (e.g. drawing, mappings, and styles).
    • xMin, xMax, yMin, yMax, width, height, and layers attributes which are useful in preprocess and postprocess.
    • id method for generating unique IDs; svgtiler.id calls this.
    • def method for including <defs> content; svgtiler.def calls this.
    • add method for adding SVG content; svgtiler.add calls this.
    • makeDOM, makeSVG, makeTeX replace old renderSVGDOM, renderSVG, and renderTeX methods of Drawing.
    • svgtiler.getRender() to find the current Render job, so you don't need to pass it through to auxiliary functions. svgtiler.runWithRender() to override.
    • New Tile and SVGSymbol classes: Tile represents an expanded (and possibly parsed) tile at a specific location, while SVGSymbol represents the parsed SVG <symbol> content (which can be used by many tiles). These replace Symbol, StaticSymbol, and DynamicSymbol classes. (In particular, avoids name conflict with JS's Symbol.)
    • The constructors for Drawing, Mapping, and Style and their subclasses now make it much easier to create the equivalent of drawing, mapping, and style files without actual files. For most subclasses X of Input, new X(data, options) generally takes the file contents as the first argument. For example, new ASCIIMapping(asc) will now parse an ASCII file, and new StylusStyle(content) will now parse Stylus content.
    • Mappings and Styles are now just Array subclasses. Instead of Mappings.from([map1, map2]), you now just use new Mappings(map1, map2).
    • New Driver class representing command-line-style drivers, with inheritance of options from the parent, to support proper recursion.
    • svgtiler.getDriver() to find the current Driver; svgtiler.runWithDriver() allows you to override the result of svgtiler.getDriver().
  • Optimizations
    • Tile caching/deduplication is now global to each rendering, not local to each dynamic Symbol (#50), enabling re-use when multiple tile keys expand to the same SVG.
    • Tiles with empty SVG content no longer render <symbol>s or <use>s. This can vastly reduce SVG outputs with blank space. (In one case, I got an 82% reduction.)
    • Generated <use> tags usually avoid repeating width and height. (I've seen this reduce large examples with many tiles by ~35%.)
    • Preact VDOM converted more efficiently to internal xmldom, speeding up use of Precat by around 7x. (#82)
    • Inlined images use shorter ids.
  • Bug fixes
    • No longer override existing width/height attributes in <image>s.
    • Remove z-index from style attribute to produce valid SVG.
    • Prevent mappings accidentally matching tile keys constructor and toString.
    • Fix TeX generation when SVG didn't need to rebuild, and when there was an unrecognized symbol.
    • Fix renderDOM accidentally using one element's settings for future elements too.
    • Fixes for running in browser, including Preact VDOM

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.4.1...v3.0.0

- CoffeeScript
Published by edemaine about 3 years ago

svgtiler - v2.4.1

  • Fix svgtiler CLI on Windows, broken in v2.3.0 when fixing Linux, by wrapping CLI in another NodeJS layer
  • Revise Mario example to use new share feature
  • Improve documentation, e.g., what "SKIPPED" and "UNCHANGED" mean.
  • Minor code cleanup

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.4.0...v2.4.1

- CoffeeScript
Published by edemaine over 3 years ago

svgtiler - v2.4.0

  • Selective building (#70): svgtiler no longer builds everything; it now acts like make and selectively builds what it detects needs rebuilding. .svg/.tex files will be recomputed only when they are older than the drawing file, any mapping file (or one of their required dependencies), or any style file; otherwise, you will see the message (SKIPPED). These files only get rewritten (and their date stamp changed) if their contents have actually changed; otherwise, you will see the message (UNCHANGED). This pairs well with the PDF/PNG conversion of v2.3.0, which only does Inkscape conversion when the SVG file is newer: if the SVG doesn't change, it will no longer trigger PDF/PNG conversion.
    • Use -f/--force to override and force all builds, like the old behavior.
  • Support require/importing raster images and SVG files from JavaScript/CoffeeScript mapping files (#73). Returns the SVG content as Preact Virtual DOM, making it easy to modify (e.g., strip off <svg> wrapper or add a child). Raw SVG string also available via require(...).svg.
  • New Chess example illustrating new require feature for loading and manipulating .svg files, dynamic symbol computation, and JSX notation for creating and composing symbols.
  • Provide new share global variable for sharing state between mapping files (#77). For example, this lets you define one mapping file whose behavior is controlled by options specified by one or more other mapping files. (See revised Mario example.)
  • Add match method to Context for simpler RegExp matching (previously documented by not implemented)
  • Omit SVG Tiler version number from generated .tex files, for consistent builds and version control across multiple users
  • Warn instead of crash when mapping returns string
  • Fix multiple xmlns:xlink attributes arising when embedding using .svg files directly inside tiles.
  • Fix removal of SVG/XML comment headers in .svg source files (when require/importing and for namespace mangling)
  • Remove examples directory from NPM package, reducing package size from 1.1 MB (135.6 kB compressed) to 184.9 kB (55.8 kB compressed), for faster installation.
  • Document -i/--inkscape option
  • Documentation now has table of contents for easier navigation

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.3.0...v2.4.0

- CoffeeScript
Published by edemaine over 3 years ago

svgtiler - v2.3.0

  • More efficient conversion of SVG files to PDF/PNG via a new spin-off project svgink. (#75)
  • You can now specify an .svg file (drawn with another tool) directly on the command line to just convert it to PDF/PNG. (Alternatively, you can run svgink directly.) (#75)
  • New command-line options -f/--force to force conversion.
  • Bug fix for Linux which prevented v2.2.0 from running.
  • API change: renamed SVGTilerException to SVGTilerError.

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.2.0...v2.3.0

- CoffeeScript
Published by edemaine over 3 years ago

svgtiler - v2.2.0

  • .js and .coffee mapping files are now loaded as NodeJS modules. (Previously, they were run as special functions.)
    • Makes these files more interoperable when using them as mappings vs. via require or import.
    • Reveals additional Node features (e.g. module global)
    • Enables a lot of other exciting features:
  • New support for import syntax as an alternative to require.
  • New ways to specify the mapping from a mapping file: export default mapping or exports.default = mapping. You can still just write the mapping at the end of the file.
  • required and imported modules can use JSX syntax, so you can share JSX code between mapping files. (#65)
  • Source maps are now fully supported, which means errors from your CoffeeScript mapping files will now have correct line numbers. (#56)
  • Command-line interface has new options for setting the output directory, helping you keep organized. (#58)
    • -o/--output sets an overall default output directory
    • -os/--output-svg, -op/--output-pdf, -oP/--output-png, -ot/--output-tex control output directory by file type
  • API changes to support a settings object instead of overriding class static attributes. (#47)
    • All settings can now be overridden in renderDOM via data-* attributes.
    • New defaultSettings exported object to modify defaults.
    • Replaces old undocumented renderDOMDefaults object.
    • Replaces old undocumented overrides: Drawing.inlineImages, Drawing.keepMargins, Drawing.useHref, Drawings.keepHidden, Symbol.svgEncoding, Symbol.forceWidth, Symbol.forceHeight, Symbol.texText, Symbol.overflowDefault
  • xmldom upgrade means that > is now escaped as &gt;. This can affect CSS output, but should make the resulting SVG easier to parse.

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.1.1...v2.2.0

- CoffeeScript
Published by edemaine almost 4 years ago

svgtiler - v2.1.1

  • Fix support for DOS-formatted (\r\n newlines) and old Mac-formatted (\r newlines) .txt files

Full Changelog: https://github.com/edemaine/svgtiler/compare/v2.1.0...v2.1.1

- CoffeeScript
Published by edemaine almost 4 years ago

svgtiler - v2.1.0

  • New renderDOM API feature for rendering DOM elements that contain drawings (e.g. ASCII art) directly into SVG (#64). See these slides for an example of usage.
  • Mapping API now supports direct construction of a mapping via new Mapping(data) where data is an object or function. (Previously, you had to create a new Mapping and then call the load method.)
  • Document above subset of API as stable

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v2.0.1

  • Update xmldom, improving SVG output in edge cases, in particular addressing a security vulnerability
  • Update Babel and xlsx

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v2.0.0

  • BREAKING CHANGE: Switch from preserveAspectRatio="xMinYMin meet" to default preserveAspectRatio="xMidyMid meet" (centering), which seems more useful especially in the context of slides. See preserveAspectRatio.
  • Fix href attribute in case of image embedding (broken in v1.17.0 when adding Drawing.href feature)

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v1.17.0

  • API improvements:
    • renderSVG* no longer requires the styles argument
    • Drawing.useHref can be set to use <use href=...> (SVG 2) instead of <use xlink:href=...> (SVG 1.1). This behaves better when embedding directly into HTML.
  • Fix use of svgtiler on web (via <script> tag, no bundling)
    • Switch from setAttributeNS to setAttribute; only createElementNS seems to be needed/preferred
    • Workarounds for grapheme-splitter (with imperfect Unicode handling), prettify-xml (no prettification), and version number ((web))

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v1.16.4

  • Fix svgtiler API access within symbol definition files (introduced in v1.16.3 when fixing exports)
  • Add support for svgtiler.version version number in API

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v1.16.3

  • Update dependencies, including DoS security vulnerabilities in xlsx
  • Render Preact to string before duplicate detection, needed for latest Preact. You may need smaller SVG output files thanks to better duplicate detection.
  • Fix svgtiler not knowing its own version number (in .svg_tex files and command-line output)
  • Fix exports when using svgtiler.js in browser or in Node
  • Fix handling of symbol without viewBox and manual width/height via --tw/--th options (as in examples/tilt).

- CoffeeScript
Published by edemaine over 4 years ago

svgtiler - v1.16.2

- CoffeeScript
Published by edemaine almost 5 years ago

svgtiler - v1.16.1

  • Fix support for zero-size viewBox width and/or height, so that "Even zero-width and zero-height symbols will get rendered (unless overflow="hidden")" as claimed in README and as used to be (regression likely introduced in 1.15.0).

- CoffeeScript
Published by edemaine over 5 years ago

svgtiler - v1.16.0

  • CSS styling can now be specified in Stylus or CSS (#38)
  • Inkscape 1.0 (which has different command-line syntax) is now supported for automatic PDF/PNG conversion
  • New .js/.coffee evaluation via Function engine instead of eval, which should offer a more consistent environment and is hopefully also faster. No more messing with the first line of code, which gives source maps more of a chance. Should be backwards-compatible via a new implicit-final-return Babel plugin.
  • Context (this in symbol definitions) now has match method for regular expression matching (#12)
  • SVG ids are escaped differently, now completely following the relevant specification (no dollar signs allowed) and unwritten spec (colons don't work on embedded SVGs). Underscores are the answer. Generated SVGs will differ but be more compatible.
  • Generated SVGs no longer have nonstandard z-index or overflowBox attributes (#62) or stray xmlns
  • Improved testing, including SVG validation which now fully passes
  • Many documentation improvements
    • Rewrote opening paragraphs, including earlier demonstrations and links to examples
    • Add links to papers using SVG TIler (#27) [add an issue/PR to include your own paper!]
    • Link to Preact API and mention helpfulness of cloneElement
  • API exports more, including extensionMap, escapeId, Style, and convertSVG
  • Dependencies use fixed versions for reliability
  • Makefile revamped (#26)

- CoffeeScript
Published by edemaine almost 6 years ago

svgtiler - v1.15.2

  • Force specific preact version to work around this issue
  • Support for .css files inlined into <style> tags (#38)
  • Animation example, illustrating CSS

- CoffeeScript
Published by edemaine almost 6 years ago

svgtiler - v1.15.1

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.15.0

  • BREAKING: Change default overflow behavior to visible, unless --no-overflow option specified (#60)
    • Remove now-unnecessary overflow attributes from examples
  • New <image> processing:
    • Automatic inlining of <image>s unless --no-inline option specified (#42)
    • Sharing of duplicate inlined images via another level of <symbol>s
    • For all <image>s (not just those included directly by filename), set default image-rendering to pixelated (via Inkscape/Chrome hack).
    • Also apply the hack when image-rendering="pixelated" or image-rendering="optimizeSpeed" specified.
    • Don't apply the hack when image-rendering="auto", for example, so can get smooth rendering that way.
    • For all <image>s (not just those included directly by filename), set width and height to that of the image (scaling if exactly one is specified).
  • BREAKING API change: Symbol.id is now a static property instead of a function, set in constructor and via new setId method.
  • Bug fix in processing style attributes (introduced in v1.12)
  • Fix viewBox/overflowBox parsing (previously did not support comma-without-space separators)
  • Change automatic viewBox output to use spaces instead of commas (a stylistic, not functional, change)

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.14.1

  • Fix handling of .xlsx file with only one sheet (was crashing)

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.14.0

  • Give Context (this in any function defining a symbol) access to filename (drawing filename) and subname (sheet name within e.g. .xlsx file). This makes it easy to customize e.g. colors for specific images, while sharing .js/.coffee code among many files. (#59)

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.13.0

  • Improved LaTeX support (#54) [BREAKING from v1.12]:
    • Switch from .tex to .svg_tex extension for LaTeX component. This fixes use of figures in arXiv.org submissions, which prevents file.pdf and file.tex from simultaneously existing. It also parallels the .pdf/.pdf_tex output of Inkscape. But it's different, as the separation is done while generating the SVG instead of while generating the PDF, so we don't use .pdf_tex.
    • Correct relative scaling: SVG units are 1px = 0.75bp, not 0.75pt. This slightly (<0.4%) affects the default (and \svgscale'd) sizing of figures, but now matches the default from \includegraphics applied to the PDF.
    • Support currfile.sty as a way to find auxiliary graphics file in LaTeX output.
    • Improve documentation, both in .svg_tex file and in README.
  • Revamp README into sections
  • Output svgtiler version in help, to help with debugging
  • Update compiled examples to new id style ($v instead of -v from v1.11)

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.12.2

  • Mogrify require calls to make ./ and ../ paths be relative to the .js or .coffee mapping file.
  • Use coffeescript/register to guarantee require('*.coffee') works

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.12.1

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.12.0

  • New feature for converting all <text> into a LaTeX overlay in a .tex file, including \svgscale, \svgwidth, and \svgheight to control sizing (#54)
  • Code cleanup

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.11.0

  • Versioned ids use $v5 suffix instead of -v5 suffix, avoiding ambiguity (#45)
  • Rename $UNRECOGNIZED$ symbol, avoiding id ambiguity (#45)
  • Support slashes in direct image filenames by fixing escaping
  • Fix id generation for blank key

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.10.0

  • Reset symbol numbering before each SVG output, which makes for more consistent outputs (#53)
  • Warn about duplicate symbol labels (#45)
  • Initial support for use as a module: Export all classes, namespaces, unrecognizedSymbol, main function
  • Initial support for in-browser use:
    • Wrap in function to prevent polluting namespace (except svgtiler which is the exported module)
    • Mock Node's path module to the extent needed (extension detection)
    • Fix use of DOMParser because of CoffeeScript scoping, and domImplementation
    • Force SVG namespace before parsing, so we get the correct namespaceURI in created nodes, without outputting additional xmlns attributes
    • Extend Input.parseFile API to allow passing in file data directly
  • Rename svg2 -> convertSVG in API
  • Bug fixes in bounding box detection, which improved tilt example
  • Bug fix in polyomino example (wrong viewBox specified)
  • Optimization: avoid creating Context for StaticSymbols which don't use it, via new usesContext hint
  • Upgrade CoffeeScript, preact, Babel, csv-parse, xlsx, xmldom, image-size, async-limiter dependencies
    • CoffeeScript 2.5 now supports xlink:href tags (#41)

- CoffeeScript
Published by edemaine about 6 years ago

svgtiler - v1.9.1

  • Critical bug fix: MODULENOTFOUND error occurred in any use of .js or .coffee input (caused by Babel path resolution weirdness)
  • Add build rules for polyomino example

- CoffeeScript
Published by edemaine over 6 years ago

svgtiler - v1.9.0

  • Support JSX and CoffeeScript's analog via Preact (#32). You can now beautifully mix JavaScript/CoffeeScript and bare SVG content with minimal notation in between (just {}s to return to *Script).
  • See new polyomino example for how this cleans up code.
  • Unfortunately, our new use of Babel broke the feature introduced in 1.6.2: Errors in .coffee files are no longer prefixed with correct filename and line numbers. I'll try to get this back, somehow...
  • Fix DynamicSymbol caching: would re-use symbol when generating objects, even if contents differed. (Also necessary for current approach to JSX.)

- CoffeeScript
Published by edemaine over 6 years ago

svgtiler - v1.8.0

  • Feature: Automatic width/height of tiles via width="auto" and height="auto"
  • Feature: Undefined symbols are now rendered like � so they're easier to locate (#18)
  • Bug fix: Handling of relative filenames in mapping files
  • Cleanup: Refactor overflow: visible check
  • Documentation improvements
  • Testing/build improvements (#26)

- CoffeeScript
Published by edemaine over 6 years ago

svgtiler - v1.7.1

  • Add z-index attribute support as alternative to style="z-index:..." (#36)
  • Fix CSV/SSV/etc. parsing (was crashing since v1.6.0 from bug in 826a1c4 code cleanup)
  • Improve maze example
  • Improve documentation
  • Fix root Makefile somewhat (#26)

- CoffeeScript
Published by edemaine almost 7 years ago

svgtiler - v1.7.0

- CoffeeScript
Published by edemaine almost 7 years ago

svgtiler - v1.6.2

  • Add support for __dirname and __filename in .coffee/.js formats
  • Errors in .coffee/.js files are now prefixed with correct filename and line numbers
    • Use sourceURL mapping for .js
    • Correctly rewrite line numbers in .coffee errors
  • Fix bug with numeric entries in xlsx sheets
  • Code cleanup to use fewer static methods

- CoffeeScript
Published by edemaine almost 7 years ago

svgtiler - v1.6.1

  • Better error message when accidentally returning null from symbol function (js/coffee modes)
  • Treat empty returned string (in js/coffee modes) as blank 0-by-0 SVG tile (fixing #30)
  • Bug fix embedding of SVG files with root id property accidentally overwriting actual id of symbol

- CoffeeScript
Published by edemaine almost 7 years ago

svgtiler - v1.6.0

  • Ignore hidden sheets in .xlsx files, making it easy to deprecate sheets (#29). You can override this behavior with --hidden
  • Force Unix-style \n newlines for consistent builds across architectures (better Windows support!)
  • Upgrade csv-parse and xlsx NPM packages
  • Much nicer SVG parse errors/warnings (#21).
  • Beginning of exports for module or browser use

- CoffeeScript
Published by edemaine about 7 years ago

svgtiler - v1.5.2

  • Detect invalid -j, --tw, --th arguments (#25)

- CoffeeScript
Published by edemaine over 7 years ago

svgtiler - v1.5.1

  • Inkscape-generated PDF is now automatically sanitized to remove any /CreationDate, unless --no-sanitize command-line option is specified. This is useful for version control: you can regenerate all your figures and generally not get any diffs if nothing changed.

- CoffeeScript
Published by edemaine about 8 years ago

svgtiler - v1.5.0

  • New command-line option -j N or --jobs N runs up to N Inkscape jobs in parallel, similar to make. The default behavior remains running the Inkscape jobs one after the other, but if you want to use your multiple cores/CPUs, you can specify e.g. -j 4 to run up to four Inkscape jobs in parallel. (SVG Tiler occupies another thread, but it's rarely much of a bottleneck, so it doesn't count as a "job" in N.)
  • Along the way, I thoroughly tested and cleaned up error handling when running Inkscape. If Inkscape fails, you should now definitely be told about it, running in both sequential and parallel mode.
  • Update to CoffeeScript 2. So you can use CS2 features in your .coffee code if you want (and if your Node version supports the output; e.g., if you use await, you should have Node 8+).

- CoffeeScript
Published by edemaine about 8 years ago

svgtiler - v1.4.2

  • Fix PDF and PNG generation to workaround an Inkscape bug that causes the ignoring of any symbols that had strange characters (e.g. |) that required percent encoding. The workaround is to replace % encoding to instead use the character $, another allowed (but not specially interpreted) symbol in SVG ids.
  • As a consequence, Tetris examples now have black background as intended (properly interpreting space).

- CoffeeScript
Published by edemaine about 8 years ago

svgtiler - v1.4.1

  • Support PNG export via the -P / --png command-line option. Uses Inkscape like PDF export.

- CoffeeScript
Published by edemaine about 8 years ago

svgtiler - v1.4.0

  • Support PNG/JPG images as symbol specifiers, automatically turning them into SVG that includes them (but images must be in the same directory)
  • Improve Tilt examples, and add Tetris examples
  • Add automatic <image> size detection
  • Bug fix: Fix <ellipse> size detection
  • Performance: Increase speed when not using some features (CoffeeScript, CSV, XLS, PDF) by pushing require calls as late as possible
  • Cleanup tile-width/tile-height documentation and attributes

- CoffeeScript
Published by edemaine about 8 years ago

svgtiler - v1.3.4

  • Fix symbol names in output SVG to avoid using colons, which seemed to wreck havoc in SVGs embedded via <img> into HTML.
  • Unfortunately, we were encoding all unusual characters using colons, so all SVGs should be regenerated.
  • Now code is simpler, just using encodeURIComponent.

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler - v1.3.3

  • Add warning about Google Sheet sheet name truncation

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler - v1.3.2

  • Fix viewBox computation with overflow (#22)

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler - v1.3.1

  • Define space character to qualify as a blank cell for margin detection (for ASCII art in particular)

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler - v1.3.0

  • Add row and column feature
  • Generated XML now has better indentation because existing spaces get stripped by prettify-xml@1.2.0.

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler - v1.2.4

  • Fix zero-size handling, in particular setting <use width/height> to match

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler -

  • PDF conversion fixes: fix non-XLS case, show inkscape launch errors

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler -

  • Remove excess console.log

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler -

  • Render zero-width/zero-height symbols when style="overflow: visible" is specified, despite CSS rules.

- CoffeeScript
Published by edemaine over 8 years ago

svgtiler -

-p/--pdf command-line option to automatically convert all exported SVG files to PDF via Inkscape

- CoffeeScript
Published by edemaine almost 9 years ago

svgtiler -

  • Support blank symbols in .txt mapping files (#17)

- CoffeeScript
Published by edemaine almost 9 years ago

svgtiler -

  • Command-line examples in documentation (#16)

- CoffeeScript
Published by edemaine almost 9 years ago

svgtiler -

  • Fix support for filenames in .txt mapping files (#15)

- CoffeeScript
Published by edemaine almost 9 years ago

svgtiler -

  • Improved documentation

- CoffeeScript
Published by edemaine almost 9 years ago

svgtiler -

  • Excel, OpenOffice, etc. spreadsheet support. In particular, multiple sheets in one file! (#19)
  • Mapping function can now return null or undefined, and it will be the same as a missing mapping for that symbol (so it might render funny, but at least it won't crash). (#11)

- CoffeeScript
Published by edemaine almost 9 years ago