addToQueue
Adds the provided value to the internal queue to be loaded, if necessary. This is used internally in new d3plus visualizations that fold in additional data sources, like the nodes and links of Network or the topojson of Geomap.
Basic example
Section titled “Basic example”Charts call this for every data-like config (data, nodes, links, topojson): a value that must be fetched is queued as a [load, paths, formatter, key] entry to run before the next draw, while an inline array is stored under key right away. Queuing the same key twice replaces the earlier entry.
import {addToQueue} from "@d3plus/data";
const ctx = {_queue: [], schema: {}};
addToQueue.call(ctx, "/data/fruits.csv", undefined, "nodes");
ctx._queue.length;
ctx.schema.nodes;
addToQueue.call(ctx, [{id: "a"}, {id: "b"}], undefined, "nodes");
ctx.schema.nodes;
Parameters
import {addToQueue} from "@d3plus/data";