Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Germline mutation #55

Closed
wants to merge 292 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
3ef1ede
need to maintain state of rendering_rules.
gideonite Apr 14, 2015
e5662bf
goodbye dirty window monkey patching in test.
gideonite Apr 14, 2015
a7b447c
only uglify prod code. keep test build light.
gideonite Apr 14, 2015
c262856
Bring README up to date.
gideonite Apr 14, 2015
8e7a33f
more encapsulation
gideonite Apr 14, 2015
51cd1c0
Merge pull request #7 from cBioPortal/expose-api-pr
Apr 16, 2015
0e9e2c4
Merge pull request #8 from cBioPortal/readme
Apr 16, 2015
3664f34
insert gender data button
gideonite Apr 16, 2015
bb33758
added naming conventions picture
gideonite Apr 22, 2015
31d2dc9
first commit, putting in stashed files
Apr 22, 2015
0f2447e
first stage of refactor is done - basic structure is in, and we can i…
Apr 23, 2015
be844d3
you pass in a d3 object to renderer
Apr 23, 2015
85579ce
starting to bake in specific rendering schemes
Apr 23, 2015
e5ed979
towards more abstraction from rendering
Apr 24, 2015
3c1a921
more separation of rendering from logic
Apr 27, 2015
6d35e12
deleting file
Apr 27, 2015
3bb956c
bug fixes and moving a fn to utils
Apr 27, 2015
891a879
renaming a file, adding beginnings of templates, and using self inste…
Apr 27, 2015
2fa7d7a
using self everywhere (actually) and using stable sort
Apr 27, 2015
055dd4c
support for percentage-based svg attribute specification in rules
Apr 27, 2015
5108d41
last commit of day - changing more this to self and modifying removeR…
Apr 27, 2015
01bdeaf
adding ability to change cell width and padding, and to move rows, as…
Apr 28, 2015
f4096c7
add removing functionality, and started document to write down existi…
Apr 28, 2015
afca913
update gitignore for emacs
gideonite May 3, 2015
68a9108
D3SVGRuleSet changes
May 6, 2015
9dae209
Some naming changes and cleaning up
May 6, 2015
637f60f
Removing circular dependencies
May 6, 2015
f467eff
Making filenames match class names, and exporting only the classes in…
May 6, 2015
e3a0c57
complete removal of circular dependency, and pass mouseclick events u…
May 6, 2015
4011473
Handling config passing, and beginning templates
May 7, 2015
7ecab47
add bar chart template
May 7, 2015
64260be
minor changes - remove vestigial stuff and add semicolon
May 7, 2015
afbf2f4
moving events into enum in different file and starting to implement g…
May 8, 2015
f1b6dd6
add fake data
May 8, 2015
61a3404
Small changes
May 8, 2015
e319aee
Adding bar range markers (including signaling system)
May 8, 2015
1dd7ea0
Use track id instead of track name
May 15, 2015
618fbda
pushing changes for ino
May 19, 2015
5224d73
Fixing bugs, adding toggle whitespace to example page, starting toolb…
May 19, 2015
1279bc7
Adding GNU LGPL License
May 20, 2015
18c63e0
minor changes, making cell movement transitions optional/configurable
May 20, 2015
f4ec447
make a couple of renderer methods private
May 26, 2015
053b74a
fix label columns, only scroll cells
May 26, 2015
54cfc4e
start of legend system. but actually need to redo rules to have rule …
May 26, 2015
7726f89
beginning of linear range rule, system to be in place for better lege…
May 26, 2015
9f7d456
Add char encoding to test page meta. Closes #15.
gideonite Jun 4, 2015
8a65dcf
Merge pull request #18 from cBioPortal/firefox-char-encoding-bug
Jun 6, 2015
cfcc156
Cleaning up circular dependency and working on legend
Jun 8, 2015
87c411f
static rule legend object further refined, utils added to deal with svgs
Jun 9, 2015
48fc381
Linear color gradient rule, and demo of changing color scheme
Jun 9, 2015
f249d57
incomplete commit...still working on legend and on genetic alteration…
Jun 10, 2015
9de5c06
first commit, beginning to remove unnecessary oopness in tracks
Jun 10, 2015
931c0b0
stashing changes for demo
Jun 11, 2015
8d9a556
Refactor; removing Track class and changing way rulesets are used
Jun 11, 2015
5cbd13f
Some legend work and some revision of API, and percent altered
Jun 12, 2015
63ce4da
Prototype methods OOP for D3SVGRuleSet and auto color selection
Jun 12, 2015
9115513
Log gradient scale...probably perceptually useless tbh
Jun 12, 2015
166e6ff
save as SVG, and added bar chart, and added sorting API
Jun 15, 2015
bca8eb3
handling legend of multiple tracks with same ruleset
Jun 15, 2015
4dc9d29
first commit, canvas exploration
Jun 16, 2015
823fe6c
Merge branch remove-some-oop
Jun 16, 2015
45b4e5d
listen for events to render
Jun 16, 2015
6c5688b
Merge branch 'master' into canvas-rendering-exploration
Jun 16, 2015
02ee886
Successful canvas rendering
Jun 16, 2015
f76a07c
adding duplicate gender track for stress-testing
Jun 17, 2015
9c00fd5
canvas and svg rendering in, and better calculations in. seems like s…
Jun 17, 2015
b445be8
Adding DS_Store to gitignore, and new SVG rendering strategy (every e…
adamabeshouse Jun 19, 2015
5d8e5d5
beginning of clever positioning separation
adamabeshouse Jun 22, 2015
08a6e60
Fast clipping and code cleanup
Jun 22, 2015
9c346b1
Isolating rendering tasks so things arent rerendered
Jun 22, 2015
55d02d3
Get rid of cell_svg
Jun 22, 2015
09f6900
Bringing back the legend
Jun 22, 2015
435d077
new legend element for bar charts, showing scale
Jun 22, 2015
60fc4a0
clever clipping done
Jun 23, 2015
abf4c06
adding tooltips and cell rollover effects
Jun 23, 2015
b8f4c6a
delete legacy code
Jun 23, 2015
d0f262d
First pass at dragging. A lot of technical debt and optimization left
Jun 23, 2015
5297338
fixing bugs
Jun 24, 2015
b7260b7
cleaning up dragging and adding test data
Jun 24, 2015
c3f22a2
first commit, adding hongxins toolbar
Jun 24, 2015
b72545d
display toolbar (bad layout still)
Jun 25, 2015
38ee50f
some performance and other tweaks
Jun 25, 2015
bb013a5
new folder for production code
Jun 29, 2015
5c2aaae
change from npm module exports to closure return pattern
Jun 29, 2015
60c018c
merging changes from trying it in production
Jun 29, 2015
a9bf3ec
update test page for new situation
Jun 29, 2015
08047a6
adding mrna to genetic alteration rule, and starting thinking about f…
Jun 29, 2015
b00e329
fast zooming via svg viewboxes
Jun 29, 2015
8aa6e56
RPPA triangle and proper zoom scaling
Jun 29, 2015
79ff5c3
Cluttered commit...CSS, track groups, GA ruleset impl
Jun 30, 2015
f77d5e8
clean up a lot, move stuff into another file
Jul 2, 2015
428af46
taking out useless clipping...browser clips fine apparently. Also add…
Jul 2, 2015
4847671
speeding up dragging a bit
Jul 2, 2015
c7718e3
default genetic alteration config and sorting
Jul 6, 2015
4758787
small fix for using default genetic alteration params
Jul 6, 2015
f53ff4a
legend table instead of svg
Jul 6, 2015
8521db5
small bug fix
Jul 6, 2015
a9951f1
html for label area instead of svg
Jul 7, 2015
2953289
dragging in html container, and styling bug fixes
Jul 7, 2015
db62253
update genetic_alteration_config and _comparator
Jul 7, 2015
ed9f3c9
beginning of toolbar and adding default sort to genetic alteration ru…
Jul 7, 2015
2bad8bf
positioning optimization
Jul 7, 2015
935f860
turn off transition when its too slow
Jul 7, 2015
b1e2f27
smart transitioning - only animate cells in view
Jul 7, 2015
300780e
fix random swapping issue
Jul 8, 2015
92e07b2
changes toward fixing smart transitions...currently no transitions
Jul 9, 2015
c9a99e2
move cursor on labels
Jul 9, 2015
52d7266
infer data range for bar chart and gradient rules
Jul 9, 2015
edb365c
tooltip style changes
Jul 9, 2015
75d8690
new genetic alteration specification system
Jul 9, 2015
d0bf99b
specify zindex in genetic alteration rule spec
Jul 9, 2015
b08ebc3
add genetic alteration label back into default config
Jul 10, 2015
fd5932d
render legend when track data set, which jives with rule setting infe…
Jul 10, 2015
3c5c107
sort on move
Jul 10, 2015
fa2b55f
add default sort for gradient and bar chart, and add different sortin…
Jul 13, 2015
c25aed0
more advanced sorting functionality
Jul 13, 2015
ae54599
more sort controls
Jul 13, 2015
b386c07
small bug fix
Jul 13, 2015
296f7c7
draw cells when you set rule set
Jul 14, 2015
c86e552
bug fixes
Jul 14, 2015
06a70b3
dealing with nans in numerical data
Jul 14, 2015
087e1df
bringing transition back, just left
Jul 14, 2015
134f4c4
trigger finished rendering event
Jul 14, 2015
a112c58
show/hide legends
Jul 14, 2015
fe36a79
hide unused rules from legend
Jul 14, 2015
0bfeaf9
CSS3 transitions
Jul 15, 2015
8bb6a7a
take out transitions, add back clipping
Jul 15, 2015
587d529
experimental clipping and positioning...
Jul 15, 2015
6bbacaa
fix sorting a bit
Jul 16, 2015
1ff3afb
clipping/positioning optimizations
Jul 16, 2015
683301d
change clipping interval width, add more auto-fill colors, and delete…
Jul 16, 2015
fd12134
fixing up available d3 colors - excluding grayscales
Jul 16, 2015
6913681
small usability changes - padding on the top so you can drag off more…
Jul 16, 2015
4df1680
fix zooming then adding track issue
Jul 16, 2015
5b73990
abbreviate long track names and add tooltips
Jul 16, 2015
35855d5
beginning of hiding unaltered cases
Jul 17, 2015
dd7d833
more functionality towards hiding/showing ids
Jul 20, 2015
2b60297
more stuff related to visible ids
Jul 20, 2015
f8254eb
fixing track initialization
Jul 20, 2015
bbed0b3
expose setIdOrder
Jul 20, 2015
4e74dd8
stateful sort config
Jul 20, 2015
7aa2b31
fix label qtip on overflow
Jul 20, 2015
19a123c
remove track, toggle track sort direction buttons
Jul 20, 2015
033d494
additions towards patient-sample switching and svg downloading
Jul 21, 2015
24e5344
adding hover events
Jul 22, 2015
209ec8e
trying to get rid of aliasing
Jul 22, 2015
1d803ff
get rid of antialiasing effort, and style track buttons
Jul 22, 2015
89923ed
re-render legend on track remove
Jul 22, 2015
5c459b8
fix zoom aliasing
Jul 22, 2015
2fc2090
clear data function
Jul 22, 2015
9467c18
clear data function
Jul 22, 2015
dbd658f
make patient data default and add ability to change track tooltip
Jul 22, 2015
726b06b
attaching data to g and trying to reuse gs
Jul 23, 2015
f8cbd55
some speed optimizations
Jul 23, 2015
781d697
fix cell area height edge case
Jul 23, 2015
44b972c
more speed optimizations
Jul 23, 2015
218ad1a
force NAs to be sorted to the end in either direction
Jul 27, 2015
ee3074c
reduce number of digits in gradient and bar chart legends
Jul 27, 2015
ea81812
by default dont distinguish mutation order
Jul 27, 2015
b2a9a19
fix qtip bug
Jul 27, 2015
6dd6be7
mouseovers and qtips handled by cell div and mousemove handler
Jul 28, 2015
61812d3
some changes to highlighting and qtip
Jul 28, 2015
5d0f393
stop event propagation
Jul 28, 2015
07a368a
fix qtip issue by renaming event
Jul 28, 2015
c54f521
fix tooltip problem, remove cell highlight, add column highlight line
Jul 28, 2015
fbfc1df
comment out column highlight
Jul 28, 2015
e4767a0
trigger mousemove event on mouseout to hide tooltip, and take out leg…
Jul 28, 2015
9422d89
fix problem where hiding cases didnt work
Jul 28, 2015
0901874
toSVG implemented
Jul 29, 2015
4a2fc6e
change ruleset name constants so you can just use strings
Jul 29, 2015
894bdc6
mouseout handler
Jul 30, 2015
3ab9625
fix space issue
Jul 30, 2015
b96c212
small adjustments
Jul 30, 2015
7ee2931
some styling changes
Jul 30, 2015
cbd3951
small change to toSVG
Jul 30, 2015
16cb74e
use full cell width for legend
Aug 3, 2015
be9c7fa
reduce default track group separation
Aug 4, 2015
49c73f7
nested rules (for more than one svg element in a single rule) and app…
Aug 4, 2015
5c79741
change qtip messages and add border to cell qtips
Aug 4, 2015
01f232c
quantize zoom
Aug 4, 2015
c1ab525
small adjustment to padding zooming, and small adjustments to mutatio…
Aug 4, 2015
f46ea82
some optimizations relating to sorting, computing altered data percen…
Aug 5, 2015
904daaa
changes from implementation
Aug 27, 2015
7c30a5d
deleting some legacy and development stuff from repository, and adjus…
Sep 15, 2015
6706368
Deleting more legacy stuff
Sep 15, 2015
e2750bd
webgl implementation
Mar 3, 2016
62a8ba0
update README
Mar 3, 2016
d0925d8
update naming
Mar 3, 2016
6354236
update README
Mar 3, 2016
de94877
remove private files
Mar 4, 2016
5dc46b6
Update from main project
Nov 3, 2016
4ce3e8c
update code
Jun 20, 2017
6061b00
Minimum example of Oncoprint + README (#25)
pambot Aug 9, 2017
6558663
Add travis.yml
inodb Aug 10, 2017
477f805
Add npm upload
inodb Aug 10, 2017
0cd40f4
Add Travis badge
inodb Aug 10, 2017
336ef3e
upload dist folder to npm
inodb Aug 10, 2017
5b1465f
changed some initial configs
Aug 17, 2017
d7d3dec
Merge pull request #29 from pambot/node-package
adamabeshouse Aug 25, 2017
f47e508
v1.0.3
inodb Aug 25, 2017
8f153b0
fill in version based on git tag
inodb Aug 25, 2017
b5a10e6
overwrite with cbioportal code
Sep 14, 2017
4cf6227
Minimum example of Oncoprint + README (#25)
pambot Aug 9, 2017
41edea0
Add travis.yml
inodb Aug 10, 2017
627787e
Add npm upload
inodb Aug 10, 2017
13d29fa
Add Travis badge
inodb Aug 10, 2017
f1da6ea
upload dist folder to npm
inodb Aug 10, 2017
15c5c3e
changed some initial configs
Aug 17, 2017
bee357a
v1.0.3
inodb Aug 25, 2017
6b896c3
fill in version based on git tag
inodb Aug 25, 2017
d91628b
Merge branch 'rebase-attempt'
Sep 14, 2017
0099582
Set up karma testing for oncoprint
Sep 18, 2017
3e8ee30
Merge pull request #30 from cBioPortal/testing-framework
adamabeshouse Sep 18, 2017
dd9167b
Attempt at adding typings
Sep 18, 2017
ec60244
Merge pull request #31 from cBioPortal/typing
adamabeshouse Sep 18, 2017
4896efe
Improve typing
Sep 19, 2017
e897e1f
Another attempt to make it work as node package
Sep 19, 2017
0704ab0
Another attempt vv
Sep 19, 2017
2ff2593
Remove src/ from npmignore
Sep 20, 2017
29f48a3
Update with changes from cbioportal and update package.json
Oct 16, 2017
e08da90
Webpack and webworkers and clustering
Nov 3, 2017
0391d38
Add onSortDirectionChange track parameter
Dec 6, 2017
fdbd0ed
Fix bar chart legend pdf downloadability by not using rgba
Dec 7, 2017
ad814a2
Fix bar ruleset bad behavior with negative values
Dec 12, 2017
0036b57
Give class to scroll div so it can be targeted
Dec 12, 2017
791de7a
Add classes to track options so they can be targeted precisely with CSS
Dec 14, 2017
41fa760
Add pending resize and organize feature to deal w offscreen updates
Dec 14, 2017
477075f
Add active class to track options button
Dec 15, 2017
fb3f770
Make oncoprint div positioned absolutely to fix legend relative mispl…
Dec 15, 2017
9298db6
Put all NaN at end in clustering
Dec 19, 2017
3418f0f
Less hacky way of putting NaNs at end of clustering
Dec 19, 2017
0b65a5c
Add toDataUrl method for use in testing
Dec 21, 2017
9bee83c
Add line break after track label in tooltip
Jan 8, 2018
ae210ee
Legend arrangement changes
Jan 11, 2018
38d62ca
nullify sort direction of tracks in a clustered track group
Jan 17, 2018
b5476d1
Update README.md to reflect changes to build process (webpack)
adamabeshouse Jan 19, 2018
a0da0f6
Fail gracefully if WebGL context is not obtainable
Jan 26, 2018
2f074a5
Reuse rule id when updating linear rules
Jan 29, 2018
2759ed8
Support marking tracks with a custom label colour
fedde-s Mar 1, 2017
2599f91
Support annotating tracks with hyperlinks
fedde-s Jul 12, 2017
6c70d39
Add support for preformatted versions of track names
fedde-s Jul 10, 2017
039d7bc
Add track expansion support
fedde-s Apr 25, 2017
5367112
Insert expansion tracks underneath their parent
fedde-s Jan 30, 2018
ccb21b8
Add Fedde to contributors
adamabeshouse Feb 16, 2018
a60c0f8
Add ability to specify rule order in legend
Feb 16, 2018
0e33895
Make infinity-ordered rules go to end even if other rules dont have o…
Feb 16, 2018
3a9b228
Add class to tooltip
Feb 16, 2018
d235363
Add a separate track param for preformatted labels
fedde-s Feb 19, 2018
5e35b5b
Declare types for APIs used by gene set functionality
fedde-s Feb 19, 2018
4739bc4
Display germline mutation as white stripe in oncoprint view
rnugraha Jan 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ Session.vim
.netrwhist
*~

# Compiled assets
dist
### emacs ###
\#*\#

# DS_Store
.DS_Store
src/.DS_Store
test/.DS_Store
55 changes: 55 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Created by https://www.gitignore.io

### Repo Files ###
# src/
test/
server.js
gulpfile.js
.gitignore
.travis.yml

### Node ###
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules


### vim ###
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

### emacs ###
\#*\#

# DS_Store
.DS_Store
src/.DS_Store
test/.DS_Store
96 changes: 96 additions & 0 deletions .oldsrc/css/oncoprint.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.oncoprint-toolbar-ctr {
display: inline-block;
vertical-align: top;
float: right;
}
.oncoprint-label-area-ctr {
float:left;
overflow: auto;
width: auto;
}
.oncoprint-cell-area-ctr {
overflow: auto;
width: auto;
position:relative;
}

.oncoprint-cell-area {
background-color: transparent;
position: relative;
}

.oncoprint-column-highlight {
position:absolute;
width: 1px;
border-left: 1px dashed rgba(0,0,0,0.75);
top: 0px;
}

.oncoprint-cell {
position: absolute;
}

.oncoprint-animated {
-webkit-transition: 0.5s ease-out;
-moz-transition: 0.5s ease-out;
-o-transition: 0.5s ease-out;
transition: 0.5s ease-out;
}

.oncoprint-cell-hover {
outline: 1px solid DarkGray;
position: absolute;
}

.oncoprint-legend-header {
font-family: Arial !important;
font-weight: bold !important;
fill: gray !important;
text-anchor: start;
alignment-baseline: hanging;
font-size: 12px;
padding-right: 30px;
}

.oncoprint-legend-label {
font-family: Arial;
alignment-baseline: hanging;
font-size: 12px;
}

.oncoprint-legend-block {
display: inline-block;
}
.oncoprint-legend-element {
display: inline-block;
}

.oncoprint-track-label {
font-size: 12px;
}

.oncoprint-track-label-draggable {
cursor: move;
}
.oncoprint-label-dragging {
font-weight: bold !important;
color: #ff0000;
}

.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.oncoprint-cell-qtip {
background-color: rgba(0,0,0,0) !important;
//border: none !important;
}
.oncoprint-cell-qtip .qtip-content {
background-color: rgba(255,255,255,0.92) !important;
font-size: 13px !important;
}
152 changes: 152 additions & 0 deletions .oldsrc/js/OncoprintRenderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/*
* Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
* FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder
* is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no
* obligations to provide maintenance, support, updates, enhancements or
* modifications. In no event shall Memorial Sloan-Kettering Cancer Center be
* liable to any party for direct, indirect, special, incidental or
* consequential damages, including lost profits, arising out of the use of this
* software and its documentation, even if Memorial Sloan-Kettering Cancer
* Center has been advised of the possibility of such damage.
*/

/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
window.OncoprintRenderer = (function() {
var events = oncoprint_events;
var utils = oncoprint_utils;
var RuleSet = oncoprint_RuleSet;

function OncoprintRenderer(oncoprint, config) {
this.rule_sets = {};
this.clipping = true;
this.oncoprint = oncoprint;
this.config = config;
this.upper_padding = utils.ifndef(config.upper_padding, 0);
this.max_label_length = utils.ifndef(config.max_label_length, 20);
this.track_group_separation = 12;

(function computeLabelAreaWidth(self) {
var label_font = self.getLabelFont();
var max_label_width = utils.textWidth((Math.pow(10,self.max_label_length)-1).toString(), label_font);
var max_percent_altered_width = utils.textWidth('100%', label_font);
var buffer_width = 20;
self.label_area_width = max_label_width + buffer_width + max_percent_altered_width;
})(this);
};
OncoprintRenderer.prototype.getCellCSSClass = function() {
return 'oncoprint-cell';
};
OncoprintRenderer.prototype.getTrackCellCSSClass = function(track_id) {
return this.getCellCSSClass()+track_id;
};
OncoprintRenderer.prototype.getTrackLabelCSSClass = function(track_id) {
return 'oncoprint-track-label oncoprint-track-label'+track_id;
};
OncoprintRenderer.prototype.getTrackLabelCSSSelector = function(track_id) {
// TODO: replace with utils.cssClassToSelector
return "."+this.getTrackLabelCSSClass(track_id).split(" ").join(".");
};
OncoprintRenderer.prototype.getTrackCellCtrCSSClass = function(track_id) {
return 'oncoprint-track-cell-ctr'+track_id;
};
OncoprintRenderer.prototype.getLabelFont = function() {
return this.config.label_font;
};
OncoprintRenderer.prototype.setRuleSet = function(track_id, type, params) {
var new_rule_set = RuleSet.makeRuleSet(type, params);
this.rule_sets[track_id] = new_rule_set;
if (new_rule_set.sort_cmp) {
this.oncoprint.setTrackSortComparator(track_id, new_rule_set.sort_cmp);
}
};
OncoprintRenderer.prototype.useSameRuleSet = function(target_track_id, source_track_id) {
var rule_set = this.rule_sets[source_track_id];
this.rule_sets[target_track_id] = rule_set;
if (rule_set.sort_cmp) {
this.oncoprint.setTrackSortComparator(target_track_id, rule_set.sort_cmp);
}
};
OncoprintRenderer.prototype.getRuleSet = function(track_id) {
return this.rule_sets[track_id];
};
OncoprintRenderer.prototype.getTrackTops = function() {
var ret = {};
var y = this.upper_padding;
var self = this;
_.each(this.oncoprint.getTrackGroups(), function(group) {
if (group.length === 0) {
return;
}
_.each(group, function(id) {
ret[id] = y;
y+= self.getRenderedTrackHeight(id);
});
y += self.track_group_separation;
});
return ret;
};
OncoprintRenderer.prototype.getTrackCellTops = function() {
return this.track_cell_tops || this.computeTrackCellTops();
};
OncoprintRenderer.prototype.computeTrackCellTops = function() {
var tops = this.getTrackTops();
var self = this;
_.each(tops, function(top, id) {
tops[id] = top + self.oncoprint.getTrackPadding(id);
});
this.track_cell_tops = tops;
return tops;
};
OncoprintRenderer.prototype.getTrackLabelTops = function() {
return this.getTrackCellTops();
};
OncoprintRenderer.prototype.getRenderedTrackHeight = function(track_id) {
return this.oncoprint.getTrackHeight(track_id) + 2*this.oncoprint.getTrackPadding(track_id);
};
OncoprintRenderer.prototype.getCellX = function(index) {
return (typeof index === 'number' ? index*(this.oncoprint.getZoomedCellWidth()+this.oncoprint.getCellPadding()) : -1);
};
OncoprintRenderer.prototype.getCellXArray = function(length) {
var cell_unit = this.oncoprint.getZoomedCellWidth() + this.oncoprint.getCellPadding();
return _.map(_.range(0,length), function(x) { return x*cell_unit; });
};
OncoprintRenderer.prototype.getCellAreaWidth = function() {
return this.oncoprint.getVisibleIdOrder().length*(this.oncoprint.getZoomedCellWidth() + this.oncoprint.getCellPadding());
};
OncoprintRenderer.prototype.getCellAreaHeight = function() {
var track_tops = this.getTrackTops();
var track_order = this.oncoprint.getTracks();
if (track_order.length === 0) {
return 0;
} else {
var last_track = track_order[track_order.length-1];
return track_tops[last_track] + this.getRenderedTrackHeight(last_track);
}
};
OncoprintRenderer.prototype.getLabelAreaWidth = function() {
return this.label_area_width;
};
OncoprintRenderer.prototype.getLabelAreaHeight = function() {
return this.getCellAreaHeight();
};
OncoprintRenderer.prototype.render = function() {
throw "not implemented in abstract class";
}
return OncoprintRenderer;
})();
Loading