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.

130 lines
2.6KB

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