(parse-range-expr range time-opts)
parsing a range expression
(parse-range-expr [:20s 0.8] {:unit :ms})
parsing a range expression (parse-range-expr [:20s 0.8] {:unit :ms})
(parse-range-unit x {:keys [unit]})
categorising the unit range
(parse-range-unit :start {}) => [:array 0]
(parse-range-unit :end {}) => [:array -1]
(parse-range-unit :1m {:unit :ms}) => [:time 60000]
(parse-range-unit :-1m {:unit :ms}) => [:time -60000]
(parse-range-unit 0.44 {}) => [:ratio 0.44]
categorising the unit range (parse-range-unit :start {}) => [:array 0] (parse-range-unit :end {}) => [:array -1] (parse-range-unit :1m {:unit :ms}) => [:time 60000] (parse-range-unit :-1m {:unit :ms}) => [:time -60000] (parse-range-unit 0.44 {}) => [:ratio 0.44]
(process-filter arr filter-opts time-opts)
processes items given a filter
(process-filter [1 2 3 4 5 6 7 8] even? {}) => [2 4 6 8]
processes items given a filter (process-filter [1 2 3 4 5 6 7 8] even? {}) => [2 4 6 8]
(process-range arr {:keys [range filter sample] time-opts :time})
range stage in the process pipeline
(process-range (range 10000) {:time {:key identity :unit :s :order :asc} :range [:1m :5m] :sample [10 :linear]}) => [60 86 112 138 164 190 216 242 268 300]
(process-range (range 10000) {:time {:key identity :unit :ms :order :asc} :range [:-1s (Date. 7000)] :sample [10 :linear]}) => [6000 6111 6222 6333 6444 6555 6666 6777 6888 7000]
range stage in the process pipeline (process-range (range 10000) {:time {:key identity :unit :s :order :asc} :range [:1m :5m] :sample [10 :linear]}) => [60 86 112 138 164 190 216 242 268 300] (process-range (range 10000) {:time {:key identity :unit :ms :order :asc} :range [:-1s (Date. 7000)] :sample [10 :linear]}) => [6000 6111 6222 6333 6444 6555 6666 6777 6888 7000]
(range-end-for arr {:keys [length]} [tag val] {:keys [order key]})
ends the array range given :for option
(range-end-for [2 3 4] {} [:array 2] {:order :asc :key identity}) => [2 3]
ends the array range given :for option (range-end-for [2 3 4] {} [:array 2] {:order :asc :key identity}) => [2 3]
(range-end-to arr {:keys [length dropped start]} [tag val] {:keys [order key]})
ends the array range given :to option
(range-end-to [2 3 4] {:dropped 2} [:array 4] {:order :asc :key identity}) => [2 3]
ends the array range given :to option (range-end-to [2 3 4] {:dropped 2} [:array 4] {:order :asc :key identity}) => [2 3]
(range-op type [tag val] arr {:keys [key order]})
standardises units for negative inputs
standardises units for negative inputs
(range-start arr {:keys [length]} [tag val] {:keys [order key]})
chooses the start of the array
(range-start [1 2 3 4] {} [:array 2] {:order :asc :key identity}) => [2 [3 4]]
(range-start [-2 -1 0 1 2] {} [:time 2] {:order :asc :key identity}) => [2 [0 1 2]]
(range-start [-2 -1 0 1 2] {} [:absolute 0] {:order :asc :key identity}) => [2 [0 1 2]]
chooses the start of the array (range-start [1 2 3 4] {} [:array 2] {:order :asc :key identity}) => [2 [3 4]] (range-start [-2 -1 0 1 2] {} [:time 2] {:order :asc :key identity}) => [2 [0 1 2]] (range-start [-2 -1 0 1 2] {} [:absolute 0] {:order :asc :key identity}) => [2 [0 1 2]]
(range-wrap f start)
function wrapper for range-start and range-end functions
function wrapper for range-start and range-end functions
(select-range arr {:keys [type] :as range-opts} time-opts)
selects the range
(select-range [1 2 3 4 5] {:type :for :start [:array 1] :end [:array 3]} {:order :asc :key identity}) => [2 3 4]
selects the range (select-range [1 2 3 4 5] {:type :for :start [:array 1] :end [:array 3]} {:order :asc :key identity}) => [2 3 4]
(select-range-end arr {:keys [start end] :as m} {:keys [key] :as time-opts})
helper for range select when a date value is at the end
helper for range select when a date value is at the end
(select-range-standard arr
{:keys [type start end] :as m}
{:keys [key] :as time-opts})
helper for standard range select
helper for standard range select
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close