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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.7KB

  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. var yearGraph = new Chart(
  78. document.getElementById('chartOfYearFrequency'),
  79. config
  80. );
  81. </script>
  82. <script type="text/javascript">
  83. // retrieve variables passed from Python
  84. var country_labels = {{ country_labels|safe }}
  85. var country_dataset = {{ country_dataset|safe }}
  86. // set up chart
  87. var data = {
  88. labels: country_labels,
  89. datasets: country_dataset,
  90. };
  91. var config = {
  92. type: 'pie',
  93. data: data,
  94. options: {
  95. plugins: {
  96. title: {
  97. display: true,
  98. text: 'number of patent records from each country'
  99. },
  100. },
  101. responsive: true,
  102. }
  103. };
  104. var yearGraph = new Chart(
  105. document.getElementById('chartOfCountryFrequency'),
  106. config
  107. );
  108. </script>
  109. {% endblock %}