Icicle
Overview
The icicle
trace type is used to create icicle charts, which are a variation of treemap charts but arranged vertically. Icicle charts are useful for visualizing hierarchical data, where each branch represents a part of the whole, and you can drill down into sub-categories.
You can customize the colors, labels, and depth of the icicle chart to represent your hierarchical data effectively.
Common Uses
- Hierarchical Data Representation: Visualizing categories and subcategories in a hierarchy.
- Part-to-Whole Relationships: Showing how parts relate to the whole, with breakdowns for subcategories.
- Drill-Down Analysis: Allowing users to explore different levels of data.
Check out the Attributes for the full set of configuration options
Examples
Common Configurations
Here's a simple icicle
plot showing hierarchical data, with branches representing categories:
You can copy this code below to create this chart in your project:
models:
- name: icicle-data
args:
- echo
- |
category,parent,value
A,,100
B,A,50
C,A,30
D,A,10
E,B,25
F,B,15
traces:
- name: Simple Icicle Plot
model: ${ref(icicle-data)}
props:
type: icicle
labels: ?{category}
parents: ?{parent}
values: ?{value}
branchvalues: "total"
marker:
colorscale: "Portland"
textposition: "middle center"
textfont:
size: 18
charts:
- name: Simple Icicle Chart
traces:
- ${ref(Simple Icicle Plot)}
layout:
title:
text: Simple Icicle Chart<br><sub>Hierarchical Data Breakdown</sub>
This example demonstrates a icicle
plot with custom colors for each branch and leaf node:
Here's the code:
models:
- name: icicle-data-custom
args:
- echo
- |
category,parent,value,color
A,,100,"#1f77b4"
B,A,50,"#ff7f0e"
C,A,30,"#2ca02c"
D,A,20,"#d62728"
E,B,25,"#9467bd"
F,B,15,"#8c564b"
traces:
- name: Custom Colors Icicle Plot
model: ${ref(icicle-data-custom)}
props:
type: icicle
labels: ?{category}
parents: ?{parent}
values: ?{value}
marker:
colors: ?{color}
branchvalues: "total"
charts:
- name: Custom Colors Icicle Chart
traces:
- ${ref(Custom Colors Icicle Plot)}
layout:
title:
text: Icicle Plot with Custom Colors<br><sub>Custom Coloring for Branches</sub>
This example shows an icicle
plot with depth limiting, allowing the user to only see the first two levels of the hierarchy:
Here's the code:
models:
- name: icicle-data-depth
args:
- echo
- |
category,parent,value
A,,100
B,A,50
C,A,30
D,A,20
E,B,25
F,B,15
traces:
- name: Icicle Plot with Depth Limiting Trace
model: ${ref(icicle-data-depth)}
props:
type: icicle
labels: ?{category}
parents: ?{parent}
values: ?{value}
maxdepth: 2
branchvalues: "total"
marker:
colorscale: "YlOrRd"
charts:
- name: Icicle Plot with Depth Limiting
traces:
- ${ref(Icicle Plot with Depth Limiting Trace)}
layout:
title:
text: Icicle Plot with Depth Limiting<br><sub>Showing Only First Two Levels</sub>
A schema to validate plotly trace properties
Attributes
These attributes apply to traces where trace.props.type
is set to icicle
. You would configure these attributes on the trace with the trace.props
object.
branchvalues: any
count: string
customdata: array
customdatasrc: 'string' #(1)!
domain:
column: integer
row: integer
x: array
y: array
hoverinfo: array
hoverinfosrc: 'string' #(2)!
hoverlabel:
align: array
alignsrc: 'string' #(3)!
bgcolor: array
bgcolorsrc: 'string' #(4)!
bordercolor: array
bordercolorsrc: 'string' #(5)!
font:
color: array
colorsrc: 'string' #(6)!
family: 'string | array' #(7)!
familysrc: 'string' #(8)!
lineposition: array
linepositionsrc: 'string' #(9)!
shadow: 'string | array' #(10)!
shadowsrc: 'string' #(11)!
size: array
sizesrc: 'string' #(12)!
style: array
stylesrc: 'string' #(13)!
textcase: array
textcasesrc: 'string' #(14)!
variant: array
variantsrc: 'string' #(15)!
weight: array
weightsrc: 'string' #(16)!
namelength: array
namelengthsrc: 'string' #(17)!
hovertemplate: 'string | array' #(18)!
hovertemplatesrc: 'string' #(19)!
hovertext: 'string | array' #(20)!
hovertextsrc: 'string' #(21)!
ids: array
idssrc: 'string' #(22)!
insidetextfont:
color: array
colorsrc: 'string' #(23)!
family: 'string | array' #(24)!
familysrc: 'string' #(25)!
lineposition: array
linepositionsrc: 'string' #(26)!
shadow: 'string | array' #(27)!
shadowsrc: 'string' #(28)!
size: array
sizesrc: 'string' #(29)!
style: array
stylesrc: 'string' #(30)!
textcase: array
textcasesrc: 'string' #(31)!
variant: array
variantsrc: 'string' #(32)!
weight: array
weightsrc: 'string' #(33)!
labels: array
labelssrc: 'string' #(34)!
leaf:
opacity: number
legend: string
legendgrouptitle:
font:
color: any
family: 'string' #(35)!
lineposition: any
shadow: 'string' #(36)!
size: number
style: any
textcase: any
variant: any
weight: integer
text: 'string' #(37)!
legendrank: number
legendwidth: number
marker:
autocolorscale: boolean
cauto: boolean
cmax: number
cmid: number
cmin: number
coloraxis: string
colorbar:
bgcolor: any
bordercolor: any
borderwidth: number
exponentformat: any
len: number
lenmode: any
minexponent: number
nticks: integer
orientation: any
outlinecolor: any
outlinewidth: number
separatethousands: boolean
showexponent: any
showticklabels: boolean
showtickprefix: any
showticksuffix: any
thickness: number
thicknessmode: any
tickangle: number
tickcolor: any
tickfont:
color: any
family: 'string' #(38)!
lineposition: any
shadow: 'string' #(39)!
size: number
style: any
textcase: any
variant: any
weight: integer
tickformat: 'string' #(40)!
tickformatstops: array
ticklabeloverflow: any
ticklabelposition: any
ticklabelstep: integer
ticklen: number
tickmode: any
tickprefix: 'string' #(41)!
ticks: any
ticksuffix: 'string' #(42)!
ticktext: array
ticktextsrc: 'string' #(43)!
tickvals: array
tickvalssrc: 'string' #(44)!
tickwidth: number
title:
font:
color: any
family: 'string' #(45)!
lineposition: any
shadow: 'string' #(46)!
size: number
style: any
textcase: any
variant: any
weight: integer
side: any
text: 'string' #(47)!
x: number
xanchor: any
xpad: number
xref: any
y: number
yanchor: any
ypad: number
yref: any
colors: array
colorscale: any
colorssrc: 'string' #(48)!
line:
color: array
colorsrc: 'string' #(49)!
width: array
widthsrc: 'string' #(50)!
pattern:
bgcolor: array
bgcolorsrc: 'string' #(51)!
fgcolor: array
fgcolorsrc: 'string' #(52)!
fgopacity: number
fillmode: any
shape: array
shapesrc: 'string' #(53)!
size: array
sizesrc: 'string' #(54)!
solidity: array
soliditysrc: 'string' #(55)!
reversescale: boolean
showscale: boolean
maxdepth: integer
metasrc: 'string' #(56)!
name: 'string' #(57)!
opacity: number
outsidetextfont:
color: array
colorsrc: 'string' #(58)!
family: 'string | array' #(59)!
familysrc: 'string' #(60)!
lineposition: array
linepositionsrc: 'string' #(61)!
shadow: 'string | array' #(62)!
shadowsrc: 'string' #(63)!
size: array
sizesrc: 'string' #(64)!
style: array
stylesrc: 'string' #(65)!
textcase: array
textcasesrc: 'string' #(66)!
variant: array
variantsrc: 'string' #(67)!
weight: array
weightsrc: 'string' #(68)!
parents: array
parentssrc: 'string' #(69)!
pathbar:
edgeshape: any
side: any
textfont:
color: array
colorsrc: 'string' #(70)!
family: 'string | array' #(71)!
familysrc: 'string' #(72)!
lineposition: array
linepositionsrc: 'string' #(73)!
shadow: 'string | array' #(74)!
shadowsrc: 'string' #(75)!
size: array
sizesrc: 'string' #(76)!
style: array
stylesrc: 'string' #(77)!
textcase: array
textcasesrc: 'string' #(78)!
variant: array
variantsrc: 'string' #(79)!
weight: array
weightsrc: 'string' #(80)!
thickness: number
visible: boolean
root:
color: any
sort: boolean
stream:
maxpoints: number
token: 'string' #(81)!
text: array
textfont:
color: array
colorsrc: 'string' #(82)!
family: 'string | array' #(83)!
familysrc: 'string' #(84)!
lineposition: array
linepositionsrc: 'string' #(85)!
shadow: 'string | array' #(86)!
shadowsrc: 'string' #(87)!
size: array
sizesrc: 'string' #(88)!
style: array
stylesrc: 'string' #(89)!
textcase: array
textcasesrc: 'string' #(90)!
variant: array
variantsrc: 'string' #(91)!
weight: array
weightsrc: 'string' #(92)!
textinfo: any
textposition: any
textsrc: 'string' #(93)!
texttemplate: 'string | array' #(94)!
texttemplatesrc: 'string' #(95)!
tiling:
flip: string
orientation: any
pad: number
type: icicle
uid: 'string' #(96)!
values: array
valuessrc: 'string' #(97)!
visible: any
- Sets the source reference on Chart Studio Cloud for
customdata
. - Sets the source reference on Chart Studio Cloud for
hoverinfo
. - Sets the source reference on Chart Studio Cloud for
align
. - Sets the source reference on Chart Studio Cloud for
bgcolor
. - Sets the source reference on Chart Studio Cloud for
bordercolor
. - Sets the source reference on Chart Studio Cloud for
color
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the source reference on Chart Studio Cloud for
family
. - Sets the source reference on Chart Studio Cloud for
lineposition
. - Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the source reference on Chart Studio Cloud for
shadow
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
style
. - Sets the source reference on Chart Studio Cloud for
textcase
. - Sets the source reference on Chart Studio Cloud for
variant
. - Sets the source reference on Chart Studio Cloud for
weight
. - Sets the source reference on Chart Studio Cloud for
namelength
. - Template string used for rendering the information that appear on hover box. Note that this will override
hoverinfo
. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%xother}, {%_xother}, {%xother_}. When showing info for several points, xother will be added to those with different x positions from the first point. An underscore before or after (x|y)other will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available inhovertemplate
are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that arearrayOk: true
) are available. Finally, the template string has access to variablescurrentPath
,root
,entry
,percentRoot
,percentEntry
andpercentParent
. Anything contained in tag<extra>
is displayed in the secondary box, for example "{fullData.name} ". To hide the secondary box completely, use an empty tag<extra></extra>
. - Sets the source reference on Chart Studio Cloud for
hovertemplate
. - Sets hover text elements associated with each sector. If a single string, the same string appears for all data points. If an array of string, the items are mapped in order of this trace's sectors. To be seen, trace
hoverinfo
must contain a text flag. - Sets the source reference on Chart Studio Cloud for
hovertext
. - Sets the source reference on Chart Studio Cloud for
ids
. - Sets the source reference on Chart Studio Cloud for
color
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the source reference on Chart Studio Cloud for
family
. - Sets the source reference on Chart Studio Cloud for
lineposition
. - Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the source reference on Chart Studio Cloud for
shadow
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
style
. - Sets the source reference on Chart Studio Cloud for
textcase
. - Sets the source reference on Chart Studio Cloud for
variant
. - Sets the source reference on Chart Studio Cloud for
weight
. - Sets the source reference on Chart Studio Cloud for
labels
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the title of the legend group.
- HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 09~15~23.46
- Sets a tick label prefix.
- Sets a tick label suffix.
- Sets the source reference on Chart Studio Cloud for
ticktext
. - Sets the source reference on Chart Studio Cloud for
tickvals
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the title of the color bar.
- Sets the source reference on Chart Studio Cloud for
colors
. - Sets the source reference on Chart Studio Cloud for
color
. - Sets the source reference on Chart Studio Cloud for
width
. - Sets the source reference on Chart Studio Cloud for
bgcolor
. - Sets the source reference on Chart Studio Cloud for
fgcolor
. - Sets the source reference on Chart Studio Cloud for
shape
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
solidity
. - Sets the source reference on Chart Studio Cloud for
meta
. - Sets the trace name. The trace name appears as the legend item and on hover.
- Sets the source reference on Chart Studio Cloud for
color
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the source reference on Chart Studio Cloud for
family
. - Sets the source reference on Chart Studio Cloud for
lineposition
. - Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the source reference on Chart Studio Cloud for
shadow
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
style
. - Sets the source reference on Chart Studio Cloud for
textcase
. - Sets the source reference on Chart Studio Cloud for
variant
. - Sets the source reference on Chart Studio Cloud for
weight
. - Sets the source reference on Chart Studio Cloud for
parents
. - Sets the source reference on Chart Studio Cloud for
color
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the source reference on Chart Studio Cloud for
family
. - Sets the source reference on Chart Studio Cloud for
lineposition
. - Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the source reference on Chart Studio Cloud for
shadow
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
style
. - Sets the source reference on Chart Studio Cloud for
textcase
. - Sets the source reference on Chart Studio Cloud for
variant
. - Sets the source reference on Chart Studio Cloud for
weight
. - The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
- Sets the source reference on Chart Studio Cloud for
color
. - HTML font family - the typeface that will be applied by the web browser. The web browser can only apply a font if it is available on the system where it runs. Provide multiple font families, separated by commas, to indicate the order in which to apply fonts if they aren't available.
- Sets the source reference on Chart Studio Cloud for
family
. - Sets the source reference on Chart Studio Cloud for
lineposition
. - Sets the shape and color of the shadow behind text. auto places minimal shadow and applies contrast text font color. See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options.
- Sets the source reference on Chart Studio Cloud for
shadow
. - Sets the source reference on Chart Studio Cloud for
size
. - Sets the source reference on Chart Studio Cloud for
style
. - Sets the source reference on Chart Studio Cloud for
textcase
. - Sets the source reference on Chart Studio Cloud for
variant
. - Sets the source reference on Chart Studio Cloud for
weight
. - Sets the source reference on Chart Studio Cloud for
text
. - Template string used for rendering the information text that appear on points. Note that this will override
textinfo
. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that arearrayOk: true
) are available. Finally, the template string has access to variablescurrentPath
,root
,entry
,percentRoot
,percentEntry
,percentParent
,label
andvalue
. - Sets the source reference on Chart Studio Cloud for
texttemplate
. - Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
- Sets the source reference on Chart Studio Cloud for
values
.