页面上的scapescape.js多个实例 [英] cytoscape.js multiple instances on page

查看:65
本文介绍了页面上的scapescape.js多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一网页上遇到两个cytoscape设置实例时遇到麻烦。我有两个用于不同图形的窗口变量 cy和 cy2。它们是功能不同的图,需要在页面的不同部分使用。我想知道如何正确进行设置?

I am having trouble having two instances of cytoscape setup on same webpage. I have two window vars "cy" and "cy2" that are being used for different graphs. They are functionally different graphs and need to be available on different parts of the page. I wanted to know how to get that setup correctly?

当我查看页面元素时,未显示的元素的基础画布的宽度和高度设置为0, cytoscape.js。能否请您帮我了解初始化错误的原因或如何设置这些值。

When I look at page elements, the one not showing has the width and height of the underlying canvases set to 0 by cytoscape.js. Can you please help me to understand what is being initialized wrong or how these values can get set like that.

感谢
gmania

Thanks gmania

cytoscape.js元素div的chrome开发工具屏幕

推荐答案

看看多实例演示: http://js.cytoscape.org/demos/310dca83ba6970812dd0

还要确保在CSS中正确设置尺寸对于每个容器。如果您指定的div大小为零,则内部Cy画布将匹配。

Also make sure you set dimensions properly in your CSS for each container. If you specify a div with zero size, then the internal Cy canvases will match.

这篇关于页面上的scapescape.js多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