#49 feat: gráficos de provenance (proveedores-organizaciones y territorios) en el resumen público
This commit is contained in:
@@ -51,17 +51,20 @@ export function computeColumnLayout (nodes, edges, options = {}) {
|
||||
|
||||
export function toCytoscapeElements ({ nodes, edges }) {
|
||||
return [
|
||||
...nodes.map(node => ({
|
||||
data: {
|
||||
id: node.id,
|
||||
kind: node.kind,
|
||||
label: node.label,
|
||||
image: node.image || null,
|
||||
entity: node.entity || null,
|
||||
},
|
||||
classes: [node.kind],
|
||||
position: { x: node.x, y: node.y },
|
||||
})),
|
||||
...nodes.map(node => {
|
||||
const classes = node.image ? [node.kind, 'has-image'] : [node.kind]
|
||||
return {
|
||||
data: {
|
||||
id: node.id,
|
||||
kind: node.kind,
|
||||
label: node.label,
|
||||
image: node.image || null,
|
||||
entity: node.entity || null,
|
||||
},
|
||||
classes,
|
||||
position: { x: node.x, y: node.y },
|
||||
}
|
||||
}),
|
||||
...edges.map(edge => ({
|
||||
data: {
|
||||
id: `edge:${edge.from}:${edge.to}`,
|
||||
|
||||
Reference in New Issue
Block a user