Skip to content

Commit 2a476ec

Browse files
committed
updated README
1 parent 48d4b42 commit 2a476ec

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,42 @@ This is the github repo for the official TMD widgets and user instructions
44

55
## Summary statistics widget
66

7+
This widget allows users to incorporate summary statistics charts into their own websites. Any changes in the TMD will then be reflected automatically on the users website.
8+
9+
### Setup
10+
11+
Add the following code snippets to your own website:
12+
13+
Insert the below snippet where on the website you want the widget to be:
14+
```
15+
<div class="tmd-widget" id="tmd-widget-container"></div>
16+
```
17+
18+
Place this code snippet in the bottom or top of your code:
19+
20+
```
21+
<script src="https://elixir-europe-training.github.io/Training-Metrics-Database-widget/widget.js"></script>
22+
<script>
23+
TMDWidget({
24+
container: '#tmd-widget-container',
25+
questions: [<question_slug>, <question_slug>],
26+
}).catch((error) => {
27+
console.error('TMDWidget failed to initialise', error);
28+
});
29+
</script>
30+
```
31+
32+
The following parameters are customizable for the widget:
33+
34+
* questions: A list of question slug ids for displaying. You can find the question slug in the admin panel in the TMD. If defined, questions are displayed in the order they are inputed.
35+
* questionSets: A list of questionSets for displaying. If defined, all questions in the questionSet will be displayed. questionSets are listed by their slug.
36+
37+
Either questionSets can be set, or questions, not both. In case of both
38+
being defined, questionSets take precedence. If neither questionSets nor questions
39+
are defined, all questionSets will be returned.
40+
41+
* chartType: Define what chart type results should be shown in. Valid choices
42+
are 'pie' and 'bar'. Defaults to 'pie' if not defined.
43+
* colors: A list of hex colors to be used for plotting. Defaults to ELIXIR colors
44+
* endpoint: The API endpoint to get the data from. Defaults
45+
to "https://tmd.elixir-europe.org/metrics/set/"

0 commit comments

Comments
 (0)