Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add panning and zooming to SVG map element
This commit adds a dependency on the [`svg-pan-zoom` package][svg-pan-zoom]. To manage the configuration and execution of that plugin, this commit introduces `controllers/seats_controller` JavaScript module. [That module will be instantiated with elements that declare `data-controller="seats"`][controllers]. Once an element with `data-controller="seats"` exists on the page, the module's [`connect()` life cycle hook][connect] will be invoked, which will initiate the `svgPanZoom` plugin configuration, passing a reference to `this.element` as the DOM Node to attach the map to. Additionally, This commit wraps the collection of `<use>` elements in an outer [`<g>` element][g-element] (as suggested by [aritutta/svg-pan-zoom#146]). [controllers]: https://stimulusjs.org/reference/controllers [connect]: https://stimulusjs.org/reference/lifecycle-callbacks#connection [svg-pan-zoom]: https://github.com/ariutta/svg-pan-zoom/tree/3.6.0 [g-element]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g [aritutta/svg-pan-zoom#146]: bumbu/svg-pan-zoom#146
- Loading branch information