-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchart-showtranscripts.html
68 lines (55 loc) · 2.69 KB
/
chart-showtranscripts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!-- External Polymer Styles/elements dependency -->
<link rel="import" href="bower_components/iron-icons/iron-icons.html">
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<!-- Epiviz element dependency -->
<link rel="import" href="epiviz-chart-showtranscripts.html">
<script>
/**
* `ChartSettingsBehavior` object manages the `<epiviz-chart-settings>` element for each chart.
* All charts inherit this behavior to update chart settings.
*
* @polymerBehavior
**/
EpivizChartShowTranscriptsBehavior = function (superClass) {
return class extends superClass {
constructor() {
super();
}
static get properties() {
return {};
}
/**
* Initializes the `<epiviz-chart-settings>` element
*/
_initializeShowTranscriptsDialog() {
var self = this;
var chartSettingsContainer = this.shadowRoot.querySelector('#chartSettingsLeftContainer');
var currSettingIcon = this.shadowRoot.querySelector('#chartShowTranscriptsIcon');
// if(currSettingIcon) {
// currSettingIcon.remove();
// }
if(!currSettingIcon) {
// currSettingIcon.remove();
var series = self.data.firstSeries();
var options = series._container._rowData._metadata["transcript_id"];
var genes = series._container._rowData._metadata["gene"];
var currSetting = document.createElement('epiviz-chart-showtranscripts');
currSetting.id = "chartShowTranscriptsIcon";
currSetting.setAttribute('items', JSON.stringify(options));
currSetting.setAttribute('settings', JSON.stringify(self.chartSettings));
currSetting.setAttribute('genes', JSON.stringify(genes));
currSetting._parentNode = self;
chartSettingsContainer.appendChild(currSetting);
} else {
var series = self.data.firstSeries();
var options = series._container._rowData._metadata["transcript_id"];
var genes = series._container._rowData._metadata["gene"];
currSettingIcon.setAttribute('items', JSON.stringify(options));
currSettingIcon.setAttribute('settings', JSON.stringify(self.chartSettings));
currSettingIcon.setAttribute('genes', JSON.stringify(genes));
currSettingIcon._parentNode = self;
}
}
}
}
</script>