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.#chart = new Chart(
this.#canvas, this.#canvas,
{ {
type: 'doughnut', // FK-TODO: use a Polar Area Chart ('polarArea') or bar chart
type: 'bar',
data: this.#getData(ADRDescr), data: this.#getData(ADRDescr),
options: this.#getOptions() options: this.#getOptions()
}); });

View File

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

View File

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

View File

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

View File

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