SQL query example does not define "weight" attribute
BlockChainMusuko opened this issue · 4 comments
This may be user error =); but...
I am not new to programming; but, also not an expert.
I have been unable to render the connection arrows when writing SQL in the APEX region source. The packaged example does not seem to define the "weight" as it does in the js code example.
EG: simple example just does not show the wighted conection arrows:
testemp table csv
deptno, empno, ename, sal, mgr, weight
111, 333, Jeff, 20, 666, 1
111, 222, Jon, 30, 666, 2
111, 111, Bob, 30, 666, 3,
222, 444, Ted, 40, 777, 1
testdept table csv
deptno, dname
111, K
222, FD
Region Source code:
WITH
nodes AS (
SELECT XMLELEMENT( "nodes", xmlattributes(
empno AS id
, ename AS label
, sal AS sizevalue
, d.deptno AS colorvalue
, d.dname AS colorlabel
) ) AS xml_nodes
FROM testemp e JOIN testdept d ON e.deptno = d.deptno
),
links AS (
SELECT XMLELEMENT( "links", xmlattributes(
empno AS fromid
, NVL(mgr,empno) AS toid
, 'dashed' AS style
, 'red' AS color
) ) AS xml_links
FROM testemp
)
SELECT XMLSERIALIZE( DOCUMENT( XMLELEMENT( "data",
( SELECT XMLAGG( xml_nodes ) FROM nodes ),
( SELECT XMLAGG( xml_links ) FROM links ) ) ) INDENT ) AS single_clob_result
FROM DUAL
*running on APEX 4.2 and downloaded your latest plugin version
Hi Jeff,
there is no attribute weight for a node or link - see here the available link attributes in the API docs.
Which js example do you mean? Can you provide more details or a link? Or are you speaking about this node runtime attributes? If so - the weight is determined by D3 at runtime.
Regarding your provided csv data. You need to provide also the managers (empno 666 and 40) in your query result. Without these two managers (also employees) there are no connections between the resulting nodes (employees) because the relevant nodes (managers) are simply missing - see attributes fromid (empno) and toid(mgr). Hope this was clear enough :-)
Best regards
Ottmar
Hi Jeff,
how are you? Can we close this issue? Is everything ok with your D3 network graph?
Best regards
Ottmar
Hi Jeff,
any news? Can I close the issue?
Best regards
Ottmar
User is not responding... Issue closed.