File tree Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Original file line number Diff line number Diff line change 7070 </ head >
7171 < body >
7272 < script type ="text/javascript ">
73- // Load dataset from external JSON file and initialize the map
7473 const map = new NetJSONGraph (
7574 "../assets/data/netjson-clustering.json" ,
7675 {
9291 { name : "ok" , nodeStyle : { color : "#1ba619" } } ,
9392 { name : "problem" , nodeStyle : { color : "#ffa500" } } ,
9493 { name : "critical" , nodeStyle : { color : "#c92517" } } ,
95- ] ,
96- nodeLabel : function ( node ) {
97- // Return just the node name without the ID
98- return node . name || '' ;
99- } ,
100- prepareData : ( data ) => {
101- data . nodes . forEach ( ( node ) => {
102- // Keep location inside properties for later usage
103- node . properties = {
104- ...node . properties ,
105- location : node . location ,
106- } ;
107-
108- const status = ( node . properties ?. status || "" ) . toLowerCase ( ) ;
109- if ( [ "ok" , "problem" , "critical" ] . includes ( status ) ) {
110- node . category = status ;
111- } else {
112- node . category = "unknown" ;
113- }
114- // No `node.label` assignment to suppress labels
115- } ) ;
116- } ,
117- } ,
94+ ]
95+ }
11896 ) ;
11997
12098 // Build legend UI
You can’t perform that action at this time.
0 commit comments