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

Detect and parse any input syntax type (string, obj) in addSteps, replaceImage methods #731

Closed
jywarren opened this issue Jan 30, 2019 · 6 comments · Fixed by #787
Closed
Labels
has-pull-request Issues which have a PR open help wanted

Comments

@jywarren
Copy link
Member

I noticed that sequencer.addSteps('invert,ndvi') doesn't work because it doesn't recognize and parse the string. We should detect commas and pre-filter the input using sequencer.importString() so that we can simply pass multiple steps in via addSteps()

This shouldn't be too hard, and we can add this as an example to the README too, where actually we don't show the use of string syntax -- we can demonstrate in a new subsection:


Use string syntax (see below) to add multiple steps and configurations quickly by passing a string to `sequencer.addStep()`:

...example...

This'd be a really nice refinement!

@jywarren
Copy link
Member Author

Just a note that:

  1. addSteps() and insertSteps() share an implementation, so we'd best make this improvement work for both.
  2. any of the input types listed in https://github.com/publiclab/image-sequencer#string-syntax ought to still return the sequencer object itself, so that the methods can be chained, like sequencer.addSteps().run()

Thanks!

@jywarren
Copy link
Member Author

And actually we should check that there's a test for their chainability -- i think there is, if I remember right!

@vibhorgupta-gh
Copy link

Hmm. Working on this!

@jywarren
Copy link
Member Author

jywarren commented Jan 30, 2019 via email

@jywarren
Copy link
Member Author

Ah, actually maybe what we should say is that any of the following methods should accept full range of input syntaxes, including string, object:

  • addStep
  • insertStep
  • replaceImage

any others? We could have a method called detectSyntax() and one called parseSyntaxes() maybe to make this easy to add anywhere?

@jywarren jywarren changed the title Detect and parse multiple steps in addSteps() method Detect and parse multiple steps and params in addSteps, replaceImage methods Jan 31, 2019
@jywarren jywarren changed the title Detect and parse multiple steps and params in addSteps, replaceImage methods Detect and parse any input syntax type (string, obj) in addSteps, replaceImage methods Jan 31, 2019
@jywarren
Copy link
Member Author

jywarren commented Feb 5, 2019

I just linked to this from publiclab/leaflet-tile-filter#3 because once this is complete we should be able to vastly improve that use case! Thanks @VibhorCodecianGupta !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-pull-request Issues which have a PR open help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants