antvis/G6







The issue has been closed
Method not implemented. 报错。 #6050
anyone0034 posted onGitHub
Describe the bug / 问题描述
我是直接复制的官方demo,没有做任何修改。
Uncaught runtime errors:
×
ERROR
Method not implemented.
at Camera.createLandmark (http://localhost:7004/js/e216158b.js:2281:15)
at ViewportController.createLandmark (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:38639:28)
at ViewportController.transform (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:38780:43)
at new ViewportController (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:38863:14)
at Graph.initRuntime (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:37416:61)
at Graph.prepare (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:37429:14)
at async Graph.render (http://localhost:7004/js/vendors-node_modules_antv_g-camera-api_node_modules_antv_g-math_dist_index_esm_js-node_module-d028d5.js:37445:9)
以下是代码示例:
import { Graph } from '@antv/g6';
import { useEffect, useRef } from 'react';
export default () => {
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const graph = new Graph({
container: containerRef.current!,
width: 500,
height: 500,
data: {
nodes: [
{
id: 'node-1',
style: { x: 50, y: 100 },
},
{
id: 'node-2',
style: { x: 150, y: 100 },
},
],
edges: [{ id: 'edge-1', source: 'node-1', target: 'node-2' }],
},
});
graph.render();
}, []);
return <div ref={containerRef} />;
};
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
Method not implemented. 报错。不太稳定,我也不知道是什么问题。我使用的是"@antv/g6": "^5.0.9",这个版本,一会报错Graph找不到,一会报错graph.data方法不存在……麻烦能不能给一个稳定的demo.
G6 Version / G6 版本
🆕 "@antv/g6": "^5.0.9",
Operating System / 操作系统
Windows
Browser / 浏览器
Chrome
Additional context / 补充说明
No response