Commit a81ca11f authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add zoom.extent option

parent b845e848
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
var __size_width = getConfig(['size','width'], null), var __size_width = getConfig(['size','width'], null),
__size_height = getConfig(['size','height'], null); __size_height = getConfig(['size','height'], null);
var __zoom_enabled = getConfig(['zoom','enabled'], false); var __zoom_enabled = getConfig(['zoom','enabled'], false),
__zoom_extent = getConfig(['zoom','extent'], null);
// data - data configuration // data - data configuration
checkConfig('data', 'data is required in config'); checkConfig('data', 'data is required in config');
...@@ -804,7 +805,8 @@ ...@@ -804,7 +805,8 @@
return this; return this;
}; };
zoom.orgScaleExtent = function () { zoom.orgScaleExtent = function () {
return [1, Math.max(maxDataCount()/10, 10)]; var extent = __zoom_extent ? __zoom_extent : [1,10];
return [extent[0], Math.max(maxDataCount()/extent[1], extent[1])];
}; };
zoom.updateScaleExtent = function () { zoom.updateScaleExtent = function () {
var ratio = diffDomain(x.orgDomain())/diffDomain(orgXDomain), extent = this.orgScaleExtent(); var ratio = diffDomain(x.orgDomain())/diffDomain(orgXDomain), extent = this.orgScaleExtent();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment