From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 9F7481FF0B4 for ; Fri, 27 Nov 2026 17:12:44 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6DB1F21646; Fri, 27 Nov 2026 17:12:44 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH yew-widget-toolkit-assets 02/38] charts: world map: add classes for the map and its features Date: Fri, 27 Nov 2026 17:11:59 +0100 Message-ID: <20261127161241.3713494-3-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.259 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: CBVWWLIH6OZTFVXUD6T3X4DMYQGFHBJJ X-Message-ID-Hash: CBVWWLIH6OZTFVXUD6T3X4DMYQGFHBJJ 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 WorldMap now has a group for each feature of the map instead of a single path with inline styles. The water gets a slight tint of the primary color that is a bit stronger in the middle, which gives it some depth. The land keeps the neutral color. The coast is drawn stronger than the borders between countries, which are a feature of their own, and the lines of the graticule are very faint. All of these colors are custom properties, so they can be overridden. Since 'vector-effect' is not inherited, it has to be set on the paths themselves to keep the lines the same width for every zoom level. Signed-off-by: Dominik Csapak --- scss/_charts.scss | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/scss/_charts.scss b/scss/_charts.scss index c4eb4f8..2295315 100644 --- a/scss/_charts.scss +++ b/scss/_charts.scss @@ -32,6 +32,57 @@ display: block; } +/// Class `pwt-world-map` +/// +/// Used for a `WorldMap`. The colors can be overridden via the `--pwt-world-map-water-color`, +/// `--pwt-world-map-land-color`, `--pwt-world-map-coast-color`, `--pwt-world-map-border-color` +/// and `--pwt-world-map-graticule-color` custom properties. +.pwt-world-map { + --pwt-world-map-water-color: color-mix(in srgb, var(--pwt-color-primary) 6%, var(--pwt-color-surface)); + --pwt-world-map-land-color: var(--pwt-color-neutral); + --pwt-world-map-coast-color: color-mix(in srgb, var(--pwt-color-on-surface) 30%, transparent); + --pwt-world-map-border-color: color-mix(in srgb, var(--pwt-color-on-surface) 22%, transparent); + --pwt-world-map-graticule-color: color-mix(in srgb, var(--pwt-color-on-surface) 8%, transparent); + + // a stronger tint in the middle gives the water some depth + background: radial-gradient( + ellipse at center, + color-mix(in srgb, var(--pwt-color-primary) 12%, var(--pwt-world-map-water-color)), + var(--pwt-world-map-water-color) 75% + ); +} + +/// Class `pwt-world-map-graticule` +/// +/// Used for the lines of constant latitude and longitude of a `WorldMap`. +.pwt-world-map-graticule { + fill: none; + stroke: var(--pwt-world-map-graticule-color); + stroke-width: 1px; + vector-effect: non-scaling-stroke; +} + +/// Class `pwt-world-map-feature` +/// +/// Used for the shapes of a GeoJSON feature on a `WorldMap`. The `data-kind` attribute holds +/// the `kind` property of the feature. Its areas are filled, and they are outlined as coast like +/// its lines, except for the kind `borders`, which has fainter lines. +.pwt-world-map-feature { + fill: var(--pwt-world-map-land-color); + stroke: var(--pwt-world-map-coast-color); + stroke-width: 1px; + stroke-linejoin: round; + + &[data-kind="borders"] { + stroke: var(--pwt-world-map-border-color); + } + + // not inherited, so it has to be set on the shapes themselves + & > path { + vector-effect: non-scaling-stroke; + } +} + /// Class `pwt-map-location` /// /// Used for a location displayed on a `Map`. Its color can be overridden via the -- 2.47.3