Skip to content

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
  1. Sets the source reference on Chart Studio Cloud for customdata.
  2. Sets the source reference on Chart Studio Cloud for hoverinfo.
  3. Sets the source reference on Chart Studio Cloud for align.
  4. Sets the source reference on Chart Studio Cloud for bgcolor.
  5. Sets the source reference on Chart Studio Cloud for bordercolor.
  6. Sets the source reference on Chart Studio Cloud for color.
  7. 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.
  8. Sets the source reference on Chart Studio Cloud for family.
  9. Sets the source reference on Chart Studio Cloud for lineposition.
  10. 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.
  11. Sets the source reference on Chart Studio Cloud for shadow.
  12. Sets the source reference on Chart Studio Cloud for size.
  13. Sets the source reference on Chart Studio Cloud for style.
  14. Sets the source reference on Chart Studio Cloud for textcase.
  15. Sets the source reference on Chart Studio Cloud for variant.
  16. Sets the source reference on Chart Studio Cloud for weight.
  17. Sets the source reference on Chart Studio Cloud for namelength.
  18. 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 in hovertemplate 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 are arrayOk: true) are available. Finally, the template string has access to variables currentPath, root, entry, percentRoot, percentEntry and percentParent. 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>.
  19. Sets the source reference on Chart Studio Cloud for hovertemplate.
  20. 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.
  21. Sets the source reference on Chart Studio Cloud for hovertext.
  22. Sets the source reference on Chart Studio Cloud for ids.
  23. Sets the source reference on Chart Studio Cloud for color.
  24. 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.
  25. Sets the source reference on Chart Studio Cloud for family.
  26. Sets the source reference on Chart Studio Cloud for lineposition.
  27. 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.
  28. Sets the source reference on Chart Studio Cloud for shadow.
  29. Sets the source reference on Chart Studio Cloud for size.
  30. Sets the source reference on Chart Studio Cloud for style.
  31. Sets the source reference on Chart Studio Cloud for textcase.
  32. Sets the source reference on Chart Studio Cloud for variant.
  33. Sets the source reference on Chart Studio Cloud for weight.
  34. Sets the source reference on Chart Studio Cloud for labels.
  35. 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.
  36. 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.
  37. Sets the title of the legend group.
  38. 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.
  39. 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.
  40. 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
  41. Sets a tick label prefix.
  42. Sets a tick label suffix.
  43. Sets the source reference on Chart Studio Cloud for ticktext.
  44. Sets the source reference on Chart Studio Cloud for tickvals.
  45. 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.
  46. 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.
  47. Sets the title of the color bar.
  48. Sets the source reference on Chart Studio Cloud for colors.
  49. Sets the source reference on Chart Studio Cloud for color.
  50. Sets the source reference on Chart Studio Cloud for width.
  51. Sets the source reference on Chart Studio Cloud for bgcolor.
  52. Sets the source reference on Chart Studio Cloud for fgcolor.
  53. Sets the source reference on Chart Studio Cloud for shape.
  54. Sets the source reference on Chart Studio Cloud for size.
  55. Sets the source reference on Chart Studio Cloud for solidity.
  56. Sets the source reference on Chart Studio Cloud for meta.
  57. Sets the trace name. The trace name appears as the legend item and on hover.
  58. Sets the source reference on Chart Studio Cloud for color.
  59. 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.
  60. Sets the source reference on Chart Studio Cloud for family.
  61. Sets the source reference on Chart Studio Cloud for lineposition.
  62. 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.
  63. Sets the source reference on Chart Studio Cloud for shadow.
  64. Sets the source reference on Chart Studio Cloud for size.
  65. Sets the source reference on Chart Studio Cloud for style.
  66. Sets the source reference on Chart Studio Cloud for textcase.
  67. Sets the source reference on Chart Studio Cloud for variant.
  68. Sets the source reference on Chart Studio Cloud for weight.
  69. Sets the source reference on Chart Studio Cloud for parents.
  70. Sets the source reference on Chart Studio Cloud for color.
  71. 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.
  72. Sets the source reference on Chart Studio Cloud for family.
  73. Sets the source reference on Chart Studio Cloud for lineposition.
  74. 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.
  75. Sets the source reference on Chart Studio Cloud for shadow.
  76. Sets the source reference on Chart Studio Cloud for size.
  77. Sets the source reference on Chart Studio Cloud for style.
  78. Sets the source reference on Chart Studio Cloud for textcase.
  79. Sets the source reference on Chart Studio Cloud for variant.
  80. Sets the source reference on Chart Studio Cloud for weight.
  81. The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details.
  82. Sets the source reference on Chart Studio Cloud for color.
  83. 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.
  84. Sets the source reference on Chart Studio Cloud for family.
  85. Sets the source reference on Chart Studio Cloud for lineposition.
  86. 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.
  87. Sets the source reference on Chart Studio Cloud for shadow.
  88. Sets the source reference on Chart Studio Cloud for size.
  89. Sets the source reference on Chart Studio Cloud for style.
  90. Sets the source reference on Chart Studio Cloud for textcase.
  91. Sets the source reference on Chart Studio Cloud for variant.
  92. Sets the source reference on Chart Studio Cloud for weight.
  93. Sets the source reference on Chart Studio Cloud for text.
  94. 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 are arrayOk: true) are available. Finally, the template string has access to variables currentPath, root, entry, percentRoot, percentEntry, percentParent, label and value.
  95. Sets the source reference on Chart Studio Cloud for texttemplate.
  96. Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
  97. Sets the source reference on Chart Studio Cloud for values.