@@ -62,7 +62,6 @@ export default class OlRenderer {
6262 multiWorld : false ,
6363 } ) ,
6464 } ) ;
65- console . log ( this . map ) ;
6665
6766 this . _extent_size = 10000000 ;
6867 this . _node_scale_types = { size : "Sqrt" , opacity : "Linear" } ;
@@ -174,6 +173,9 @@ export default class OlRenderer {
174173 hex_opacity = "00" ;
175174 } else {
176175 hex_opacity = Math . floor ( opacity * 255 ) . toString ( 16 ) ;
176+ if ( hex_opacity . length === 1 ) {
177+ hex_opacity = "0" + hex_opacity ;
178+ }
177179 }
178180
179181 return color + hex_opacity ;
@@ -185,6 +187,10 @@ export default class OlRenderer {
185187 opacity = Math . round ( nstyle . opacity . fixed * 100 ) / 100 ;
186188 } else if ( nstyle . opacity . mode === "varied" ) {
187189 opacity = Math . round ( this . nodeOpacityScale ( node ) * 100 ) / 100 ;
190+ //As log(0) = -Infinity, we affect zero in this case
191+ if ( opacity === - Infinity ) {
192+ opacity = 0 ;
193+ }
188194 }
189195
190196 //COLOR
@@ -247,7 +253,9 @@ export default class OlRenderer {
247253 }
248254 nodeOpacityScale ( node ) {
249255 //We need to round the number
250- return this . _scale_node_opacity ( + node . properties [ this . _node_var . opacity ] ) ;
256+ var node_value = node . properties [ this . _node_var . opacity ] ;
257+
258+ return this . _scale_node_opacity ( node_value ) ;
251259 }
252260
253261 //Creates color groups according to qualitative variable
@@ -508,7 +516,6 @@ export default class OlRenderer {
508516 [ min_opa , max_opa ] = this . handle_log_scale_opacity_range (
509517 min_opa ,
510518 max_opa ,
511- false ,
512519 "#semioNodes"
513520 ) ;
514521 } else if (
@@ -521,10 +528,12 @@ export default class OlRenderer {
521528 true ,
522529 "#semioNodes"
523530 ) ;
531+ if ( [ min_size , max_size ] === false ) {
532+ return ;
533+ }
524534 [ min_opa , max_opa ] = this . handle_log_scale_opacity_range (
525535 min_opa ,
526536 max_opa ,
527- false ,
528537 "#semioNodes"
529538 ) ;
530539 }
@@ -575,6 +584,7 @@ export default class OlRenderer {
575584 alert (
576585 "Size : Can't use logarithmic scale with this data (range must not intersect 0)"
577586 ) ;
587+ return false ;
578588 } else {
579589 if ( do_not_close === false ) $ ( modal_id ) . modal ( "hide" ) ;
580590 }
@@ -643,6 +653,9 @@ export default class OlRenderer {
643653 opacity = Math . round ( lstyle . opacity . fixed * 100 ) / 100 ;
644654 } else if ( lstyle . opacity . mode === "varied" ) {
645655 opacity = Math . round ( this . linkOpacityScale ( link ) * 100 ) / 100 ;
656+ if ( opacity === - Infinity ) {
657+ opacity = 0 ;
658+ }
646659 }
647660
648661 //COLOR
@@ -738,7 +751,6 @@ export default class OlRenderer {
738751 //Nombre de couleurs (7.99 car ayant 8 couleurs, l'indice finale ne doit pas dépasser 7)
739752 . range ( [ 0 , 7.99 ] )
740753 . domain ( [ min_count , max_count ] ) ;
741- console . log ( min_count , max_count ) ;
742754
743755 //SIZE
744756
@@ -811,9 +823,9 @@ export default class OlRenderer {
811823
812824 create_arrows ( links , lstyle ) {
813825 var nodes_hash = this . proj_nodes_hash ;
826+ console . log ( nodes_hash ) ;
814827 let orientation = lstyle . shape . orientation ;
815828 let shape_type = lstyle . shape . type ;
816- console . log ( orientation , shape_type ) ;
817829
818830 let style = {
819831 geometry : {
0 commit comments