最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - increase node size vis.js - Stack Overflow

programmeradmin1浏览0评论

I have a problem with vis.js, I cannot increase the size of a node and the font of its label.

nodes.push({id: el, label: currentNode.hostName,font: {color:'#FF9900', face:'courier',size:300}, group: "Domain", color:{background: getColor(currentNode) , border: getColor(currentNode) }, value: 10000, title: label,labelHighlightBold: true, borderWidthSelected: 7 });


Domain: {
                shape: 'triangleDown',
                shapeProperties: {

                      useImageSize: false,

                      size:3333
                    }

            }

Thank you

I have a problem with vis.js, I cannot increase the size of a node and the font of its label.

nodes.push({id: el, label: currentNode.hostName,font: {color:'#FF9900', face:'courier',size:300}, group: "Domain", color:{background: getColor(currentNode) , border: getColor(currentNode) }, value: 10000, title: label,labelHighlightBold: true, borderWidthSelected: 7 });


Domain: {
                shape: 'triangleDown',
                shapeProperties: {

                      useImageSize: false,

                      size:3333
                    }

            }

Thank you

Share Improve this question asked Jun 24, 2016 at 14:36 urotiuroti 1472 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

you can define the font size inside the option for creating the network

var options = {
    nodes : {
        shape : 'dot',
        size : 15,
        color : '#ECBF26', // select color

        font : {
            size : 16,
            color : '#ffffff'
        },
        borderWidth : 2
    },

Well, I know its a little late, but I just started working with viz.js so you can do it like this:

Assuming you have your nodes save in NODES

NODES.update({ id: yourNodeId, size: 100 });

With the same method you can pretty much change anything (except for theid, which I havent been able to change like this yet) on your nodes or edges.

You can find that here, although I must admit that I ve seen better documentation for a library.

http://visjs/docs/data/dataset.html

发布评论

评论列表(0)

  1. 暂无评论