Comments (5)
The problem with pedantically not answering someone's question is that you inevitably end up as the first google search result.
- There is no mention of this change in CHANGES.md on master. Perhaps you meant a specific commit?
- There is no answer on stack overflow
- The current API Documentation does not explain what the second parameter does, or what the function returns
I believe the answer is that the json
function now returns a promise, so change your code from:
d3.json("data.json", function(error, json){
data = data.concat(json);
render(data);
});
to
d3.json("data.json").then(function(json){
data = data.concat(json);
render(data);
});
from d3-fetch.
Please read the CHANGES:
https://github.com/d3/d3/blob/master/CHANGES.md#changes-in-d3-50
Please use Stack Overflow tag d3.js to ask for help. Stack Overflow provides a better collaborative forum: thousands of D3-related questions have been asked there, and some answers may be relevant to you.
When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.
If you have a question about D3βs behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.
Thank you! π€
from d3-fetch.
@cheshirekow, the answer is the very first change described in the linked CHANGES document, starting with βD3 now uses Promises instead of asynchronous callbacks to load dataβ¦β and immediately followed by code snippets that exactly describe how to turn a v4-style callback into a v5 promise. The only difference is that itβs using d3.csv rather than d3.json, but all the d3-fetch methods behave the same way.
from d3-fetch.
Thanks for your time coming here help my question. I learn a lot data visualization from D3.js. This is the best framework i ever try since i want the flexibility. Your innovation in data visualization is the best contribution to the society.
currently to learn I am following the book : Data Visualization with D3.js Cookbook by Nick Qhi Zu. Published in 2013. so i guess i get the old d3.js version. Okay later i will use stackoverflow and joining the group :)
I love to share, prof.
from d3-fetch.
New SO post https://stackoverflow.com/questions/49768165/code-within-d3-json-callback-is-not-executed
from d3-fetch.
Related Issues (20)
- Access denied under Basic Authentication HOT 3
- ReferenceError: fetch is not defined HOT 4
- Fetch broken on local file urls HOT 1
- Documentation gap for POST between d3-request and d3-fetch HOT 1
- JSON fetching discrepancy between v4 and v5 HOT 5
- Localhost slow data loading HOT 1
- Async await with d3 fetch functions? HOT 1
- d3.text() decode UTF-16 HOT 4
- Response's body lost when error is thrown HOT 1
- d3.append returns undefined when appending result from xml() HOT 3
- How to handle fetch errors? HOT 1
- How to initialise graph object from Javascript object?
- Is there going to be an on.("progress", ...) equivalent for d3 v5? HOT 1
- Fetching large files always gives up at 50MiB HOT 1
- Fix incompatibility with strict/safe CSP HOT 1
- Including d3-fetch.v1.js causes d3.svg to be undefined in nv.d3.js HOT 8
- d3.json interprets HTTP 204 as errors HOT 3
- mention workarounds for all those environments where networks don't allow JS-loading CSV files HOT 2
- d3.json doesn't recognize my function as a RequestInit HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-fetch.