import { extend } from 'vega' ; const ns = require ( './ns' ) ; param { number } markId param { string } markType param { string } property returns { string } export const propSg = function ( markId , markType , property ) : string { return ns ( markType + '_' + markId + '_' + property ) ; } ; export function convertValuesToSignals ( encode , type , id , propName ? ) { if ( ! encode ) { return encode ; } return Object . keys ( encode ) . reduce ( function ( selection , key ) { if ( selection [ key ] === undefined || selection [ key ] . value === undefined ) { return selection ; } selection [ key ] = extend ( { } , { signal : propSg ( id , type , propName ? propName + '_' + key : key ) } , selection [ key ] . _disabled ? { _disabled : true } : { } ) ; return selection ; } , encode ) ; }