* Create a new event stream from an event source. * @param {object} source - The event source to monitor. The input must * support the addEventListener method. * @param {string} type - The event type. * @param {function(object): boolean} [filter] - Event filter function. * @param {function(obj
(source, type, filter4, apply)
| 107809 | * used as the downstream event value. |
| 107810 | * @return {EventStream} |
| 107811 | */ function events(source, type, filter4, apply) { |
| 107812 | const df = this, s = stream(filter4, apply), send = function(e) { |
| 107813 | e.dataflow = df; |
| 107814 | try { |
| 107815 | s.receive(e); |
| 107816 | } catch (error) { |
| 107817 | df.error(error); |
| 107818 | } finally{ |
| 107819 | df.run(); |
| 107820 | } |
| 107821 | }; |
| 107822 | let sources; |
| 107823 | if (typeof source === "string" && typeof document !== "undefined") sources = document.querySelectorAll(source); |
| 107824 | else sources = (0, _vegaUtil.array)(source); |
| 107825 | const n = sources.length; |
| 107826 | for(let i = 0; i < n; ++i)sources[i].addEventListener(type, send); |
| 107827 | return s; |
| 107828 | } |
| 107829 | function parse(data, format) { |
| 107830 | const locale = this.locale(); |
| 107831 | return (0, _vegaLoader.read)(data, format, locale.timeParse, locale.utcParse); |
nothing calls this directly
no test coverage detected