Edge Data

2312

Tasks

add nodes A-E add a directed edge from A to B and A to C add edge data to edge AB setting a strength of 23 and a type as "colleagues" add edge data to edge AC setting a strength of 12 and a type as "acquaintances" add edge weights equal to the strength for each edge with strength data define a style called "light" with line style dotted and line color steelblue define a style called "heavy" with line style solid and line color tomato apply the style heavy to any edge with type data equal to "colleagues" apply the style light to any edge with type data equal to "acquaintances"

JSON Representation

{
"directed": true,
"hasParents": false,
"nodes": {
  "A": {},
  "B": {},
  "C": {},
  "D": {},
  "E": {}
},
"edges": {
  "AB": {
    "source": "A",
    "target": "B",
    "data": {
      "strength": "23",
      "type": "colleagues"
    },
    "weight": 23
  },
  "AC": {
    "source": "A",
    "target": "C",
    "data": {
      "strength": "12",
      "type": "acquaintances"
    },
    "weight": 12,
    "style": "light"
  }
},
"constraints": [],
"styles": {
  "light": {
    "lineStyle": "dotted",
    "lineColor": "steelblue"
  }
},
"_positions": {
  "A": [
    -2.488550924233892,
    4.128881165524764
  ],
  "B": [
    -0.8574745166410667,
    -4.745050125465496
  ],
  "C": [
    -3.663152067609195,
    -0.6739862094689396
  ],
  "D": [
    3.0215784597942124,
    3.26938321779808
  ],
  "E": [
    3.9874863097855324,
    -1.9792875246755566
  ]
}
}