d3-textwrap
d3-textwrap copied to clipboard
Import and Export Errors loading in script element
I'm using the syntax from the docs:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://d3js.org/d3.v5.min.js"></script>
<script type="text/javascript" src="textwrap.js"></script>
</head>
<body>
<div id="graph"></div>
</body>
</html>
But on Safari I get this error:
Unexpected token '{'. import call expects exactly one argument. textwrap.js:1
And on Firefox:
SyntaxError: import declarations may only appear at top level of a module textrap.js:1
Looks like the example was added recently (#15), but perhaps I'm missing something? Do I need to change the source file to load this way?