(entry4, stream, scope)
| 147168 | return Object.keys(entry3).length === 1 ? id : scope.addStream(entry3).id; |
| 147169 | } |
| 147170 | function streamParameters(entry4, stream, scope) { |
| 147171 | let param1 = stream.between; |
| 147172 | if (param1) { |
| 147173 | if (param1.length !== 2) (0, _vegaUtil.error)('Stream "between" parameter must have 2 entries: ' + (0, _vegaUtil.stringValue)(stream)); |
| 147174 | entry4.between = [ |
| 147175 | parseStream(param1[0], scope), |
| 147176 | parseStream(param1[1], scope) |
| 147177 | ]; |
| 147178 | } |
| 147179 | param1 = stream.filter ? [].concat(stream.filter) : []; |
| 147180 | if (stream.marktype || stream.markname || stream.markrole) // add filter for mark type, name and/or role |
| 147181 | param1.push(filterMark(stream.marktype, stream.markname, stream.markrole)); |
| 147182 | if (stream.source === Scope$1) // add filter to limit events from sub-scope only |
| 147183 | param1.push("inScope(event.item)"); |
| 147184 | if (param1.length) entry4.filter = (0, _vegaFunctions.parseExpression)("(" + param1.join(")&&(") + ")", scope).$expr; |
| 147185 | if ((param1 = stream.throttle) != null) entry4.throttle = +param1; |
| 147186 | if ((param1 = stream.debounce) != null) entry4.debounce = +param1; |
| 147187 | if (stream.consume) entry4.consume = true; |
| 147188 | return entry4; |
| 147189 | } |
| 147190 | function filterMark(type, name, role) { |
| 147191 | const item = "event.item"; |
| 147192 | return item + (type && type !== "*" ? "&&" + item + ".mark.marktype==='" + type + "'" : "") + (role ? "&&" + item + ".mark.role==='" + role + "'" : "") + (name ? "&&" + item + ".mark.name==='" + name + "'" : ""); |
no test coverage detected