Collections
The Collections
module has a variety of data-structures to supplement those already available in the web platform.
Data structures
Section titled “Data structures”In brief:
- Queue: first-in, first-out ranked data. Like the queue at a bakery
- Stack: first-in, last-out ranked data. Like a stack of plates, you can’t just grab the one at the bottom
- Set: unique data
- Map: relate keys with values, like a dictionary
- Tree: structured data of parents and children
- Graph: relations
Importing
Section titled “Importing”// Whole moduleimport * as Collections from "@ixfx/collections"
// Single functionimport { circularArray } from "@ixfx/collections"
// One of several modulesimport { Collections, Modulation, Flow, Data } from "@ixfx"
// And within your HTML's <HEAD> </HEAD> block:<script type="importmap">{ "imports": { "@ixfx":"/ixfx/index.js", "@ixfx/": "/ixfx/" } }</script>
// Whole moduleimport * as Collections from "@ixfx/collections.js"
// Single functionimport { circularArray } from "@ixfx/collections.js"
// One of several modulesimport { Collections, Modulation, Flow, Data } from "@ixfx/bundle.js"
// Single module from the bundleimport { Collections } from "https://unpkg.com/@ixfx/bundle"
// Single moduleimport * as Collections from "https://unpkg.com/@ixfx/collections/bundle"
// One of several modulesimport { Collections, Modulation, Flow, Data } from "https://unpkg.com/@ixfx/bundle"