PageSourceSearch

https://www.cancerhotspots.org/src/js/render/TumorCountRender.js

js cancerhotspots.org collected 2026-10-03 21:18:22 UTC 2,340 bytes, 64 lines download raw bytes

1/*
2 * Copyright (c) 2016 Memorial Sloan-Kettering Cancer Center.
3 *
4 * This library is distributed in the hope that it will be useful, but WITHOUT
5 * ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
6 * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
7 * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
8 * obligations to provide maintenance, support, updates, enhancements or
9 * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
10 * liable to any party for direct, indirect, special, incidental or
11 * consequential damages, including lost profits, arising out of the use of this
12 * software and its documentation, even if Memorial Sloan-Kettering Cancer
13 * Center has been advised of the possibility of such damage.
14 */
15
16/*
17 * This file is part of cBioPortal Cancer Hotspots.
18 *
19 * cBioPortal is free software: you can redistribute it and/or modify
20 * it under the terms of the GNU Affero General Public License as
21 * published by the Free Software Foundation, either version 3 of the
22 * License.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27 * GNU Affero General Public License for more details.
28 *
29 * You should have received a copy of the GNU Affero General Public License
30 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
31 */
32
33/**
34 * @author Selcuk Onur Sumer
35 */
36function TumorCountRender(options)
37{
38    var _defaultOpts = {
39        templateId: "samples_column"
40    };
41
42    // merge options with default options to use defaults for missing values
43    var _options = jQuery.extend(true, {}, _defaultOpts, options);
44
45    function render (data, type)
46    {
47        var templateFn = _.template($("#" + _options.templateId).html());
48        return templateFn(data);
49    }
50
51    function postRender(td, cellData, rowData, row, col)
52    {
53        if (cellData.tumorCount > 0 &&
54            !_.isEmpty(cellData.composition))
55        {
56            cbio.util.addTargetedQTip($(td).find(".qtipped-text"),
57                                      TooltipUtils.tooltipOptions(cellData));
58        }
59    }
60
61    this.render = render;
62    this.postRender = postRender;
63}
64

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.