Reputation: 101
From the documentation I would guess that this code should work:
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>blah</title>
<!-- <script src="https://d3js.org/d3.v7.min.js"></script> -->
<!-- v6 is also supported -->
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="https://unpkg.com/cal-heatmap/dist/cal-heatmap.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/cal-heatmap/dist/cal-heatmap.css">
</head>
<body>
<p>I'm the content</p>
<div id="cal-heatmap"></div>
<script>
const cal = new CalHeatmap();
cal.paint({});
render(<div id="cal-heatmap"></div>);
</script>
</body>
</html>
However, there is an issue with the render function (the browser says Uncaught SyntaxError: expected expression, got '<'
). This issues gets solved by removing the render line, but then more complex version of the heatmap are not possible
I deducted the minimal version from the website, but the documentation does not speak about the render function. Furthermore, there are no indication on the web of this issue.
Upvotes: 0
Views: 98