with using D3.js offline

Asked

Viewed 99 times

0

is it possible to use D3.js offline? I usually use the normal script to use online.

but I am in need of a way to work with D3 offline

2 answers

0


What you should do is download the files, and extract in the directory of your project, example:

Projeto
- js ( Diretório que contém seus arquivos Javascript )
-- d3 ( Diretório contendo os arquivos d3js )

You must call him in your code.

<script src="js/d3/d3.v3.min.js" charset="utf-8"></script>
  • Good answer, I hope that this is what he is looking for, but I really recommend that when the question is not so clear, or it is too wide to be restrained and wait for the author to edit the question, it is also interesting to use the Signal link to say that there is something wrong with the question, in case you select the option: It is not clear. Read more on: https://pt.meta.stackoverflow.com/a/2676/3635

  • 1

    @Guilhermenascimento, true. The finger is itching rsrs, but I took the advice and I’ll be reading.

-2

You can download the library and work with it offline: https://d3js.org/

@Edit

But for that you need to compile it. After downloaded and extracted somewhere, enter the output extraction folder and the following commands: npm i npm prepublishOnly

a folder will be generated build. Enter this and copy the D3.js or D3.min.js file. Then paste it into your project, where you store the js files, or into the folder of your choice. Then in your index.html refer to it. eg:

    <body>
    <script src="d3.min.js"></script>
    <script>

    d3.select("body").append("h1").text("Hello, world!");
  • I already downloaded but I can’t use I have to run a local server or something?

  • but remember to enter the path correctly, and if you use it on D3.js, put src="D3.js", instead of src="D3.mim.js"

  • you can find the steps here https://bl.ocks.org/mbostock/bb09af4c39c79cffcde4

Browser other questions tagged

You are not signed in. Login or sign up in order to post.