Change color of nodes in groups option (vis.js)

Viewed 1871

is it possible to set the same color options in groups as in nodes? Only to pass the color as a string in icon.color works. But I also want to set hover and highlight colors.

I've tried the following:

var options={
  groups: {
    table: {
      shape: 'icon',
      icon: {
        face: 'FontAwesome',
        code: '\uf0ce',
        size: 50
      },
      color: {
        background: '#008CBA',
        border: '#008CBA',
        highlight: {
          border: '#5BC0DE',
          background: '#5BC0DE'
        },
        hover: {
          border: '#5BC0DE',
          background: '#5BC0DE'
        }
      }
    }
  }
}

I've also tried this:

var options={
  groups: {
    table: {
      shape: 'icon',
      icon: {
        face: 'FontAwesome',
        code: '\uf0ce',
        size: 50,
        color: {
          background: '#008CBA',
          border: '#008CBA',
          highlight: {
            border: '#5BC0DE',
            background: '#5BC0DE'
          },
          hover: {
            border: '#5BC0DE',
            background: '#5BC0DE'
          }
        }
      }

    }
  }
}

Both attempts do not lead to the desired solution. The documentation states that all options of nodes that make sense also work in groups. Doesn't color make sense in groups?

1 Answers

Unfortunately there is no implementation for hover and highlight for icons yet.

You can find more details in the related GitHub issue: Color Icon Issue

Related