Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a 3d node is addNodeData, the vertex graph of the same type as the new add data in the original data will not be visible #6567

Open
xiaoxiaofu1 opened this issue Nov 27, 2024 · 1 comment
Labels
Need Improvement Lack of information or incorrect format

Comments

@xiaoxiaofu1
Copy link

Describe the bug / 问题描述

如下添加node-8后,node-1的图形会看不到
image
image

Reproduction link / 重现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

import { ExtensionCategory, Graph, register } from '@antv/g6';
import {
Capsule,
Cone,
Cube,
Cylinder,
Light,
ObserveCanvas3D,
Plane,
Sphere,
Torus,
renderer,
} from '@antv/g6-extension-3d';

register(ExtensionCategory.PLUGIN, '3d-light', Light);
register(ExtensionCategory.NODE, 'sphere', Sphere);
register(ExtensionCategory.NODE, 'plane', Plane);
register(ExtensionCategory.NODE, 'cylinder', Cylinder);
register(ExtensionCategory.NODE, 'cone', Cone);
register(ExtensionCategory.NODE, 'cube', Cube);
register(ExtensionCategory.NODE, 'capsule', Capsule);
register(ExtensionCategory.NODE, 'torus', Torus);
register(ExtensionCategory.BEHAVIOR, 'observe-canvas-3d', ObserveCanvas3D);

const nodes = [
{
id: 'node-1',
type: 'sphere',
style: {
texture: 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/AcdTdTI2bNl8AAAAAAAAAAAAADmJ7AQ/original',
},
},
{ id: 'node-2', type: 'plane', style: { size: 50 } },
{ id: 'node-3', type: 'cylinder' },
{ id: 'node-4', type: 'cone' },
{
id: 'node-5',
type: 'cube',
style: {
texture: 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A
8TlCRIsKeUkAAAAAAAAAAAAAARQnAQ',
},
},
{ id: 'node-6', type: 'capsule' },
{ id: 'node-7', type: 'torus' },

];

const graph = new Graph({
container: 'container',
renderer,
data: {
nodes,
},
node: {
style: {
materialType: 'phong',
labelText: (d) => d.id,
x: (d) => 100 + (nodes.findIndex((n) => n.id === d.id) % 5) * 100,
y: (d) => 100 + Math.floor(nodes.findIndex((n) => n.id === d.id) / 5) * 100,
},
},
plugins: [
{
type: '3d-light',
directional: {
direction: [0, 0, 1],
},
},
],
behaviors: ['observe-canvas-3d'],
});

graph.render();
setTimeout(() => {
graph.addNodeData([ { id: 'node-8', type: 'sphere' }])
graph.draw()
}, 1000)

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

@github-actions github-actions bot changed the title 3d节点当addNodeData后,原有数据中与新add数据相同type的点图形会看不到 When a 3d node is addNodeData, the vertex graph of the same type as the new add data in the original data will not be visible Nov 27, 2024
@Aarebecca Aarebecca added the Need Improvement Lack of information or incorrect format label Nov 28, 2024
Copy link

This issue has been marked as Bad. Please provide more information, or use the standard format, otherwise it will be closed soon.
Reference document:


这个 issue 已经被标记为 Bad。请提供更多信息,或者使用规范的格式,否则将在近期关闭。
参考文档:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Improvement Lack of information or incorrect format
Projects
None yet
Development

No branches or pull requests

2 participants