9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/opal/d3/histograms.rb', line 9
def thresholds(count=nil, &block)
if block_given?
@native.JS.thresholds(block)
elsif count.is_a?(Numeric)
@native.JS.thresholds(count)
elsif count == :scott
@native.JS.thresholds{|*args| D3.threshold_scott(*args)}
elsif count == :sturges
@native.JS.thresholds{|*args| D3.threshold_sturges(*args)}
elsif count == :freedman_diaconis
@native.JS.thresholds{|*args| D3.threshold_freedman_diaconis(*args)}
else
raise ArgumentError, "Wrong use of D3::Histogram.thresholds API - pass block, number, or symbol"
end
self
end
|