Light High Efficiency Graph Component

Qunee Developer Guide

Data Conversion

After the front end gets the data, firstly it has to be converted to data format supported by Javascript, so as to read data property, such as text data in JSON format. It can be analysed via JSON#parse(…). For the text in XML format, it can be converted to XML object via DOMParse#parseFromString

Conversion to JS object

Continue the above example. Analyze the text to JSON object

function onDataCollected(txt){
    var json = JSON.parse(txt);

Conversion to Qunee element

Images in Qunee graphic component have corresponding model objects, called Qunee element. User data has to firstly be converted to this element and then demonstrated in Qunee graphic component. Qunee elements have many types, support various presentation styles and expansion ways. Different data can be converted to different types of Qunee elements according to explicit intents. Set corresponding image styles. Special demastration effect can be realized by UI extension.

Convert JSON objects to Qunee elements, and add them to graphic vessel

function translateToQuneeElements(json, graph){
    var map = {};
        Q.forEach(json.nodes, function(data){
            var node = graph.createNode(, data.x || 0, data.y || 0);
            node.set("data", data);
            map[] = node;
        Q.forEach(json.edges, function(data){
            var from = map[data.from];
            var to = map[];
            if(!from || !to){
            var edge = graph.createEdge(, from, to);
            edge.set("data", data);
        }, graph);