267Echarts - GL 关系图(GraphGL GPU Layout)

简介: 267Echarts - GL 关系图(GraphGL GPU Layout)
效果图

源代码
function createNodes(widthCount, heightCount) {
    var nodes = [];
    for (var i = 0; i < widthCount; i++) {
        for (var j = 0; j < heightCount; j++) {
            nodes.push({
                x: Math.random() * window.innerWidth,
                y: Math.random() * window.innerHeight,
                value: 1
            });
        }
    }
    return nodes;
}
function createEdges(widthCount, heightCount) {
    var edges = [];
    for (var i = 0; i < widthCount; i++) {
        for (var j = 0; j < heightCount; j++) {
            if (i < widthCount - 1) {
                edges.push({
                    source: i + j * widthCount,
                    target: i + 1 + j * widthCount,
                    value: 1
                });
            }
            if (j < heightCount - 1) {
                edges.push({
                    source: i + j * widthCount,
                    target: i + (j + 1) * widthCount,
                    value: 1
                });
            }
        }
    }
    return edges;
}
var nodes = createNodes(50, 50);
var edges = createEdges(50, 50);
option = {
    series: [{
        type: 'graphGL',
        nodes: nodes,
        edges: edges,
        itemStyle: {
            color: 'rgba(255,255,255,0.8)'
        },
        lineStyle: {
            color: 'rgba(255,255,255,0.8)',
            width: 3
        },
        forceAtlas2: {
            steps: 5,
            jitterTolerence: 10,
            edgeWeightInfluence: 4
        }
    }]
};


相关实践学习
基于阿里云DeepGPU实例,用AI画唯美国风少女
本实验基于阿里云DeepGPU实例,使用aiacctorch加速stable-diffusion-webui,用AI画唯美国风少女,可提升性能至高至原性能的2.6倍。
目录
相关文章
|
7月前
269Echarts - GL 关系图(1w 节点 2w7 边的NPM 依赖图)
269Echarts - GL 关系图(1w 节点 2w7 边的NPM 依赖图)
30 0
|
7月前
268Echarts - GL 关系图(GraphGL - Large Internet)
268Echarts - GL 关系图(GraphGL - Large Internet)
25 0
|
7月前
266Echarts - GL 矢量场图(Global Wind Visualization 2)
266Echarts - GL 矢量场图(Global Wind Visualization 2)
31 0
|
7月前
266Echarts - GL 矢量场图(Global wind visualization)
266Echarts - GL 矢量场图(Global wind visualization)
27 0
|
7月前
265Echarts - GL 矢量场图(Flow on the cartesian)
265Echarts - GL 矢量场图(Flow on the cartesian)
26 0
|
7月前
|
定位技术
264Echarts - GL 散点图(10 million Bulk GPS points)
264Echarts - GL 散点图(10 million Bulk GPS points)
24 0
|
7月前
261Echarts - 3D 路径图(Flights GL)
261Echarts - 3D 路径图(Flights GL)
25 0
|
7月前
207Echarts - 数据集(Series Layout By Column or Row)
207Echarts - 数据集(Series Layout By Column or Row)
21 0
|
7月前
125Echarts - 关系图(Force Layout)
125Echarts - 关系图(Force Layout)
29 0
|
7月前
123Echarts - 关系图(Force Layout)
123Echarts - 关系图(Force Layout)
18 0