JavaScript Modules
This page is generated automatically from the module headers and JSDoc annotations in js/ on every build.
API Scope: The functions documented here are primarily designed for internal module interaction within QGas. A stable subset is intentionally exposed on the global window object for cross-module use; these are the recommended integration points for any downstream tooling. Functions labelled Internal Helpers are implementation details and may change between releases.
core.js
QGas - Core Application Module
This is the main JavaScript module for the QGas Interactive Gas Infrastructure Toolkit. It handles map initialization, data loading, user interactions, and all core functionality for visualizing and editing pipeline infrastructure.
Key Responsibilities:
- Map initialization and layer management (Leaflet.js)
- Dynamic layer loading and registry management
- Project context management
- Contributor tracking system
- Infrastructure element CRUD operations
- Interactive editing modes (add, edit, delete pipelines/nodes)
- Styling and visual customization
- Data persistence and synchronization
- Element attribute management
- Filter and search functionality
Technical Stack:
- Leaflet.js for interactive mapping
- GeoJSON for infrastructure data
- LocalStorage for client-side persistence
Module Structure:
- Global state variables and configuration
- Layer management and registry
- Map initialization
- Data loading and processing
- Interactive tools and modes
- Element management (CRUD operations)
- UI helpers and utilities
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM containers and UI elements declared in GUI.html.
- External libraries: Leaflet, Leaflet.Draw, JSZip, XLSX, Chart.js.
- Global runtime state (layerConfig, dynamicLayers, contributorInitials).
Public API (selected):
- formatElementId(prefix, contributor, number): Build a standardized element ID.
- getFacilityPrefix(type): Resolve or register a facility prefix.
- getNextIdNumber(type, layerOverride): Compute the next sequential ID number.
- createNewNode(latlng, nodeId, options): Create and register a node marker.
- getAllNodeLayers(): Return active node layers.
- getAllLineLayers(): Return active line layers.
Public API Functions (20)
sanitizeProjectName(name)
Sanitize project name to prevent injection and ensure filesystem compatibility
| Parameter | Type | Description |
|---|---|---|
name | string | Raw project name |
Returns: string — Sanitized project name (alphanumeric, underscore, hyphen only)
persistProjectSelection(projectName)
Persist the selected project to browser localStorage for future sessions
| Parameter | Type | Description |
|---|---|---|
projectName | string | Project name to save |
getStoredProjectSelection()
Retrieve the stored project selection from localStorage
Returns: string — Stored project name or empty string if not found
getProjectFromQuery()
Extract project name from URL query parameters
Returns: string — Project name from URL or empty string
fetchProjectFromServer()
Fetch current project from the server API
Returns: Promise<string> — Project name from server or empty string
determineProjectContext()
Determine the active project context from multiple sources Priority: URL query > Server API > LocalStorage > Default
Returns: Promise<string> — Resolved project name
normalizeColorHex(color)
Normalize color values to lowercase hex format (#rrggbb) Handles short hex (#rgb) and values without # prefix
| Parameter | Type | Description |
|---|---|---|
color | string | Input color value |
Returns: string — Normalized hex color or empty string
registerLineColorUsage(color)
Track usage of a line color for statistics and recommendations
| Parameter | Type | Description |
|---|---|---|
color | string | Color hex value to register |
formatElementId(prefix, contributor, number)
Format a standardized element ID with prefix, contributor initials, and number
| Parameter | Type | Description |
|---|---|---|
prefix | string | Element type prefix (e.g., 'PL' for pipeline) |
contributor | string | Contributor initials |
number | number | Sequential number |
Returns: string — Formatted ID (e.g., 'PL_ABC_001')
openInfoOverlay(layer)
Open the attribute info overlay for a pipeline feature. Highlights the clicked pipeline layer, stores it as the active popup layer for attribute editing, generates the attribute form via createAttributeForm, and binds Save, Add Attribute, and Delete action handlers. The overlay remains visible until the user dismisses it or selects another element.
| Parameter | Type | Description |
|---|---|---|
layer | L.Path | The Leaflet polyline layer whose attributes should be displayed. |
Returns: void
checkContributorName()
Check whether a valid contributor name has been entered. Reads the #contributor-input field and returns false (showing a contributor dialog) when the value is empty or still the default placeholder "Max Mustermann". All editing tools call this guard before modifying map data to ensure every change is attributed to a real contributor.
Returns: boolean — true if a valid contributor name is present; false otherwise.
createNewNode(latlng, nodeId, options = {})
Create and register a new node marker on the map. Creates a Leaflet CircleMarker at latlng with the default node style, attaches a GeoJSON feature with Type: 'Node' and the provided nodeId, and adds it to the appropriate node layer (determined via options.targetLayer or the global nodeLayer). Wires up mode-aware click handlers for info display and pipeline-connection callbacks.
| Parameter | Type | Description |
|---|---|---|
latlng | L.LatLng | Geographic position for the new node. |
nodeId | string | Unique identifier to assign to the node feature (properties.ID). |
Returns: L.CircleMarker — The created node marker.
Example:
// Place a node on the default node layer
const marker = createNewNode(L.latLng(48.21, 16.37), 'N_MQ_001');
// Place a node on a specific layer (e.g. hydrogen nodes)
const h2marker = createNewNode(L.latLng(48.21, 16.37), 'N_MQ_002', {
targetLayer: hydrogenNodeLayer
});
getFacilityPrefix(type)
Return the GeoJSON type prefix string for a given element type. Looks up the internal facilityTypeMap for a registered prefix; if none exists, derives one from the type name via generatePrefixFromName and registers it. Used to construct standardised element IDs (PREFIX_CONTRIBUTOR_NNN).
| Parameter | Type | Description |
|---|---|---|
type | string | Element type name (e.g., 'Pipeline', 'Node', 'Compressor'). |
Returns: string — Two-to-three-character prefix string (e.g., 'PL', 'N', 'C').
getNextIdNumber(type, layerOverride = null)
Return the next available sequential ID number for a given element type. Scans all layers of the specified type to collect existing numeric suffixes matching the pattern PREFIX_CONTRIBUTOR_NNN and returns the lowest unused positive integer. Accepts an optional layerOverride to restrict scanning to a specific layer.
| Parameter | Type | Description |
|---|---|---|
type | string | Element type (e.g., 'Pipeline'). |
Returns: number — Next unused sequential number (always ≥ 1).
deactivateAllModes()
Deactivate all active editing modes and return to a clean state. Disables any open Leaflet Draw tool, closes popups, ends the current node-position edit, clears pending delete selections, removes transient UI overlays (direction buttons, save/discard strips), and resets all mode-specific state variables. Called as a prerequisite by every tool-activation function to prevent mode conflicts.
Returns: void
showElementModal(title, content, layer)
Display the element details modal. Stores the active layer reference, injects the provided title and HTML content into the modal DOM elements, and makes the modal visible. The modal remains open until closeElementModal is called.
| Parameter | Type | Description |
|---|---|---|
title | string | Heading text for the modal. |
content | string | HTML string for the modal body (typically generated by createModalPopupContent). |
layer | L.Layer | Leaflet layer instance associated with the displayed element. |
Returns: void
closeElementModal()
Close the element details modal. Hides the modal overlay and resets the highlight styles of any previously highlighted pipeline or point-element layer. Clears the internal currentLayer, activePipeline, and activeElement references.
Returns: void
loadAdditionalDatasets()
Load supplementary GeoJSON datasets from the Additional Datasets/ server directory. Iterates a hardcoded list of dataset filenames and calls loadSingleDatasetWithCallback for each. Loaded datasets are added to the map as hidden layers and stored in the additionalDatasets registry, making them available for the integrate-dataset tool.
Returns: void
getAllNodeLayers()
Return all node-type Leaflet layers currently registered in the project. First queries layerConfig for entries with Type === 'node', then performs a fallback heuristic scan of dynamicLayers using metadata type hints and key names. Both the primary and fallback result sets are deduplicated.
Returns: Array<L.LayerGroup> — Array of Leaflet layer groups whose features represent network nodes.
Example:
// Count all node markers across the project
let count = 0;
getAllNodeLayers().forEach(lg => lg.eachLayer(() => count++));
console.log('Total nodes:', count);
getAllLineLayers()
Return all line-type Leaflet layers currently registered in the project. Queries layerConfig for entries with Type === 'line' or 'pipeline', then performs a heuristic scan of dynamicLayers. If metadata hints are unavailable, samples the first feature geometry of each layer to determine whether it is a LineString or MultiLineString.
Returns: Array<L.LayerGroup> — Array of Leaflet layer groups whose features represent pipeline or line-string infrastructure.
node_layers.js
QGas - Node Layers Shared Module
Provides centralized utilities for discovering and managing node layers across the application. This module is loaded early in the initialization sequence to ensure tools and other modules can reliably access node layer information.
Key Responsibilities:
- Discover all node/point layers in the system
- Provide unified interface for node layer queries
- Support both dynamic and legacy layer systems
- Handle fallback scenarios gracefully
Usage:
- getAllNodeLayers() - Returns array of all node layer objects
- getNodeLayerEntries() - Returns detailed node layer entries with metadata
This module uses an IIFE (Immediately Invoked Function Expression) to avoid polluting the global scope while exposing necessary functions.
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Global layer registries (dynamicLayers, layerMetadataRegistry).
- Legacy layer references (nodeLayer, hydrogenNodeLayer).
Public API:
- getAllNodeLayers(): Return all discovered node layers.
- getNodeLayerEntries(): Return node layer entries with metadata.
Public API Functions (2)
getAllNodeLayers()
Get all node layers from the system Attempts to use core functions first, falls back to scanning if unavailable
Returns: Array — Array of all node/point layer objects
getNodeLayerEntries()
Get detailed node layer entries with metadata Returns an array of objects containing key, label, layer reference, and metadata
Returns: Array — Array of node layer entry objects {key, label, layer, meta}
Internal Helpers (1)
fallbackScan()
Fallback scan for node layers when core functions are not yet available. Searches through dynamicLayers and legacy layer references.
Returns: Array — Array of node layer objects
export.js
QGas - Export Module
Module Description:
Handles export workflows for changed, filtered, and complete datasets, including ZIP assembly and Excel configuration generation.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- In-memory layer state (dynamicLayers, layerConfig, deleted registry).
- External libraries: JSZip, XLSX.
Public API:
- exportChanges(): Export modified and deleted elements.
- exportFilteredData(folderName): Export filtered datasets to ZIP.
- exportCompleteDataset(): Export the full current dataset to ZIP.
Public API Functions (4)
exportChanges()
Export all modified and deleted elements as GeoJSON files in a ZIP archive. Collects every layer feature marked with modified: true and all entries in the soft-deletion registry. Organises the output into GeoJSON files per infrastructure type (pipelines, nodes, compressors, storages, power-plants, etc.) and triggers a browser download of the resulting ZIP archive (changes.zip).
Returns: void
exportFilteredData(folderName)
Export the currently filtered dataset as a ZIP archive. Iterates all active layer configurations, applies the current attribute filter state, and serialises each layer to a GeoJSON file. Supplementary files (Excel configuration workbook, short-pipe definitions) are appended and the archive is offered for browser download as <folderName>.zip.
| Parameter | Type | Description |
|---|---|---|
folderName | string | Name used for the top-level ZIP folder and the downloaded filename. |
Returns: Promise<void>
exportCompleteDataset()
Export the complete current dataset as a ZIP archive. Serialises all registered dynamic layers — including layers that have no unsaved modifications — together with the Excel configuration workbook and short-pipe definitions. The archive is downloaded as complete_dataset.zip. Useful for creating a full project snapshot or preparing input for a fresh run.
Returns: Promise<void>
Example:
// Trigger a full project snapshot download
exportCompleteDataset().then(() => {
console.log('complete_dataset.zip downloaded');
});
openExportDialog()
Open the export type selection dialog. Presents a modal popup with three export options: changes only, filtered data (prompts for a folder name), and the complete dataset. Delegates to exportChanges, showFolderNameDialog, or exportCompleteDataset on confirmation.
Returns: void
filter.js
QGas - Filter UI Module
Manages the geographic filtering system for infrastructure visualization. Allows users to filter displayed elements by European country codes.
Key Responsibilities:
- Filter modal UI management
- Country selection interface
- Layer filtering by country code
- Filter state management
- Original layer state preservation
Filtering Approach:
- Preserves original layers before filtering
- Creates filtered copies based on country selection
- Supports multiple country selection
- Provides "Clear All" functionality
Supported Countries:
- All EU member states
- United Kingdom
- Uses ISO 3166-1 alpha-2 country codes
Global Scope: This module maintains global scope for compatibility with inline HTML event handlers.
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM elements for the filter modal and country selection UI.
- Map layer registries and country metadata embedded in features.
Public API:
- openFilterModal(): Open the filter dialog.
- applyCountryFilter(): Apply the selected country filter.
- clearAllFilters(): Reset to unfiltered layers.
Public API Functions (8)
openFilterModal()
Open the main filter selection modal. Makes the primary filter modal visible by setting its CSS display property to flex. The modal lists available filter categories (e.g., country-based filtering) and acts as the entry point for all spatial filtering operations.
Returns: void
closeFilterModal()
Close the main filter selection modal. Hides the primary filter modal without discarding any pending selection. May be called programmatically, e.g., before transitioning to the country-filter sub-modal.
Returns: void
openCountryFilterModal()
Open the country-specific filter modal. Closes the main filter modal, populates the country selection list by calling populateCountryList, and displays the country-filter sub-modal. Previously selected countries are preserved between invocations.
Returns: void
closeCountryFilterModal()
Close the country filter modal. Hides the country-filter sub-modal. Any countries that were checked remain selected in memory until applyCountryFilter is called or the selection is explicitly cleared.
Returns: void
clearAllFilters()
Clear all active filters and restore the original layer state. Calls restoreAllOriginalLayers to put back the unfiltered Leaflet layer objects, empties the selectedCountries set, and closes the filter modal. This is the single authoritative reset point for all spatial filter state.
Returns: void
populateCountryList()
Populate the country list UI with checkboxes for all European countries Restores previously selected countries from the selectedCountries Set
applyCountryFilter()
Apply the current country selection as a geographic filter. Snapshots each unfiltered layer reference if not already cached, then either restores all layers (when no countries are selected) or delegates to filterAllElementsByCountries to rebuild each layer with only the features whose country-code property matches an entry in selectedCountries. Closes the country-filter modal on completion.
Returns: void
toggleFilterPanel()
Toggle (open) the filter panel from a toolbar button. Thin error-guarded alias of openFilterModal used by the main-screen toolbar button. Wraps the call in a try/catch so that a misconfigured DOM state surfaces as an info popup rather than a silent failure.
Returns: void
groups.js
QGas - Pipeline Groups Module
Module Description:
Supports visualizing and highlighting pipeline groups created in the UI.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Pipeline group definitions and layer registries.
- Map instance for pan/zoom and style updates.
Public API:
- highlightGroup(index): Highlight a saved pipeline group.
- unhighlightAllGroups(): Clear group highlights.
Public API Functions (3)
highlightGroup(index)
Highlight all pipelines belonging to a saved pipeline group. Resets any existing group highlights, then applies a red stroke (#ff2b2b, weight 6) to every pipeline whose ID is listed in the specified group. The map viewport is automatically fitted to the bounding box of the highlighted elements with 80 px padding.
| Parameter | Type | Description |
|---|---|---|
index | number | Zero-based index of the pipeline group in the global pipelineGroups array. |
Returns: void
openGroupsPanel()
Open the pipeline groups panel. Displays a scrollable modal popup listing all saved pipeline groups. Each group entry shows the group name, pipeline count, and total length. Clicking an entry calls highlightGroup to visualise the group on the map. If no groups exist yet the user is informed with a guidance message.
Returns: void
unhighlightAllGroups()
Remove all group highlights from the map. Iterates every pipeline in all active line layers and resets their Leaflet path styles to the defaults defined in the layer configuration. Should be called before applying a new group highlight or when the groups panel is closed.
Returns: void
legend.js
QGas - Legend UI Module
Module Description:
Maintains the legend controls, visibility toggles, and synchronization between legend state and map layers.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM legend container and checkbox elements.
- Map layer references and visibility state.
Public API:
- updateLegendControl(): Rebuild and refresh the legend UI.
- updateLegendSymbols(): Refresh legend swatches after style updates.
options.js
QGas - Options UI Module
Module Description:
Manages the options dialog for styling layers, including color, size, and line style controls, while keeping a global scope for UI compatibility.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM elements for options, color, size, and line-type modals.
- Layer registries and styling helpers from core modules.
Public API:
- openOptionsModal(): Open the layer options dialog.
- closeOptionsModal(): Close the layer options dialog.
- updateLayerColor(layerKey, newColor): Apply color updates to a layer.
screenshot.js
QGas - Screenshot Module
Module Description:
Provides a screenshot mode for highlighting elements and preparing the map for manual capture.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM elements for tool controls and legend.
- Map layers for highlight toggling.
Public API:
- openScreenshotMode(): Launch the screenshot mode dialog.
- activateScreenshotMode(): Enter screenshot mode.
- deactivateScreenshotMode(): Exit screenshot mode.
Public API Functions (3)
openScreenshotMode()
Open the screenshot mode dialog. Presents a modal popup that explains the screenshot workflow and offers the user a single-click entry into screenshot mode. No map state is altered until the user confirms by pressing "Activate Screenshot Mode".
Returns: void
activateScreenshotMode()
Enter screenshot mode. Hides all UI chrome (menus, toolbars, export buttons, contributor box) and strips the map legend down to only the currently visible layers. Enables element highlighting on click and registers an Escape-key listener that calls exitScreenshotMode. Intended to produce a clean, publication-ready map view without interactive controls.
Returns: void
exitScreenshotMode()
Exit screenshot mode and restore the full UI. Re-displays all previously hidden interface elements (menus, toolbars, contributor box, logos, export and screenshot buttons) and restores the original legend HTML. Removes the Escape-key listener registered by activateScreenshotMode. Safe to call even if screenshot mode is not currently active.
Returns: void
statistics.js
QGas - Statistics Module
Module Description:
Computes and displays infrastructure statistics in a modal dialog, including counts and aggregated metrics.
Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map layers and feature properties for aggregation.
- DOM elements for statistics modal and charts.
Public API:
- openStatisticsModal(): Show the statistics modal.
- closeStatisticsModal(): Hide the statistics modal.
- updateStatistics(): Recompute and render statistics.
Public API Functions (3)
openStatisticsModal()
Open the statistics modal dialog. Triggers a full recomputation of infrastructure statistics via updateStatistics before making the modal visible. This ensures that all displayed values reflect the current map state at the time of opening.
Returns: void
closeStatisticsModal()
Close the statistics modal dialog. Hides the statistics modal by setting its CSS display property to none. No statistical data is cleared; subsequent calls to openStatisticsModal will recompute and re-display updated values.
Returns: void
updateStatistics()
Recompute and render all infrastructure statistics. Calculates aggregate metrics (pipeline counts, total lengths, node counts, storage capacities, etc.) from the current map layers and renders the results into the statistics modal. The computed statistics object is also cached in window.cachedStatistics for subsequent use by other modules without redundant recalculation.
Returns: void
tools.js
QGas - Tools UI Module
Manages the tools popup interface and dispatches tool activation commands. This module provides the user interface for selecting and switching between different editing and interaction modes in the QGas application.
Key Responsibilities:
- Tool popup UI management (open/close)
- Active tool state tracking and display
- Tool selection and mode switching
- Contributor name validation
- Tool dispatcher for various editing modes
Available Tools:
- Info Mode: View element information
- Edit Geometry: Modify element positions
- Add Pipeline: Create new pipeline segments
- Add Infrastructure: Place new infrastructure points
- Change Direction: Reverse pipeline flow direction
- Short Pipe: Create short connecting pipes
- Delete: Remove elements from the map
- Group Pipelines: Combine multiple pipelines
- Switch Sublayer: Change element layer assignment
- Add Plan: Manage infrastructure plans
- Divide Pipeline: Split pipelines at points
- Add New Element: Create custom elements
- Integrate Dataset: Import external data
- Split Node: Divide nodes for network restructuring
- Reconnect Infrastructure: Update element connections
- Distribute Compressors: Auto-place compressors
Global Scope: This module maintains global scope for compatibility with inline HTML event handlers (e.g., onclick="openToolsPopup()")
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- DOM elements for the tools popup and tiles.
- Global tool activation functions (e.g., activateInfoTool).
Public API:
- openToolsPopup(): Open the tools selection overlay.
- closeToolsPopup(): Close the tools selection overlay.
- selectTool(mode): Activate a tool by mode identifier.
- updateActiveToolDisplay(mode): Update the active tool label.
Public API Functions (4)
updateActiveToolDisplay(mode)
Update the active tool display in the UI
| Parameter | Type | Description |
|---|---|---|
mode | string | Tool mode identifier |
openToolsPopup()
Open the tools selection popup Displays all available tools and highlights the currently active one
closeToolsPopup()
Close the tools selection popup
selectTool(mode)
Select and activate a specific tool mode
| Parameter | Type | Description |
|---|---|---|
mode | string | Tool identifier (e.g., 'info', 'edit', 'add-pipeline') |
add_infrastructure.js
QGas - Add Infrastructure Tool
Enables placement of new infrastructure points (compressors, storages, LNG terminals, power plants, etc.) on the map with optional node connectivity.
Key Features:
- Interactive point placement via map click
- Optional connection to existing nodes
- Automatic ID generation with contributor tracking
- Support for multiple infrastructure types
- Continuous placement workflow (add multiple points)
- Confirmation dialogs with user-friendly prompts
Workflow:
1. User activates tool and chooses connection preference 2. Selects infrastructure type from available layers 3. Clicks map to place point 4. Point is created with auto-generated ID 5. Optional: Continue placing more points or return to info mode
Infrastructure Types:
- Compressors
- Storage facilities
- LNG terminals
- Power plants
- Custom infrastructure types from dynamic layers
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map clicks and optional node selection.
- Active infrastructure layers and contributor initials.
Public API:
- activateAddInfrastructureTool(): Start the add-infrastructure workflow.
Public API Functions (1)
activateAddInfrastructureTool()
Activate the Add Infrastructure tool. Verifies that a contributor name has been set, deactivates any active editing mode, and sets the application mode to 'add-infrastructure'. The user is first prompted to choose whether the new element should be connected to an existing node. After confirmation, the user selects the target infrastructure layer (compressor, storage, LNG terminal, power plant, or custom type) and clicks a map location to place the point. An auto-generated ID incorporating contributor initials is assigned, and the tool allows continuous placement until the user opts to stop.
Returns: void
add_new_element.js
QGas - Add New Element Tool
Creates entirely new custom layer types for specialized infrastructure elements not covered by standard layers.
Key Features:
- Custom layer creation
- Layer type selection (line/point/inline/node)
- User-defined layer names
- Automatic legend integration
- Layer metadata generation
- Drawing tool integration
Layer Types:
- Pipeline (Line Layer): For linear infrastructure
- Infrastructure (Point Layer): For point-based facilities
- In-Line Element Layer: For elements positioned along pipelines
- Node Layer: For standard node handling
Workflow:
1. User selects layer type 2. Enters layer name 3. System creates empty layer 4. Layer added to map and legend 5. User can begin adding elements to new layer
Technical Details:
- Registers layer in customLayers registry
- Creates layer metadata
- Initializes with appropriate geometry type
- Sets up interaction handlers
- Configures default styling
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- User-selected layer type and name.
- Map instance and layer registries.
Public API:
- activateAddNewElementTool(): Start the custom-layer creation flow.
Public API Functions (1)
activateAddNewElementTool()
Activate the Add New Element tool. Deactivates any currently active editing mode, sets the application mode to 'add-new-element', and launches the custom-layer creation dialog. The dialog allows the user to select a layer geometry type (line, point, in-line, or node) and provide a user-defined name. On confirmation, an empty GeoJSON layer is created, registered in the customLayers registry, added to the map, and integrated into the legend — enabling immediate element placement.
Returns: void
add_pipeline.js
QGas - Add Pipeline Tool
Provides functionality for adding new pipeline segments to the infrastructure network. Supports interactive drawing, node snapping, and automatic ID generation.
Key Features:
- Interactive pipeline drawing with map clicks
- Automatic node detection and snapping
- Support for multiple pipeline layer types
- Contributor tracking and attribution
- Automatic ID generation with prefixes
- Length calculation
- Custom attribute support
Workflow:
1. User selects target pipeline layer 2. Clicks map to define start point (snaps to existing node or creates new) 3. Clicks map to define end point 4. Pipeline is created with auto-generated ID 5. Pipeline is added to selected layer
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map clicks for node and pipeline placement.
- Active node and line layer selections.
- Contributor initials for ID generation.
Public API:
- promptPipelineLayerSelection(onComplete, onCancel): Choose a target line layer.
- proceedWithAddPipeline(): Start the add-pipeline workflow.
Public API Functions (2)
getAvailablePipelineLayers()
Get all available pipeline layers from the system Scans dynamic layers, legacy layers, and custom layers for line geometry
Returns: Array — Array of layer objects with name, layer reference, and metadata
proceedWithAddPipeline()
Launch the interactive pipeline-creation workflow. Sets currentMode to 'add-pipeline', resolves the target pipeline layer, and opens a modal dialog asking whether the pipeline starts at an existing node or a free map location. Subsequent steps guide the user through endpoint selection (start and end), live polyline drawing between selected points, and finally saving the new pipeline feature with auto-generated ID and default attributes to the target layer.
Returns: void
Internal Helpers (3)
forEachNodeMarker(callback)
Iterate every node marker across all active node layers. Traverses the full layer tree of each group returned by getAllNodeLayers, descending into nested LayerGroup and FeatureGroup instances, and invokes callback for every individual point-feature marker found. Internal structure layers are skipped.
| Parameter | Type | Description |
|---|---|---|
callback | Function | Function called with each node L.CircleMarker or L.Marker as its sole argument. |
Returns: void
setNodeSelectionHandlers(handler)
Attach a unified click handler to all node markers. Removes any existing click listeners from every node marker (via forEachNodeMarker) and registers handler as the new listener. The handler receives the marker instance and the Leaflet click event. Event propagation to the map is suppressed. Used during pipeline-drawing mode so that clicking a node acts as a pipeline endpoint selection rather than opening an info popup.
| Parameter | Type | Description |
|---|---|---|
handler | Function | Callback invoked with (marker, event) when a node is clicked. |
Returns: void
clearNodeSelectionHandlers()
Remove all node click handlers registered during pipeline drawing. Iterates every node marker via forEachNodeMarker and removes all 'click' listeners. Called when the pipeline-drawing workflow ends (after save or discard) to restore normal info-mode click behaviour.
Returns: void
add_plan.js
QGas - Add Infrastructure Plans Tool
Enables georeferencing and overlay of infrastructure plan images (JPG/PNG) onto the interactive map. Users can align scanned plans with geographic coordinates through control point matching.
Key Features:
- Image file upload (JPG/PNG)
- Interactive georeferencing with control points
- Visual overlay on map
- Opacity control
- Plan metadata management
- Multiple plan support
- Control point validation
Workflow:
1. User uploads infrastructure plan image 2. Selects matching points on image and map 3. System calculates transformation matrix 4. Image is georeferenced and overlaid on map 5. Plan can be toggled, adjusted, or removed
Technical Details:
- Requires minimum 3 control points
- Uses affine transformation for georeferencing
- Stores plan data in infrastructure_plans layer
- Supports interactive opacity adjustment
- Maintains plan metadata (name, bounds, control points)
Note: Functions exposed in global scope for cross-module compatibility
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Image files (JPG/PNG) and control point pairs.
- Map instance for georeferenced overlays.
Public API:
- activateAddPlanTool(): Start the infrastructure plan workflow.
Public API Functions (1)
startAddInfrastructurePlan()
Open the file-picker dialog to begin the plan georeferencing workflow. Initialises the georeferencing UI via initializePlanGeorefUI and programmatically triggers the browser file-input dialog so the user can select a JPG or PNG plan image. Called automatically by activateAddPlanTool and by the retry button inside the georeferencing panel.
Returns: void
change_direction.js
QGas - Change Direction Tool
Enables users to reverse the flow direction of pipeline segments by swapping their Start_Node and End_Node references.
Key Features:
- Visual direction indicators (arrows)
- Interactive pipeline selection
- Batch direction reversal
- Property-based direction tracking
- Confirmation before applying changes
Workflow:
1. User activates tool 2. Direction arrows appear on all pipelines 3. User clicks pipelines to mark for reversal 4. Selected pipelines show reversed arrows 5. Confirmation dialog saves all changes
Technical Details:
- Uses Leaflet PolylineDecorator for arrow visualization
- Tracks state in directionChangeState Map
- Swaps Start_Node and End_Node properties
- Updates all connected references
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Selected pipeline features and their Start_Node/End_Node attributes.
- Map layer references for visual arrows.
Public API:
- activateChangeDirectionMode(): Begin direction-change workflow.
Public API Functions (1)
activateChangeDirectionMode()
Activate the change-direction editing mode. Resets all pipeline highlights, clears internal direction state, and attaches click handlers to every polyline in all active line-layer groups. Each click toggles the geometric direction of the selected pipeline (reverses the coordinate array) and updates the directional arrow decorator. A Save/Discard toolbar strip is shown for confirmation. Exits automatically on Escape key or explicit user discard.
Returns: void
delete.js
QGas - Delete Tool
Manages element deletion functionality with visual feedback and undo support. Allows users to mark elements for deletion and batch-delete them with confirmation.
Key Features:
- Visual marking of elements pending deletion
- Batch deletion with single confirmation
- Automatic orphaned node cleanup
- Undo functionality (elements stored in deleted registries)
- Support for all element types (pipelines, nodes, infrastructure)
- Parent layer tracking for proper removal
Deletion Process:
1. User activates delete mode 2. Clicks elements to mark for deletion (visual feedback) 3. Clicks "Delete Elements" button to confirm 4. Elements are removed from map and stored in deletion registries 5. Orphaned nodes are automatically cleaned up
Supported Element Types:
- Pipelines (including short pipes, hydrogen pipes)
- Nodes
- Compressors
- Storages
- LNG terminals
- Power plants
- Custom elements
- Drawn items
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- User selections (click or box selection).
- Layer registries and deletion identity tracker.
Public API:
- activateDeleteMode(): Enter delete workflow.
- finalizeDeletion(): Confirm and apply deletions.
Public API Functions (2)
clearPendingDeletionSelections()
Clear all pending deletion selections without committing any deletions. Iterates every pending-deletion list (pipelines, nodes, compressors, storages, LNG terminals, power-plants, custom elements, drawn items) and restores the original visual style of each marked element. All pending lists are emptied and the toolbar button state is refreshed. Useful for resetting the selection before exiting delete mode.
Returns: void
activateDeleteMode()
Activate the element deletion mode. Disables any active drawing tools, captures a snapshot of the current map state for undo support, and attaches click handlers to every deletable element (pipelines, nodes, compressors, storages, LNG terminals, power-plants, custom layers). Clicking an element marks it for deletion (visual cue: red overlay) without immediately removing it. A Save/Discard toolbar strip is shown; confirming commits all pending deletions to the soft-delete registry.
Returns: void
Internal Helpers (1)
showSaveDeleteButton()
Show the save/confirm delete button in the UI. Creates a button that executes batch deletion of all marked elements.
distribute_compressors.js
QGas - Distribute Compressors Tool
Distributes a single compressor into multiple sub-compressors along pipelines. Useful for representing distributed compression infrastructure.
Key Features:
- Interactive compressor selection
- Automatic distribution count input
- Visual connection lines
- Sub-compressor auto-placement
- Pipeline splitting at placement points
- Node generation for connections
Workflow:
1. User selects compressor to distribute 2. Enters number of sub-compressors 3. Clicks pipeline locations for placement 4. Visual connection lines show relationships 5. Original compressor replaced with distributed units
Technical Details:
- Creates sub-nodes at compressor positions
- Splits pipelines at insertion points
- Generates unique IDs for sub-compressors (e.g., C_01A, C_01B)
- Maintains visual connection to original location
- Updates topology automatically
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Selected compressor feature and target pipeline locations.
- User-entered distribution counts.
Public API:
- activateDistributeCompressors(): Start compressor distribution workflow.
Public API Functions (2)
startDistributeCompressors()
Start the compressor distribution workflow. Initialises distribution state, hides all map layers except pipelines and compressors to reduce visual clutter, and activates click handlers on every compressor marker. The user selects a source compressor, then specifies how many sub-compressors to place along pipeline segments. Sub-compressor positions are computed geometrically on the selected pipeline and persisted via the standard layer write-back mechanism.
Returns: void
exitDistributeMode()
Exit distribute-compressor mode and restore normal map state. Re-adds any layers that were hidden during distribution (power-plants, storages, nodes, etc.), removes all temporary connection-line polylines and sub-compressor markers from the map, and resets all internal distribution state variables. Safe to call both after a completed distribution and after an explicit cancellation.
Returns: void
divide_pipeline.js
QGas - Divide Pipeline Tool
Splits a single pipeline segment into multiple segments at specified points. Creates new intermediate nodes and updates topology automatically.
Key Features:
- Interactive point selection for division
- Visual support point markers
- Automatic node creation at division points
- Geometry preservation
- Property inheritance for new segments
- Multi-point division support
Workflow:
1. User selects pipeline to divide 2. Clicks map to add division points 3. Support markers appear at each point 4. Confirmation creates new segments and nodes 5. Original pipeline replaced with segmented version
Technical Details:
- Creates new node IDs for division points
- Splits coordinates at each division point
- Generates new pipeline segments with proper Start/End nodes
- Updates all layer references
- Maintains attribute consistency across segments
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Selected pipeline and user-defined division points.
- Node and pipeline layers for updates.
Public API:
- activateDividePipelineTool(): Begin pipeline division workflow.
Public API Functions (1)
activateDividePipelineTool()
Activate the pipeline divide tool. Entry point for the divide-pipeline workflow. Delegates to startPipelineDivision, which guides the user through selecting a pipeline segment and clicking the desired split point. The original pipeline feature is replaced by two new child features whose coordinate arrays cover each half; attributes are inherited with a sequence suffix appended to the ID. A node marker is automatically inserted at the division point.
Returns: void
edit_geometry.js
QGas - Edit Geometry Tool
Provides interactive geometry editing capabilities for infrastructure elements. Allows users to modify positions of nodes and reshape pipeline routes.
Key Features:
- Node position editing with drag-and-drop
- Pipeline route editing (vertex manipulation)
- Endpoint locking to preserve connections
- Visual feedback during editing
- Split node support with offset tracking
- Save and discard actions
- Automatic geometry updates
- Contributor tracking
Editing Modes:
- Node Editing: Drag nodes to new positions
- Pipeline Editing: Add, move, and remove vertices
- Locked Endpoints: Pipeline start/end points remain connected to nodes
Technical Details:
- Uses Leaflet.Editable for geometry manipulation
- Tracks original geometry for discard functionality
- Updates all connected elements when nodes move
- Maintains split node offsets during zoom/pan
- Prevents simultaneous editing of multiple elements
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map interactions for geometry edits.
- Target layers for nodes and pipelines.
Public API:
- activateEditMode(): Enter geometry editing mode.
- updateAllElementInteractions(): Refresh info handlers.
Public API Functions (1)
activateEditModeForExisting()
Activate edit mode for existing drawn items Binds click handlers to enable editing on selected features
group_pipelines.js
QGas - Group Pipelines Tool
Allows users to logically group multiple pipeline segments into named groups for organizational and analytical purposes.
Key Features:
- Named pipeline groups
- Visual selection with color coding
- Automatic total length calculation
- Start/end point tracking
- Group metadata storage
- Multi-segment selection
Workflow:
1. User enters group name 2. Selects multiple pipeline segments by clicking 3. Selected pipelines show visual highlight 4. Group is saved with metadata (name, length, endpoints) 5. Group data available for export and analysis
Technical Details:
- Calculates total length from all segments
- Tracks first start point and last end point
- Stores group information in pipelineGroups array
- Maintains visual feedback during selection
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Selected pipeline segments and group naming.
- Map layers for selection highlighting.
Public API:
- activateGroupPipelinesTool(): Begin grouping workflow.
Public API Functions (1)
startPipelineGrouping()
Start the pipeline grouping workflow. Deactivates all active modes, prompts the user to enter a group name, and then guides them through selecting a set of pipeline segments and optionally specifying a start and end node. The resulting group is stored in the pipelineGroups array with metadata (name, pipeline IDs, total length, element count) and persisted to the project state. The group can later be highlighted via highlightGroup.
Returns: void
info_mode.js
QGas - Info Mode Tool
Default interaction mode for viewing element information without editing. Displays element attributes, metadata, and allows navigation between features.
Key Features:
- View element properties in info overlays
- Click elements to see detailed information
- Non-destructive interaction (read-only)
- Automatic cleanup of edit mode artifacts
- Reset all temporary highlights and selections
- Restore normal layer visibility
Functionality:
- Deactivates all editing tools
- Removes edit-mode UI elements (save/discard buttons)
- Resets pipeline and node highlights
- Clears pending deletion selections
- Restores standard info popup handlers
- Shows full layer visibility (no edit-mode hiding)
This is the safe default mode that users return to after completing editing operations.
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map click events and feature properties.
- Modal UI helpers for info display.
Public API:
- activateInfoTool(): Activate info tool with contributor checks.
- activateInfoMode(force): Bind info handlers for the map.
Public API Functions (2)
activateInfoTool()
Activate info tool (wrapper with contributor check)
activateInfoMode(force = false)
Activate info mode
| Parameter | Type | Description |
|---|---|---|
force | boolean | Force reactivation even if already in info mode |
integrate_dataset.js
QGas - Integrate Dataset Tool
Two top-level modes:
1. Full Element Import a. QGas Project – import multiple layers from another project folder with a layer-mapping UI (merge into existing or add as new). b. Single Layer – add a single .geojson as a new permanent layer. 2. Element Mapping Import – interactively link dataset features to existing pipelines and download an equivalence JSON.
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025 / Revised April 2026
- License: See LICENSE file
Public API:
- activateIntegrateDatasetTool(): entry point called by tools.js
reconnect_infrastructure.js
QGas - Reconnect Infrastructure Tool
Allows users to change the node connection of infrastructure elements (storages, LNG terminals, power plants, compressors) by selecting a new connection node.
Key Features:
- Interactive infrastructure element selection
- Visual node selection
- Connection reassignment
- Property update automation
- Layer visibility management
Workflow:
1. User selects infrastructure element to reconnect 2. Other layers temporarily hidden for clarity 3. User clicks new target node 4. Connection updated in properties 5. Visual feedback confirms change
Technical Details:
- Updates node reference properties
- Maintains element geometry
- Preserves all other attributes
- Restores layer visibility after completion
- Supports all infrastructure types
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Node and infrastructure selections.
- Map layers for connection updates.
Public API:
- activateReconnectInfrastructureTool(): Start reconnection workflow.
Public API Functions (1)
activateReconnectInfrastructureTool()
Activate the Reconnect Infrastructure tool. Deactivates any currently active editing mode, sets the application mode to 'reconnect-infrastructure', and initiates the two-step reconnection workflow. In the first step the user selects an existing infrastructure element (storage, LNG terminal, power plant, or compressor); in the second step the user clicks a target node, and the element's node-reference property is updated accordingly. Layer visibility is temporarily adjusted during the workflow and restored upon completion or cancellation.
Returns: void
short_pipe.js
QGas - Short Pipe Tool
Converts standard pipeline segments into short-pipe elements with distinct styling and layer assignment. Used for creating simplified connection segments.
Key Features:
- Interactive pipeline selection
- Visual selection feedback
- Layer reassignment (from pipeline to short-pipe layer)
- Batch selection support
- Confirmation before applying changes
Workflow:
1. User activates tool 2. Clicks pipeline segments to mark as short pipes 3. Selected segments show highlighted styling 4. Confirmation moves segments to short-pipe layer 5. Properties and styling updated automatically
Technical Details:
- Maintains original geometry
- Updates layer membership
- Preserves all attributes except layer assignment
- Uses distinct visual style for identification
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Map clicks for short pipe placement.
- Node selection and layer context.
Public API:
- activateShortPipeMode(): Start short pipe workflow.
Public API Functions (1)
startShortPipeSelection()
Start the short-pipe selection workflow. Activates short-pipe selection mode and attaches click handlers to all polyline features in every active line layer. Clicking a pipeline segment toggles its short-pipe status (visual cue: orange dashed stroke). A save button at the top of the map commits the selection as short-pipe entries in the dataset; a discard button resets all styles and exits the mode without saving.
Returns: void
split_node.js
QGas - Split Node Tool
Enables splitting a single node into multiple subnodes while maintaining pipeline connectivity. Useful for representing multiple parallel connections or separating infrastructure at complex junction points.
Key Features:
- Interactive node selection for splitting
- Visual subnode creation with offset positioning
- Automatic pipeline reassignment to subnodes
- Maintains network topology
- Generates unique IDs for subnodes (e.g., N_01A, N_01B)
- Preserves node attributes on subnodes
- Interactive pipeline selection for reassignment
Workflow:
1. User selects parent node to split 2. Creates subnodes with visual offset 3. Assigns connected pipelines to appropriate subnodes 4. Original node can be kept or deleted 5. Network topology is automatically updated
Technical Details:
- Subnodes positioned with pixel offsets from parent
- Offsets maintained during map zoom/pan
- Start_Node/End_Node references updated in pipeline properties
- Supports multiple subnode creation from single parent
- Interactive highlighting for pipeline selection
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Selected node and connected pipelines.
- Map interactions for split confirmation.
Public API:
- activateSplitNodeTool(): Begin node split workflow.
Public API Functions (7)
activateSplitNodeTool()
Activate the split-node tool. Deactivates all other active editing modes, sets currentMode to 'split-node', and starts the interactive node-splitting workflow. The user selects a node to split; the tool then creates a duplicate node offset from the original and reassigns a user-selected subset of the connected pipelines to the new node, thereby restructuring the network topology.
Returns: void
showCustomPopup(title, content, buttons, extraElement = null)
Display a fully configurable modal popup. Renders a modal dialog with a title, arbitrary HTML content, an optional extra DOM element appended below the content, and one or more action buttons. Each button carries an onClick callback; setting keepOpen: true on a button prevents the popup from closing after the callback executes. Errors thrown inside button callbacks are caught and shown as a secondary error popup.
| Parameter | Type | Description |
|---|---|---|
title | string | Popup heading text. |
content | string | HTML string for the popup body. |
buttons | Array<Object> | Array of button descriptors. |
buttons | string | [].text - Button label. |
Returns: void
closeCustomPopup()
Close the currently open custom popup. Hides the popup overlay and container and resets the docking state. Safe to call even when no popup is currently displayed.
Returns: void
showInfoPopup(message, title = 'ℹ️ Notice', buttonText = 'OK')
Show a simple informational popup. Convenience wrapper around showCustomPopup that renders a centred message paragraph and a single OK button.
| Parameter | Type | Description |
|---|---|---|
message | string | Plain text or newline-separated message to display. Newlines are converted to <br>. |
Returns: void
showErrorPopup(message, title = '⚠️ Error', buttonText = 'OK')
Show an error popup with visually distinct styling. Convenience wrapper around showCustomPopup that renders the message in red and uses a single OK button for dismissal.
| Parameter | Type | Description |
|---|---|---|
message | string | Error description text. |
Returns: void
showConfirmationPopup(options = {})
Show a two-button confirmation popup. Presents a message with a Cancel and a Confirm button. Executes options.onConfirm when confirmed or options.onCancel when cancelled.
Returns: void
showInputPrompt(options = {})
Show a modal prompt with a text or numeric input field. Renders a popup with an input element pre-filled with options.defaultValue. Optional validator callback is invoked on confirm; if it returns a non-empty string the value is treated as an error message and the popup remains open. On successful confirmation options.onConfirm receives the trimmed input value.
Returns: void
switch_sublayer.js
QGas - Switch Sublayer Tool
Enables moving infrastructure elements between different sublayers while maintaining geometry and attributes. Useful for reorganizing data and managing infrastructure plans.
Key Features:
- Interactive element selection
- Layer-to-layer transfer
- Attribute preservation
- Visual feedback during selection
- Batch element transfer
- Parent layer selection
Workflow:
1. User selects source (parent) layer 2. Chooses destination sublayer 3. Selects elements to transfer (by clicking) 4. Confirmation moves elements to new layer 5. Layer metadata updated automatically
Technical Details:
- Preserves all GeoJSON properties
- Updates layer membership
- Maintains visual styling
- Handles both line and point geometries
- Updates legend automatically
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: August 2025
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Inputs:
- Parent and target sublayer selection from layerConfig.
- Map interactions for feature selection.
Public API:
- activateSwitchSublayerTool(): Start sublayer switching workflow.
Public API Functions (1)
startSublayerSwitchFlow()
Begin the sublayer-switching workflow. Validates that at least one eligible parent layer is loaded, then presents a selection dialog that lets the user choose a parent layer and a destination sublayer. After confirmation, click handlers are attached to every matching element so the user can mark features for transfer. Completes by moving the selected elements to the destination sublayer and updating the legend.
Returns: void
topology_check.js
QGas - Topology Check Tool
Analyzes network connectivity to identify unconnected nodes, unconnected lines, and disconnected network islands. Provides clickable results that focus the map on the selected element or isolate a specific network component.
Development Information:
- Authors: Marco Quantschnig, Yannick Werner, Sonja Wogrin and Thomas Klatzer
- Institution: Institute of Electricity Economics and Energy Innovation (IEE), Graz University of Technology, Inffeldgasse 18, Graz, 8010, Austria
- Created: March 2026
- License: See LICENSE file
- Disclaimer: AI-assisted tools were used to support development and documentation.
Public API:
- activateTopologyCheckTool(): Run topology analysis and open results popup.
Public API Functions (1)
activateTopologyCheckTool()
Run the network topology analysis and display results. Resets all active editing modes, performs a full topological analysis of the loaded node and line layers (via buildTopologyAnalysis), and renders the results in a popup. The analysis identifies: (a) isolated nodes not connected to any pipeline, (b) pipelines not connected at either endpoint to a node, (c) disconnected network sub-graphs (islands). Each result entry is clickable and pans/zooms the map to the offending element.
Returns: void