Allow to either set zooms data through JS or data-* attributes in IMGs #2

Closed
opened 2023-05-21 19:33:26 +02:00 by caribaud · 1 comment
Owner

Right now, melpomene.js expect zooms to be defined.
It's not ideal.

It would be best to also allow the img tags themselves to define the zooms, e.g. with data-zooms="[<zoom 1 coord x>, <zoom 1 coord y>, <zoom 1 width>, <zoom 1 hieght>, <zoom2>, ...]"

At init, if zooms is already set, do not lookup the imgs data. If it is not, do it.

Also, the generator should probably be able to output a static version of melpomene.html with the images pre-defined. A prefix and extension could be provided while keeping the filename of the svg.

Right now, melpomene.js expect `zooms` to be defined. It's not ideal. It would be best to also allow the `img` tags themselves to define the zooms, e.g. with `data-zooms="[<zoom 1 coord x>, <zoom 1 coord y>, <zoom 1 width>, <zoom 1 hieght>, <zoom2>, ...]"` At init, if `zooms` is already set, do not lookup the `img`s data. If it is not, do it. Also, the generator should probably be able to output a static version of melpomene.html with the images pre-defined. A prefix and extension could be provided while keeping the filename of the svg.
Author
Owner
Fixed in 855808b46965e8602709d296231b4e015ca270f2, 9f522334059961300a5dc0ba1870ae8abf005022
caribaud added the
kind/enhancement
label 2023-06-04 10:31:20 +02:00
caribaud added the
scope/core
label 2023-06-04 21:19:23 +02:00
Sign in to join this conversation.
No description provided.