Bladeren bron

Fix grafica nessun risultato scheda persona

Giulia Cacioli 1 jaar geleden
bovenliggende
commit
59dea1dfdd
4 gewijzigde bestanden met toevoegingen van 41 en 16 verwijderingen
  1. 4 2
      Persona.html
  2. 9 5
      css/place_people.css
  3. 15 5
      js/people.js
  4. 13 4
      js/word_cloud.js

+ 4 - 2
Persona.html

@@ -357,6 +357,7 @@
 												<div class="loader"></div>
 											</div>
 										</div>
+										<div id="people_map_no_res"></div>
 									</div>
 
 									<div class="col-3" id="references_persona">
@@ -376,11 +377,12 @@
 
 								<div class="row">
 									<div class="col-9">
-										<div id="person_map" style="background-color: #fff; min-height:300px; margin-left:15px; margin-right:15px;">
-											<div id="myWordCloud" class="svg-container">
+										<div id="person_map">
+											<div id="myWordCloud" class="svg-container" style="background-color: #fff; min-height:400px;">
 												<div id="word_loader" class="loader"></div>
 											</div>
 										</div>
+										<div id="person_map_no_res"></div>
 									</div>
 
 									<div class="col-3" id="references_network">

+ 9 - 5
css/place_people.css

@@ -279,7 +279,6 @@ div#container {
     display: inline-block;
     position: relative;
     width: 100%;
-    padding-bottom: 60%;
     vertical-align: top;
     overflow: auto;
 }
@@ -506,14 +505,19 @@ text.source {
 }
 
 .no_info_icon {
-  width:50%;
-  height: auto;
-  fill: #e9e9e9;
+  display: flex;
+  align-items: center;
+}
+
+.no_info_icon p {
+  margin-bottom: 0;
+  margin-left: 10px;
 }
 
 .record_box {
   max-height: 300px;
-  overflow: scroll;
+  overflow-y: scroll;
+  border-bottom: 1px solid rgba(0,0,0,.1);
 }
 
 #ev_thead {

+ 15 - 5
js/people.js

