hrbrmstr/vegalite

rmarkdown: vegalite + ggvis incompatability

stephlocke opened this issue · 3 comments

vegalite does not play nicely with ggvis inside rmarkdown docs

In this gist, the rmarkdown errors, even though the ggvis chunk is not actively evaluated. However, if you flip it so vegalite is not eval'd & ggvis is eval'd, it works.

Tested on CRAN and dev version of rmarkdown, latest dev of vegalite, and cran ggvis

This does not surprise me :-)

ggvis is based on Vega-Lite's big brother Vega and both it and vegalite import the Vega js lib. I probably import a way newer one that Hadley is using. Hard to imagine that there's a language with worse namespacing than R, but that'd be javascript.

Lemme try to make an option to add to a call to vegalite that will use a different widget js base that doesn't import Vega proper for use with ggvis.

I have every confidence in your ability to solve my crazy edge cases :-) 

-------- Original message --------
From: boB Rudis notifications@github.com
Date: 06/03/2016 8:09 pm (GMT+00:00)
To: hrbrmstr/vegalite vegalite@noreply.github.com
Cc: Stephanie Locke stephanie.g.locke@gmail.com
Subject: Re: [vegalite] rmarkdown: vegalite + ggvis incompatability (#9)

This does not surprise me :-)

ggvis is based on Vega-Lite's big brother Vega and both it and vegalite import the Vega js lib. I probably import a way newer one that Hadley is using. Hard to imagine that there's a language with worse namespacing than R, but that'd be javascript.

Lemme try to make an option to add to a call to vegalite that will use a different widget js base that doesn't import Vega proper for use with ggvis.


Reply to this email directly or view it on GitHub.

One thing that will be necessary even after I make some JS changes is that whenever ggvis and vegalite are in the same R code, you'll need to explicitly use the pkg prefix for add_data since both I and Hadley chose that name (I haven't used ggvis in a while so I didn't even notice he used add_data).