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

Add filter to globally determine viewport #990

Open
allysonja opened this issue Feb 18, 2019 · 2 comments
Open

Add filter to globally determine viewport #990

allysonja opened this issue Feb 18, 2019 · 2 comments

Comments

@allysonja
Copy link

Some quick questions:

1: I am trying to test/add some functionality to createBitmaps.js to add something similar to "--filter" but instead do "--viewports" where I can specific labels of viewport configuration to run globally. I was already looking at the issue #577 and the addition of the custom array to scenarios is great, but I was curious if I could figure out how to add functionality on a smaller scale. However, I don't know how to test my code, like at all. I'm a novice in trying to implement changes in original code.

2: I was looking at lines 55-65 of createBitmaps.js to see how the filter argument is handled, and was wondering if a similar functionality could be implemented for viewports using similar code. For example:
if (config.args.viewports) { var viewports = []; config.arts.viewports.split(',').forEach(function (filteredTest){ each(configJSON.viewports, function (viewport) { if (regexTest(viewport.label, filteredTest)) { viewports.push(viewport); } }); }); configJSON.viewports = viewports; }

I'm not sure what else this would need or if the config.args.filter is defined somewhere else and I would need to add a definition for viewports as well.

Thanks in advance for any advice or help you can give me! I'm mostly just looking for how to test this on my own machine since after looking through the issues log it seems most people wouldn't need similar functionality.

@brendensoares
Copy link

I'm looking for a way to debug a scenario and only run one viewport at a time. This would be very useful (especially as a new user).

@garris
Copy link
Owner

garris commented Feb 18, 2021

This isn't natively supported-- maybe just edit your viewports properties in the config? Comment out the ones you don't want while debugging?

You can optionally add a viewports property to your scenario -- that overrides the root level one in the config (just another way to do it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants