caksoylar / keymap-drawer

Visualize keymaps that use advanced features like hold-taps and combos, with automatic parsing
https://caksoylar.github.io/keymap-drawer
MIT License
730 stars 62 forks source link

Feature Request: List with checkbox to only export some layers #94

Closed griccardos closed 6 months ago

griccardos commented 6 months ago

Sometimes only want to export 2 or 3 layers. Currently, have to export image then crop it in image editor. Would be great to include only the layers I want in the export

caksoylar commented 6 months ago

Are you using the web app?

If you are using the CLI, keymap draw command has an argument called --select-layers/-s to subselect the layers to be drawn, see https://github.com/caksoylar/keymap-drawer/issues/51#issuecomment-1722304621.

The web app currently doesn't have a way to do that: It is purely a UI issue because I am not sure where I'd put it as it doesn't exist in the configuration (see the linked comment for justification). Perhaps I can put it under the "Export" dialog, next to the new background color selectors -- the problem with that is that they don't affect the preview; they would only take effect in the exported file. I'll also consider adding a new dialog for these kinds of options that would modify the preview directly, but I don't know if it would be clean enough.

caksoylar commented 6 months ago

I implemented a "Draw filters" dialog in the dev version of the web app, please have a look and feedback would be appreciated! https://keymap-drawer-dev.streamlit.app/

caksoylar commented 6 months ago

I pushed this to the main app in https://github.com/caksoylar/keymap-drawer-web/commit/b7733dbcf0262be799a07078e9e64487d82101bc as well, so I am closing assuming the original request was satisfied. Feedback is still welcome, though!

griccardos commented 6 months ago

Changes look great! Did some testing. Filter for preview works perfectly. Exporting only relevant layers works perfectly. Not sure if a bug, but exporting png does not export in dark mode. SVG works as expected.

caksoylar commented 6 months ago

Great, thanks for testing.

For PNG export you have to force dark_mode setting to on (not "auto"), I believe it will always default to light otherwise. Let me know if that doesn't work for you.