Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vega-lite read data from source #376

Open
rasmusmk opened this issue Jun 28, 2022 · 4 comments
Open

vega-lite read data from source #376

rasmusmk opened this issue Jun 28, 2022 · 4 comments

Comments

@rasmusmk
Copy link

rasmusmk commented Jun 28, 2022

I am trying to make a plot using vega-lite included in kroki but have trouble with loading data from a csv in antora context. I have something like this but it cannot locate the csv file. Right now the same csv is placed in folders: pages, partials, attachements because I do not know how to specify where it is placed.

[vegalite]
----
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "lowpassfilter.csv"},
  "mark": "point",
}
----

I get this error:

Skipping vegalite block. Preprocessing of Vega-Lite view specification failed, because reading the local data file 'lowpassfilter.csv' referenced in the diagram caused an error:
Error: ENOENT: no such file or directory, open 'lowpassfilter.csv'
@ggrossetie ggrossetie added the 🍩 enhancement New feature or request label Jun 28, 2022
@ggrossetie
Copy link
Member

You need to use an Antora resource ID:

[vegalite]
....
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {"url": "example$lowpassfilter.csv"},
  "mark": "point",
}
....

I just added a test case and it's working as expected. If you are using the Intellij extension it won't work in the preview. My guess is that the preprocessor is not compatible with this environment (Java/JRuby).

@rasmusmk
Copy link
Author

rasmusmk commented Jun 28, 2022 via email

@ggrossetie
Copy link
Member

VS code asciidoc extension can also not show it in preview when have to load the data from file. But in antora it is ok :-)

The VS Code extension does not have Antora support (yet) but we are working on it so this issue might be resolved in the future.

@ggrossetie
Copy link
Member

I'm keeping this issue open to remind myself to document this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants