attachStylesToNodes(nodes, view) {

    view = ViewAbstraction.exists(view) ? new ViewAbstraction(view) : null;

    const inheritedStyles = this.getInheritedNodeStyles(nodes);
    const viewNodeData = view ? view.getNodeData() : utils.makeHashMap();
    const isStaticMode = view && !view.isEnabled('physics_mode');

    for (let id in nodes) {

      const tRef = this.getTiddlerById(id);
      const tObj = this.wiki.getTiddler(tRef);
      const fields = tObj.fields;
      const node = nodes[id];
      let icon;

      // == group styles ==

      const inheritedStyle = inheritedStyles[tRef];

      if (inheritedStyle) {

        utils.merge(node, inheritedStyle.style);
        icon = getIcon(inheritedStyle['fa-icon'], inheritedStyle['tw-icon']);
      }

      // == global node styles ==

      // background color
      if (fields.color) {
        node.color = fields.color;
      }

      // global node style from vis editor
      if (fields['tmap.style']) {
        utils.merge(node, utils.parseJSON(fields['tmap.style']));
      }

      icon = getIcon(fields['tmap.fa-icon'], fields['icon']) || icon;

      // == local node styles ==

      // local node style and positions

      const nodeData = viewNodeData[id];

      if (nodeData) {

        utils.merge(node, nodeData);
        if (isStaticMode) {
          // fix x if x-position is set; same for y
          node.fixed = {
            x: (node.x != null),
            y: (node.y != null)
          };
        }

        icon = getIcon(nodeData['fa-icon'], nodeData['tw-icon']) || icon;
      }

      // == tweaks ==

      const isColorObject = (node.color !== null && typeof node.color === 'object');
      // color/border-color may be undefined
      const color = (isColorObject ? node.color.background : node.color);

      node.color = {
        background: color,
        border: (isColorObject ? node.color.border : undefined)
      };

      // ATTENTION: this function needs to be called after color is assigned
      addNodeIcon(node, icon);

      // determine font color if not defined via a group- or node-style;
      // in case of global and local default styles, the user is responsible
      // him- or herself to adjust the font
      node.font = node.font || {};

      if (node.shape && !this.visShapesWithTextInside[node.shape]) {
        node.font.color = 'black'; // force a black color
      } else if (!node.font.color && color) {
        node.font.color = getContrastColour(color, color, 'black', 'white');
      }

      if (node.shape === 'icon') {
        // prefixing with a newline symbol as a hack to keep
        // visjs' "widthConstraint" working for icons and to prevent
        // text being too close to fontawesome icons
        node.label = '\n' + node.label;

        if (typeof node.icon === 'object') {
          node.icon.color = color;
        }
      }

    }

    if (view) {
      const node = nodes[view.getConfig('central-topic')];
      if (node) {
        utils.merge(node, this.indeces.glNTyById['tmap:central-topic'].style);
      }
    }

  }
Adds styles to nodes.

@param {Object<string, Node>} nodes
@param {ViewAbstraction|string} view