From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 0D2CE1FF0B4 for ; Fri, 27 Nov 2026 17:12:46 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E76D12170B; Fri, 27 Nov 2026 17:12:44 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH yew-widget-toolkit-assets 03/38] charts: map: stack the map and its points in two layers Date: Fri, 27 Nov 2026 17:12:00 +0100 Message-ID: <20261127161241.3713494-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261127161241.3713494-1-d.csapak@proxmox.com> References: <20261127161241.3713494-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.258 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: X4XXOYFEY5BNUIJEMQTXHD45TBYJDBD2 X-Message-ID-Hash: X4XXOYFEY5BNUIJEMQTXHD45TBYJDBD2 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: A Map now draws its points in an svg element of their own. Place that one on top of the element with the map, which still defines the size, and make each of them a layer of its own. That way the browser only has to draw the points again when they change and not the much more expensive map below them, and not what is behind the map when the map moves. The container of both is positioned, so that the buttons of the map are placed relative to the map instead of the next positioned element around it, e.g. a panel with a title. It can also shrink below the height that fits to its width now, so that it does not overflow when it gets less space than that. Signed-off-by: Dominik Csapak --- scss/_charts.scss | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/scss/_charts.scss b/scss/_charts.scss index 2295315..9aafd29 100644 --- a/scss/_charts.scss +++ b/scss/_charts.scss @@ -13,6 +13,26 @@ color: var(--pwt-legend-color) } +/// Class `pwt-map-container` +/// +/// Used for the outermost element of a `Map`. The buttons of the map are placed relative to it. +/// Without a height of its own it takes the height from the aspect ratio of the map, but it +/// shrinks to the space it gets. +.pwt-map-container { + display: block; + position: relative; + min-height: 0; +} + +/// Class `pwt-map-layers` +/// +/// Used for the element that stacks the SVG elements of a `Map` on top of each other. +.pwt-map-layers { + position: relative; + width: 100%; + height: 100%; +} + /// Class `pwt-map-info` /// /// Used for the info panel shown when a point is clicked on a map. The transition @@ -24,7 +44,7 @@ /// Class `pwt-map` /// -/// Used for the base SVG element of the map. +/// Used for the SVG elements of the map. .pwt-map { width: 100%; height: 100%; @@ -32,6 +52,26 @@ display: block; } +/// Class `pwt-map-background` +/// +/// Used for the SVG element with the map itself, which gives the `Map` its size. It ignores +/// the pointer, the overlay on top of it handles that. It is a layer of its own, so that the +/// browser does not have to draw what is behind the map again when the map is moved. +.pwt-map-background { + pointer-events: none; + will-change: transform; +} + +/// Class `pwt-map-overlay` +/// +/// Used for the SVG element with the locations of a `Map`. It is a layer of its own, so that +/// the browser does not have to draw the map again when they change. +.pwt-map-overlay { + position: absolute; + inset: 0; + will-change: transform; +} + /// Class `pwt-world-map` /// /// Used for a `WorldMap`. The colors can be overridden via the `--pwt-world-map-water-color`, -- 2.47.3