Light High Efficiency Graph Component
en

Qunee Developer Guide

FAQ

After it is upgraded to v1.4, some problems exist to word alignment

Versions higher than v1.4 supports to take the text as the node main part. Now the anchor position of text will be set directly via the property of Node#anchorPosition, instead of setStyle

text.setStyle(Q.Styles.LABEL_ANCHOR_POSITION, Q.Position.LEFT_BOTTOM);

revised to

text.anchorPosition = Q.Position.LEFT_BOTTOM;

Why the icon of SVG can’t be loaded under Firefox?

The loading of SVG picture under each browser has difference. In SVG file, certain width-height value must be assigned (such as:<svg width=“100” height=“100” …>), which can’t be a percentage. Otherwise Qunee will be unable to acquire the original width-height rate. Surely this will generally not be a problem, since SVG, as a drawing tool(such as AI), will be set with corresponding width and height. But if hand-written SVG file, you have to pay attention on this problem

Why the icon of SVG can’t be dyed under IE?

In IE browser, you can draw SVG images in Canvas, but unable to acquire the pixel information of SVG images, and thus unable to dye the images, it is the same for seeking node edge. So Qunee recommend to use after SVG file is converted to the code of Canvas

Why the current subnet can’t be set?

In Qunee, any element can be set as a subnet, on preconditions that the property enableSubNetwork for modification of element shall be set to true. Otherwise, it can’t be set. For example

var subnetwork = graph.createNode('SubNetwork');
subnetwork.enableSubNetwork = true;
graph.currentSubNetwork = subnetwork;

How to determine whether the Node type Element?

Javascript support instanceof keyword, you can do this type of judgment keyword

element instanceof Q.Node

the same as edge type

element instanceof Q.Edge

How to determine whether the node subnet type?

All element types can be set to a subnet, only you need to set enableSubNetwork property is true, to determine whether the node is the subnet type can also be judged by this element

if(element.enableSubNetwork){
    Q.log('is SubNetwork');
}