metasoarous / oz

Data visualizations in Clojure and ClojureScript using Vega and Vega-lite
Eclipse Public License 1.0
828 stars 74 forks source link

vega-lite v5 compatibility? #155

Closed wongjoel closed 3 years ago

wongjoel commented 3 years ago

Vega-Lite version 5 was released at the end of February, and it has some breaking changes when it comes to interactive charts. (See release notes: https://github.com/vega/vega-lite/releases/tag/v5.0.0)

Oz currently has "vega-lite": "4.17.0" listed in package.json. I'm currently having an issue where charts using the new v5 params approach to selections do not render due to the v4 code not supporting it. For now, I think I can safely move to v5 by forking the repo and bumping the dependencies, but thought I would note that here.

metasoarous commented 3 years ago

Thanks for pointing this out Joel. I'll try to cut a version with an update for this soon.

It sure would be great if Oz let you pick the version you want to use :thinking:

realgenekim commented 3 years ago

Hi, @metasoarous — was good interacting with you briefly on Twitter. :) https://twitter.com/RealGeneKim/status/1434996575328104451

As I mentioned, I was able to bump the vega-lite version to 5.1.0 and use it to generate a strip plot that required v5. However, as I show in the gist below, hitting the devcards endpoint results in a bunch of errors on the server.

The good news is that oz wrapping vega-lite 5.1.0 does seem to generate correct graphs.

PS: kudos on switching to shadow-cljs, which made it so easy to use a :local/root local version! Thank you for all your great work on this amazing library!

PPS: for anyone who needs to replicate this, update the version in package.json library, and type `clj -M:shadow-cljs compile devcards app'.

https://gist.github.com/realgenekim/a909ff8ab25a0a4cb03e1741d9dacab9

metasoarous commented 3 years ago

Hey @realgenekim! Thanks again for submitting this!

I just tried pulling down your branch, and wasn't able to reproduce the error you described in that gist. It may have been a spurious compilation or stale maven repo artifact issue. I'm curious what would happen if you moved your local maven repo temporarily and reran to see if the problem persists (mv ~/.m2 ~/.m2_$(date +%F) is a nice option if date works the same on mac as on linux).

In any case, this seems to be working to me, so I'm going to go ahead and merge. However, in the the future note that it's also necessary to update the vars oz.core/{vega,vega-lite,vega-embed}-version in order for the html output to come out right. I'll go ahead and take care of it this go around though.

Thanks again!

metasoarous commented 3 years ago

This should now be supported by 1.6.0-alpha35-SNAPSHOT. Please let me know if that works for you!