How can I use D3.js offline? I usually use the normal script to use online.
But I'm in need of a way to work with D3 offline
How can I use D3.js offline? I usually use the normal script to use online.
But I'm in need of a way to work with D3 offline
What you should do is download the files, and extract into the directory of your project, example:
Projeto
- js ( Diretório que contém seus arquivos Javascript )
-- d3 ( Diretório contendo os arquivos d3js )
You should call it in your code.
<script src="js/d3/d3.v3.min.js" charset="utf-8"></script>
You can download and work with the library offline: link
@edit
But for this you need to compile it.
After downloaded and extracted somewhere, enter the extraction folder and the following commands:
npm i
npm prepublishOnly
This will generate a build
folder.
Log in and copy the file d3.js or d3.min.js.
Dai paste into your project, where you store the js files, or in the folder of your choice. Then in your index.html referencie it. ex:
<body>
<script src="d3.min.js"></script>
<script>
d3.select("body").append("h1").text("Hello, world!");