我试图在我的re-frame/reagent/leiningen项目中使用cljsjs/vis,但是在将此库导入命名空间时出现错误。
cljsjs/vis in namespace required but not available
尝试使用其他库进行图表/数据可视化,但结果仍然相同。将 JS 库导入 clojurescript 项目似乎有问题。
莱宁根project.cljs
文件
(defproject test1 "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.764"
:exclusions [com.google.javascript/closure-compiler-unshaded
org.clojure/google-closure-library
org.clojure/google-closure-library-third-party]]
[thheller/shadow-cljs "2.9.3"]
[reagent "0.10.0"]
[re-frame "0.12.0"]
[cljs-ajax "0.7.5"]
[cljsjs/vis "4.21.0-1"]]
:plugins [[lein-shadow "0.2.0"]
[lein-shell "0.5.0"]]
:min-lein-version "2.9.0"
:source-paths ["src/clj" "src/cljs"]
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"]
:shell {:commands {"open" {:windows ["cmd" "/c" "start"]
:macosx "open"
:linux "xdg-open"}}}
:shadow-cljs {:nrepl {:port 8777}
:builds {:app {:target :browser
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
:modules {:app {:init-fn test1.core/init
:preloads [devtools.preload]}}
:devtools {:http-root "resources/public"
:http-port 8280
}}}}
:aliases {"dev" ["with-profile" "dev" "do"
["shadow" "watch" "app"]]
"prod" ["with-profile" "prod" "do"
["shadow" "release" "app"]]
"build-report" ["with-profile" "prod" "do"
["shadow" "run" "shadow.cljs.build-report" "app" "target/build-report.html"]
["shell" "open" "target/build-report.html"]]
"karma" ["with-profile" "prod" "do"
["shadow" "compile" "karma-test"]
["shell" "karma" "start" "--single-run" "--reporters" "junit,dots"]]}
:profiles
{:dev
{:dependencies [[binaryage/devtools "1.0.0"]]
:source-paths ["dev"]}
:prod {}
}
:prep-tasks [])
cljs
文件
(ns my-project
(:require [cljsjs.vis]))