-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata_broker_component.js
89 lines (71 loc) · 1.6 KB
/
data_broker_component.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { DataBroker } from './data_broker.js';
import { upgradeProperty } from './common.js';
class DataBrokerElement extends HTMLElement {
constructor() {
super();
upgradeProperty(this, 'alignmentUrl');
upgradeProperty(this, 'indexUrl');
upgradeProperty(this, 'bedUrl');
upgradeProperty(this, 'server');
}
get broker() {
return this._broker
}
get apiUrl() {
return this.getAttribute('api-url');
}
set apiUrl(_) {
this.broker.apiUrl = _;
this.setAttribute('api-url', _);
}
get alignmentUrl() {
return this.getAttribute('alignment-url');
}
set alignmentUrl(_) {
this.broker.alignmentUrl = _;
this.setAttribute('alignment-url', _);
}
get indexUrl() {
return this.getAttribute('index-url');
}
set indexUrl(_) {
this.broker.indexUrl = _;
this.setAttribute('index-url', _);
}
get bedUrl() {
return this.getAttribute('bed-url');
}
set bedUrl(_) {
this.broker.bedUrl = _;
this.setAttribute('bed-url', _);
}
get regions() {
return this.broker.regions;
}
set regions(_) {
this.broker.regions = _;
}
get server() {
return this.getAttribute('server');
}
set server(_) {
this.setAttribute('server', _);
}
get bedText() {
return this.broker.bedText;
}
set bedText(_) {
this.broker.bedText = _;
}
connectedCallback() {
const options = {};
if (this.server) {
options.server = this.server;
}
this._broker = new DataBroker(this.alignmentUrl, options);
}
}
customElements.define('iobio-data-broker', DataBrokerElement);
export {
DataBrokerElement,
};