Browse Source

adding more data to 'data' page

solr_update
Simon Bowie 2 years ago
parent
commit
d4f363d5e1
3 changed files with 31 additions and 1 deletions
  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 View File

# @author: Simon Bowie <ad7588@coventry.ac.uk> # @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: data route for data # @purpose: data route for data
# @acknowledgements: # @acknowledgements:
#
# pycountry module for country data


from flask import Blueprint, render_template, request from flask import Blueprint, render_template, request
import random import random
if country is None: if country is None:
country = pycountry.historic_countries.get(alpha_2=country_data[i]) country = pycountry.historic_countries.get(alpha_2=country_data[i])
country_labels.append(country.name) country_labels.append(country.name)
country_data[i] = country
country_dataset.append(country_dict) country_dataset.append(country_dict)


germany = pycountry.countries.get(alpha_2='DE') germany = pycountry.countries.get(alpha_2='DE')

+ 8
- 0
web/app/templates/compare.html View File

</p> </p>
{% endif %} {% 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 %} {% if result['original_title'] is defined %}
<p class="mb-2"> <p class="mb-2">
Original language title: Original language title:

+ 21
- 0
web/app/templates/data.html View File



<br><br> <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="chartOfYearFrequency" width="600" height="300"></canvas>
<canvas id="chartOfCountryFrequency" width="600" height="300"></canvas> <canvas id="chartOfCountryFrequency" width="600" height="300"></canvas>



Loading…
Cancel
Save