Skip to content

Instantly share code, notes, and snippets.

@EE2dev
Last active April 19, 2024 12:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EE2dev/52b57438d4e017eefac1765e5727459a to your computer and use it in GitHub Desktop.
Save EE2dev/52b57438d4e017eefac1765e5727459a to your computer and use it in GitHub Desktop.
sequence explorer - single chart

Sequence explorer

This example shows how use a single chart sequence explorer.

More examples

Link to sequence explorer on github.


The data is obtained (and mapped to the required format) from the sunburst visualization example from Kerry Rodden.

It is easy to see the pros and cons of these two visualizations for this specific data set.

<!DOCTYPE html>
<meta charset="utf-8"> <!-- also save this file as unicode-8 ! -->
<head>
<link rel="stylesheet" type="text/css" href="https://ee2dev.github.io/libs/sankeySeqExplorer.v20.css">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://ee2dev.github.io/libs/sequence-explorer.v20.min.js"></script>
</head>
<body>
<script>
var myChart = sequenceExplorer.chart("sc.csv") // load data from a csv file
.eventOrder(["home", "product", "search", "account", "other"]) // changing the order of the events on the y axis
.sequenceName("visit"); // changing the name of the x axis for the tooltip
d3.select("body")
.append("div")
.attr("class", "chart")
.call(myChart);
</script>
</body>
</html>
value sourceX sourceY targetX targetY
167538 1 home 2 other
1250384 2 product 3 home
46566 3 other 4 home
476521 1 other 2 product
297120 0 account 1 product
483736 3 search 4 search
847466 0 home 1 other
127881 2 account 3 home
156329 2 home 3 account
40526 1 other 2 search
2518929 0 home 1 home
197984 3 home 4 home
48750 3 other 4 account
1041150 0 product 1 home
172113 2 search 3 account
55659 0 account 1 other
707312 1 account 2 product
537561 3 product 4 account
57117 2 other 3 home
695088 1 account 2 account
1512114 2 product 3 search
416311 1 search 2 account
76858 1 other 2 home
89274 2 account 3 other
62655 2 search 3 home
7553472 2 product 3 product
84607 1 other 2 account
199980 1 product 2 other
889723 1 product 2 search
1418110 1 home 2 product
157908 2 product 3 other
856434 2 account 3 product
1773947 1 product 2 home
1044306 3 product 4 home
768063 2 account 3 account
6828298 1 product 2 product
737449 1 home 2 search
6424145 3 product 4 product
114907 1 account 2 home
138500 3 product 4 other
5465283 1 search 2 product
25107 2 other 3 search
1014015 0 home 1 account
1150183 3 product 4 search
281658 2 other 3 other
196645 3 other 4 other
767855 3 home 4 product
96147 1 account 2 other
1248351 1 search 2 search
317391 2 other 3 product
7756 2 search 3 other
66304 3 account 4 search
77048 0 account 1 home
596098 2 search 3 search
343786 3 home 4 search
5388205 0 product 1 product
753785 1 product 2 account
619041 2 product 3 account
45824 0 other 1 search
86247 0 product 1 search
372027 1 other 2 other
6295 3 search 4 other
190000 1 home 2 account
624734 3 account 4 account
123104 0 product 1 other
95051 1 search 2 home
42317 3 search 4 home
251791 0 other 1 product
319144 0 account 1 account
60100 2 other 3 account
30894 0 other 1 home
7325644 0 home 1 search
1794027 3 search 4 product
65998 1 account 2 search
2014254 2 search 3 product
12879 1 search 2 other
8550120 0 home 1 product
357548 2 home 3 search
77078 2 home 3 other
110571 3 home 4 account
229635 3 other 4 product
563835 0 product 1 account
1249792 2 home 3 product
23569 0 other 1 account
78782 2 account 3 search
19209 3 other 4 search
75482 3 account 4 other
52717 3 home 4 other
286618 2 home 3 home
139294 3 search 4 account
106926 3 account 4 home
521630 1 home 2 home
151754 0 other 1 other
69030 0 account 1 search
734055 3 account 4 product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment