PageSourceSearch

https://www.3dhotspots.org/src/js/util/TooltipUtils.js

js 3dhotspots.org collected 2026-10-08 02:14:11 UTC 1,901 bytes, 59 lines download raw bytes

1var TooltipUtils = (function() {
2    function defaultTooltipOpts()
3    {
4        return {
5            content: {text: 'NA'},
6            show: {event: 'mouseover'},
7            hide: {fixed: true, delay: 100, event: 'mouseout'},
8            style: {classes: 'cancer-hotspots-tooltip qtip-shadow qtip-light qtip-rounded'},
9            position: {my:'top left', at:'bottom right', viewport: $(window)}
10        };
11    }
12
13    function tooltipOptions(colData, viewOpts)
14    {
15        var tooltipOpts = defaultTooltipOpts();
16
17        // this will overwrite the default content
18        tooltipOpts.events = {
19            render: function(event, api) {
20                var tableData = [];
21
22                var defaultViewOpts = {
23                    el: $(this).find('.qtip-content'),
24                    colData: colData,
25                    data: tableData
26                };
27
28                // only update table data in case no data provided within view options!
29                if (_.isEmpty(viewOpts) ||
30                    _.isEmpty(viewOpts.data))
31                {
32                    var map = colData.composition || colData;
33
34                    _.each(_.pairs(map), function(pair) {
35                        tableData.push({type: pair[0], count: pair[1]});
36                    });
37                }
38
39                var opts = jQuery.extend(true, {}, defaultViewOpts, viewOpts);
40                var tableView = new CompositionView(opts);
41
42                tableView.render();
43
44                // this is a workaround for the misaligned table headers
45                // due to the scroll bar feature
46                setTimeout(function() {
47                    tableView.getDataTable().columns.adjust();
48                }, 0);
49            }
50        };
51
52        return tooltipOpts;
53    }
54
55    return {
56        defaultTooltipOpts: defaultTooltipOpts,
57        tooltipOptions: tooltipOptions
58    };
59})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.