Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

syncfusion-wpf-treemap同步融合 WPF 树形图

Agent Skill

syncfusion-wpf-treemap 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,023

周安装

41

GitHub Stars

2

下载量

331
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-wpf-treemap(同步融合 WPF 树形图)
来源仓库:https://github.com/syncfusion/wpf-ui-components-skills
仓库路径:skills/syncfusion-wpf-treemap
安装命令:
npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-treemap
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/wpf-ui-components-skills --skill syncfusion-wpf-treemap

简介

用于查找、检索和筛选相关信息。syncfusion-wpf-treemap 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合根据关键词、任务场景或来源线索快速定位候选结果。
  • 可结合来源仓库和 README 进一步核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • 注意避免在不具备相应权限时执行写回或批量操作。

SKILL.md

Implementing Syncfusion WPF TreeMap (SfTreeMap)

When to Use This Skill

Use this skill when the user needs to:

  • Visualize hierarchical data as nested, sized rectangles representing quantities
  • Display large datasets where TreeMap's space-efficient layout is ideal
  • Implement data visualization for stock market analysis, usage statistics, or categorized data
  • Create heat maps where color represents values and size represents weight
  • Build WPF applications that need the Syncfusion TreeMap control (SfTreeMap)
  • Customize TreeMap layouts, colors, levels, or interactive features
  • Configure data binding for hierarchical or flat data structures

This skill covers the complete implementation of Syncfusion WPF TreeMap, from basic setup to advanced features like drill-down, color mapping, and custom templates.

Component Overview

Syncfusion WPF TreeMap (SfTreeMap) is a data visualization control that displays hierarchical information as a series of clustered rectangles. Each rectangle's size represents a quantitative value (weight), and its color can represent another dimension of the data.

Key Capabilities:

  • Multiple layout algorithms (Squarified, SliceAndDice variants)
  • Flexible color mapping strategies (solid, range, desaturation, palette, group-based)
  • Hierarchical levels with customizable headers
  • Interactive features (selection, tooltips, drill-down)
  • Comprehensive data binding support
  • Accessibility and keyboard navigation
  • Theme support

Common Use Cases:

  1. Stock Market Analysis - Rectangle size = stock weight, color = gain/loss
  2. Internet Usage Visualization - Categorize traffic by type (retail, social, search)
  3. News Aggregation - Color = section (business/politics), size = story count
  4. Weather Analysis - Opacity/color = humidity, size = geographic area

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Installation and package setup
  • Assembly and namespace references (Syncfusion.SfTreeMap.WPF)
  • Creating TreeMap via Visual Studio, Expression Blend, or code
  • Basic TreeMap configuration in XAML and C#
  • Setting up ItemsSource with data models
  • DataContext configuration
  • First working example with population data
  • Theme support (SfSkinManager, ThemeStudio)

Layout Modes

📄 Read: references/layout-modes.md

  • Available layout algorithms
  • Squarified layout (default, optimized aspect ratios)
  • SliceAndDiceAuto (alternates horizontal/vertical by level)
  • SliceAndDiceHorizontal (horizontal slicing only)
  • SliceAndDiceVertical (vertical slicing only)
  • Choosing the right layout for your data
  • Performance considerations

Data Binding and Configuration

📄 Read: references/data-binding.md

  • WeightValuePath property (determines rectangle sizes)
  • ColorValuePath property (drives color mapping)
  • ItemsSource binding to collections
  • Data model requirements and structure
  • Hierarchical vs flat data binding
  • Supported collection types (ObservableCollection, List, etc.)

Color Mapping

📄 Read: references/color-mapping.md

  • Color mapping overview and types
  • UniColorMapping (solid color for all leaves)
  • RangeBrushColorMapping (colors based on value ranges)
  • DesaturationColorMapping (opacity ranges for visual emphasis)
  • PaletteColorMapping (cycling through color collections)
  • GroupColorMapping (different colors per group)
  • LeafColorMapping vs TreeMapLevel ColorMapping
  • Applying colors to leaf nodes vs headers

