MCPcopy Index your code
hub / github.com/microsoft/SandDance / eventExtend

Function eventExtend

docs/app/js/sanddance-app.js:141778–141791  ·  view source on GitHub ↗

* Extend an event with additional view-specific methods. * Adds a new property ('vega') to an event that provides a number * of methods for querying information about the current interaction. * The vega object provides the following methods: * view - Returns the backing View instance. * ite

(view, event2, item)

Source from the content-addressed store, hash-verified

141776 * @param {Item} item - The currently active scenegraph item (if any).
141777 * @return {Event} - The extended input event.
141778 */ function eventExtend(view, event2, item) {
141779 var r = view._renderer, el = r && r.canvas(), p, e, translate;
141780 if (el) {
141781 translate = offset(view);
141782 e = event2.changedTouches ? event2.changedTouches[0] : event2;
141783 p = (0, _vegaScenegraph.point)(e, el);
141784 p[0] -= translate[0];
141785 p[1] -= translate[1];
141786 }
141787 event2.dataflow = view;
141788 event2.item = item;
141789 event2.vega = extension(view, item, p);
141790 return event2;
141791}
141792function extension(view, item1, point) {
141793 const itemGroup = item1 ? item1.mark.marktype === "group" ? item1 : item1.mark.group : null;
141794 function group(name) {

Callers 1

sendFunction · 0.70

Calls 2

offsetFunction · 0.70
extensionFunction · 0.70

Tested by

no test coverage detected