Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
El elemento Cytoscape se agrega pero no se procesa

Así que quiero renderizar el siguiente elemento de Cytoscape pero al final no aparece nada en la pantalla.

 let cy = cytoscape({ container: document.getElementById('cy'), elements: [ // list of graph elements to start with { // node a data: { id: 'a' } }, { // node b data: { id: 'b' } }, { // edge ab data: { id: 'ab', source: 'a', target: 'b' } }, { data: { id: 'c' } }, { data: { id: 'ac', source: 'a', target: 'c', 'value': 'ceva', 'value2': 'data(target)', } } ], style: [ // the stylesheet for the graph { selector: 'node', style: { 'background-color': 'red', 'label': 'data(id)' } }, { selector: 'edge', style: { 'width': 3, 'line-color': 'blue', 'target-arrow-color': '#ccc', 'target-arrow-shape': 'triangle', 'curve-style': 'bezier', } } ], layout: { name: 'grid', rows: 1 } }) cy.add([ { group: 'nodes', data: { id: 'n0' }, position: { x: 100, y: 100 } }, { group: 'nodes', data: { id: 'n1' }, position: { x: 200, y: 200 } }, { group: 'edges', data: { id: 'e0', source: 'n0', target: 'n1' } } ]);

Este es el HTML:

 <html> <head> <script src="./script.js"></script> </head> <body> <div id="cy"></div> <script src="./cyto.js"></script> </body> </html>

Lo que me parece el problema es el hecho de que la clase Cytoscape termina teniendo la altura = 0. Después de modificar la clase en el elemento de inspección y agregar altura = 1000px, funciona bien en su mayoría. ¿Cuál podría ser la solución? Soy nuevo en Cytoscape, así que creo que esto podría ser un error básico.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Estoy usando cytoscape con este tipo de configuración:

 <div id="cy" style="width: 900px; height: 800px;"></div>

donde la altura y el ancho se establecen al principio.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!