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

Extending channel types definitions. #431

Open
shamansir opened this issue Feb 13, 2017 · 2 comments
Open

Extending channel types definitions. #431

shamansir opened this issue Feb 13, 2017 · 2 comments

Comments

@shamansir
Copy link
Owner

Despite of #99 and #429

@shamansir shamansir added the bug label Feb 13, 2017
@shamansir shamansir added this to the v2.1.x milestone Feb 13, 2017
@shamansir
Copy link
Owner Author

It happens because their renderers have no edit handler, which is true for all new channels since it is not known which type of editor they require (number input?, checkbox?, etc.). Current (kinda hacky) way to "inherit" an editor from another channel could be:

Rpd.channelrenderer('my/new-channel', 'svg', {
    edit: Rpd.allChannelRenderers['util/number'].edit
});

But probably there should be an easy way to inherit properties from another channel type even in the type definition, so to say "my new channel is extending util/number channel in every possible way, including renderer, but ...".

@shamansir shamansir changed the title Some inlets (with adapt function?) are yet not editable Extending channel types definitions. Feb 13, 2017
@shamansir
Copy link
Owner Author

shamansir commented Feb 13, 2017

It is also possible to just:

Rpd.channelrenderer('my/new-channel', 'svg', Rpd.allChannelRenderers['util/number']['svg']);
Rpd.channelrenderer('my/new-channel', 'html', Rpd.allChannelRenderers['util/number']['html']);

or:

Rpd.allChannelRenderers['my/new-channel'] = Rpd.allChannelRenderers['util/number'];

...Or not to register any new channel, but to override the definition with required methods on node definition step:

Rpd.nodetype('my/new-node', {
    inlets: {
        extendedNumber: { type: `util/number`, adapt: function(v) { return ...; } }
    },
    . . .
});

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

No branches or pull requests

1 participant