A search interface for the Performing Patents Otherwise publication as part of the Politics of Patents case study (part of Copim WP6): this parses data from the archive of RTF files and provides additional data from the European Patent Office OPS API. https://patents.copim.ac.uk
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

127 lines
2.8KB

  1. {% extends "base.html" %}
  2. {% block content %}
  3. <a href="{{ url_for('main.index') }}" class="h1 text-left"> ⇽ </a>
  4. There are a total of {{ total_number }} patents.
  5. <br><br>
  6. <div class="row">
  7. <div class="col-6 text-center">
  8. {% for i in range(0, year_data|length) %}
  9. {% if i % 2 %}
  10. {{ year_data[i] }}<br>
  11. {% else %}
  12. <a href="{{ url_for('search.basic_search', year=year_data[i]) }}">
  13. {{ year_data[i] }}
  14. </a>:
  15. {% endif %}
  16. {% endfor %}
  17. </div>
  18. <div class="col-6 text-center">
  19. {% for i in range(0, country_data|length) %}
  20. {% if i % 2 %}
  21. {{ country_data[i] }}<br>
  22. {% else %}
  23. {% if country_data[i].name is defined %}
  24. <a href="{{ url_for('search.basic_search', country=country_data[i].alpha_2) }}">
  25. {{ country_data[i].name }}
  26. </a>
  27. {{ country_data[i].flag }}:
  28. {% else %}
  29. <a href="{{ url_for('search.basic_search', country=country_data[i]) }}">
  30. {{ country_data[i] }}
  31. </a>:
  32. {% endif %}
  33. {% endif %}
  34. {% endfor %}
  35. </div>
  36. </div>
  37. <canvas id="chartOfYearFrequency" width="600" height="300"></canvas>
  38. <canvas id="chartOfCountryFrequency" width="600" height="300"></canvas>
  39. <script type="text/javascript">
  40. // retrieve variables passed from Python
  41. var year_labels = {{ year_labels|safe }}
  42. var year_dataset = {{ year_dataset|safe }}
  43. // set up chart
  44. var data = {
  45. labels: year_labels,
  46. datasets: year_dataset,
  47. };
  48. var config = {
  49. type: 'bar',
  50. data: data,
  51. options: {
  52. plugins: {
  53. title: {
  54. display: true,
  55. text: 'number of patent records for each year'
  56. },
  57. },
  58. responsive: true,
  59. scales: {
  60. x: {
  61. title: {
  62. display: true,
  63. text: 'year'
  64. },
  65. stacked: true,
  66. },
  67. y: {
  68. title: {
  69. display: true,
  70. text: 'number of records'
  71. },
  72. stacked: true
  73. }
  74. }
  75. }
  76. };
  77. Chart.defaults.font.family = 'Compagnon'
  78. var yearGraph = new Chart(
  79. document.getElementById('chartOfYearFrequency'),
  80. config
  81. );
  82. </script>
  83. <script type="text/javascript">
  84. // retrieve variables passed from Python
  85. var country_labels = {{ country_labels|safe }}
  86. var country_dataset = {{ country_dataset|safe }}
  87. // set up chart
  88. var data = {
  89. labels: country_labels,
  90. datasets: country_dataset,
  91. };
  92. var config = {
  93. type: 'pie',
  94. data: data,
  95. options: {
  96. plugins: {
  97. title: {
  98. display: true,
  99. text: 'number of patent records from each country'
  100. },
  101. },
  102. responsive: true,
  103. }
  104. };
  105. Chart.defaults.font.family = 'Compagnon'
  106. var yearGraph = new Chart(
  107. document.getElementById('chartOfCountryFrequency'),
  108. config
  109. );
  110. </script>
  111. {% endblock %}