generating select options in python
This commit is contained in:
@@ -26,7 +26,7 @@ class PageInitializer {
|
|||||||
{
|
{
|
||||||
selectElement: vaccineSelectElement,
|
selectElement: vaccineSelectElement,
|
||||||
onValueSelected: vaccine => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(vaccine),
|
onValueSelected: vaccine => prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(vaccine),
|
||||||
minimumInputLength: 0
|
minimumInputLength: 4
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class PageInitializer {
|
|||||||
PageInitializer.#symptomX = symptomX;
|
PageInitializer.#symptomX = symptomX;
|
||||||
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
||||||
},
|
},
|
||||||
minimumInputLength: 0
|
minimumInputLength: 4
|
||||||
});
|
});
|
||||||
PageInitializer.#initializeSelectElement(
|
PageInitializer.#initializeSelectElement(
|
||||||
{
|
{
|
||||||
@@ -48,7 +48,7 @@ class PageInitializer {
|
|||||||
PageInitializer.#symptomY = symptomY;
|
PageInitializer.#symptomY = symptomY;
|
||||||
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
||||||
},
|
},
|
||||||
minimumInputLength: 0
|
minimumInputLength: 4
|
||||||
});
|
});
|
||||||
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
PageInitializer.#symptomVsSymptomChartView.loadAndDisplayChart(PageInitializer.#symptomX, PageInitializer.#symptomY);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -438,7 +438,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile\n",
|
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile, updateHtmlFile4SymptomsCausedByCOVIDLots\n",
|
||||||
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
|
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
|
||||||
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
|
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
|
||||||
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
|
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
|
||||||
@@ -627,11 +627,10 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"updateHtmlFile(\n",
|
"updateHtmlFile4SymptomsCausedByCOVIDLots(\n",
|
||||||
" symptoms = list(prrByLotAndSymptom.columns),\n",
|
" symptoms = list(prrByLotAndSymptom.columns),\n",
|
||||||
" vaccines = list(prrByLotAndSymptom.index),\n",
|
" batches = list(prrByLotAndSymptom.index),\n",
|
||||||
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\",\n",
|
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\")"
|
||||||
" defaultSelectVaccineOptionText = 'Select Batch')"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,19 @@ def updateHtmlFile(symptoms, vaccines, htmlFile, defaultSelectVaccineOptionText
|
|||||||
htmlFile = htmlFile,
|
htmlFile = htmlFile,
|
||||||
selectElementId = 'vaccineSelect')
|
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):
|
def _saveOptions(options, htmlFile, selectElementId):
|
||||||
HtmlTransformerUtil().applySoupTransformerToFile(
|
HtmlTransformerUtil().applySoupTransformerToFile(
|
||||||
file=htmlFile,
|
file=htmlFile,
|
||||||
|
|||||||
Reference in New Issue
Block a user