dribnet / strokes

Let's pretend d3 was written in ClojureScript.
374 stars 28 forks source link

TypeError: mrhyde.mrhyde is undefined #16

Open hlolli opened 8 years ago

hlolli commented 8 years ago

I wanted to try out strokes for d3 visualizations in Clojurescript. I add [net.drib/strokes "0.5.1"] to my dependencies and [strokes :refer [d3]] to my project and I get the error: TypeError: mrhyde.mrhyde is undefined. I'm using figweel and [org.clojure/clojurescript "1.8.40" :scope "provided"].

mbossenbroek commented 8 years ago

+1

I'm getting a similar exception, just playing with some of the samples. I'm using [org.clojure/clojurescript "1.7.228"] and [figwheel-sidecar "0.5.0"]

clojure.lang.ExceptionInfo : failed compiling file:resources/public/js/compiled/out/mrhyde/mrhyde.cljs
clojure.lang.ExceptionInfo : Invalid :refer, var var clojure.string/re-matches does not exist in file resources/public/js/compiled/out/mrhyde/mrhyde.cljs
Error on file , line , column
behaviary commented 7 years ago

Wow, still open almost a year later. I'm running into this exact error. Did either of you figure this out back then?

ChipNowacek commented 7 years ago

Sure could use this library — and, given my inability to sort out the error, I can't take the lead. Is there a way I can help out?

behaviary commented 7 years ago

I took another look at this today. It seems like version 0.5.1 of mrhyde (which is required by the current 'official' clojars version of strokes) refers in "re-matches" from clojure.string which is now part of core:

(:require [clojure.string :refer [join re-matches]]
          [cljs.reader :refer [read-string]]
          [mrhyde.guts :refer [hyde-proto-array-marker hyde-proto-object-marker]]
          ))

There are two different versions in clojars com.davidkay and org.clojars.davidkay that you might have more luck with. These pull in a newer version of mrhyde that has re-matches taken out of the refer.

Another solution is to use this actual repo and manually pull in the namespace. If you look at the project.clj, you'll see that the dependencies are updated. This is not a great way to go for a production project.

  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.145"]
                 [net.drib/mrhyde "0.5.4-SNAPSHOT"]]

Finally, I'm solving my problem by using reagent by itself. It has decent svg manipulation. It looks like that's the best I can come up with at the moment. Hope that helps!

ChipNowacek commented 7 years ago

Ooohhh. That does help. Maybe I can get away with direct manipulation from within reagent. Seen anyone do a force graph?

Thanks tons.

wpcarro commented 7 years ago

Having the same error with:

[org.clojure/clojure "1.9.0-beta1"]
[org.clojure/clojurescript "1.9.908"]
[net.drib/strokes "0.5.1"]]

I'm new to Clojure and ClojureScript but I'm looking to build a fairly robust D3 interface, so I was hoping that using strokes would be feasible.