-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Keys expanding to multiple <symbol>s #33
Labels
Comments
Closed
11 tasks
Closed
edemaine
changed the title
Symbols expanding to multiple <symbol>s
Keys expanding to multiple <symbol>s
Aug 31, 2022
edemaine
added a commit
that referenced
this issue
Sep 25, 2022
* Don't output tile `<symbol>`s with no children, and don't `<use>` them * Such symbols are still useful for spacing. * For example, in `examples/grid-graph`, `ips_*_path.svg` reduced by 50% while `ips_example_*.svg` reduced by 78-82%.
edemaine
added a commit
that referenced
this issue
Sep 26, 2022
* Don't output tile `<symbol>`s with no children, and don't `<use>` them * Such symbols are still useful for spacing. * For example, in `examples/grid-graph`, `ips_*_path.svg` reduced by 50% while `ips_example_*.svg` reduced by 78-82%.
edemaine
added a commit
that referenced
this issue
Sep 26, 2022
* Don't output tile `<symbol>`s with no children, and don't `<use>` them * Such symbols are still useful for spacing. * For example, in `examples/grid-graph`, `ips_*_path.svg` reduced by 50% while `ips_example_*.svg` reduced by 78-82%.
edemaine
added a commit
that referenced
this issue
Sep 26, 2022
* Mapping can now return an array of strings or VDOM tiles, each with their own `z-index`. First non-null tile controls `viewBox`. * `chess` examples save 15-35% by avoiding duplication of background tiles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, each symbol (character, table entry) expands to a single SVG
<symbol>
. I think it could be extremely valuable to generalize to allow a sequence of<symbol>
s. Specifically:<symbol>...</symbol><symbol>...</symbol>
<> <symbol/> <symbol/> </>
(all<symbol>
children). [A mixture of<symbol>
and other tags would result in an error. All non-<symbol>
tags gets automatically wrapped in a<symbol>
as currently.][<symbol/>, "<symbol>...</symbol>"]
<stack><symbol/><symbol/></stack>
top-level element.Currently, I'm leaning toward just supporting Option 3, so that you're explicit about the difference in behavior from SVG/XML. Options 1 and 2 turn out to be hard to parse (need to wrap in a containing element).
One advantage is that each symbol could have a different
z-index
, and therefore get placed at different positions in the final render stack. This enables a single input symbol to render multiple "layers", e.g., a background behind all other symbols and a foreground element.Another advantage is deduplication. For example, the Chess example currently ends up with two
<symbol>
s for each chess piece, one for each cell parity. But if we separated the background symbol from the piece symbol, the deduplication could result in only one<symbol>
per piece type and one per background.An issue with this approach is that it doesn't make sense to have multiple different
viewBox
andoverflowBox
settings (in terms of symbol width/height, though I guess changing the min x/y could be handy). I think it's natural to take theviewBox
from the first symbol (for layout), andoverflowBox
is the smallest box containing all of the symbols'overflowBox
es. I wonder whether we should support an anchor option for where to place mismatchedviewBox
es relative to the first one.An alternative would be to support pieces of a single<symbol>
to have differentz-index
settings. Presumably just top-level elements. Logically, we could imagine<layer>
tags which specifyz-index
values, but I could see making these automatic. In the output, these will get split into multiple<symbol>
s and multiple<use>
calls, at different places in the stack.Reading the SVG z-index proposal, the second approach seems inconsistent, as
<symbol>
s generate their own stacking context. So maybe the first approach is better.""
(empty string) or<></>
(empty VDOM), we shouldn't actually build a<symbol>
and<use>
it; we should just omit it.Progress
svgtiler.static
The text was updated successfully, but these errors were encountered: