Skip to content

A CORS issue for loading data from web #12

@TonyLianLong

Description

@TonyLianLong

The following spec (w/ code to add the plot) is rendered correctly in the current version of plotgallery. However, thumbnail does not work (either in a browser or Electron). Through debugging and testing, a highly possible reason is that because it uses an external source of data, and the function that we are using to convert to an PNG URL will not work under this condition for web security.

addPlot({type: "vega", data:{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "width": 500,
  "height": 300,
  "data": {"url": "https://vega.github.io/vega-lite/examples/data/cars.json"},
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "Origin",
      "type": "nominal"
    },
    "y": {
      "aggregate": "count",
      "type": "quantitative"
    }
  }
}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions