-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use fully-qualified symbols in render fns & drop global aliases
- Loading branch information
Showing
10 changed files
with
43 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
;; # 🤾🏼 Jump to Definition | ||
(ns jump-to-definition | ||
(:require | ||
[clojure.string :as str] | ||
[nextjournal.clerk :as clerk] | ||
[nextjournal.clerk.render :as-alias render] | ||
[nextjournal.clerk.render.hooks :as-alias hooks] | ||
[nextjournal.clerk.viewer :as v])) | ||
(:require [nextjournal.clerk :as clerk] | ||
[nextjournal.clerk.render :as-alias render] | ||
[nextjournal.clerk.render.hooks :as-alias hooks] | ||
[nextjournal.clerk.viewer :as v])) | ||
|
||
;; Trying various ways to support jump to definition | ||
(def my-code-viewer | ||
{:render-fn 'nextjournal.clerk.render/render-code :transform-fn clerk/mark-presented}) | ||
|
||
|
||
(v/->viewer-fn '(fn [spec] (let [plotly (hooks/use-d3-require "plotly.js-dist@2.15.1") | ||
ref-fn (hooks/use-callback #(when % (.newPlot plotly % (clj->js spec ))) [spec plotly])] | ||
(js/console.log "dude") | ||
(when spec | ||
(if plotly | ||
[:div.overflow-x-auto [:div.plotly {:ref ref-fn}]] | ||
render/default-loading-view))))) | ||
(clerk/resolve-aliases '(fn [spec] (let [plotly (hooks/use-d3-require "plotly.js-dist@2.15.1") | ||
ref-fn (hooks/use-callback #(when % (.newPlot plotly % (clj->js spec ))) [spec plotly])] | ||
(js/console.log "dude") | ||
(when spec | ||
(if plotly | ||
[:div.overflow-x-auto [:div.plotly {:ref ref-fn}]] | ||
render/default-loading-view))))) | ||
|
||
(v/->viewer-eval '(fn [spec] (let [plotly (hooks/use-d3-require "plotly.js-dist@2.15.1") | ||
ref-fn (hooks/use-callback #(when % (.newPlot plotly % (clj->js spec))) [spec plotly])] | ||
(js/console.log "dude") | ||
(when spec | ||
(if plotly | ||
[:div.overflow-x-auto [:div.plotly {:ref ref-fn}]] | ||
render/default-loading-view))))) | ||
(v/->viewer-eval | ||
(clerk/resolve-aliases '(fn [spec] (let [plotly (hooks/use-d3-require "plotly.js-dist@2.15.1") | ||
ref-fn (hooks/use-callback #(when % (.newPlot plotly % (clj->js spec))) [spec plotly])] | ||
(js/console.log "dude") | ||
(when spec | ||
(if plotly | ||
[:div.overflow-x-auto [:div.plotly {:ref ref-fn}]] | ||
render/default-loading-view)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters