Ver código fonte

adding more data to 'data' page

solr_update
Simon Bowie 2 anos atrás
pai
commit
d4f363d5e1
3 arquivos alterados com 31 adições e 1 exclusões
  1. +2
    -1
      web/app/data.py
  2. +8
    -0
      web/app/templates/compare.html
  3. +21
    -0
      web/app/templates/data.html

+ 2
- 1
web/app/data.py Ver arquivo

@@ -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')

+ 8
- 0
web/app/templates/compare.html Ver arquivo

@@ -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:

+ 21
- 0
web/app/templates/data.html Ver arquivo

@@ -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>


Carregando…
Cancelar
Salvar