diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py index 7a4b428f..7ed38634 100644 --- a/cara/apps/calculator/report_generator.py +++ b/cara/apps/calculator/report_generator.py @@ -286,18 +286,22 @@ def scenario_statistics(mc_model: mc.ExposureModel, sample_times: typing.List[fl def comparison_report( + form: FormData, report_data: typing.Dict[str, typing.Any], scenarios: typing.Dict[str, mc.ExposureModel], sample_times: typing.List[float], executor_factory: typing.Callable[[], concurrent.futures.Executor], ): - statistics = { - 'Current scenario' : { - 'probability_of_infection': report_data['prob_inf'], - 'expected_new_cases': report_data['expected_new_cases'], - 'concentrations': report_data['concentrations'], + if (form.short_range_option == "short_range_no"): + statistics = { + 'Current scenario' : { + 'probability_of_infection': report_data['prob_inf'], + 'expected_new_cases': report_data['expected_new_cases'], + 'concentrations': report_data['concentrations'], + } } - } + else: + statistics = {} with executor_factory() as executor: results = executor.map( @@ -351,7 +355,7 @@ class ReportGenerator: context.update(report_data) alternative_scenarios = manufacture_alternative_scenarios(form) context['alternative_scenarios'] = comparison_report( - report_data, alternative_scenarios, scenario_sample_times, executor_factory=executor_factory, + form, report_data, alternative_scenarios, scenario_sample_times, executor_factory=executor_factory, ) context['permalink'] = generate_permalink(base_url, self.calculator_prefix, form) context['calculator_prefix'] = self.calculator_prefix diff --git a/cara/apps/calculator/static/js/report.js b/cara/apps/calculator/static/js/report.js index a6010221..add174ce 100644 --- a/cara/apps/calculator/static/js/report.js +++ b/cara/apps/calculator/static/js/report.js @@ -691,7 +691,7 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_ highest_concentration = Math.max(highest_concentration, Math.max(...scenario_concentrations)); } - yRange.domain([0., highest_concentration]); + yRange.domain([0., highest_concentration*1.1]); yAxisEl.transition().duration(1000).call(yAxis); for (const [scenario_name, data] of Object.entries(data_for_scenarios)) {