This is an example of using a very simple pagination when you need an overflow for a small number of items (just a next/prev). It uses a flex grid and just hides and display the containing div
.
forked from eesur's block: d3 | simple pagination (next/prev)
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8">
<!-- https://www.basscss.com/ -->
<link href="https://unpkg.com/basscss@8.0.2/css/basscss.min.css" rel="stylesheet">
<!-- https://clrs.cc/ -->
<link href="//s3-us-west-2.amazonaws.com/colors-css/2.2.0/colors.min.css" rel="stylesheet">
<style>
body {
background: #dddddd;
font-family: Consolas, monaco, monospace;
color: #333333;
}
.chart {
background: #fbae17;
}
.btn {
font-family: inherit;
font-size: 16px;
cursor: pointer;
display: inline-block;
padding: .5rem 1rem;
height: auto;
border: 1px solid transparent;
vertical-align: middle;
-webkit-appearance: none;
color: inherit;
background-color: transparent;
text-decoration: none;
letter-spacing: 2px;
}
.btn-primary {
color: #fff;
background-color: #de3d83;
border-radius: 100px;
}
.btn-primary:hover {
box-shadow: inset 0 0 0 20rem #C73675;
}
</style>
</head>
<body>
<section class="js-vis-wrap mx-auto max-width-4 p2">
<div class="js-vis-1 flex flex-wrap"></div>
<!-- overflow div -->
<div class="js-vis-2 flex flex-wrap display-none"></div>
</section>
<script src="https://d3js.org/d3.v4.min.js"></script>
<!-- d3 code -->
<script src=".script-compiled.js" charset="utf-8"></script>
</body>
</html>
https://d3js.org/d3.v4.min.js