|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {% extends "base.html" %}
-
- {% block content %}
-
- <a href="{{ url_for('main.index') }}" class="h1 text-left" title="back to index"> ⇽ </a>
-
- <h1 class="h1 text-center"> There are a total of {{ total_number }} patents.</h1>
-
- <div class="anchordata">
- <a href="#time">temporal focus</a>
- <br>
- <a href="#geo">geographic focus</a>
- </div>
-
- <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 %}
- <a href="{{ url_for('search.basic_search', year=year_data[i]) }}">
- {{ year_data[i] }}
- </a>:
- {% 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 %}
- {% if country_data[i].name is defined %}
- <a href="{{ url_for('search.basic_search', country=country_data[i].alpha_2) }}">
- {{ country_data[i].name }}
- </a>
- {{ country_data[i].flag }}:
- {% else %}
- <a href="{{ url_for('search.basic_search', country=country_data[i]) }}">
- {{ country_data[i] }}
- </a>:
- {% endif %}
- {% endif %}
- {% endfor %}
- </div>
- </div>
-
- <div id="time">
- <canvas id="chartOfYearFrequency" width="600" height="300"></canvas>
- </div>
-
- <div id="geo">
- <canvas id="chartOfCountryFrequency" width="600" height="300"></canvas>
- </div>
-
- <script type="text/javascript">
- // retrieve variables passed from Python
- var year_labels = {{ year_labels|safe }}
- var year_dataset = {{ year_dataset|safe }}
-
- // set up chart
- var data = {
- labels: year_labels,
- datasets: year_dataset,
- };
-
- var config = {
- type: 'bar',
- data: data,
- options: {
- plugins: {
- title: {
- display: true,
- text: 'number of patent records for each year'
- },
- animation: {
- onComplete: () => {
- delayed = true;
- },
- delay: (context) => {
- let delay = 0;
- if (context.type === 'data' && context.mode === 'default' && !delayed) {
- delay = context.dataIndex * 1000 + context.datasetIndex * 100;
- }
- return delay;
- },
- },
- },
- responsive: true,
- scales: {
- x: {
- title: {
- display: true,
- text: 'year'
- },
- stacked: true,
- },
- y: {
- title: {
- display: true,
- text: 'number of records'
- },
- stacked: true
- }
- }
- }
- };
-
- Chart.defaults.font.family = 'Compagnon'
- var yearGraph = new Chart(
- document.getElementById('chartOfYearFrequency'),
- config
- );
-
- </script>
-
- <script type="text/javascript">
- // retrieve variables passed from Python
- var country_labels = {{ country_labels|safe }}
- var country_dataset = {{ country_dataset|safe }}
-
- // set up chart
- var data = {
- labels: country_labels,
- datasets: country_dataset,
- };
-
- var config = {
- type: 'pie',
- data: data,
- options: {
- plugins: {
- title: {
- display: true,
- text: 'number of patent records from each country'
- },
- },
- responsive: true,
- }
- };
-
- Chart.defaults.font.family = 'Compagnon'
- var yearGraph = new Chart(
- document.getElementById('chartOfCountryFrequency'),
- config
- );
- </script>
-
- {% endblock %}
|