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.

109 lines
2.1KB

  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. <canvas id="chartOfYearFrequency" width="600" height="300"></canvas>
  7. <canvas id="chartOfCountryFrequency" width="600" height="300"></canvas>
  8. <script type="text/javascript">
  9. // retrieve variables passed from Python
  10. var year_labels = {{ year_labels|safe }}
  11. var year_dataset = {{ year_dataset|safe }}
  12. // set up chart
  13. var data = {
  14. labels: year_labels,
  15. datasets: year_dataset,
  16. };
  17. var config = {
  18. type: 'bar',
  19. data: data,
  20. options: {
  21. plugins: {
  22. title: {
  23. display: true,
  24. text: 'number of patent records for each year'
  25. },
  26. },
  27. responsive: true,
  28. scales: {
  29. x: {
  30. title: {
  31. display: true,
  32. text: 'year'
  33. },
  34. stacked: true,
  35. },
  36. y: {
  37. title: {
  38. display: true,
  39. text: 'number of records'
  40. },
  41. stacked: true
  42. }
  43. }
  44. }
  45. };
  46. var yearGraph = new Chart(
  47. document.getElementById('chartOfYearFrequency'),
  48. config
  49. );
  50. </script>
  51. <script type="text/javascript">
  52. // retrieve variables passed from Python
  53. var country_labels = {{ country_labels|safe }}
  54. var country_dataset = {{ country_dataset|safe }}
  55. // set up chart
  56. var data = {
  57. labels: country_labels,
  58. datasets: country_dataset,
  59. };
  60. var config = {
  61. type: 'bar',
  62. data: data,
  63. options: {
  64. plugins: {
  65. title: {
  66. display: true,
  67. text: 'number of patent records from each country'
  68. },
  69. },
  70. responsive: true,
  71. scales: {
  72. x: {
  73. title: {
  74. display: true,
  75. text: 'country'
  76. },
  77. stacked: true,
  78. },
  79. y: {
  80. title: {
  81. display: true,
  82. text: 'number of records'
  83. },
  84. stacked: true
  85. }
  86. }
  87. }
  88. };
  89. var yearGraph = new Chart(
  90. document.getElementById('chartOfCountryFrequency'),
  91. config
  92. );
  93. </script>
  94. {% endblock %}