MCPcopy Create free account
hub / github.com/apache/storm / createNetwork

Function createNetwork

storm-webapp/src/main/webapp/js/visualization.js:165–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

163}
164
165function createNetwork() {
166 var data = {
167 "nodes": visNS.nodes,
168 "edges": visNS.edges
169 };
170
171 // Merge theme-dependent colors into options
172 var themeOpts = getThemeOptions();
173 $.extend(true, visNS.options.edges, themeOpts.edges);
174 $.extend(true, visNS.options.nodes, themeOpts.nodes);
175
176 // Create network
177 visNS.network = new vis.Network(visNS.networkContainer, data, visNS.options);
178
179 // Create event handlers
180 visNS.network.on("click", function (params) {
181 handleClickEvent(params);
182 });
183 visNS.network.on("deselectNode", function(params) {
184 handleNodeClickEvent(null);
185 });
186
187 // Then disable layout
188 visNS.network.setOptions({layout: {hierarchical: false } });
189
190 // Watch for theme changes and update network colors
191 new MutationObserver(function() {
192 applyThemeToNetwork();
193 }).observe(document.documentElement, {
194 attributes: true,
195 attributeFilter: ['data-bs-theme']
196 });
197}
198
199function handleClickEvent(params) {
200 if (params["nodes"].length == 1) {

Callers 1

parseResponseFunction · 0.85

Calls 4

getThemeOptionsFunction · 0.85
handleClickEventFunction · 0.85
handleNodeClickEventFunction · 0.85
applyThemeToNetworkFunction · 0.85

Tested by

no test coverage detected