question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dataset insert error

See original GitHub issue

Hello,

There seems to be an error while trying to insert the dataset to vegaEmbed: Uncaught (in promise) SyntaxError: Unexpected token m in JSON at position 0

Here is the code:

    const defData = [
        { "a": "A", "b": 28 }, { "a": "B", "b": 55 }, { "a": "C", "b": 43 },
        { "a": "D", "b": 91 }, { "a": "E", "b": 81 }, { "a": "F", "b": 53 },
        { "a": "G", "b": 19 }, { "a": "H", "b": 87 }, { "a": "I", "b": 52 }
    ]
    const spec = {
        "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
        "description": "A simple bar chart with embedded data.",
        "data": {
            "name": 'data1',
            "values": 'myData'
        },
        "mark": "bar",
        "encoding": {
            "x": { "field": "a", "type": "nominal", "axis": { "labelAngle": 0 } },
            "y": { "field": "b", "type": "quantitative" }
        }
    }


    vegaEmbed('#view', spec).then( res => {
        res.view
            .insert('myData', defData)
            .run()
        window.view = res.view
    })

The data loads ok when insert into the “name” tag. The same error is at my Vega spec where I have multiple data object in the array - so I need the “name” tag.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
domoritzcommented, Jan 2, 2022

You need to remove "values": 'data_len',.

0reactions
nerevaercommented, Jan 2, 2022

SO I removed the values tag and inserted under the name tag. Thank you very much!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors in inserting data to database - Stack Overflow
Show activity on this post. Actually,I'm inserting unique data to the primary key field. But it is not saved to the database. @AkilaRanasingha ......
Read more >
SQL INSERT Error – Q&A Hub | 365 Data Science
This error appears if you have already created another table, employees, where you have missed inserting data about the individual with id ...
Read more >
Error with DATABASE insert Activity - UiPath Community Forum
While using Insert activity to insert datatable into database, there is an issue as there are spaces in the column name.
Read more >
Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
Question: Data insert error not being picked up by try catch.
I.e. data flowing to the Insert object, no errors, but no data being inserted ... Relates to dates and date formats .. Insert...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found