Skip to content

Commit f7e59b2

Browse files
author
Your Name
committed
Automated commit on 2024-12-31 16:59:27
1 parent b60beef commit f7e59b2

File tree

1 file changed

+1
-211
lines changed

1 file changed

+1
-211
lines changed

html-static/js/dev.js

+1-211
Original file line numberDiff line numberDiff line change
@@ -3125,168 +3125,6 @@ function viewportDrawerLayoutHorizontal() {
31253125
}, 2000);
31263126
}
31273127

3128-
// // Function to initialize Leaflet map and apply GeoMap layout
3129-
// // Function to initialize and enable GeoMap
3130-
// function viewportDrawerLayoutGeoMap() {
3131-
// // cytoscape-leaflet global variables
3132-
// // var isGeoMapInitialized = false;
3133-
// // var cytoscapeLeafletMap;
3134-
// // var cytoscapeLeafletLeaf;
3135-
3136-
// if (!isGeoMapInitialized) {
3137-
// // Show Leaflet container
3138-
// var leafletContainer = document.getElementById('cy-leaflet');
3139-
// if (leafletContainer) {
3140-
// leafletContainer.style.display = 'block';
3141-
// }
3142-
3143-
// // Initialize Cytoscape-Leaflet
3144-
// cytoscapeLeafletLeaf = cy.leaflet({
3145-
// container: leafletContainer
3146-
// });
3147-
3148-
// // Remove default tile layer
3149-
// cytoscapeLeafletLeaf.map.removeLayer(cytoscapeLeafletLeaf.defaultTileLayer);
3150-
3151-
// // Assign map reference
3152-
// cytoscapeLeafletMap = cytoscapeLeafletLeaf.map;
3153-
3154-
// // Add custom tile layer
3155-
// L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}{r}.png', {
3156-
// attribution: '© OpenStreetMap contributors © CARTO',
3157-
// subdomains: 'abcd',
3158-
// maxZoom: 19
3159-
// }).addTo(cytoscapeLeafletMap);
3160-
3161-
// isGeoMapInitialized = true;
3162-
// }
3163-
3164-
// loadCytoStyle(cy); // Reapply the Cytoscape stylesheet
3165-
3166-
// // Apply GeoMap layout
3167-
// cy.layout({
3168-
// name: 'preset',
3169-
// fit: false,
3170-
// positions: function (node) {
3171-
// let data = node.data();
3172-
3173-
// // Convert lat/lng to container point
3174-
// console.log("node.id", node.id())
3175-
// console.log("data.lat, data.lng", data.lat, data.lng)
3176-
// console.log("Number(data.lat), Number(data.lng)", Number(data.lat), Number(data.lng))
3177-
3178-
// const point = cytoscapeLeafletMap.latLngToContainerPoint([Number(data.lat), Number(data.lng)]);
3179-
// console.log("point: ", point.x, point.y)
3180-
3181-
// return { x: point.x, y: point.y };
3182-
3183-
// }
3184-
// }).run();
3185-
3186-
// // cytoscapeLeafletLeaf instance map to fit nodes
3187-
// cytoscapeLeafletLeaf.fit();
3188-
// console.log("cytoscapeLeafletLeaf.fit()")
3189-
3190-
// // Show GeoMap buttons
3191-
// var viewportDrawerGeoMapElements = document.getElementsByClassName("viewport-geo-map");
3192-
// for (var i = 0; i < viewportDrawerGeoMapElements.length; i++) {
3193-
// viewportDrawerGeoMapElements[i].classList.remove('is-hidden');
3194-
// }
3195-
3196-
// // Enable node editing
3197-
// viewportButtonsGeoMapEdit();
3198-
3199-
// console.log("GeoMap has been enabled.");
3200-
// }
3201-
3202-
// // Function to disable GeoMap and revert to default layout
3203-
// function viewportDrawerDisableGeoMap() {
3204-
// // cytoscape-leaflet global variables
3205-
// // var isGeoMapInitialized = false;
3206-
// // var cytoscapeLeafletMap;
3207-
// // var cytoscapeLeafletLeaf;
3208-
// if (!isGeoMapInitialized) {
3209-
// console.log("GeoMap is not initialized.");
3210-
// return;
3211-
// }
3212-
3213-
// // Hide Leaflet container
3214-
// var leafletContainer = document.getElementById('cy-leaflet');
3215-
// if (leafletContainer) {
3216-
// leafletContainer.style.display = 'none';
3217-
// }
3218-
3219-
// // destroy cytoscapeLeafletLeaf instance
3220-
// cytoscapeLeafletLeaf.destroy();
3221-
3222-
// // Revert to default Cytoscape layout
3223-
// const layout = cy.layout({
3224-
// name: "cola",
3225-
// nodeGap: 5,
3226-
// edgeLength: 100,
3227-
// animate: true,
3228-
// randomize: false,
3229-
// maxSimulationTime: 1500,
3230-
// });
3231-
// layout.run();
3232-
3233-
// // remove node topoviewer
3234-
// topoViewerNode = cy.filter('node[name = "topoviewer"]');
3235-
// topoViewerNode.remove();
3236-
3237-
// var cyExpandCollapse = cy.expandCollapse({
3238-
// layoutBy: null, // null means use existing layout
3239-
// undoable: false,
3240-
// fisheye: false,
3241-
// animationDuration: 10, // when animate is true, the duration in milliseconds of the animation
3242-
// animate: true
3243-
// });
3244-
3245-
// // Example collapse/expand after some delay
3246-
// // Make sure the '#parent' node exists in your loaded elements
3247-
// setTimeout(function() {
3248-
// var parent = cy.$('#parent'); // Ensure that '#parent' is actually present in dataCytoMarshall.json
3249-
// cyExpandCollapse.collapse(parent);
3250-
3251-
// setTimeout(function() {
3252-
// cyExpandCollapse.expand(parent);
3253-
// }, 2000);
3254-
// }, 2000);
3255-
3256-
// // Hide GeoMap buttons
3257-
// var viewportDrawerGeoMapElements = document.getElementsByClassName("viewport-geo-map");
3258-
// for (var i = 0; i < viewportDrawerGeoMapElements.length; i++) {
3259-
// if (!viewportDrawerGeoMapElements[i].classList.contains('is-hidden')) {
3260-
// viewportDrawerGeoMapElements[i].classList.add('is-hidden');
3261-
// }
3262-
// }
3263-
3264-
// // Optionally, disable node editing if enabled
3265-
// // For example:
3266-
// // disableGeoMapNodeEditing();
3267-
3268-
// isGeoMapInitialized = false;
3269-
3270-
// loadCytoStyle(cy); // Reapply the Cytoscape stylesheet
3271-
3272-
// console.log("GeoMap has been disabled and reverted to default Cytoscape layout.");
3273-
// }
3274-
3275-
// // Function to toggle GeoMap on and off
3276-
// function toggleGeoMap() {
3277-
// var leafletContainer = document.getElementById('cy-leaflet');
3278-
// var isGeoMapEnabled = leafletContainer && leafletContainer.style.display !== 'none';
3279-
3280-
// if (isGeoMapEnabled) {
3281-
// // Disable GeoMap
3282-
// viewportDrawerDisableGeoMap();
3283-
// } else {
3284-
// // Enable GeoMap
3285-
// viewportDrawerLayoutGeoMap();
3286-
// }
3287-
// }
3288-
3289-
32903128
function viewportDrawerCaptureFunc() {
32913129
console.info("viewportDrawerCaptureButton() - clicked")
32923130

@@ -4240,55 +4078,7 @@ function addSvgIcon(targetHtmlId, svgIcon, altName, position, size) {
42404078
addSvgIcon("endpoint-a-edgeshark", "images/svg-wireshark.svg", "Wireshark Icon", "before", "20px");
42414079
addSvgIcon("endpoint-b-edgeshark", "images/svg-wireshark.svg", "Wireshark Icon", "before", "20px");
42424080

4243-
42444081
addSvgIcon("endpoint-a-clipboard", "images/svg-copy.svg", "Clipboard Icon", "before", "20px");
42454082
addSvgIcon("endpoint-b-clipboard", "images/svg-copy.svg", "Clipboard Icon", "before", "20px");
42464083

4247-
4248-
addSvgIcon("panel-link-action-impairment-B->A", "images/svg-impairment.svg", "Impairment Icon", "before", "15px");
4249-
4250-
4251-
4252-
4253-
// function addWiresharkIcon() {
4254-
// // Find the target node
4255-
// const targetNode = document.getElementById("endpoint-a-edgeshark");
4256-
// if (!targetNode) {
4257-
// console.error("Target node not found.");
4258-
// return;
4259-
// }
4260-
4261-
// // Ensure the target node uses flexbox for alignment
4262-
// targetNode.style.display = "flex";
4263-
// targetNode.style.alignItems = "center";
4264-
4265-
// // Create a container for the icon
4266-
// const iconContainer = document.createElement("div");
4267-
// iconContainer.style.width = "20px";
4268-
// iconContainer.style.height = "20px";
4269-
// iconContainer.style.marginLeft = "4px";
4270-
// iconContainer.style.backgroundImage = "linear-gradient(90deg, white, #00bfff, white)"; // Neon blue
4271-
// iconContainer.style.backgroundSize = "200% 200%"; // For smooth transitions
4272-
// iconContainer.style.animation = "colorGradient 3s infinite"; // Animation to shift gradient
4273-
// iconContainer.style.maskImage = "url('https://raw.githubusercontent.com/siemens/edgeshark/refs/heads/main/icons/_media/icons/Capture.svg')";
4274-
// iconContainer.style.maskSize = "contain";
4275-
// iconContainer.style.maskRepeat = "no-repeat";
4276-
// iconContainer.style.maskPosition = "center";
4277-
4278-
// // Append the container after the label
4279-
// targetNode.append(iconContainer);
4280-
4281-
// // Add dynamic style for gradient animation
4282-
// const style = document.createElement("style");
4283-
// style.textContent = `
4284-
// @keyframes colorGradient {
4285-
// 0% { background-position: 0% 50%; }
4286-
// 50% { background-position: 100% 50%; }
4287-
// 100% { background-position: 0% 50%; }
4288-
// }
4289-
// `;
4290-
// document.head.appendChild(style);
4291-
// }
4292-
4293-
// // Call the function to add the icon
4294-
// addWiresharkIcon();
4084+
addSvgIcon("panel-link-action-impairment-B->A", "images/svg-impairment.svg", "Impairment Icon", "before", "15px");

0 commit comments

Comments
 (0)