vvvv / VL.StandardLibs

A collection of standard libraries for vvvv including VL.Stride, VL.Skia, VL.ImGui, msgpack.org[VL]
https://visualprogramming.net
GNU Lesser General Public License v3.0
35 stars 14 forks source link

Channels: proposing GetSlice [Reactive.Channel] #628

Closed antongit closed 1 year ago

antongit commented 1 year ago

Is your feature request related to a problem? Please describe. There is no easy way to convert between human-readable-strings and datatypes when binding. An example is ImGui's Combo (dropdown). UI shows Strings, but the logic is interested in the "values" behind them. (see the screenshot, where the Strings are mapped to Vector2s).

Describe the solution you'd like One can use Merge (Selector), but it's cumbersome. GetSlice [Reactive.Channel] offers an easy mapping of Strings (as an example) to Index, and the Index is then used to choose the "value".

Although GetSlice can be a good old name, it is working with Channels so shouldn't be confused with the old one. Maybe it is still not the best name.

Invented with @gregsn but the node still needs more thoughts about namings.

image

GetSlice Channel.zip

gregsn commented 1 year ago

b96c90be7e3f6f6dc7751e3f09484abb74258bc0