1

I would like to use algebraic operations in order to be more flexible in the Cytoscape style sheet. My first trial was

    {
        selector: 'node',
        style: {
            'content': 'data(d0)',
            'width': 'data(d1)*10 -5', /*Here*/
            'height': 'data(d1)/10 +5' /*Here*/
        }
    },

However, it turn out to be invalid. Can someone help?

1 Answer 1

2

I would suggest using functions for this feature:

{
    selector: 'node',
    style: {
        'content': 'data(d0)',
        'width': function (node) {
            return (node.data().di * 10) - 5;
        },
        'height': function (node) {
            return (node.data().di / 10) + 5;
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.