Skip to content

Commit 0297c53

Browse files
authored
Merge pull request #6842 from syncfusion-content/985588-TreeMapUG
983838: Updated the UG content and example changes in the TreeMap control.
2 parents 4c74c89 + 2539991 commit 0297c53

16 files changed

+1241
-1047
lines changed

blazor/treemap/accessibility.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
layout: post
33
title: Accessibility in Blazor TreeMap Component | Syncfusion
4-
description: Checkout and learn here all about Accessibility in Syncfusion Blazor TreeMap component and much more.
4+
description: Check out and learn here all about Accessibility in Syncfusion Blazor TreeMap component and much more.
55
platform: Blazor
66
control: TreeMap
77
documentation: ug
88
---
99

1010
# Accessibility in Blazor TreeMap Component
1111

12-
The [Blazor TreeMap](https://www.syncfusion.com/blazor-components/blazor-treemap) component follows commonly used accessibility guidelines and standards, such as [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/) standards, and [WCAG roles](https://www.w3.org/TR/wai-aria/#roles).
12+
The [Blazor TreeMap](https://www.syncfusion.com/blazor-components/blazor-treemap) component adheres to widely adopted accessibility standards, including [ADA](https://www.ada.gov/), [Section 508](https://www.section508.gov/), [WCAG 2.2](https://www.w3.org/TR/WCAG22/), and [WAI-ARIA roles](https://www.w3.org/TR/wai-aria/#roles).
1313

14-
The accessibility compliance for the Blazor TreeMap component is outlined below.
14+
The accessibility compliance for the Blazor TreeMap component is summarized below.
1515

1616
| Accessibility Criteria | Compatibility |
1717
| -- | -- |
@@ -39,28 +39,28 @@ The accessibility compliance for the Blazor TreeMap component is outlined below.
3939

4040
## WAI-ARIA attributes
4141

42-
The Blazor TreeMap component follows the [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/) patterns to meet the accessibility. The following `WAI-ARIA` attributes are used in the TreeMap component:
42+
The Blazor TreeMap component follows [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/) patterns to support accessibility. The following ARIA attributes are used in the TreeMap component:
4343

4444
| Attributes | Purpose |
4545
| --- | --- |
46-
| `role=region` | It specifies the TreeMap areas that do not support interactive functions like selection and highlight. |
47-
| `role=button` | It specifies the TreeMap areas where interactive functions such as selection and highlight are available. |
48-
| `aria-label` | Provides an accessible name for the title, subtitle, data labels, legend title, and legend item labels. |
46+
| `role=region` | Identifies TreeMap areas without interactive behavior such as selection or highlight. |
47+
| `role=button` | Identifies TreeMap areas where interactive behavior such as selection or highlight is available. |
48+
| `aria-label` | Provides accessible names for the title, subtitle, data labels, legend title, and legend item labels. |
4949

5050
## Screen reading in TreeMap
5151

52-
Accessibility in the Blazor TreeMap component ensures that all users, regardless of ability or disability, can use screen reading. The following TreeMap elements will be read aloud using screen reading software, such as Narrator for Windows.
52+
Accessibility support in the Blazor TreeMap component enables screen readers to announce relevant content. The following TreeMap elements are read by screen readers such as Narrator on Windows.
5353

5454
| Elements | Description |
5555
| --- | --- |
56-
| Data labels | Reads the labels displayed on leaf items of the TreeMap. |
57-
| Title | Reads the title in the TreeMap. |
58-
| Subtitle | Reads the title below the main title content in the TreeMap. |
59-
| Legend title | Reads the title of the legend in the TreeMap. |
60-
| Legend item label | Reads the label of the legend item in the TreeMap. |
56+
| Data labels | Announces the labels displayed on leaf items of the TreeMap. |
57+
| Title | Announces the TreeMap title. |
58+
| Subtitle | Announces the subtitle below the main title. |
59+
| Legend title | Announces the legend title in the TreeMap. |
60+
| Legend item label | Announces the label of each legend item in the TreeMap. |
6161

6262
## Ensuring accessibility
6363

64-
The Blazor TreeMap component's accessibility levels are ensured through an [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) software tool during automated testing.
64+
The Blazor TreeMap components accessibility is validated using the [axe-core](https://www.nuget.org/packages/Deque.AxeCore.Playwright) tool during automated testing.
6565

66-
The accessibility compliance of the TreeMap component is shown in the following sample. Open the [sample](https://blazor.syncfusion.com/accessibility/treemap) in a new window to evaluate the accessibility of the TreeMap component with accessibility tools.
66+
The accessibility compliance of the TreeMap component is demonstrated in the following sample. Open the [sample](https://blazor.syncfusion.com/accessibility/treemap) in a new window to evaluate TreeMap accessibility with testing tools.

blazor/treemap/color-mapping.md

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
22
layout: post
33
title: Color Mapping in Blazor TreeMap Component | Syncfusion
4-
description: Checkout and learn here all about Color Mapping in Syncfusion Blazor TreeMap component and much more.
4+
description: Check out and learn how to configure Color Mapping in the Syncfusion Blazor TreeMap component and much more.
55
platform: Blazor
66
control: TreeMap
77
documentation: ug
88
---
99

1010
# Color Mapping in Blazor TreeMap Component
1111

12-
Color mapping is used to customize the color for each group or item based on the specified types. The following options are available to customize the group and leaf items in the TreeMap component.
12+
Color mapping customizes group and leaf item colors based on defined mapping types. The following options allow customizing group and leaf items in the TreeMap component.
1313

1414
## Range color mapping
1515

16+
Range color mapping applies colors to items based on numeric ranges of a specified value, defined by the [RangeColorValuePath](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.SfTreeMap-1.html#Syncfusion_Blazor_TreeMap_SfTreeMap_1_RangeColorValuePath) property.
1617

1718
```cshtml
1819
@using Syncfusion.Blazor.TreeMap
@@ -32,25 +33,28 @@ Color mapping is used to customize the color for each group or item based on the
3233
public string FruitName { get; set; }
3334
public double Count { get; set; }
3435
};
36+
3537
public List<Fruit> Fruits = new List<Fruit> {
36-
new Fruit { FruitName="Apple", Count=5000 },
37-
new Fruit { FruitName="Mango", Count=3000 },
38-
new Fruit { FruitName="Orange", Count=2300 },
39-
new Fruit { FruitName="Banana", Count=500 },
40-
new Fruit { FruitName="Grape", Count=4300 },
41-
new Fruit { FruitName="Papaya", Count=1200 },
42-
new Fruit { FruitName="Melon", Count=4500 }
38+
new Fruit { FruitName = "Apple", Count = 5000 },
39+
new Fruit { FruitName = "Mango", Count = 3000 },
40+
new Fruit { FruitName = "Orange", Count = 2300 },
41+
new Fruit { FruitName = "Banana", Count = 500 },
42+
new Fruit { FruitName = "Grape", Count = 4300 },
43+
new Fruit { FruitName = "Papaya", Count = 1200 },
44+
new Fruit { FruitName = "Melon", Count = 4500 }
4345
};
4446
}
47+
4548
```
4649

4750
![Blazor TreeMap with Color Mapping](images/Colormapping/blazor-treemap-color-mapping.png)
4851

4952
## Equal color mapping
5053

51-
Equal color mapping is used to fill colors to each item by specifying equal value present in the data source, that can be specified in the [EqualColorValuePath](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.SfTreeMap-1.html#Syncfusion_Blazor_TreeMap_SfTreeMap_1_EqualColorValuePath) property.
54+
Equal color mapping fills items with colors by matching equal values from the data source, specified by the [EqualColorValuePath](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.SfTreeMap-1.html#Syncfusion_Blazor_TreeMap_SfTreeMap_1_EqualColorValuePath) property.
5255

5356
```cshtml
57+
5458
@using Syncfusion.Blazor.TreeMap
5559
5660
<SfTreeMap WeightValuePath="Count" TValue="Car" DataSource="Cars" EqualColorValuePath="Brand">
@@ -71,24 +75,26 @@ Equal color mapping is used to fill colors to each item by specifying equal valu
7175
public string Brand { get; set; }
7276
};
7377
public List<Car> Cars = new List<Car> {
74-
new Car { Name="Mustang", Brand="Ford", Count=232 },
75-
new Car { Name="EcoSport", Brand="Ford", Count=121 },
76-
new Car { Name="Swift", Brand="Maruti", Count=143 },
77-
new Car { Name="Baleno", Brand="Maruti", Count=454 },
78-
new Car { Name="Vitara Brezza", Brand="Maruti", Count=545 },
79-
new Car { Name="A3 Cabriolet", Brand="Audi",Count=123 },
80-
new Car { Name="RS7 Sportback", Brand="Audi", Count=523 }
78+
new Car { Name = "Mustang", Brand = "Ford", Count = 232 },
79+
new Car { Name = "EcoSport", Brand = "Ford", Count = 121 },
80+
new Car { Name = "Swift", Brand = "Maruti", Count = 143 },
81+
new Car { Name = "Baleno", Brand = "Maruti", Count = 454 },
82+
new Car { Name = "Vitara Brezza", Brand = "Maruti", Count = 545 },
83+
new Car { Name = "A3 Cabriolet", Brand = "Audi",Count = 123 },
84+
new Car { Name = "RS7 Sportback", Brand = "Audi", Count = 523 }
8185
};
8286
}
87+
8388
```
8489

8590
![Blazor TreeMap with Equal Color Mapping](images/Colormapping/blazor-treemap-equal-color-mapping.png)
8691

8792
## Desaturation color mapping
8893

89-
Desaturation color mapping is used to apply colors to the items based on the [MinOpacity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_MinOpacity) and the [MaxOpacity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_MaxOpacity) properties in the [TreeMapLeafColorMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafColorMapping.html).
94+
Desaturation color mapping applies colors to items based on [MinOpacity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_MinOpacity) and [MaxOpacity](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_MaxOpacity) properties in [TreeMapLeafColorMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafColorMapping.html).
9095

9196
```cshtml
97+
9298
@using Syncfusion.Blazor.TreeMap
9399
94100
<SfTreeMap WeightValuePath="Count" TValue="Fruit" DataSource="Fruits" RangeColorValuePath="Count">
@@ -99,17 +105,19 @@ Desaturation color mapping is used to apply colors to the items based on the [Mi
99105
</TreeMapLeafColorMappings>
100106
</TreeMapLeafItemSettings>
101107
</SfTreeMap>
108+
102109
```
103110

104-
N> Refer to the [code block](#range-color-mapping) to know about the property value of the **Fruits**.
111+
N> See the [range color mapping](#range-color-mapping) section for the **Fruits** data model and values.
105112

106113
![Blazor TreeMap with Desaturation Color Mapping](images/Colormapping/blazor-treemap-desaturation-color-mapping.png)
107114

108115
## Desaturation with multiple colors
109116

110-
Multiple colors are used to provide gradient effect to the TreeMap items based on the [TreeMapLeafColorMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafColorMapping.html) ranges and specify the **n** number of colors in the [Color](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafItemSettings.html#Syncfusion_Blazor_TreeMap_TreeMapLeafItemSettings_ColorMapping) property.
117+
Multiple colors provide a gradient effect to TreeMap items based on [TreeMapLeafColorMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafColorMapping.html) ranges. Specify multiple colors in the [ColorMapping](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.TreeMapLeafItemSettings.html#Syncfusion_Blazor_TreeMap_TreeMapLeafItemSettings_ColorMapping) property.
111118

112119
```cshtml
120+
113121
@using Syncfusion.Blazor.TreeMap
114122
115123
<SfTreeMap WeightValuePath="Count" TValue="Fruit" DataSource="Fruits" RangeColorValuePath="Count">
@@ -120,33 +128,38 @@ Multiple colors are used to provide gradient effect to the TreeMap items based o
120128
</TreeMapLeafColorMappings>
121129
</TreeMapLeafItemSettings>
122130
</SfTreeMap>
131+
123132
```
124133

125-
N> Refer to the [code block](#range-color-mapping) to know about the property value of **Fruits**.
134+
N> See the [range color mapping](#range-color-mapping) section for the **Fruits** data model and values.
126135

127136
![Multiple Color Mapping in Blazor TreeMap with Desaturation](images/Colormapping/blazor-treemap-desaturation-with-multiple-color.png)
128137

129138
## Palette color mapping
130139

140+
Palette color mapping assigns colors to items from a predefined set of colors specified using the [Palette](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.SfTreeMap-1.html#Syncfusion_Blazor_TreeMap_SfTreeMap_1_Palette) property.
131141

132142
```cshtml
143+
133144
@using Syncfusion.Blazor.TreeMap
134145
135146
<SfTreeMap WeightValuePath="Count" TValue="Car" DataSource="Cars" Palette='new string[] { "red", "green" }'>
136147
<TreeMapLeafItemSettings LabelPath="Name">
137148
</TreeMapLeafItemSettings>
138149
</SfTreeMap>
150+
139151
```
140152

141-
N> Refer to the [code block](#equal-color-mapping) to know about the property value of **Cars**.
153+
N> See the [equal color mapping](#equal-color-mapping) section for the **Cars** data model and values.
142154

143155
![Blazor TreeMap with Palette Color Mapping](images/Colormapping/blazor-treemap-palette-color-mapping.png)
144156

145157
## Color for items excluded from color mapping
146158

147-
Get the excluded ranges from data source using the color mapping and apply the specific color to those items, without specifying the [StartRange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_StartRange) and the [EndRange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_EndRange) properties.
159+
Retrieve excluded ranges from the data source and apply a specific color to those items without specifying [StartRange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_StartRange) and [EndRange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.TreeMap.ColorMapping.html#Syncfusion_Blazor_TreeMap_ColorMapping_EndRange) properties.
148160

149161
```cshtml
162+
150163
@using Syncfusion.Blazor.TreeMap
151164
152165
<SfTreeMap WeightValuePath="Count" TValue="Fruit" DataSource="Fruits" RangeColorValuePath="Count">
@@ -158,16 +171,17 @@ Get the excluded ranges from data source using the color mapping and apply the s
158171
</TreeMapLeafColorMappings>
159172
</TreeMapLeafItemSettings>
160173
</SfTreeMap>
174+
161175
```
162176

163-
N> Refer to the [code block](#range-color-mapping) to know about the property value of the **Fruits**.
177+
N> See the [range color mapping](#range-color-mapping) section for the **Fruits** data model and values.
164178

165179
![Blazor TreeMap with Color Mapping for Excluded Items](images/Colormapping/blazor-treemap-color-for-exclude-item.png)
166180

167181
## Bind the colors to items from the data source
168182

169-
170183
```cshtml
184+
171185
@using Syncfusion.Blazor.TreeMap
172186
173187
<SfTreeMap WeightValuePath="Count" TValue="Fruit" DataSource="Fruits" RangeColorValuePath="Count" ColorValuePath="Color">
@@ -182,16 +196,18 @@ N> Refer to the [code block](#range-color-mapping) to know about the property va
182196
public double Count { get; set; }
183197
public string Color { get; set; }
184198
};
199+
185200
public List<Fruit> Fruits = new List<Fruit> {
186-
new Fruit { Name="Apple", Count=5000, Color = "red" },
187-
new Fruit { Name="Mango", Count=3000, Color="blue" },
188-
new Fruit { Name="Orange", Count=2300, Color="green" },
189-
new Fruit { Name="Banana", Count=500 , Color="yellow"},
190-
new Fruit { Name="Grape", Count=4300 , Color="orange"},
191-
new Fruit { Name="Papaya",Count=1200 , Color="pink"},
192-
new Fruit { Name="Melon", Count=4500, Color="violet" }
201+
new Fruit { Name = "Apple", Count = 5000, Color = "red" },
202+
new Fruit { Name = "Mango", Count = 3000, Color = "blue" },
203+
new Fruit { Name = "Orange", Count = 2300, Color = "green" },
204+
new Fruit { Name = "Banana", Count = 500 , Color = "yellow"},
205+
new Fruit { Name = "Grape", Count = 4300 , Color = "orange"},
206+
new Fruit { Name = "Papaya",Count = 1200 , Color = "pink"},
207+
new Fruit { Name = "Melon", Count = 4500, Color = "violet" }
193208
};
194209
}
210+
195211
```
196212

197213
![Binding Colors in Blazor TreeMap](images/Colormapping/blazor-treemap-color-binding.png)

0 commit comments

Comments
 (0)