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 BBC461FF0B4 for ; Fri, 27 Nov 2026 17:12:47 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8D31121738; Fri, 27 Nov 2026 17:12:45 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH yew-widget-toolkit-assets 04/38] charts: map: show locations as a dot with a halo Date: Fri, 27 Nov 2026 17:12:01 +0100 Message-ID: <20261127161241.3713494-5-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: JYL2IISIIMYN7PUOP3RFIV2AWLCEIOPD X-Message-ID-Hash: JYL2IISIIMYN7PUOP3RFIV2AWLCEIOPD 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 a dot, a halo and, for more than one point, their count for each location. The dot has the color of the location and an outline that keeps it apart from the halo and from other dots. The halo is the same color, but translucent, fades out with a fainter ring and grows while the location is hovered. The ring of a selected location starts at the halo now. It ignores the pointer, since the area that reacts to the pointer would pulse with it otherwise. For users that prefer reduced motion it stands still. The sizes of outlines and the count use the size of a screen pixel on the map, which the Map provides as '--pwt-map-pixel-size', so they stay the same for every size of the map. Signed-off-by: Dominik Csapak --- scss/_charts.scss | 71 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/scss/_charts.scss b/scss/_charts.scss index 9aafd29..5818807 100644 --- a/scss/_charts.scss +++ b/scss/_charts.scss @@ -65,7 +65,9 @@ /// 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. +/// the browser does not have to draw the map again when they change. The `--pwt-map-pixel-size` +/// custom property is the size of a screen pixel on the map, it keeps stroke widths and font +/// sizes the same for every size of the map. .pwt-map-overlay { position: absolute; inset: 0; @@ -130,16 +132,52 @@ .pwt-map-location { --pwt-map-location-color: var(--pwt-color-primary); cursor: pointer; +} - & > circle { - fill: color-mix(in srgb, var(--pwt-map-location-color), transparent 80%); - stroke: var(--pwt-map-location-color); - stroke-width: 2px; - r: calc(var(--pwt-map-location-radius) - 2px); - vector-effect: non-scaling-stroke; +// how much bigger than the radius of a location its halo is +$map-location-halo-factor: 1.25; + +/// Class `pwt-map-location-halo` +/// +/// Used for the translucent circle around a location, which fades out with a fainter ring. It +/// grows while the location is hovered. +.pwt-map-location-halo { + fill: color-mix(in srgb, var(--pwt-map-location-color) 35%, transparent); + stroke: color-mix(in srgb, var(--pwt-map-location-color) 15%, transparent); + stroke-width: calc(var(--pwt-map-location-radius) * 0.5); + r: calc(var(--pwt-map-location-radius) * #{$map-location-halo-factor}); + transition: r 0.15s ease-out; + + .pwt-map-location:hover > & { + r: calc(var(--pwt-map-location-radius) * 1.6); } } +/// Class `pwt-map-location-dot` +/// +/// Used for the dot in the middle of a location. The outline keeps it apart from its halo and +/// from a dot it overlaps with. +.pwt-map-location-dot { + fill: var(--pwt-map-location-color); + stroke: var(--pwt-color-surface); + stroke-width: calc(1.5 * var(--pwt-map-pixel-size)); + r: calc(var(--pwt-map-location-radius) * 0.8); +} + +/// Class `pwt-map-location-count` +/// +/// Used for the number of points of a location with more than one point. +.pwt-map-location-count { + fill: var(--pwt-color-surface); + font-size: max(10 * var(--pwt-map-pixel-size), var(--pwt-map-location-radius) * 0.7); + font-weight: bold; + text-anchor: middle; + dominant-baseline: central; + pointer-events: none; + -webkit-user-select: none; + user-select: none; +} + /// Class `pwt-map-interaction-panel` /// /// This is used for positioning the panel containing the interactive elements @@ -151,18 +189,29 @@ /// Class `pwt-map-location-animated` /// -/// Used to animate a selected location with a pulsing ring. +/// Used to animate a selected location with a pulsing ring. The ring ignores the pointer, so +/// that the area that reacts to it does not change with the animation. .pwt-map-location-animated { - animation: pwt-map-location-pulse 1.2s infinite; + fill: none; + pointer-events: none; + stroke: var(--pwt-map-location-color); + stroke-width: calc(2 * var(--pwt-map-pixel-size)); + animation: pwt-map-location-pulse 1.6s ease-out infinite; + + @media (prefers-reduced-motion: reduce) { + animation: none; + r: calc(var(--pwt-map-location-radius) * 1.8); + } } @keyframes pwt-map-location-pulse { + // starts at the halo and doubles from { - r: var(--pwt-map-location-radius); + r: calc(var(--pwt-map-location-radius) * #{$map-location-halo-factor}); opacity: 100%; } to { - r: calc(var(--pwt-map-location-radius) * 1.5); + r: calc(var(--pwt-map-location-radius) * #{2 * $map-location-halo-factor}); opacity: 0%; } } -- 2.47.3