generating select options in python

This commit is contained in:
frankknoll
2023-11-09 11:49:58 +01:00
parent eb69b5d553
commit be62c55b2d
4 changed files with 150 additions and 17643 deletions

View File

@@ -26,7 +26,7 @@ class PageInitializer {
{
selectElement: vaccineSelectElement,
onValueSelected: vaccine => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(vaccine),
minimumInputLength: 0
minimumInputLength: 4
});
}
@@ -39,7 +39,7 @@ class PageInitializer {
PageInitializer.#symptomX = symptomX;
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
},
minimumInputLength: 0
minimumInputLength: 4
});
PageInitializer.#initializeSelectElement(
{
@@ -48,7 +48,7 @@ class PageInitializer {
PageInitializer.#symptomY = symptomY;
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
},
minimumInputLength: 0
minimumInputLength: 4
});
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
}

File diff suppressed because one or more lines are too long

View File

@@ -438,7 +438,7 @@
"metadata": {},
"outputs": [],
"source": [
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile\n",
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile, updateHtmlFile4SymptomsCausedByCOVIDLots\n",
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
@@ -627,11 +627,10 @@
"metadata": {},
"outputs": [],
"source": [
"updateHtmlFile(\n",
"updateHtmlFile4SymptomsCausedByCOVIDLots(\n",
" symptoms = list(prrByLotAndSymptom.columns),\n",
" vaccines = list(prrByLotAndSymptom.index),\n",
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\",\n",
" defaultSelectVaccineOptionText = 'Select Batch')"
" batches = list(prrByLotAndSymptom.index),\n",
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\")"
]
},
{

View File

@@ -16,6 +16,19 @@ def updateHtmlFile(symptoms, vaccines, htmlFile, defaultSelectVaccineOptionText
htmlFile = htmlFile,
selectElementId = 'vaccineSelect')
def updateHtmlFile4SymptomsCausedByCOVIDLots(symptoms, batches, htmlFile):
symptomOptions = getSymptomOptions(symptoms)
for selectElementId in ['symptomSelect', 'symptomSelectX', 'symptomSelectY']:
_saveOptions(
options = symptomOptions,
htmlFile = htmlFile,
selectElementId = selectElementId)
_saveOptions(
options = getVaccineOptions(batches, 'Select Batch'),
htmlFile = htmlFile,
selectElementId = 'vaccineSelect')
def _saveOptions(options, htmlFile, selectElementId):
HtmlTransformerUtil().applySoupTransformerToFile(
file=htmlFile,