@@ -4,7 +4,7 @@ | |||
# @author: Simon Bowie <ad7588@coventry.ac.uk> | |||
# @purpose: data route for data | |||
# @acknowledgements: | |||
# | |||
# pycountry module for country data | |||
from flask import Blueprint, render_template, request | |||
import random | |||
@@ -48,6 +48,7 @@ def main_data(): | |||
if country is None: | |||
country = pycountry.historic_countries.get(alpha_2=country_data[i]) | |||
country_labels.append(country.name) | |||
country_data[i] = country | |||
country_dataset.append(country_dict) | |||
germany = pycountry.countries.get(alpha_2='DE') |
@@ -27,6 +27,14 @@ | |||
</p> | |||
{% endif %} | |||
{% if result['country'] is defined %} | |||
<p class="mb-2"> | |||
Country: | |||
{{ result['country'].name }} | |||
{{ result['country'].flag }} | |||
</p> | |||
{% endif %} | |||
{% if result['original_title'] is defined %} | |||
<p class="mb-2"> | |||
Original language title: |
@@ -8,6 +8,27 @@ There are a total of {{ total_number }} patents. | |||
<br><br> | |||
<div class="row"> | |||
<div class="col-6 text-center"> | |||
{% for i in range(0, year_data|length) %} | |||
{% if i % 2 %} | |||
{{ year_data[i] }}<br> | |||
{% else %} | |||
{{ year_data[i] }}: | |||
{% endif %} | |||
{% endfor %} | |||
</div> | |||
<div class="col-6 text-center"> | |||
{% for i in range(0, country_data|length) %} | |||
{% if i % 2 %} | |||
{{ country_data[i] }}<br> | |||
{% else %} | |||
{{ country_data[i].name }} {{ country_data[i].flag }}: | |||
{% endif %} | |||
{% endfor %} | |||
</div> | |||
</div> | |||
<canvas id="chartOfYearFrequency" width="600" height="300"></canvas> | |||
<canvas id="chartOfCountryFrequency" width="600" height="300"></canvas> | |||