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

210
Views
Obteniendo "SyntaxError: token inesperado" en Observable

Estaba probando vega-lite-api en observablehq aquí .

Este es mi código:

Poner estos dos en diferentes celdas funciona:

 obj = vl.markPoint() .data(df) .encode(vl.y().fieldN('city'));

En la siguiente celda:

 obj.render()

Si pongo ambos en la misma celda, da SyntaxError: Unexpected token :

 obj2 = vl.markPoint() .data(df) .encode(vl.y().fieldN('city')); obj2.render(); ^

¿Por qué esto es tan?

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

0

Si desea colocar el código en la misma celda, puede encadenar la llamada para que se represente así:

 vl.markPoint() .data(df) .encode(vl.y().fieldN('city')) .render()

O puede usar una celda de bloque con llaves así:

 { const obj = vl.markPoint() .data(df) .encode(vl.y().fieldN('city')); return obj.render(); }

Para obtener más información sobre JavaScript observable:

https://observablehq.com/@observablehq/observables-no-javascript

about 4 years ago · Juan Pablo Isaza Report

0

para obj tienes una definición antes de usarla...

 obj = N { Symbol(data): Object {mark: h, data: Object, encoding: h} <prototype>: N {} }

¿Supongo que lo olvidaste para obj2?

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!