* Parse an event stream specification.
(spec)
| 146595 | /** |
| 146596 | * Parse an event stream specification. |
| 146597 | */ function parseStream(spec) { |
| 146598 | var ctx = this, filter = spec.filter != null ? ctx.eventExpression(spec.filter) : undefined, stream = spec.stream != null ? ctx.get(spec.stream) : undefined, args; |
| 146599 | if (spec.source) stream = ctx.events(spec.source, spec.type, filter); |
| 146600 | else if (spec.merge) { |
| 146601 | args = spec.merge.map((_)=>ctx.get(_)); |
| 146602 | stream = args[0].merge.apply(args[0], args.slice(1)); |
| 146603 | } |
| 146604 | if (spec.between) { |
| 146605 | args = spec.between.map((_)=>ctx.get(_)); |
| 146606 | stream = stream.between(args[0], args[1]); |
| 146607 | } |
| 146608 | if (spec.filter) stream = stream.filter(filter); |
| 146609 | if (spec.throttle != null) stream = stream.throttle(+spec.throttle); |
| 146610 | if (spec.debounce != null) stream = stream.debounce(+spec.debounce); |
| 146611 | if (stream == null) (0, _vegaUtil.error)("Invalid stream definition: " + JSON.stringify(spec)); |
| 146612 | if (spec.consume) stream.consume(true); |
| 146613 | ctx.stream(spec, stream); |
| 146614 | } |
| 146615 | /** |
| 146616 | * Parse an event-driven operator update. |
| 146617 | */ function parseUpdate(spec) { |
no test coverage detected