ggvega icon indicating copy to clipboard operation
ggvega copied to clipboard

empty objects

Open ijlyttle opened this issue 6 years ago • 5 comments

This may be a matter of personal taste 🤓

Would it be a difficult thing to omit empty objects from the "final" Vega-Lite spec? For example, things like this:

"scale": {}

ijlyttle avatar Jun 15 '19 12:06 ijlyttle

Thanks for your advice. I have removed the empty scale. I believe it's not difficult to omit all empty objects. But let me do it later. For now, these "mistakes" are helpful for me to modify the code.

wenyuyangpku avatar Jun 15 '19 17:06 wenyuyangpku

Sounds good - hurry on the bigger fix, when you will have it done, please close the issue and note the commit where you made the change.

As we do more, we can talk about using feature branches for this (perhaps you have experience with this already).

ijlyttle avatar Jun 15 '19 21:06 ijlyttle

Yes, I have some experience in feature branches but not on RStudio. Looking forward to your guidance.

I have added a function removeEmpty(Object) to omit the null value and {} Object.

wenyuyangpku avatar Jun 16 '19 12:06 wenyuyangpku

Happy to discuss more the next time we have a meeting, one place to get started might be the pr_*() set of functions in usethis: https://usethis.r-lib.org/reference/pr_init.html

ijlyttle avatar Jun 16 '19 21:06 ijlyttle

Hi Wenyu,

Sorry to reopen this issue - we may have to rethink this a bit to get a ggplot geom_path() to work using "mark": "line" in Vega-Lite.

See https://vega.github.io/vega-lite/docs/encoding.html#order, where they explicitly use {"value": null} in the order encoding.

ijlyttle avatar Jun 19 '19 03:06 ijlyttle