diff --git a/lib/helper/src/ta/helper/date_ds.clj b/lib/helper/src/ta/helper/date_ds.clj index 9517662a..e94e4f22 100644 --- a/lib/helper/src/ta/helper/date_ds.clj +++ b/lib/helper/src/ta/helper/date_ds.clj @@ -5,22 +5,22 @@ [tech.v3.datatype.functional :as dfn] [tech.v3.datatype.datetime :as datetime] [tablecloth.api :as tc] - [tick.core :as tick] + [tick.core :as t] [ta.helper.date :as dt] [ta.helper.ds :refer [cols-of-type]])) (defn now [] - (-> (tick/now) - (tick/date-time))) + (-> (t/now) + (t/date-time))) (defn days-ago [n] - (-> (tick/now) - (tick/date-time) - (tick/<< (tick/new-duration n :days)))) + (-> (t/now) + (t/date-time) + (t/<< (t/new-duration n :days)))) (defn days-ago-instant [n] - (-> (tick/now) - (tick/- (tick/new-duration n :days)))) + (-> (t/now) + (t/- (t/new-duration n :days)))) (defn ds-epoch [ds] (tds/column-map ds :epoch #(* 1000 (dt/->epoch-second %)) [:date])) @@ -40,10 +40,10 @@ (comment - (-> (tc/dataset {:date [(tick/new-date 2021 10 28) - (tick/new-date 2021 10 29) - (tick/new-date 2021 11 01) - (tick/new-date 2021 11 02)]}) + (-> (tc/dataset {:date [(t/new-date 2021 10 28) + (t/new-date 2021 10 29) + (t/new-date 2021 11 01) + (t/new-date 2021 11 02)]}) (add-year-and-month-date-as-local-date)) ; ) @@ -56,15 +56,15 @@ (if (= t :packed-instant) (do (println "converting to local-datetime") (-> ds - (tds/column-map :date-close #(tick/date-time %) [:date-close]) - (tds/column-map :date-open #(tick/date-time %) [:date-open]))) + (tds/column-map :date-close #(t/date-time %) [:date-close]) + (tds/column-map :date-open #(t/date-time %) [:date-open]))) (do (println "already local-date") ds)))) (defn convert-col-instant->localdatetime [ds col] (println "converting col " col "to local-datetime") - (tds/column-map ds col #(tick/date-time %) [col])) + (tds/column-map ds col #(t/date-time %) [col])) (defn ds-convert-col-instant->localdatetime [ds] (let [cols (cols-of-type ds :packed-instant)] @@ -72,13 +72,13 @@ (reduce convert-col-instant->localdatetime ds cols))) (defn month-as-int [dt] - (-> dt tick/month .getValue)) + (-> dt t/month .getValue)) (comment (days-ago 50) - (-> (month-as-int (tick/now)) class) + (-> (month-as-int (t/now)) class) ; ) @@ -102,48 +102,48 @@ false)))) (comment - (month-end? [(tick/now)]) + (month-end? [(t/now)]) - (month-begin? [(tick/new-date 2021 10 28) - (tick/new-date 2021 10 29) - (tick/new-date 2021 11 01) - (tick/new-date 2021 11 02)]) + (month-begin? [(t/new-date 2021 10 28) + (t/new-date 2021 10 29) + (t/new-date 2021 11 01) + (t/new-date 2021 11 02)]) - (month-end? [(tick/new-date 2021 10 28) - (tick/new-date 2021 10 29) - (tick/new-date 2021 11 01) - (tick/new-date 2021 11 02)]) + (month-end? [(t/new-date 2021 10 28) + (t/new-date 2021 10 29) + (t/new-date 2021 11 01) + (t/new-date 2021 11 02)]) - (month-end? [(tick/new-date 2021 12 28) - (tick/new-date 2021 12 29) - (tick/new-date 2022 1 01) - (tick/new-date 2022 1 02)]) + (month-end? [(t/new-date 2021 12 28) + (t/new-date 2021 12 29) + (t/new-date 2022 1 01) + (t/new-date 2022 1 02)]) ; ) (comment - (-> (tick/now) - (tick/year) + (-> (t/now) + (t/year) .getValue class) - (into [] (month [(tick/now)])) - (into [] (year [(tick/now)])) + (into [] (month [(t/now)])) + (into [] (year [(t/now)])) - (-> (tick/now) - (tick/date-time) + (-> (t/now) + (t/date-time) class) - (->> (tc/dataset [{:date-close (tick/now) - :date-open (tick/now)}]) + (->> (tc/dataset [{:date-close (t/now) + :date-open (t/now)}]) ensure-roundtrip-date-localdatetime ;tc/columns ;(map meta) ) - (->> (tc/dataset [{:date-close (tick/now) - :date-open (tick/now) + (->> (tc/dataset [{:date-close (t/now) + :date-open (t/now) :bongo 3 :signal true}]) ds-convert-col-instant->localdatetime diff --git a/lib/indicator/src/ta/indicator.clj b/lib/indicator/src/ta/indicator.clj index f8b32819..ee9d9903 100644 --- a/lib/indicator/src/ta/indicator.clj +++ b/lib/indicator/src/ta/indicator.clj @@ -124,7 +124,6 @@ n v)) (defn- ehlers-tfn - "" [{:keys [c1 c2 c3]}] (let [f (fn [x y1 y2] (+ (* c1 x) diff --git a/lib/interact/src/ta/interact/page/algo.cljs b/lib/interact/src/ta/interact/page/algo.cljs index 045e6aac..71d4bcd9 100644 --- a/lib/interact/src/ta/interact/page/algo.cljs +++ b/lib/interact/src/ta/interact/page/algo.cljs @@ -1,6 +1,6 @@ (ns ta.interact.page.algo (:require - [spaces] + [spaces.core] [options.edit :as edit] [ta.viz.lib.ui :refer [link-href]] [ta.interact.view.state :as s] @@ -40,11 +40,11 @@ (defn algo-ui [] (let [state (s/create-state)] (fn [] - [spaces/viewport - [spaces/top-resizeable {:size 50} + [spaces.core/viewport + [spaces.core/top-resizeable {:size 50} ;[:div.bg-gray-200.w-full.h-full "top"] [header-ui state]] - [spaces/fill + [spaces.core/fill ;[:div.bg-red-200.w-full.h-full "main"] [result-view state]]]))) diff --git a/lib/interact/src/ta/interact/view/state.cljs b/lib/interact/src/ta/interact/view/state.cljs index 656dc0f8..e8221cb6 100644 --- a/lib/interact/src/ta/interact/view/state.cljs +++ b/lib/interact/src/ta/interact/view/state.cljs @@ -2,7 +2,7 @@ (:require [reagent.core :as r] [promesa.core :as p] - [ui.webly :refer [notify]] + [frontend.notification :refer [show-notification]] [goldly.service.core :refer [clj]])) ;; state management @@ -32,7 +32,7 @@ (p/then (fn [r] (set-state state k r))) (p/catch (fn [_r] - (notify :error (str "data load error:" fun args))))))) + (show-notification :error (str "data load error:" fun args))))))) (defn get-available-templates [state] (clj-state-k state :template-list 'ta.interact.template/available-templates) diff --git a/lib/viz/src/ta/viz/lib/format.cljs b/lib/viz/src/ta/viz/lib/format.cljs index 801346f2..cb5d4df5 100644 --- a/lib/viz/src/ta/viz/lib/format.cljs +++ b/lib/viz/src/ta/viz/lib/format.cljs @@ -1,6 +1,6 @@ (ns ta.viz.lib.format (:require - [tick.goldly :refer [dt-format]] + [tick.helper :refer [dt-format]] [goog.string])) (defn fmt-nodigits [nr] diff --git a/lib/viz/src/ta/viz/lib/format_date.cljs b/lib/viz/src/ta/viz/lib/format_date.cljs index 4c08f81a..a05cc193 100644 --- a/lib/viz/src/ta/viz/lib/format_date.cljs +++ b/lib/viz/src/ta/viz/lib/format_date.cljs @@ -1,6 +1,6 @@ (ns ta.viz.lib.format-date (:require - [tick.goldly :refer [dt-format]])) + [tick.helper :refer [dt-format]])) (defn dt-yyyymmdd [dt] ;(println "dt-yyyymmdd: " dt) diff --git a/lib/viz/src/ta/viz/lib/layout.cljs b/lib/viz/src/ta/viz/lib/layout.cljs index 35327a9b..7cbb9746 100644 --- a/lib/viz/src/ta/viz/lib/layout.cljs +++ b/lib/viz/src/ta/viz/lib/layout.cljs @@ -1,16 +1,16 @@ (ns ta.viz.lib.layout (:require - [spaces])) + [spaces.core])) (defn left-right-top [{:keys [top left right]}] - [spaces/viewport - [spaces/top-resizeable {:size 50} top] - [spaces/fill - [spaces/left-resizeable {:size "50%" :scrollable false} left] - [spaces/fill {:scrollable false} right]]]) + [spaces.core/viewport + [spaces.core/top-resizeable {:size 50} top] + [spaces.core/fill + [spaces.core/left-resizeable {:size "50%" :scrollable false} left] + [spaces.core/fill {:scrollable false} right]]]) (defn main-top [{:keys [top main]}] - [spaces/viewport - [spaces/top-resizeable {:size 50} top] - [spaces/fill + [spaces.core/viewport + [spaces.core/top-resizeable {:size 50} top] + [spaces.core/fill main]]) \ No newline at end of file diff --git a/lib/viz/src/ta/viz/lib/resolve.cljs b/lib/viz/src/ta/viz/lib/resolve.cljs index bac58fa8..0a82eb94 100644 --- a/lib/viz/src/ta/viz/lib/resolve.cljs +++ b/lib/viz/src/ta/viz/lib/resolve.cljs @@ -1,7 +1,7 @@ (ns ta.viz.lib.resolve (:require [promesa.core :as p] - [goldly.sci :refer [requiring-resolve]])) + [webly.spa.resolve :refer [get-resolver]])) ; replace symbols with functions ; functions are resolved via requiring-resolve which returns a promesa promise @@ -12,6 +12,7 @@ [symbols] ;(println "resolve-symbols: " (pr-str symbols)) (let [symbols (->> symbols (into #{}) (into [])) ; in case some symbols are duplicates + requiring-resolve (get-resolver) promises (map requiring-resolve symbols) all (p/all promises) result (p/deferred)] diff --git a/lib/viz/src/ta/viz/lib/ui.cljs b/lib/viz/src/ta/viz/lib/ui.cljs index 71a53094..9a87ff56 100644 --- a/lib/viz/src/ta/viz/lib/ui.cljs +++ b/lib/viz/src/ta/viz/lib/ui.cljs @@ -1,8 +1,7 @@ (ns ta.viz.lib.ui (:require [re-frame.core :as rf] - [layout] - [site])) + [ui.site.template :refer [header-menu]])) ;; links @@ -20,7 +19,7 @@ ;; site layout (defn site-header [] - [site/header-menu + [header-menu {:brand "DemoGoldly" :brand-link "/" :items [{:text "fortune-cookie" :dispatch [:bidi/goto :user/fortune :query-params {}]} diff --git a/lib/viz/src/ta/viz/view/tsymbol.cljs b/lib/viz/src/ta/viz/view/tsymbol.cljs index caf06df5..9b6b6c2b 100644 --- a/lib/viz/src/ta/viz/view/tsymbol.cljs +++ b/lib/viz/src/ta/viz/view/tsymbol.cljs @@ -1,8 +1,6 @@ (ns ta.viz.view.tsymbol (:require [reagent.core :as r] - [layout] - [site] [input] [goldly.service.core :refer [run-a]]))