How to use the d3-collection.map function in d3-collection

To help you get started, we’ve selected a few d3-collection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphsense / graphsense-dashboard / src / nodeGraph.js View on Github external
constructor (dispatcher, labelType, currency, txLabelType) {
    super()
    this.currency = currency
    this.dispatcher = dispatcher
    this.labelType = labelType
    this.txLabelType = txLabelType
    // nodes of the graph
    this.entityNodes = map()
    this.addressNodes = map()
    // ids of addresses/entities present in graph
    this.references = {address: map(), entity: map()}
    this.adding = set()
    this.selectedNode = null
    this.highlightedNodes = []
    this.layers = []
    this.transform = {k: 1, x: 0, y: 0, dx: 0, dy: 0}
    this.colorMapCategories = map()
    this.colorMapTags = map()
    let colorGen = (map, type) => (k) => {
      if (!k) return defaultColor[type]
      let color = map.get(k)
      if (color === undefined) {
        color = colorScale(map.size())
        map.set(k, color.toString())
github graphsense / graphsense-dashboard / src / nodeGraph.js View on Github external
super()
    this.currency = currency
    this.dispatcher = dispatcher
    this.labelType = labelType
    this.txLabelType = txLabelType
    // nodes of the graph
    this.entityNodes = map()
    this.addressNodes = map()
    // ids of addresses/entities present in graph
    this.references = {address: map(), entity: map()}
    this.adding = set()
    this.selectedNode = null
    this.highlightedNodes = []
    this.layers = []
    this.transform = {k: 1, x: 0, y: 0, dx: 0, dy: 0}
    this.colorMapCategories = map()
    this.colorMapTags = map()
    let colorGen = (map, type) => (k) => {
      if (!k) return defaultColor[type]
      let color = map.get(k)
      if (color === undefined) {
        color = colorScale(map.size())
        map.set(k, color.toString())
      }
      let c = hsl(color)
      c.l = c.l * lightnessFactor[type]
      return c
    }
    this.colors =
      {
        'entity': {
          categories: colorGen(this.colorMapCategories, 'entity'),
github graphsense / graphsense-dashboard / src / store.js View on Github external
constructor () {
    this.addresses = map()
    this.entities = map()
    this.outgoingLinks = map()
    this.notesStore = map()
    this.tagsStore = map()
  }
  /**
github graphsense / graphsense-dashboard / src / store.js View on Github external
constructor () {
    this.addresses = map()
    this.entities = map()
    this.outgoingLinks = map()
    this.notesStore = map()
    this.tagsStore = map()
  }
  /**
github graphsense / graphsense-dashboard / src / store.js View on Github external
constructor () {
    this.addresses = map()
    this.entities = map()
    this.outgoingLinks = map()
    this.notesStore = map()
    this.tagsStore = map()
  }
  /**
github quantmind / giotto / src / plugins / transitions.js View on Github external
constructor (paper, opts, defaults) {
        var transitions = map(),
            options = {};
        forEach(opts, (o, key) => {
            if (isObject(o)) transitions.set(key, o);
            else options[key] = o;
        });
        super(paper, options, defaults);
        var scope = this.$scope;
        scope.transitions = map();
        transitions.each((o, key) => {
            scope.transitions.set(key, scope.$new().$extend(o));
        });
    }
    /**
github graphsense / graphsense-dashboard / src / nodeGraph / layer.js View on Github external
constructor (id) {
    super()
    this.id = id
    this.nodes = map()
  }
  serialize () {
github quantmind / lux / lux / js / core / api.js View on Github external
constructor ($location, $q, $http, $log, $timeout, context) {
        this.$location = $location;
        this.$q = $q;
        this.$http = $http;
        this.$log = $log;
        this.$timeout = $timeout;
        this.apis = map();
        this.context = context;
    }
github graphsense / graphsense-dashboard / src / store.js View on Github external
initOutgoing (id, keyspace) {
    if (typeof id !== 'string' && typeof id !== 'number') {
      throw new Error('id is not string')
    }
    let outgoing = this.outgoingLinks.get(prefix(keyspace, id))
    if (!outgoing) {
      outgoing = map()
      this.outgoingLinks.set(prefix(keyspace, id), outgoing)
    }
    return outgoing
  }
  linkOutgoing (source, target, keyspace, data) {
github ricklupton / d3-sankey-diagram / src / digraph.js View on Github external
export default function Digraph () {
  this._nodes = []
  this._edges = []
  this._dummyNodes = map()
}

d3-collection

Handy data structures for elements keyed by string.

BSD-3-Clause
Latest version published 6 years ago

Package Health Score

55 / 100
Full package analysis