Skip to main content
100%

D3 Sunburst Sequence

✓ Published0🌍 Public
TThanaporn-sk
Last edited Oct 4, 2016
Created on Oct 4, 2016

This interactive sunburst sequence visualization shows how a population progresses through sequential stages, with each sequence’s final value determining the arc size. Users can hover over arcs to see path summaries, and the visualization includes breadcrumb trails and a dynamic legend. Built with D3 v3 and AngularJS, the code uses the `d3.layout.partition` and `d3.svg.arc` APIs to render the hierarchical data, which is parsed from CSV files into a JSON tree structure. The example supports custom file uploads and includes sample datasets for Android OS conversion, Netflix churn, and page clicks.

AI-generated description

D3 Sunburst Sequence

bl.ocks.org link

D3 Sunburst Sequence visualizes a graph of nodes by highlighting sequential progression of nodes leading up to a final value. A sunburst sequence is useful to visualize relative weights/percentages of a starting state to an end state (e.g. webpage redirects, product retention, subscription-based products, cashflows).


Description

  • This is a variation of the original sunburst sequence.

  • A major improvement to the original visualization is to organize the code base and draw the D3 components (breadcrumbs, sunburst, legend) into a single HTML div tag, and to dynamically assign color and legend scales.

  • The other improvement is generalizing and conventionalizing data inputs. The input requires a simple tabular schema of sequence, stage, node, and value (see below) and the program will parse the data into a JSON graph.

  • The CSV data can be unsorted but it must NOT contain a header.

  • The data input has to be a 4-column CSV conforming to the data schema of:

    • sequence (int/string): an ordered sequence that clearly defines the grouping of nodes.
    • stage (int): the index/order of nodes in a given sequence.
    • node (int/string): the data name of the node.
    • value (int): the value at each stage of a given sequence. Only the final stage value in a given sequence is used in this visualization.

Files

  • index.html: main HTML file.

  • app.js: Main angular app file. Contains directive onReadFile to handle file uploads and sunburst to re-render the D3 visualization on data updates.

  • sunburst.js: Contains the logic for drawing the D3 visualization by selecting the angular.element from which the vis is to be drawn. Updates and prompts D3 to re-render the visualization when the angular data changes on file uploads.

  • style.css: stylesheet containing optional D3 classes that can be adjusted (commented out)

  • data.csv: Four CSV-data files for sample downloads and uploads to the app.


Other Notes

  • Visualization hover can be a little glitchy if the base data does not contain very meaningful sequences i.e. smaller parent nodes that lead up to larger child nodes.

  • A big help from this fiddle to help implement an AngularJS FileReader.

<!-- external links --> <!-- ga beacon -->

Analytics

forked from <a href='http://bl.ocks.org/chrisrzhou/'>chrisrzhou</a>'s block: <a href='http://bl.ocks.org/chrisrzhou/d5bdd8546f64ca0e4366'>D3 Sunburst Sequence</a>

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/fe5cfc708d27fa43eadaae208b10a7c2'>D3 Sunburst Sequence</a>

mit Licensed

Similar vizzes

Loading thumbnail…

Sequences sunburst

This sunburst visualization summarizes sequences of user navigation paths through a website, using a D3 v3 partition layout to display hierarchical data derived from a CSV of event sequences. The data is parsed from rows in visit-sequences.csv, where each line is a complete path from root to leaf, and the partition layout computes the intermediate values by summing counts for shared prefixes. The visualization is interactive: hovering over an arc highlights the corresponding sequence and updates a breadcrumb trail at the top, showing the current path from the root. A central label displays the percentage of all visits that begin with the hovered sequence. The legend toggles visibility, and colors represent distinct page types (e.g., home, product, search, account, other, end). The sunburst uses a radial partition layout with arcs sized by the value of each node, and it includes a breadcrumb trail to emphasize the sequence of steps. Percentages are shown explicitly to mitigate the distortion inherent to radial presentations. The example demonstrates how to handle sequence data without pre-generating hierarchical JSON, using a CSV with hyphen-separated steps and an "end" marker for true endpoints. Key features: - Interactive breadcrumb trail emphasizes the sequence. - Percentages shown explicitly to help overcome radial data distortion. - Uses D3 v3 and a partition layout to create the sunburst. - Works with CSV data (no need for pre-generated hierarchical JSON). - Mouse events update the breadcrumbs and percentages on hover. - Toggle legend option to show/hide the color legend. - Hovering over arcs displays the corresponding sequence and percentage of visits.This example demonstrates a D3.js sunburst visualization (partition layout) designed to summarize sequences of events, such as navigation paths through a website. The circular chart displays hierarchical data as a series of concentric rings, where each ring segment represents a step in a sequence, and its arc length encodes the number of visits. The interactive visualization features a breadcrumb trail that updates as users hover over segments, clarifying the current path. Percentages are displayed explicitly to counterbalance the distortion inherent in radial representations. The data is loaded from a CSV file without a header, using hyphens to separate sequence steps and an "end" marker to indicate true endpoints. The visualization is generated using D3 v3 and includes a legend to map steps to colors. The project is licensed under the Apache License 2.0 and was forked from Kerry Rodden's block.

EEE2dev
84% match