|
408 | 408 |
|
409 | 409 |
|
410 | 410 | <div class="col--md-12 align-self-end pb-0 mb-0"> |
411 | | - {% if request.GET.year_from_min or request.GET.year_to_max or request.GET.created_before or request.GET.polity or request.GET.selected_batch or request.GET.inst_type or request.GET.ra_check or request.GET.inst_extent or request.GET.inst_intensity or request.GET.has_comment or request.GET.has_private_comment or request.GET.researcher or request.GET.expert or request.GET.real_event_check %} |
| 411 | + {% if request.GET.polity or request.GET.selected_batch or request.GET.inst_type or request.GET.ra_check or request.GET.inst_extent or request.GET.inst_intensity or request.GET.has_comment or request.GET.has_private_comment or request.GET.researcher or request.GET.expert or request.GET.real_event_check %} |
412 | 412 |
|
413 | 413 | <div class="py-1 px-0 d-inline-block" > |
414 | 414 | <strong>Filters applied:</strong> |
415 | 415 | <ul class="list-inline mb-1"> |
416 | | - {% if request.GET.year_from_min %} |
417 | | - <li class="list-inline-item px-2 mb-1 rounded bg-orange-light text-dark"> |
418 | | - <span class="fw-light">Year ≥ </span> <span class="fw-bold"> {{ request.GET.year_from_min }}</span> |
419 | | - |
420 | | - <a href="?{% query_transform request year_from_min=None %}" class="text-dark ms-1" style="vertical-align:center;"> <i class="fa-solid fa-square-xmark"></i></a> |
421 | | - </li> |
422 | | - {% endif %} |
423 | | - {% if request.GET.year_to_max %} |
424 | | - <li class="list-inline-item px-2 mb-1 rounded bg-orange-light text-dark"> |
425 | | - <span class="fw-light">Year ≤ </span> <span class="fw-bold"> {{ request.GET.year_to_max }}</span> |
426 | | - |
427 | | - <a href="?{% query_transform request year_to_max=None %}" class="text-dark ms-1" style="text-decoration: none;"> <i class="fa-solid fa-square-xmark"></i></a> |
428 | | - </li> |
429 | | - {% endif %} |
430 | 416 | {% for type in instability_types %} |
431 | 417 | {% if type.id|stringformat:"s" in selected_inst_type_ids %} |
432 | 418 | <li class="list-inline-item px-2 mb-1 rounded bg-info-light text-dark"> |
|
493 | 479 | {% else %} |
494 | 480 | Not Available |
495 | 481 | {% endif %} |
496 | | - |
497 | | - |
498 | 482 | </span> |
499 | 483 | <a href="?{% query_transform request has_private_comment=None %}" class="text-dark ms-1"> <i class="fa-solid fa-square-xmark"></i></a> |
500 | 484 | </li> |
|
510 | 494 | {% else %} |
511 | 495 | Not Available |
512 | 496 | {% endif %} |
513 | | - |
514 | | - |
515 | 497 | </span> |
516 | 498 | <a href="?{% query_transform request has_private_comment=None %}" class="text-dark ms-1"> <i class="fa-solid fa-square-xmark"></i></a> |
517 | 499 | </li> |
@@ -590,8 +572,8 @@ <h5> <span class="fw-light"> Total Selected Events: </span> {{events|length}} / |
590 | 572 | </div> |
591 | 573 | <div class="row"> |
592 | 574 | <div class="col-md-8 p-3 border border-1"> |
593 | | - <canvas id="centuryChart" height="5" width="10"></canvas> |
594 | | - <hr> |
| 575 | + <canvas id="centuryChart" height="5" width="10"></canvas> |
| 576 | +<hr> |
595 | 577 | <div class="row"> |
596 | 578 | <div class="col-md-6"> |
597 | 579 | <canvas id="extentChart" height="10" width="10"></canvas> |
@@ -674,10 +656,73 @@ <h5> <span class="fw-light"> Total Selected Events: </span> {{events|length}} / |
674 | 656 | const expertData = {{ expert_chart_data|safe }}; |
675 | 657 | const centuryData = {{ century_chart_data|safe }}; |
676 | 658 |
|
| 659 | + |
677 | 660 | const batchData = {{ batch_data|safe }}; |
678 | 661 |
|
679 | 662 | const realCheckData = {{ real_check_data|safe }}; |
680 | 663 |
|
| 664 | + |
| 665 | + new Chart(document.getElementById('centuryChart'), { |
| 666 | + type: 'bar', |
| 667 | + data: { |
| 668 | + labels: centuryData.map(c => c.century), |
| 669 | + datasets: [{ |
| 670 | + label: ' Count', |
| 671 | + data: centuryData.map(c => c.count), |
| 672 | + backgroundColor: 'teal' |
| 673 | + }] |
| 674 | + }, |
| 675 | + options: { |
| 676 | + responsive: true, |
| 677 | + plugins: { |
| 678 | + title: { |
| 679 | + display: true, |
| 680 | + text: 'Events by Century', |
| 681 | + font: { |
| 682 | + size: 18, |
| 683 | + weight: 'bold' |
| 684 | + }, |
| 685 | + padding: { |
| 686 | + top: 10, |
| 687 | + bottom: 30 |
| 688 | + } |
| 689 | + }, |
| 690 | + legend: { |
| 691 | + display: false |
| 692 | + } |
| 693 | + }, |
| 694 | + scales: { |
| 695 | + y: { |
| 696 | + ticks: { |
| 697 | + // This ensures only integer labels appear |
| 698 | + callback: function(value) { |
| 699 | + if (Number.isInteger(value)) { |
| 700 | + return value; |
| 701 | + } |
| 702 | + return null; |
| 703 | + }, |
| 704 | + }, |
| 705 | + beginAtZero: true, |
| 706 | + title: { |
| 707 | + display: true, |
| 708 | + text: 'Event Count' |
| 709 | + } |
| 710 | + }, |
| 711 | + x: { |
| 712 | + grid: { |
| 713 | + display: false // 👈 removes vertical grid lines |
| 714 | + }, |
| 715 | + title: { |
| 716 | + display: true, |
| 717 | + text: 'Century' |
| 718 | + } |
| 719 | + } |
| 720 | + } |
| 721 | + } |
| 722 | + }); |
| 723 | + |
| 724 | + |
| 725 | + |
681 | 726 | new Chart(document.getElementById('realCheckChart'), { |
682 | 727 | type: 'pie', |
683 | 728 | data: { |
@@ -853,66 +898,6 @@ <h5> <span class="fw-light"> Total Selected Events: </span> {{events|length}} / |
853 | 898 | } |
854 | 899 | }); |
855 | 900 |
|
856 | | - new Chart(document.getElementById('centuryChart'), { |
857 | | - type: 'line', |
858 | | - data: { |
859 | | - labels: centuryData.map(c => c.century), |
860 | | - datasets: [{ |
861 | | - label: 'Count', |
862 | | - data: centuryData.map(c => c.count), |
863 | | - backgroundColor: 'teal' |
864 | | - }] |
865 | | - }, |
866 | | - options: { |
867 | | - responsive: true, |
868 | | - plugins: { |
869 | | - title: { |
870 | | - display: true, |
871 | | - text: 'Events by Century', |
872 | | - font: { |
873 | | - size: 18, |
874 | | - weight: 'bold' |
875 | | - }, |
876 | | - padding: { |
877 | | - top: 10, |
878 | | - bottom: 30 |
879 | | - } |
880 | | - }, |
881 | | - legend: { |
882 | | - display: false |
883 | | - } |
884 | | - }, |
885 | | - scales: { |
886 | | - y: { |
887 | | - ticks: { |
888 | | - // This ensures only integer labels appear |
889 | | - callback: function(value) { |
890 | | - if (Number.isInteger(value)) { |
891 | | - return value; |
892 | | - } |
893 | | - return null; |
894 | | - }, |
895 | | - }, |
896 | | - beginAtZero: true, |
897 | | - title: { |
898 | | - display: true, |
899 | | - text: 'Event Count' |
900 | | - } |
901 | | - }, |
902 | | - x: { |
903 | | - grid: { |
904 | | - display: false // 👈 removes vertical grid lines |
905 | | - }, |
906 | | - title: { |
907 | | - display: true, |
908 | | - text: 'Century' |
909 | | - } |
910 | | - } |
911 | | - } |
912 | | - } |
913 | | - }); |
914 | | - |
915 | | - |
916 | 901 |
|
917 | 902 | new Chart(document.getElementById('extentChart'), { |
918 | 903 | type: 'bar', |
|
0 commit comments