PhiaUi.Components.Data.ChartDrilldown (phia_ui v0.1.17)

Copy Markdown View Source

Drilldown component for click-to-explore-data pattern.

Maps to Highcharts' drilldown API. Wraps chart content with drill state management and breadcrumb trail navigation. No JS hook needed — LiveView handles state transitions.

Examples

<.chart_drilldown
  levels={["Region", "Country", "City"]}
  current_level={0}
  breadcrumb_items={["All Regions"]}
  on_drill="drill_down"
  on_up="drill_up"
>
  <.bar_chart data={@chart_data} />
</.chart_drilldown>

Summary

Functions

chart_drilldown(assigns)

Attributes

  • levels (:list) - List of drill level labels. Defaults to [].
  • current_level (:integer) - Current drill depth (0 = root). Defaults to 0.
  • breadcrumb_items (:list) - List of breadcrumb label strings from root to current. Defaults to [].
  • on_drill (:string) - Event name for drill-down action. Defaults to nil.
  • on_up (:string) - Event name for drill-up action. Defaults to nil.
  • animate (:boolean) - Enable drill transition animation. Defaults to true.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

chart_drilldown_breadcrumb(assigns)

Breadcrumb trail for drill navigation.

Attributes

  • items (:list) (required) - Breadcrumb label list.
  • on_up (:string) - Event name for drill-up. Defaults to nil.
  • class (:string) - Defaults to nil.