refactoring

This commit is contained in:
frankknoll
2023-04-14 11:46:40 +02:00
parent 16ff49fd4e
commit 963f60dc5a
5 changed files with 12 additions and 9 deletions

View File

@@ -14,7 +14,8 @@ class AdverseReactionReportsChartView {
this.#chart = new Chart(
this.#canvas,
{
type: 'doughnut',
// FK-TODO: use a Polar Area Chart ('polarArea') or bar chart
type: 'bar',
data: this.#getData(ADRDescr),
options: this.#getOptions()
});

View File

@@ -1,14 +1,14 @@
class BatchCodeSelectInitializer {
static initialize({batchCodeSelect, batchCodeDetails}) {
batchCodeSelect.select2({ minimumInputLength: 4 });
batchCodeSelect.on(
static initialize({batchCodeSelectElement, batchCodeDetailsElement}) {
batchCodeSelectElement.select2({ minimumInputLength: 4 });
batchCodeSelectElement.on(
'select2:select',
function (event) {
const batchcode = event.params.data.id;
new HistogramView(batchCodeDetails).displayHistogramView(batchcode);
new HistogramView(batchCodeDetailsElement).displayHistogramView(batchcode);
GoogleAnalytics.click_batchcode(batchcode);
});
batchCodeSelect.select2('open');
batchCodeSelectElement.select2('open');
}
}

View File

@@ -1,3 +1,4 @@
// FK-TODO: rename to BatchCodeDetailsView
class HistogramView {
#uiContainer;

View File

@@ -41,8 +41,8 @@
$(document).ready(function () {
BatchCodeSelectInitializer.initialize(
{
batchCodeSelect: $('#batchCodeSelect'),
batchCodeDetails: document.querySelector("#batchCodeDetails")
batchCodeSelectElement: $('#batchCodeSelect'),
batchCodeDetailsElement: document.querySelector("#batchCodeDetails")
}
);
});
@@ -49762,7 +49762,7 @@
<option value="Ø94F21A">Ø94F21A</option>
</select>
</p>
<div id="batchCodeDetails"></div>
<div id="batchCodeDetails" style="width: 50%"></div>
<p><b>Data Source:</b>
<a href="https://vaers.hhs.gov/data/datasets.html" target="_blank">Vaccine Adverse Event Reporting System
(VAERS)</a>

View File

@@ -4,6 +4,7 @@ FK-FIXME:
FK-TODO:
- add google captcha to batchCodeTable.html
- remove batch code combinations, use just a single batch code for symptom chart
anacron job:
sudo cp src/intensivstationen_howbadismybatch.sh /etc/cron.daily/intensivstationen_howbadismybatch