diff --git a/demo/resources/ext/demo-rtable.edn b/demo/resources/ext/demo-rtable.edn index a5f7041..47e575c 100644 --- a/demo/resources/ext/demo-rtable.edn +++ b/demo/resources/ext/demo-rtable.edn @@ -45,6 +45,7 @@ demo.service.highcharts/highstock-static demo.service.pixi/pixi-static demo.service.rtable/rtable-data + demo.service.saying/saying ]} diff --git a/demo/src/demo/helper/daliclj.cljs b/demo/src/demo/helper/daliclj.cljs index d7c44fd..01cdad9 100644 --- a/demo/src/demo/helper/daliclj.cljs +++ b/demo/src/demo/helper/daliclj.cljs @@ -16,4 +16,15 @@ (let [{:keys [fun args]} options] (if fun [clj-viewer {:fun fun :args args}] - [:div "error: option does not contain :fun key"])))) \ No newline at end of file + [:div "error: option does not contain :fun key"])))) + + +(defmethod component-ui "saying" [{:keys [id state]}] + (fn [options] + [:div + "saying options (at request): " (pr-str options) + [clj-viewer {:fun 'demo.service.saying/saying + :args [options]}] + + ] +)) \ No newline at end of file diff --git a/demo/src/demo/page/layout.cljs b/demo/src/demo/page/layout.cljs index 63be9b2..4dcacf7 100644 --- a/demo/src/demo/page/layout.cljs +++ b/demo/src/demo/page/layout.cljs @@ -150,7 +150,27 @@ :style {:border-radius "5px" :border "1px solid lightgray"}} - "add algo"]] + "add algo"] + + [:button + {:on-click #(add-node m {:component "saying" + :name "saying" + :id "saying1" + :options {:id 0} + :edit [{:type :select + :path :id, + :name "saying-id", + :spec + (into [] (range 20))}]}) + + :style {:border-radius "5px" + :border "1px solid lightgray"}} + "add saying"] + + + + ; end of top menu + ] [:div {:style {:display "flex" :flex-grow "1" diff --git a/demo/src/demo/service/saying.clj b/demo/src/demo/service/saying.clj new file mode 100644 index 0000000..da9860b --- /dev/null +++ b/demo/src/demo/service/saying.clj @@ -0,0 +1,25 @@ +(ns demo.service.saying + (:require + [dali.plot.hiccup :refer [hiccup]])) + +(defn saying [{:keys [id]}] + (println "serving saying id: " id) + (let [s (case id + 0 "Peace to the world" + 1 "The hottentotten are here" + 2 "The sky is always blue" + 3 "Biene Maya and Willy" + 4 "Quot erum demunstrandum" + 5 "The early bird catches the worm" + 6 "Six Six Six" + 7 "Seven Angles are here" + 8 "8 means infinity " + 9 "what is the secret of nine?" + nil)] + (hiccup [:div.bg-blue-300.w-100.h-100 + [:h1 "Sayings Response"] + [:p "You entered: " id] + [:hr] + (if s + [:p.bg-green-500.p-5 s] + [:p.bg-red-500.p-5 "This saying does not exist: " id])]))) \ No newline at end of file diff --git a/deps.edn b/deps.edn index 7a68aa3..8adbd8a 100644 --- a/deps.edn +++ b/deps.edn @@ -6,7 +6,7 @@ ; source code heavily modified, but based on this one: ;org.clojars.frozenlock/reagent-table {:mvn/version "0.1.6"} io.helins/canvas {:mvn/version "2.0.0-beta0"} - org.pinkgorilla/dali {:mvn/version "0.1.21"}} + org.pinkgorilla/dali {:mvn/version "0.1.24"}} :aliases {; github ci :build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"} diff --git a/src/rtable/transform/highcharts/data.cljs b/src/rtable/transform/highcharts/data.cljs index 7bf9dbb..159c03a 100644 --- a/src/rtable/transform/highcharts/data.cljs +++ b/src/rtable/transform/highcharts/data.cljs @@ -50,7 +50,7 @@ _ (println "rows with signal: " (tmlds/row-count only-signal-ds)) data (->> (map #(flag v2style column %) rows) (into []))] - (println "series data: " data) + ;(println "series data: " data) data)) ; set series