# # SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # WebGL-Enhanced Remote GPU Rendering Service # Using Three.js for GPU-accelerated visualization import json from typing import Dict, Any, List class WebGLGPUVisualizationService: """Enhanced remote GPU service with Three.js WebGL rendering""" def _generate_threejs_webgl_html(self, session_data: dict, config: dict) -> str: """Generate Three.js WebGL visualization with GPU-accelerated rendering""" # Extract data nodes = session_data['processed_nodes'] edges = session_data['processed_edges'] layout_positions = session_data.get('layout_positions', {}) clusters = session_data.get('clusters', {}) centrality = session_data.get('centrality', {}) # Configuration animation_duration = config.get('animation_duration', 3000) show_splash = config.get('show_splash', True) auto_zoom = config.get('auto_zoom', True) show_labels = config.get('show_labels', True) background_color = config.get('background_color', '#0a0a0a') render_quality = config.get('render_quality', 'high') # GPU rendering settings gpu_settings = self._get_gpu_rendering_settings(len(nodes), render_quality) html_template = f"""