TreeMap Levels and Hierarchy

📄 Read: references/levels-and-hierarchy.md

  • TreeMapFlatLevel for grouping flat data
  • GroupPath property for hierarchical organization
  • Configuring multiple levels
  • GroupGap for spacing between groups
  • Header configuration (HeaderHeight, ShowHeader)
  • Header templates and styling
  • ShowLabels property for leaf labels
  • Creating nested hierarchies

Leaf Node Customization

📄 Read: references/leaf-customization.md

  • LeafItemSettings overview
  • Border customization (LeafBorderBrush, LeafBorderThickness)
  • LeafLabelPath for displaying text on leaves
  • LeafTemplate for custom leaf UI
  • Label positioning and formatting
  • Customizing individual leaf appearances
  • Template examples for complex leaf content

Headers and Labels

📄 Read: references/headers-and-labels.md

  • Header templates (HeaderTemplate property)
  • Header styling and customization
  • Label visibility and content control
  • Custom header content with data binding
  • Positioning headers within levels

Interactive Features

📄 Read: references/interactive-features.md

  • Selection support (single and multiple)
  • SelectionModes (Default, Multiple)
  • SelectedItems property and selection events
  • Tooltip configuration and display
  • TooltipTemplate for custom tooltips
  • Drill-down navigation support
  • DrillDownHeaderTemplate customization
  • EnableDrillDown property

Legend

📄 Read: references/legend.md

  • Legend overview and purpose
  • ShowLegend property
  • LegendType (Gradient, DockPosition)
  • LegendHeight and LegendWidth configuration
  • LegendTemplate for custom legends
  • Legend positioning options

Accessibility

📄 Read: references/accessibility.md

  • Keyboard navigation support
  • Tab and Shift+Tab navigation between items
  • SelectionModes impact on keyboard behavior
  • WCAG compliance features
  • Screen reader support

Quick Start Example

Here's a minimal example to create a functional TreeMap displaying population data:

<Window x:Class="TreeMapDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:syncfusion="clr-namespace:Syncfusion.UI.Xaml.TreeMap;assembly=Syncfusion.SfTreeMap.WPF"
        Title="TreeMap Demo" WindowState="Maximized">
    <Grid>
        <Grid.DataContext>
            <local:PopulationViewModel/>
        </Grid.DataContext>

        <syncfusion:SfTreeMap ItemsSource="{Binding PopulationDetails}"
                              WeightValuePath="Population"
                              ColorValuePath="Growth"
                              ItemsLayoutMode="Squarified">

            <!-- Color mapping for growth values -->
            <syncfusion:SfTreeMap.LeafColorMapping>
                <syncfusion:RangeBrushColorMapping>
                    <syncfusion:RangeBrushColorMapping.Brushes>
                        <syncfusion:RangeBrush From="0" To="1" Color="#A4C400"/>
                        <syncfusion:RangeBrush From="1" To="2" Color="#AA00FF"/>
                        <syncfusion:RangeBrush From="2" To="3" Color="#F0A30A"/>
                        <syncfusion:RangeBrush From="3" To="4" Color="#1BA1E2"/>
                    </syncfusion:RangeBrushColorMapping.Brushes>
                </syncfusion:RangeBrushColorMapping>
            </syncfusion:SfTreeMap.LeafColorMapping>

            <!-- Hierarchical levels -->
            <syncfusion:SfTreeMap.Levels>
                <syncfusion:TreeMapFlatLevel GroupPath="Continent"
                                             GroupGap="10"
                                             HeaderHeight="30">
                    <syncfusion:TreeMapFlatLevel.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Header}"
                                      Foreground="#D6D6D6"
                                      FontSize="18"
                                      FontWeight="Light"/>
                        </DataTemplate>
                    </syncfusion:TreeMapFlatLevel.HeaderTemplate>
                </syncfusion:TreeMapFlatLevel>
            </syncfusion:SfTreeMap.Levels>
        </syncfusion:SfTreeMap>
    </Grid>
