Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API #34

Open
edemaine opened this issue May 24, 2019 · 0 comments
Open

API #34

edemaine opened this issue May 24, 2019 · 0 comments

Comments

@edemaine
Copy link
Owner

edemaine commented May 24, 2019

It's time to have/document a NodeJS/browser API for SVG Tiler. Example applications:

  • Generating a drawing (spreadsheet) algorithmically.
  • Generating an animation where each frame is a slight tweak to a previous frame, and you want to output SVG or PNG of each, then assemble into an animated GIF.
  • SVG Tiler GUI

At the minimum, we want to load some mappings (from data or files), and apply them to drawings (in data or in files). In particular, need to formalize the internal mapping and drawing formats (which shouldn't be difficult).

At this point (Oct. 28, 2022), this is mainly a documentation issue, as the APIs have been substantially improved.

@edemaine edemaine mentioned this issue May 17, 2022
5 tasks
edemaine added a commit that referenced this issue Aug 13, 2022
* Support mapping defined by `Map` or `WeakMap`
* All function mappings are now automatically dynamic;
  no need to wrap in a second layer of function.
* Can force old static behavior (for efficiency)
  via `svgtiler.static` wrapper, cached at `Mapping` level.
* Function mappings get `context` second argument in addition to `this`.
* `Context` object now shared throughout each drawing
  (so you could store extra drawing-specific data there).
* API change: `Context` no longer has `symbols`, `symbol`, `data`,
  `filename`, or `subname` attributes.  For the latter three,
  use `drawing.data`, `drawing.filename`, or `drawing.subname`.
* API change: No more `Symbol`, `StaticSymbol`, or `DynamicSymbol` class
  (in particular, there was a name conflict with JS's `Symbol`)
* API change: `Input` constructor supports direct loading of data
  (for easy manual creation) or immediate parsing of file data,
  as well as option setting.  This will help with #34.
* New `Tile` class represents an expanded (and possibly parsed)
  tile `<symbol>` (roughly what `Symbol` was before).
* Tile caching/deduplication now within the renderer, not by `Symbol`
  (fix #50), enabling re-use when multiple symbols expand to the same SVG.
* Fix: Don't fill in `<image>` `width`/`height` when both already set.
* Fix: Use `hasOwnProperty` and `Set`s to avoid accidentally matching
  e.g. `toString`.
edemaine added a commit that referenced this issue Aug 13, 2022
* Support mapping defined by `Map` or `WeakMap`
* All function mappings are now automatically dynamic;
  no need to wrap in a second layer of function.
* Can force old static behavior (for efficiency)
  via `svgtiler.static` wrapper, cached at `Mapping` level.
* Function mappings get `context` second argument in addition to `this`.
* `Context` object now shared throughout each drawing
  (so you could store extra drawing-specific data there).
* API change: `Context` no longer has `symbols` or `symbol` attributes.
* API change: No more `Symbol`, `StaticSymbol`, or `DynamicSymbol` class
  (in particular, there was a name conflict with JS's `Symbol`)
* API change: `Input` constructor supports direct loading of data
  (for easy manual creation) or immediate parsing of file data,
  as well as option setting.  This will help with #34.
* New `Tile` class represents an expanded (and possibly parsed)
  tile `<symbol>` (roughly what `Symbol` was before).
* Tile caching/deduplication now within the renderer, not by `Symbol`
  (fix #50), enabling re-use when multiple symbols expand to the same SVG.
* Fix: Don't fill in `<image>` `width`/`height` when both already set.
* Fix: Use `hasOwnProperty` and `Set`s to avoid accidentally matching
  e.g. `toString`.
@edemaine edemaine mentioned this issue Nov 16, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant