Questions tagged [queue.js]

Asynchronous helper library for JavaScript.

Queue.js is an asynchronous helper library for JavaScript that allows to fine-tune the parallelism of the execution. See its website for more information. Also look at this for a quick look.

Queue.js is a plugin that loads external files into the script and ensures each file is completely loaded before allowing the script to continue running.

27 questions
4
votes
1 answer

Adding HTTP header to d3.json with queue.js

I'm aware that I can add a header to a D3 JSON request by doing the following: d3.json("http://localhost:8080/data") .header("Application-ID", "1") But how do I add this header when using queue's defer? queue() .defer(d3.json,…
user1596371
4
votes
1 answer

Dynamically change the number of 'defer' calls in queue.js

My webpage lets the user plot multiple timeseries on a chart and I am using queue.js to go and asynchronously get this data, like so: queue() .defer(d3.json, "api/TransactionCost/?marketCode=" + marketCode1) .defer(d3.json,…
ninjaPixel
  • 6,122
  • 3
  • 36
  • 47
3
votes
1 answer

Quora pixel issue when refreshing

I'm actually facing a weird error on Angular with quora pixel. I've included the script in HTML code like this: ! function(q, e, v, n, t, s) { if (q.qp) return; n = q.qp = function() { n.qp ? n.qp.apply(n, arguments) :…
Imad
  • 31
  • 3
3
votes
1 answer

Trying to load simple CSV file into D3 with queue.js

I'm a newbie to web dev, and am trying to figure out how to load CSV data into D3.js, using queue.js to ensure that data is fully loaded before I execute the next step of the code (which will be drawing a chart with the data). I have googled this…
TheBlake
  • 267
  • 1
  • 5
  • 12
3
votes
1 answer

Using queue() to load multiple files and assign to globals

I cannot get multiple files to load data and assign to globals. I've read up on similar questions and related examples, but I still am having trouble. var origins = [], geoJSON = { "type": "FeatureCollection", "features": [] …
josiekre
  • 795
  • 1
  • 7
  • 19
3
votes
1 answer

Difference between queue.await() and queue.awaitAll()

I'm new to D3 & JavaScript. I'm trying to understand queue.js in that. I've gone through this link. But still can't get a clear cut idea about the difference between queue.await() and queue.awaitAll(). Can anyone help me with an example(if…
RAS
  • 8,100
  • 16
  • 64
  • 86
3
votes
1 answer

Queue.js to preload images is waiting forever? (Callback)

I'm using mbostock queue.js script to load several json files, by doing something like that: var q = queue() .defer(d3.json, "world-110m.json") .defer(d3.tsv, "world-country-names.tsv") .await(ready); where ready is the function to execute when…
Roger Veciana
  • 983
  • 1
  • 12
  • 25
2
votes
1 answer

queue.js pass data from local variable not from external file

I want to pass the data using a json variable. In the below example the json is fetched from an external JSON file. can any one help me how to pass the data from a local variable as i am new to dc.js queue() .defer(d3.json, "sampledata.json")…
Rakesh
  • 57
  • 7
2
votes
0 answers

After compiling Typescript to javascript, in code before imported function adds module name with suffix "_1"

I am trying to rewrite some js/d3.js code in ts/amd. But i have a problem with importing of libraries. That is structure of my .ts file: /// ; /// ; import * as d3 from "d3"; import {queue}…
Ivan Kaduk
  • 60
  • 1
  • 7
2
votes
2 answers

d3.js queue.js and node.js

I'm trying to load data in nodejs before passing it to expressjs to render a d3 chart in the browser. I understand that I can load data this way from this - https://github.com/mbostock/queue I have an expressjs route configurd like this - var…
Colin
  • 930
  • 3
  • 19
  • 42
2
votes
0 answers

Error handling practices with queue.js

I want to handle errors in a proper way when using queue.js, but have some uncertainty about how to make it. For example we have such code: function getImage(path, callback) { var img = new Image(); img.src = path; //I have some issues about…
KoGor
  • 237
  • 5
  • 12
1
vote
0 answers

Java Rest service Jersey multiple connections doesn't work

I'm using Queue.js as a libary for loading data from a java RestService. https://github.com/mbostock/queue I used the following code: queue() .defer(d3.json, "rest/v1/status/geographicalData") .defer(d3.json,…
user2644964
  • 763
  • 2
  • 10
  • 28
1
vote
0 answers

d3.js/queue.js: How to skip errors in queue.js

I'm working with the last.fm API and queue.js to dynamically merge a user's Weekly Track List and Track Info datasets together. I'm running into a problem when my AJAX call for a certain song returns an error. My main question is, how do I skip…
goblin-esque
  • 465
  • 5
  • 15
1
vote
2 answers

PieChart in DC.js with Queue.js not working

Here is an example using Queue.js to loading multiple csv in a dc.js : https://github.com/dc-js/dc.js/blob/master/web/examples/composite.html Here is my version (javascript): var composite = dc.compositeChart("#test_composed"); var composite2 =…
Kai Feng Chew
  • 779
  • 8
  • 24
1
vote
1 answer

Trying to add an XHR to Queue.js to show progress

I am trying to add a progress meter to my files by following this code: Progress Events I have an XHR with progress working fine like so: d3.csv("data/WLAN2.csv") .on("progress", function() { var i = d3.interpolate(progress,…
Brian Feeny
  • 441
  • 4
  • 14
1
2