</Window>
// ViewModel with sample data
public class PopulationViewModel
{
    public ObservableCollection<PopulationDetail> PopulationDetails { get; set; }

    public PopulationViewModel()
    {
        PopulationDetails = new ObservableCollection<PopulationDetail>
        {
            new PopulationDetail { Continent = "Asia", Country = "Indonesia", Growth = 3, Population = 237641326 },
            new PopulationDetail { Continent = "Asia", Country = "Russia", Growth = 2, Population = 152518015 },
            new PopulationDetail { Continent = "North America", Country = "United States", Growth = 4, Population = 315645000 },
            new PopulationDetail { Continent = "Europe", Country = "Germany", Growth = 1, Population = 81993000 }
        };
    }
}

public class PopulationDetail
{
    public string Continent { get; set; }
    public string Country { get; set; }
    public double Growth { get; set; }
    public double Population { get; set; }
}

Common Patterns

Pattern 1: Basic TreeMap with Single Level

When displaying flat data without hierarchical grouping:

<syncfusion:SfTreeMap ItemsSource="{Binding Items}"
                      WeightValuePath="Value"
                      ItemsLayoutMode="Squarified">
    <syncfusion:SfTreeMap.LeafColorMapping>
        <syncfusion:UniColorMapping Color="Crimson"/>
    </syncfusion:SfTreeMap.LeafColorMapping>
</syncfusion:SfTreeMap>

Pattern 2: Multi-Level Hierarchy

When displaying nested hierarchical data (e.g., Continent → Country):

<syncfusion:SfTreeMap.Levels>
    <syncfusion:TreeMapFlatLevel GroupPath="Continent" GroupGap="10" HeaderHeight="30"/>
    <syncfusion:TreeMapFlatLevel GroupPath="Country" GroupGap="5" HeaderHeight="20" ShowLabels="True"/>
</syncfusion:SfTreeMap.Levels>

Pattern 3: Range-Based Color Mapping

When coloring rectangles based on value ranges:

<syncfusion:SfTreeMap.LeafColorMapping>
    <syncfusion:RangeBrushColorMapping>
        <syncfusion:RangeBrushColorMapping.Brushes>
            <syncfusion:RangeBrush From="0" To="25" Color="LightGreen"/>
            <syncfusion:RangeBrush From="25" To="50" Color="Yellow"/>
            <syncfusion:RangeBrush From="50" To="75" Color="Orange"/>
            <syncfusion:RangeBrush From="75" To="100" Color="Red"/>
        </syncfusion:RangeBrushColorMapping.Brushes>
    </syncfusion:RangeBrushColorMapping>
</syncfusion:SfTreeMap.LeafColorMapping>

Pattern 4: Selection and Interaction

When enabling user interaction:

<syncfusion:SfTreeMap SelectionModes="Multiple">
    <!-- Multiple selection with Ctrl/Shift -->
</syncfusion:SfTreeMap>

Pattern 5: Custom Tooltips

When showing detailed information on hover:

<syncfusion:SfTreeMap>
    <syncfusion:SfTreeMap.TooltipTemplate>
        <DataTemplate>
            <StackPanel Background="White" Margin="5">
                <TextBlock Text="{Binding Country}" FontWeight="Bold"/>
                <TextBlock Text="{Binding Population, StringFormat='Population: {0:N0}'}"/>
            </StackPanel>
        </DataTemplate>
    </syncfusion:SfTreeMap.TooltipTemplate>
</syncfusion:SfTreeMap>

Key Properties

Essential Properties

  • ItemsSource - Collection of data objects to visualize
  • WeightValuePath - Property name determining rectangle sizes
  • ColorValuePath - Property name determining color mapping values
  • ItemsLayoutMode - Layout algorithm (Squarified, SliceAndDiceAuto, etc.)

