Code Monkey home page Code Monkey logo

Comments (13)

metasoarous avatar metasoarous commented on May 23, 2024 3

Oh lovely! It actually wasn't I who updated those, but I'm glad to see that someone did! And doubly glad that it's solved your problem :-)

I'll leave this issue open till I'm able to update the deps in the project.clj and mint a new oz version.

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

Hi Boris! You're quite welcome; Happy to have you using it!

My guess is that this is something to do with Vega/Vega-Lite versions. Their team has been moving insanely fast, and I've multiple times found bugs in my work on this a few month ago that were resolved by just updating the Vega/Vega-Lite versions.

I'm gonna be giving a talk on Vega/Vega-Lite/Vizard at a local Clojure meetup next week, and there should be a video recording which I'll be able to share. In preparation for that, I'll try to update things. I may not get around to it until this weekend though, so if you feel like testing this hypothesis in the mean time, that would be super helpful.

Cheers

from oz.

BorisVSchmid avatar BorisVSchmid commented on May 23, 2024

Hi metasoarous

No rush. I looked whether there were updated version of vega/vega-lite available at https://cljsjs.github.io/, but you are using the latest versions repackaged for cljsjs. The latest vega-lite is a few versions ahead though (2.6.0), so I guess the packages at cljsjs need to be updated first (which I tried once, but didn't succeed back then).

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

Yes, that all sounds about right. I was actually the last one to update the cljsjs packages. I think the process for doing that could be spelled out a bit better in their docs, but I did manage to get it done.

from oz.

BorisVSchmid avatar BorisVSchmid commented on May 23, 2024

New vega packages are on cljsjs. I guess that was you! And indeed, updating the project.clj file fixed this issue.

             [cljsjs/vega "3.3.1-0"]
             [cljsjs/vega-lite "2.6.0-0"]
             [cljsjs/vega-embed "3.16.1-0"]
             [cljsjs/vega-tooltip "0.12.0-0"]

from oz.

maacl avatar maacl commented on May 23, 2024

Upgrading to the vega packages above gives me the following error in the console:

TypeError: vegaTooltip.vegaLite is not a function
    at core.cljs?rel=1537656423194:93

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

Update: I've added some even more recent cljsjs updates in flight, so once those hit clojars, I'll mint a new release of oz. Regarding your issue @maacl, I think this is because some of the "extra" vega apis have changed, and calls in oz may need to be updated. Stay tuned, thank you both...

from oz.

realgenekim avatar realgenekim commented on May 23, 2024

Hi, @metasoarous — wonderful talk at Clojure/conj 2018 about the wonderful work you are doing with polis. I was delighted to learn at the end that you're the author of oz!

I'm having a problem that I think is similar to this issue. I successfully create a bunch of graphs, but just recently noticed an oddity. Vega-lite boxplots only work with :type "box-plot", instead of :type "boxplot". (It works in the Vega Lite Editor, but not in Oz. https://vega.github.io/editor/#/examples/vega-lite/boxplot_minmax_2D_vertical)

I'd love to know how to get boxplots working in Oz — using "boxplot" as the type results in the following error in the browser console.

(def boxplot
  {:width 400
   :data {:name "table"
          :values (bpoints 10)}
   :mark {:type "boxplot"  ; <---- results in error.  OTOH, "box-plot" works.  why?
          :extent 1.5}
   :encoding {
              :x {:field "x", :type "ordinal"
                  :axis {:title "ABC"}},
              :y {:field "y", :type "quantitative"}}})

Chrome console error:

Uncaught Error: Unregistered composite mark boxplot
    at Object.n.normalize (oz.js:14)
    at B (oz.js:14)
    at Object.q [as normalize] (oz.js:14)
    at Object.n.compile (oz.js:14)
    at AI (oz.js:1213)
    at Object.<anonymous> (oz.js:1214)
    at Object.<anonymous> (oz.js:608)
    at Object.componentDidMount (oz.js:29)
    at e.notifyAll (oz.js:42)
    at r.close (oz.js:44)

I had already updated the project.clj dependencies with the latest cljsjs dependencies:

:dependencies [[org.clojure/clojure "1.10.0-RC2"]
                 [org.clojure/tools.cli "0.3.5"]
                 [cljsjs/vega "4.4.0-0"]
                 [cljsjs/vega-lite "3.0.0-rc10-0"]
                 [cljsjs/vega-embed "3.24.1-0"]
                 [cljsjs/vega-tooltip "0.13.0-0"]
                 [metasoarous/oz "1.3.1"]]

Here's the odd thing — using "box-plot" as the type works. Is this a vega-lite v2.0 syntax?

After hours of poking around, and I may be wildly wrong, but I'm wondering if somehow using an old version of vega-lite, say vega-lite 2.2.0? (Click on the source file in the console, I found the following string, which I think comes from the compiled.js file in the JAR file?)

        7: [function(e, t, n) {
            t.exports = {
                name: "vega-lite",
                author: 'Jeffrey Heer, Dominik Moritz, Kanit "Ham" Wongsuphasawat',
                version: "2.2.0",

Many thanks, and keep up the great work!

PS: I put all the graphs I made here: https://gist.github.com/realgenekim/749eac40573c56434d863fe48549cb3c#file-oz-demos-clj-L103

PPS: I'm using the Java 10.

$ java --version
java 10.0.2 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

@realgenekim Thanks for all your poking around here! I think you're right that this is the result of oz being compiled against vega 2, although I was under the impression that modifying your dependency list as you did should have had things load the most recent RC instead of the old v2. I'll do some tinkering around here to see if I can't reproduce that, but long story short is that I have updates on some other issues that I haven't pushed yet, and will try to get a new release minted today which will hopefully resolve this.

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

@realgenekim @BorisVSchmid There's now a [metasoarous/oz "1.4.0-SNAPSHOT"] on Clojars if either of you would be so kind as to test. Pushing changelog updates soon.

from oz.

realgenekim avatar realgenekim commented on May 23, 2024

@metasoarous @BorisVSchmid Awesome! It worked! Thank you!! So cool! :)

@metasoarous Is there an easy explanation of why this fix works, versus how it was working before when it appeared that it was loading v2.2 of vega-lite? Will updating to more recent versions work in the future? (I.e., where did v2.2 of vega-lite come from?)

(Question is not urgent or important: I only ask only because I'm trying to understand Clojure better, how the classpath works, etc. Thx again!)

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

Wonderful :-) Again, thanks so much for testing @realgenekim!

I don't know why it was still loading the v2.2 of vega-lite before. It's possible it was just cause of stale js build targets that didn't get regenerated when they were supposed to? I thought that I had run a test to verify that putting the cljsjs deps above metasoarous/oz would override the vega/vega-lite versions, and it sounds like @BorisVSchmid got this to work as well, so it must have been something like this. Maybe there's a caveat we don't know about yet.

In any case, glad this is working. Will close this once I get out 1.4.0.

from oz.

metasoarous avatar metasoarous commented on May 23, 2024

OK; 1.4.0 is now out.

from oz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.