@inb/oeb_visualizations 0.0.6-beta → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -206
- package/dist/oeb-visualizations.cjs.js +825 -0
- package/dist/oeb-visualizations.esm.js +832 -1
- package/dist/oeb-visualizations.min.js +1 -1
- package/dist/oeb-visualizations.umd.js +825 -1
- package/package.json +13 -7
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# OpenEBench Visualizations
|
|
2
2
|
|
|
3
|
-
Collection of Vue components for data visualization in OpenEBench.
|
|
3
|
+
Collection of Vue components for data visualization in [OpenEBench](https://openebench.bsc.es/).
|
|
4
4
|
|
|
5
|
-
- Go to the [demo](https://inab.github.io/oeb-visualizations-demo/) to see the components in action.
|
|
6
|
-
-
|
|
5
|
+
- :magic_wand: Go to the [live demo](https://inab.github.io/oeb-visualizations-demo/) to see the components in action.
|
|
6
|
+
- :open_book: Check the [documentation](https://inab.github.io/oeb-visualizations/) for details on how to use the components.
|
|
7
|
+
- :package: This package is available through [npmjs](https://www.npmjs.com/package/@inb/oeb_visualizations).
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
## Installation
|
|
@@ -11,209 +12,9 @@ Collection of Vue components for data visualization in OpenEBench.
|
|
|
11
12
|
To install the package run:
|
|
12
13
|
|
|
13
14
|
```bash
|
|
14
|
-
npm install @inb/
|
|
15
|
+
npm install @inb/oeb_visualizations
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## Development
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
#### Data
|
|
23
|
-
|
|
24
|
-
Data is provided to the component as an array of objects through the `dataItems` prop. Each object represents an access to the server. The object must have the following keys: `access_time`, `date` and `code`.
|
|
25
|
-
- `access_time`: time it took to access the server in ms.
|
|
26
|
-
- `date`: date of the access. Should not be null.
|
|
27
|
-
- `code`: HTTP code returned by the server. If `null` the bar will be colored with the color specified in the `colorNA` prop. If the code is an error code the bar will be colored with the color specified in the `colorOffline` prop. If the code is 200 the bar will be colored with the color specified in the `colorOnline` prop.
|
|
28
|
-
|
|
29
|
-
Example:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
[
|
|
33
|
-
{
|
|
34
|
-
"date": "2022-10-23T07:54:06.716122Z",
|
|
35
|
-
"code": 200,
|
|
36
|
-
"access_time": 51
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"date": "2022-10-24T07:58:50.609475Z",
|
|
40
|
-
"code": 200,
|
|
41
|
-
"access_time": 67
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"date": "2022-10-25T07:51:53.841140Z",
|
|
45
|
-
"code": 200,
|
|
46
|
-
"access_time": 55
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
#### Props
|
|
52
|
-
|
|
53
|
-
| Name | Type | Description | Default | Required |
|
|
54
|
-
| --- | --- | --- | --- | --- |
|
|
55
|
-
|dataItems | Array | Array of objects with keys `access_time`, `date` and `code`. <br> More details in "Data" section | | true |
|
|
56
|
-
| height | Number | Height of the plot in pixels. | 400 | false |
|
|
57
|
-
| colorNA | String | Color of bars for which there is no monitoring information (`code`=`null`). RGB format: `"<R>, <G>, <B>"` | 204, 204, 204 | false |
|
|
58
|
-
| colorOffline | String | Color of bars for which the server was offline (`code` is an error code). RGB format: `"<R>, <G>, <B>"` | 255, 153, 145 | false |
|
|
59
|
-
| colorOnline | String | Color of bars for which the server was online (`code` is 200). RGB format: `"<R>, <G>, <B>"` | 111, 176, 129 | false |
|
|
60
|
-
| yaxisTitle | String | Title of the y axis. | Access time (ms) | false |
|
|
61
|
-
| xaxisTitle | String | Title of the x axis. | Date | false |
|
|
62
|
-
| dtick | String | Tick interval for the x axis in unix epoch. | 86400000 | false |
|
|
63
|
-
|
|
64
|
-
#### Usage
|
|
65
|
-
|
|
66
|
-
Import the `accessibilityPlot` in your Vue component and add it to the `components` section. Then use the component in the template.
|
|
67
|
-
|
|
68
|
-
```html
|
|
69
|
-
<template>
|
|
70
|
-
<div>
|
|
71
|
-
<accessibilityPlot :dataItems="data" />
|
|
72
|
-
</div>
|
|
73
|
-
</template>
|
|
74
|
-
|
|
75
|
-
<script>
|
|
76
|
-
import { accessibilityPlot } from '@inb/oeb_visualizations'
|
|
77
|
-
|
|
78
|
-
export default {
|
|
79
|
-
components: {
|
|
80
|
-
accessibilityPlot
|
|
81
|
-
},
|
|
82
|
-
data(){
|
|
83
|
-
return {
|
|
84
|
-
data: [
|
|
85
|
-
{
|
|
86
|
-
"date": "2022-10-23T07:54:06.716122Z",
|
|
87
|
-
"code": 200,
|
|
88
|
-
"access_time": 51
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"date": "2022-10-24T07:58:50.609475Z",
|
|
92
|
-
"code": 200,
|
|
93
|
-
"access_time": 67
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"date": "2022-10-25T07:51:53.841140Z",
|
|
97
|
-
"code": 200,
|
|
98
|
-
"access_time": 55
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
</script>
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### citationsPlot
|
|
108
|
-
|
|
109
|
-
#### Data
|
|
110
|
-
|
|
111
|
-
Data is provided to the component as an array of objects through the `dataTraces` prop. Each object corresponds to a publication and will be represented as a trace in the resulting plot. They have the following keys: `data`, `id`, `label`, `title`, `year` and `url`.
|
|
112
|
-
- `data`: array of objects. Each object has the following keys: `count` and `year`. `count` is the number of citations of the publication in the year `year`. Exmple
|
|
113
|
-
```
|
|
114
|
-
[
|
|
115
|
-
{
|
|
116
|
-
"count": 1,
|
|
117
|
-
"year": 2019
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"count": 1,
|
|
121
|
-
"year": 2020
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"count": 1,
|
|
125
|
-
"year": 2021
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
- `id`: string. Identifier of the publication.
|
|
132
|
-
- `label`: string. Label of the publication.
|
|
133
|
-
- `title`: string. Title of the publication.
|
|
134
|
-
- `year`: number. Year of the publication.
|
|
135
|
-
- `url`: string. URL of the publication.
|
|
136
|
-
|
|
137
|
-
#### Props
|
|
138
|
-
|
|
139
|
-
| Name | Type | Description | Default | Required |
|
|
140
|
-
| --- | --- | --- | --- | --- |
|
|
141
|
-
|dataTraces | Array | Array of objects with keys `data`, `id`, `label`, `title`, `year` and `url`. <br> More details in "Data" section | | true |
|
|
142
|
-
| stack | Boolean | If true, the traces will be stacked. | false | false |
|
|
143
|
-
| colors | Array | Array of colors for the traces. HEX format | | false |
|
|
144
|
-
| height | Number | Height of the plot in pixels. | 400 | false |
|
|
145
|
-
| showlegend | Boolean | If true, the legend will be shown. | true | false |
|
|
146
|
-
| title | String | Title of the plot. | | false |
|
|
147
|
-
| xaxisTitle | String | Title of the x axis. | Year | false |
|
|
148
|
-
| yaxisTitle | String | Title of the y axis. | Number of citations | false |
|
|
149
|
-
| dark | Boolean | If true, the plot will be displayed in dark mode. | false | false |
|
|
150
|
-
|
|
151
|
-
#### Usage
|
|
152
|
-
|
|
153
|
-
Import the `citationsPlot` in your Vue component and add it to the `components` section. Then use the component in the template.
|
|
154
|
-
|
|
155
|
-
```html
|
|
156
|
-
<template>
|
|
157
|
-
<div>
|
|
158
|
-
<citationsPlot :dataTraces="data" />
|
|
159
|
-
</div>
|
|
160
|
-
</template>
|
|
161
|
-
<script>
|
|
162
|
-
import citationsPlotPage from '../components/citationsPlotPage.vue'
|
|
163
|
-
|
|
164
|
-
export default {
|
|
165
|
-
name: 'IndexPage',
|
|
166
|
-
components: {
|
|
167
|
-
citationsPlotPage
|
|
168
|
-
},
|
|
169
|
-
data(){
|
|
170
|
-
return {
|
|
171
|
-
data: [
|
|
172
|
-
{
|
|
173
|
-
"data": [
|
|
174
|
-
{
|
|
175
|
-
"count": 1,
|
|
176
|
-
"year": 2019
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"count": 1,
|
|
180
|
-
"year": 2020
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"count": 1,
|
|
184
|
-
"year": 2021
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
"id": "paper1",
|
|
188
|
-
"label": "OEB paper",
|
|
189
|
-
"title": "OpenEBench: a web platform for transparent and reproducible biomedical benchmarking",
|
|
190
|
-
"year": 2020,
|
|
191
|
-
"url": ""
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
"data": [
|
|
195
|
-
{
|
|
196
|
-
"count": 1,
|
|
197
|
-
"year": 2019
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"count": 1,
|
|
201
|
-
"year": 2020
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"count": 1,
|
|
205
|
-
"year": 2021
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
"id": "paper2",
|
|
209
|
-
"label": "OEB paper 2",
|
|
210
|
-
"title": "OpenEBench 2: an update of the web platform for transparent and reproducible biomedical benchmarking",
|
|
211
|
-
"year": 2020,
|
|
212
|
-
"url": ""
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
</script>
|
|
219
|
-
```
|
|
20
|
+
🚧 Work in progress 🚧
|