(function ($) { var setupTooltip = function () { $('[data-toggle="tooltip"]').tooltip({ 'placement': 'top', 'container': 'body', 'html': 'true', 'white-space': 'nowrap' }); }; var setupClick = function ($graphDiv) { $('a', $graphDiv).click(function (evt) { evt.preventDefault(); evt.stopPropagation(); window.location.hash = $(this).attr('href'); }); }; var graphControls = function ($queryDiv, $graphDiv, isInit) { var MIN_HITS_TO_SHOW = 20; var totalHits, shownHits, lessButton, moreButton; var countHits = function () { totalHits = $queryDiv.data().hitCount, shownHits = $queryDiv.find('.ghit > g').length; }; var setupButtons = function($queryDiv, $graphDiv) { $graphDiv .append( $('