@@ -955,7 +955,7 @@ function createDivRelazione(type, id){
 
 function createColRelazione(text, link) {
   htmlCode = '\
-    <div class="row"> \
+    <div class="row mb-1"> \
         <div class="col"><NAME></div> \
         <div class="col-auto"> \
             <button class="persona btn btn-default" type="button" id="<URI>">\
@@ -1022,7 +1022,16 @@ function handle_Events(json) {
   if (events.length != 0) {
     document.getElementById("res_events").innerHTML = EventsTable;
   } else {
-    document.getElementById("res_events").innerHTML = "Nessun evento trovato";
+    var eventIcon = "<div id='map_icon' class='no_info_icon'> \
+      <svg width='30' viewBox='0 0 411 404' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'> \
+        <g id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'> \
+          <g id='noun-event-1989064' fill='#000000' fill-rule='nonzero'><path d='M31.55,403.44 L380.46,403.44 C397.304,403.44 410.538,389.331 410.538,372.378 L410.538,166.098 L0.378,166.098 L0.378,372.378 C0.378,389.331 14.706,403.44 31.55,403.44 Z' id='Path'></path><polygon id='Path' points='76.94 0.562 129.44 0.562 129.44 69.468 76.94 69.468'></polygon><path d='M410.53,80.08 C410.53,63.236 397.296,49.783 380.452,49.783 L361.311,49.783 L361.311,82.924 C361.311,90.1428 355.186,95.721 347.967,95.721 L269.655,95.721 C262.4362,95.721 256.202,90.1429 256.202,82.924 L256.202,49.783 L155.582,49.783 L155.582,82.924 C155.582,90.1428 149.457,95.721 142.129,95.721 L63.817,95.721 C56.5982,95.721 50.473,90.1429 50.473,82.924 L50.473,49.783 L31.551,49.783 C14.707,49.783 0.379,63.127 0.379,80.08 L0.379,143.846 L410.539,143.846 L410.53,80.08 Z' id='Path'></path><polygon id='Path' points='282.56 0.562 335.06 0.562 335.06 69.468 282.56 69.468'></polygon></g> \
+        </g> \
+      </svg> \
+      <p>Nessun evento trovato</p> \
+    </div>";
+
+    document.getElementById("res_events").innerHTML = eventIcon;
   }
 
 }
@@ -1377,15 +1386,16 @@ function handle_map(json) {
   var longitude = long/i;
 
   var mapIcon = "<div id='map_icon' class='no_info_icon'> \
-  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'> \
-  <!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d='M408 120C408 174.6 334.9 271.9 302.8 311.1C295.1 321.6 280.9 321.6 273.2 311.1C241.1 271.9 168 174.6 168 120C168 53.73 221.7 0 288 0C354.3 0 408 53.73 408 120zM288 152C310.1 152 328 134.1 328 112C328 89.91 310.1 72 288 72C265.9 72 248 89.91 248 112C248 134.1 265.9 152 288 152zM425.6 179.8C426.1 178.6 426.6 177.4 427.1 176.1L543.1 129.7C558.9 123.4 576 135 576 152V422.8C576 432.6 570 441.4 560.9 445.1L416 503V200.4C419.5 193.5 422.7 186.7 425.6 179.8zM150.4 179.8C153.3 186.7 156.5 193.5 160 200.4V451.8L32.91 502.7C17.15 508.1 0 497.4 0 480.4V209.6C0 199.8 5.975 190.1 15.09 187.3L137.6 138.3C140 152.5 144.9 166.6 150.4 179.8H150.4zM327.8 331.1C341.7 314.6 363.5 286.3 384 255V504.3L192 449.4V255C212.5 286.3 234.3 314.6 248.2 331.1C268.7 357.6 307.3 357.6 327.8 331.1L327.8 331.1z'/> \
+  <svg xmlns='http://www.w3.org/2000/svg' width='30' viewBox='0 0 576 512'> \
+    <path d='M408 120C408 174.6 334.9 271.9 302.8 311.1C295.1 321.6 280.9 321.6 273.2 311.1C241.1 271.9 168 174.6 168 120C168 53.73 221.7 0 288 0C354.3 0 408 53.73 408 120zM288 152C310.1 152 328 134.1 328 112C328 89.91 310.1 72 288 72C265.9 72 248 89.91 248 112C248 134.1 265.9 152 288 152zM425.6 179.8C426.1 178.6 426.6 177.4 427.1 176.1L543.1 129.7C558.9 123.4 576 135 576 152V422.8C576 432.6 570 441.4 560.9 445.1L416 503V200.4C419.5 193.5 422.7 186.7 425.6 179.8zM150.4 179.8C153.3 186.7 156.5 193.5 160 200.4V451.8L32.91 502.7C17.15 508.1 0 497.4 0 480.4V209.6C0 199.8 5.975 190.1 15.09 187.3L137.6 138.3C140 152.5 144.9 166.6 150.4 179.8H150.4zM327.8 331.1C341.7 314.6 363.5 286.3 384 255V504.3L192 449.4V255C212.5 286.3 234.3 314.6 248.2 331.1C268.7 357.6 307.3 357.6 327.8 331.1L327.8 331.1z'/> \
   </svg> \
   <p>Nessun luogo trovato</p> \
   </div>";
 
   if (locations.length == 0) {
+    $("#people_map").css("display", "none");
     $("#references_persona").css("display", "none");
-    document.getElementById("map").innerHTML = mapIcon;
+    document.getElementById("people_map_no_res").innerHTML = mapIcon;
   }
 
   document.getElementById("list_places_person").innerHTML = myPlaces;

+ 13 - 4
js/word_cloud.js

@@ -210,18 +210,27 @@ function doWordCloud(words){
 
 // Helper function -- draw special empty word cloud if there are no occurrences
 function drawEmptyWordCloud(){
-
     let wordIcon = "<div id='users_icon' class='no_info_icon'> \
-    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'> \
-      <!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d='M319.9 320c57.41 0 103.1-46.56 103.1-104c0-57.44-46.54-104-103.1-104c-57.41 0-103.1 46.56-103.1 104C215.9 273.4 262.5 320 319.9 320zM369.9 352H270.1C191.6 352 128 411.7 128 485.3C128 500.1 140.7 512 156.4 512h327.2C499.3 512 512 500.1 512 485.3C512 411.7 448.4 352 369.9 352zM512 160c44.18 0 80-35.82 80-80S556.2 0 512 0c-44.18 0-80 35.82-80 80S467.8 160 512 160zM183.9 216c0-5.449 .9824-10.63 1.609-15.91C174.6 194.1 162.6 192 149.9 192H88.08C39.44 192 0 233.8 0 285.3C0 295.6 7.887 304 17.62 304h199.5C196.7 280.2 183.9 249.7 183.9 216zM128 160c44.18 0 80-35.82 80-80S172.2 0 128 0C83.82 0 48 35.82 48 80S83.82 160 128 160zM551.9 192h-61.84c-12.8 0-24.88 3.037-35.86 8.24C454.8 205.5 455.8 210.6 455.8 216c0 33.71-12.78 64.21-33.16 88h199.7C632.1 304 640 295.6 640 285.3C640 233.8 600.6 192 551.9 192z'/> \
+    <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='30' height='30' viewBox='0 0 256 256' xml:space='preserve'> \
+        <g transform='translate(128 128) scale(0.72 0.72)'> \
+            <g style='stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;' transform='translate(-175.05 -175.05000000000004) scale(3.89 3.89)'> \
+                <path d='M 45 49.519 L 45 49.519 c -7.68 0 -13.964 -6.284 -13.964 -13.964 v -5.008 c 0 -7.68 6.284 -13.964 13.964 -13.964 h 0 c 7.68 0 13.964 6.284 13.964 13.964 v 5.008 C 58.964 43.236 52.68 49.519 45 49.519 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+                <path d='M 52.863 51.438 c -2.362 1.223 -5.032 1.927 -7.863 1.927 s -5.501 -0.704 -7.863 -1.927 C 26.58 53.014 18.414 62.175 18.414 73.152 v 14.444 c 0 1.322 1.082 2.403 2.403 2.403 h 48.364 c 1.322 0 2.403 -1.082 2.403 -2.403 V 73.152 C 71.586 62.175 63.42 53.014 52.863 51.438 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+                <path d='M 71.277 34.854 c -2.362 1.223 -5.032 1.927 -7.863 1.927 c -0.004 0 -0.007 0 -0.011 0 c -0.294 4.412 -2.134 8.401 -4.995 11.43 c 10.355 3.681 17.678 13.649 17.678 24.941 v 0.263 h 11.511 c 1.322 0 2.404 -1.082 2.404 -2.404 V 56.568 C 90 45.59 81.834 36.429 71.277 34.854 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+                <path d='M 63.414 0 c -7.242 0 -13.237 5.589 -13.898 12.667 c 8 2.023 13.947 9.261 13.947 17.881 v 2.385 c 7.657 -0.027 13.914 -6.298 13.914 -13.961 v -5.008 C 77.378 6.284 71.094 0 63.414 0 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+                <path d='M 13.915 73.152 c 0 -11.292 7.322 -21.261 17.677 -24.941 c -2.861 -3.029 -4.702 -7.019 -4.995 -11.43 c -0.004 0 -0.007 0 -0.011 0 c -2.831 0 -5.5 -0.704 -7.863 -1.927 C 8.166 36.429 0 45.59 0 56.568 v 14.444 c 0 1.322 1.082 2.404 2.404 2.404 h 11.511 V 73.152 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+                <path d='M 26.536 32.932 v -2.385 c 0 -8.62 5.946 -15.858 13.947 -17.881 C 39.823 5.589 33.828 0 26.586 0 c -7.68 0 -13.964 6.284 -13.964 13.964 v 5.008 C 12.622 26.635 18.879 32.905 26.536 32.932 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;' transform='matrix(1 0 0 1 0 0)' stroke-linecap='round' /> \
+            </g> \
+        </g> \
     </svg> \
     <p>Nessuna persona trovata</p> \
     </div>";
 
+    $("#person_map").css("display", "none");
     $("#wordcloudNetwork").css("display", "none");
     $("#references_network").css("display", "none");
 
-    document.getElementById("myWordCloud").innerHTML = wordIcon;
+    document.getElementById("person_map_no_res").innerHTML = wordIcon;
 
 }