@@ -1207,11 +1207,10 @@ export default class Sigma<
12071207
12081208 /**
12091209 * Get the label color for a node.
1210- * TODO: This should be integrated into the styles system.
12111210 * @private
12121211 */
1213- private getLabelColor ( _data : NodeDisplayData ) : string {
1214- return "#000" ;
1212+ private getLabelColor ( data : NodeDisplayData ) : string {
1213+ return data . labelColor ;
12151214 }
12161215
12171216 /**
@@ -1849,11 +1848,9 @@ export default class Sigma<
18491848 this . edgeLabelProgram . reallocate ( totalCharacters ) ;
18501849
18511850 // Process each visible edge label into the program's buffer
1852- // TODO: These defaults should come from the styles system
18531851 const defaultEdgeLabelSize = 12 ;
18541852 const defaultEdgeLabelMargin = this . primitives ?. edges ?. label ?. margin ?? 5 ;
18551853 const defaultEdgeLabelPosition = "over" as const ;
1856- const defaultEdgeLabelColor = "#000" ;
18571854
18581855 let characterOffset = 0 ;
18591856 for ( const { edge, sourceData, targetData, edgeData, sourceKey, targetKey } of edgesToProcess ) {
@@ -1870,7 +1867,7 @@ export default class Sigma<
18701867 x : ( sourceData . x + targetData . x ) / 2 ,
18711868 y : ( sourceData . y + targetData . y ) / 2 ,
18721869 size : defaultEdgeLabelSize ,
1873- color : defaultEdgeLabelColor ,
1870+ color : edgeData . labelColor ,
18741871 nodeSize : 0 ,
18751872 nodeIndex : - 1 ,
18761873 margin : defaultEdgeLabelMargin ,
@@ -2106,6 +2103,7 @@ export default class Sigma<
21062103 size : resolvedStyle . size ?? 2 ,
21072104 color : resolvedStyle . color ?? "#666" ,
21082105 opacity : resolvedStyle . opacity ?? 1 ,
2106+ labelColor : resolvedStyle . labelColor ?? "#000" ,
21092107 label : resolvedStyle . label ?? null ,
21102108 hidden : resolvedStyle . visibility === "hidden" ,
21112109 forceLabel : resolvedStyle . labelVisibility === "visible" ,
@@ -2466,6 +2464,7 @@ export default class Sigma<
24662464 size : resolvedStyle . size ?? 0.5 ,
24672465 color : resolvedStyle . color ?? "#ccc" ,
24682466 opacity : resolvedStyle . opacity ?? 1 ,
2467+ labelColor : resolvedStyle . labelColor ?? "#666" ,
24692468 label : resolvedStyle . label ?? "" ,
24702469 hidden : resolvedStyle . visibility === "hidden" ,
24712470 forceLabel : resolvedStyle . labelVisibility === "visible" ,
0 commit comments