Save context data every time navigation to a different node happens
@private
15904
function setContext(rawData) {
    for (var index = 0; index < defaultContextKeys.length; index++) {
      var key = defaultContextKeys[index];
      try {
        if (typeof rawData[key] === 'string') {
          rawData[key] = JSON.parse(rawData[key]);
        }
      } catch (e) {
        console.info(
          'unable to parse luigi context data for',
          key,
          rawData[key],
          e
        );
      }
    }
    currentContext = rawData;
  }
738475
function(layerContext, node) {
        if (! ("srs" in layerContext)) {
            layerContext.srs = {};
        }
        layerContext.srs[this.getChildValue(node)] = true;
    }
466279
function ( e ) {

        var i = R.ui.length, next = -1, u, x, y;

        while( i-- ){

            u = R.ui[i];

            if( u.isCanvasOnly ) {

                x = u.mouse.x;
                y = u.mouse.y;

            } else {

                x = e.clientX;
                y = e.clientY;

            }

            if( R.onZone( u, x, y ) ){ 
                
                next = i;
                
                if( next !== R.current ){
                    R.clearOldID();
                    R.current = next;
                    R.ID = u;
                }
                break;
            }
                
        }

        if( next === -1 ) R.clearOldID();

    }
1078433
function(e) {
            e.stopPropagation();
            var opt = $(this).data('contextMenu') || {};

            // obtain currently selected menu
            if (opt.$selected) {
                var $s = opt.$selected;
                opt = opt.$selected.parent().data('contextMenu') || {};
                opt.$selected = $s;
            }
            
            var $children = opt.$menu.children(),
                $prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(),
                $round = $prev;
            
            // skip disabled
            while ($prev.hasClass('disabled') || $prev.hasClass('not-selectable')) {
                if ($prev.prev().length) {
                    $prev = $prev.prev();
                } else {
                    $prev = $children.last();
                }
                if ($prev.is($round)) {
                    // break endless loop
                    return;
                }
            }
            
            // leave current
            if (opt.$selected) {
                handle.itemMouseleave.call(opt.$selected.get(0), e);
            }
            
            // activate next
            handle.itemMouseenter.call($prev.get(0), e);
            
            // focus input
            var $input = $prev.find('input, textarea, select');
            if ($input.length) {
                $input.focus();
            }
        }
236226
def OnNodeActivated(self, event):
        """"""
        self.activated_node = self.selected_node = event.node
        self.squareMap.SetModel(event.node, self.adapter)
        self.squareMap.SetSelected( event.node )
        if editor:
            if self.SourceShowFile(event.node):
                if hasattr(event.node,'lineno'):
                    self.sourceCodeControl.GotoLine(event.node.lineno)
        self.RecordHistory()
952893
function gotNavigation(results) {
  console.log('gotNavigation', results, browser);
  var browser;
  if (results.navigator === 'treemap') {
    browser = browseTreemap;
  } else if (results.navigator === 'facet') {
    browser = browseFacet;
  } else if (results.navigator === 'cluster') {
    browser = browseCluster;
  } else if (results.navigator === 'debug') {
    browser = browseDebug;
  }
  if (browser) {
    $('.browse.sidebar').sidebar('show');
    $('#browse').html();
    browser.render('#browse', results, resultView, context);
  } else {
    $('.browse.sidebar').sidebar('hide');
  }
}
832426
function move(node, stayWithin, directionIsNext) {
  if (directionIsNext) {
    return NodeTraversal.next(node, stayWithin);
  } else {
    if (node === stayWithin) {
      return null;
    }
    return NodeTraversal.previous(node, null);
  }
}
1138443
function addToJSONRecursively(contextNames, data, obj) {
        var currentContexName = contextNames.shift();

        // last name
        if (!contextNames.length) {
            obj[currentContexName] = data;
            return;
        }

        if (!obj[currentContexName]) {
            obj[currentContexName] = {};
        }

        addToJSONRecursively(contextNames, data, obj[currentContexName]);
    }
438620
function(e) {
            var $this = $(this),
                $related = $(e.relatedTarget),
                $document = $(document);
            
            // abort if we're coming from a menu
            if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
                return;
            }
            
            // abort if a menu is shown
            if ($currentTrigger && $currentTrigger.length) {
                return;
            }
            
            hoveract.pageX = e.pageX;
            hoveract.pageY = e.pageY;
            hoveract.data = e.data;
            $document.on('mousemove.contextMenuShow', handle.mousemove);
            hoveract.timer = setTimeout(function() {
                hoveract.timer = null;
                $document.off('mousemove.contextMenuShow');
                $currentTrigger = $this;
                $this.trigger($.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY }));
            }, e.data.delay );
        }
758110
function _onFrameNavigated(event, res) {
        // res = {frame}
        if (!res.frame.parentId) {
            exports.url = _cleanURL(res.frame.url);
        }
    }
264162
function visit(node, context, visitor) {
	if (node === null || node === undefined) {
		return null;
	}

	if (Array.isArray(visitor)) {
		return visitor
			.reduce((n, v) => {
				const newNode = visit(n, context, v);
				return newNode;
			}, node);
	}

	const method = visitor[node.type];
	if (typeof method === 'function') {
		return method.apply(null, [node].concat(context));
	}

	const defaultMethod = visitor.defaultMethod;
	if (typeof defaultMethod === 'function') {
		return defaultMethod.apply(null, [node].concat(context));
	}

	return node;
}
693592
public Object navigation(Context context, NavigationCallback callback) {
        return ARouter.getInstance().navigation(context, this, -1, callback);
    }
108668
function(selector, from, doc, data) {
      Contexts[selector] = from;
      Results[selector] = data;
      return;
    }
1049596
function closeStrokedPath(context) {
    context.stroke();
    context.restore();
    context.closePath();
    context.save();
}
95367
function Node(value, prev, next) {
    this.value = value;
    this.prev = prev;
    this.next = next;
  }
975193
function (event) {
            if (event.event.name == "ContextualTargetFound") {
                var templateCtxt = event.event.templateCtxt;
                // NO NEED TO REFRESH -> displaying the context menu does it already
                this._selectFromTemplateCtxt(templateCtxt);
            }
        }
1247600
function(events, callback, context) {
      var calls, event, node, tail, list;
      if (!callback) {
        return this;
      }
      events = events.split(eventSplitter);
      calls = this._callbacks || (this._callbacks = {});

      // Create an immutable callback list, allowing traversal during
      // modification.  The tail is an empty object that will always be used
      // as the next node.
      event = events.shift();
      while (event) {
        list = calls[event];
        node = list ? list.tail : {};
        node.next = tail = {};
        node.context = context;
        node.callback = callback;
        calls[event] = { tail: tail, next: list ? list.next : node };
        event = events.shift();
      }

      return this;
    }