Color Mapping Properties

  • LeafColorMapping - Color mapping strategy for leaf nodes
  • RangeBrushColorMapping.Brushes - Color ranges for value-based coloring
  • DesaturationColorMapping - Opacity-based color mapping
  • PaletteColorMapping.Colors - Collection of colors to cycle through

Level Configuration

  • Levels - Collection of TreeMapFlatLevel objects
  • GroupPath - Property name for grouping data at each level
  • GroupGap - Spacing between groups (in pixels)
  • HeaderHeight - Height of group headers
  • HeaderTemplate - Custom template for headers
  • ShowHeader - Show/hide headers at a level
  • ShowLabels - Show/hide labels on leaf nodes

Leaf Customization

  • LeafItemSettings - Settings for leaf node appearance
  • LeafBorderBrush - Border color for leaf nodes
  • LeafBorderThickness - Border thickness for leaf nodes
  • LeafLabelPath - Property name for leaf labels
  • LeafTemplate - Custom template for leaf content

Interactive Features

  • SelectionModes - Selection behavior (Default, Multiple)
  • SelectedItems - Collection of currently selected items
  • TooltipTemplate - Custom template for tooltips
  • EnableDrillDown - Enable drill-down navigation
  • DrillDownHeaderTemplate - Template for drill-down headers

Legend Properties

  • ShowLegend - Show/hide legend
  • LegendType - Legend display type
  • LegendHeight/LegendWidth - Legend dimensions
  • LegendTemplate - Custom template for legend

Common Use Cases

Use Case 1: Stock Portfolio Visualization

Display stock holdings where rectangle size = investment amount, color = performance:

Guidance: Use RangeBrushColorMapping with negative (red) to positive (green) ranges. Set WeightValuePath to investment amount, ColorValuePath to percentage gain/loss.

References: color-mapping.md, data-binding.md

Use Case 2: Disk Space Usage Analysis

Show folder sizes in a filesystem hierarchy:

Guidance: Use multi-level TreeMapFlatLevel with GroupPath for folder hierarchy. Set WeightValuePath to file size. Consider SliceAndDiceAuto layout for better readability.

References: levels-and-hierarchy.md, layout-modes.md

Use Case 3: Sales Performance Dashboard

Display sales by region and salesperson:

Guidance: Create two levels (Region → Salesperson), use DesaturationColorMapping to highlight top performers with stronger colors. Enable tooltips to show detailed metrics.

References: interactive-features.md, levels-and-hierarchy.md

Use Case 4: Website Traffic Analysis

Visualize page views by category and page:

Guidance: Use PaletteColorMapping for distinct category colors. Add custom LeafTemplate to display page names and metrics. Enable drill-down for navigation.

References: color-mapping.md, leaf-customization.md, interactive-features.md

Use Case 5: Weather Data Visualization

Display temperature or precipitation data by geographic region:

Guidance: Use DesaturationColorMapping where opacity represents humidity/precipitation. Set up GroupColorMapping for different regions with base colors.

References: color-mapping.md

Assembly and Namespace

Assembly: Syncfusion.SfTreeMap.WPF Namespace: Syncfusion.UI.Xaml.TreeMap

Add this namespace to your XAML:

xmlns:syncfusion="clr-namespace:Syncfusion.UI.Xaml.TreeMap;assembly=Syncfusion.SfTreeMap.WPF"

Additional Resources

Theme Support:

Accessibility:


Next Steps:

  1. Review getting-started.md for installation and setup
  2. Choose appropriate layout from layout-modes.md
  3. Configure data binding using data-binding.md
  4. Apply color mapping strategies from color-mapping.md
  5. Add levels and hierarchy as needed from levels-and-hierarchy.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.38%
按下载量换算110

Claude

28.71%
按下载量换算95

Cursor

19.32%
按下载量换算64

Gemini CLI

9.53%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills