Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
mxGraph: ¿Cómo puedo integrar mxgraph en mi proyecto en Javascript? Descargué las bibliotecas mxgraph

En este proceso se utiliza XML en formato mxgraph con javascript. Quise decodificar el xml y agregar el gráfico a la interfaz de configuración, pero no funcionó, donde me sale el error es la línea que di a continuación,

decoder = mxCodecRegistry.getCodec(mxCell);

 var xml = '<root><mxCell id="2" value="World!Vishal" vertex="1"><mxGeometry x="200" y="150" width="80" height="30" as="geometry"/></mxCell><mxCell id="3" edge="1" source="2"><mxGeometry relative="1" as="geometry"><mxPoint x="440" y="90" as="targetPoint"/></mxGeometry></mxCell></root>'; var doc = mxUtils.parseXml(xml); var codec = new mxCodec(doc); var elt = doc.documentElement.firstChild; var cells = []; while (elt != null){ cells.push(codec.decodeCell(elt)); graph.refresh(); elt = elt.nextSibling; } this.graph.addCells(cells); mxCodec.prototype.decodeCell = function(node, restoreStructures) { restoreStructures = (restoreStructures != null) ? restoreStructures : true; var cell = null; if (node != null && node.nodeType == mxConstants.NODETYPE_ELEMENT) { var decoder = mxCodecRegistry.getCodec(node.nodeName); if (!this.isCellCodec(decoder)) { var child = node.firstChild; while (child != null && !this.isCellCodec(decoder)) { decoder = mxCodecRegistry.getCodec(node.nodeName); child = child.nextSibling; } } if (!this.isCellCodec(decoder)) { decoder = mxCodecRegistry.getCodec(mxCell); } cell = decoder.decode(this, node); if (restoreStructures) { this.insertIntoGraph(cell); } } return cell; };
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda