asciidoctor-kroki icon indicating copy to clipboard operation
asciidoctor-kroki copied to clipboard

vega-lite read data from source

Open rasmusmk opened this issue 2 years ago • 4 comments

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'

rasmusmk avatar Jun 28 '22 12:06 rasmusmk

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).

ggrossetie avatar Jun 28 '22 14:06 ggrossetie

Hi

Thanks. I thought I had tried it. But yes it works also for attachment, partial :-)

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 :-)

Mvh Rasmus Kjeldmand

Den tir. 28. jun. 2022 kl. 16.02 skrev Guillaume Grossetie < @.***>:

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).

— Reply to this email directly, view it on GitHub https://github.com/Mogztter/asciidoctor-kroki/issues/376#issuecomment-1168768842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIM6FHEXBKZDVWEN6SOWTADVRMAYVANCNFSM52B6SBZQ . You are receiving this because you authored the thread.Message ID: @.***>

rasmusmk avatar Jun 28 '22 19:06 rasmusmk

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 avatar Jun 28 '22 21:06 ggrossetie

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

ggrossetie avatar Jun 28 '22 21:06 ggrossetie