3d-force-graph节点是否支持梯度变化

问题描述 投票:0回答:0

enter image description here 如何制作3D图形渐变的节点颜色

this.myGraph = ForceGraph3D({ controlType: 'trackball', // orbital沿2d轨道绕着拖动,fly固定不动 rendererConfig: { antialias: true, alpha: true } })(this.$refs.graph)

            .backgroundColor('black') // 背景颜色,支持内置颜色和RGB
            .width(this.$refs.graph.parentElement.offsetWidth) // 画布宽度(充满父级容器)
            .height(this.$refs.graph.parentElement.offsetHeight) // 画布高度(充满父级容器)
            .showNavInfo(false) // 是否显示底部导航提示信息
        //.cooldownTicks(100)
        this.myGraph
            .onEngineStop(() => this.myGraph.zoomToFit(400)) //当引擎停止时适合画布

            .nodeRelSize(4) // 节点大小(支持数值)
            .nodeVal(node => {
                return node.val * 0.05
            }) // 节点大小(支持回调)
            .nodeAutoColorBy('group') 
            .nodeColor(node => {
                console.log(node, 'node')
                return node.colorKey
            })
vue.js 3d
© www.soinside.com 2019 - 2024. All rights reserved.