type: string
default: 'none'

we can color nodes by a metadata attribute by setting the colorBy parameter to that attribute’s name.

any metadata attribute can be used to compute node size.

showing:

from webweb import Web

# Instantiate webweb object
web = Web([[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]], display={
    'metadata' : {
        'emotion' : {
            'values' : ['happy', 'sad', 'angry', 'sad', 'happy', 'sad']
        }

    }
})

# use the 'emotion' attribute to color nodes
web.display.colorBy = 'emotion'

# show the visualization
web.show()
{
    "display": {
        "colorBy": "emotion",
        "metadata": {
            "emotion": {
                "values": [
                    "happy",
                    "sad",
                    "angry",
                    "sad",
                    "happy",
                    "sad"
                ]
            }
        }
    },
    "networks": {
        "webweb": {
            "layers": [
                {
                    "edgeList": [
                        [
                            0,
                            1
                        ],
                        [
                            1,
                            2
                        ],
                        [
                            2,
                            3
                        ],
                        [
                            3,
                            4
                        ],
                        [
                            4,
                            5
                        ]
                    ],
                    "metadata": null,
                    "nodes": null
                }
            ]
        }
    },
    "title": "webweb"
}