Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
7e527b45
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e527b45
编写于
11月 10, 2017
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Workaround on build bug of rollup0.51.
上级
376b7420
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
14 deletion
+12
-14
src/scale/Scale.js
src/scale/Scale.js
+12
-14
未找到文件。
src/scale/Scale.js
浏览文件 @
7e527b45
...
...
@@ -28,14 +28,12 @@ function Scale(setting) {
this
.
init
&&
this
.
init
.
apply
(
this
,
arguments
);
}
var
scaleProto
=
Scale
.
prototype
;
/**
* Parse input val to valid inner number.
* @param {*} val
* @return {number}
*/
scaleProto
.
parse
=
function
(
val
)
{
Scale
.
prototype
.
parse
=
function
(
val
)
{
// Notice: This would be a trap here, If the implementation
// of this method depends on extent, and this method is used
// before extent set (like in dataZoom), it would be wrong.
...
...
@@ -43,11 +41,11 @@ scaleProto.parse = function (val) {
return
val
;
};
scaleProto
.
getSetting
=
function
(
name
)
{
Scale
.
prototype
.
getSetting
=
function
(
name
)
{
return
this
.
_setting
[
name
];
};
scaleProto
.
contain
=
function
(
val
)
{
Scale
.
prototype
.
contain
=
function
(
val
)
{
var
extent
=
this
.
_extent
;
return
val
>=
extent
[
0
]
&&
val
<=
extent
[
1
];
};
...
...
@@ -57,7 +55,7 @@ scaleProto.contain = function (val) {
* @param {number} val
* @return {number}
*/
scaleProto
.
normalize
=
function
(
val
)
{
Scale
.
prototype
.
normalize
=
function
(
val
)
{
var
extent
=
this
.
_extent
;
if
(
extent
[
1
]
===
extent
[
0
])
{
return
0.5
;
...
...
@@ -70,7 +68,7 @@ scaleProto.normalize = function (val) {
* @param {number} val
* @return {number}
*/
scaleProto
.
scale
=
function
(
val
)
{
Scale
.
prototype
.
scale
=
function
(
val
)
{
var
extent
=
this
.
_extent
;
return
val
*
(
extent
[
1
]
-
extent
[
0
])
+
extent
[
0
];
};
...
...
@@ -79,7 +77,7 @@ scaleProto.scale = function (val) {
* Set extent from data
* @param {Array.<number>} other
*/
scaleProto
.
unionExtent
=
function
(
other
)
{
Scale
.
prototype
.
unionExtent
=
function
(
other
)
{
var
extent
=
this
.
_extent
;
other
[
0
]
<
extent
[
0
]
&&
(
extent
[
0
]
=
other
[
0
]);
other
[
1
]
>
extent
[
1
]
&&
(
extent
[
1
]
=
other
[
1
]);
...
...
@@ -92,7 +90,7 @@ scaleProto.unionExtent = function (other) {
* @param {module:echarts/data/List} data
* @param {string} dim
*/
scaleProto
.
unionExtentFromData
=
function
(
data
,
dim
)
{
Scale
.
prototype
.
unionExtentFromData
=
function
(
data
,
dim
)
{
this
.
unionExtent
(
data
.
getDataExtent
(
dim
,
true
));
};
...
...
@@ -100,7 +98,7 @@ scaleProto.unionExtentFromData = function (data, dim) {
* Get extent
* @return {Array.<number>}
*/
scaleProto
.
getExtent
=
function
()
{
Scale
.
prototype
.
getExtent
=
function
()
{
return
this
.
_extent
.
slice
();
};
...
...
@@ -109,7 +107,7 @@ scaleProto.getExtent = function () {
* @param {number} start
* @param {number} end
*/
scaleProto
.
setExtent
=
function
(
start
,
end
)
{
Scale
.
prototype
.
setExtent
=
function
(
start
,
end
)
{
var
thisExtent
=
this
.
_extent
;
if
(
!
isNaN
(
start
))
{
thisExtent
[
0
]
=
start
;
...
...
@@ -122,7 +120,7 @@ scaleProto.setExtent = function (start, end) {
/**
* @return {Array.<string>}
*/
scaleProto
.
getTicksLabels
=
function
()
{
Scale
.
prototype
.
getTicksLabels
=
function
()
{
var
labels
=
[];
var
ticks
=
this
.
getTicks
();
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
...
...
@@ -135,7 +133,7 @@ scaleProto.getTicksLabels = function () {
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
scaleProto
.
isBlank
=
function
()
{
Scale
.
prototype
.
isBlank
=
function
()
{
return
this
.
_isBlank
;
},
...
...
@@ -143,7 +141,7 @@ scaleProto.isBlank = function () {
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
scaleProto
.
setBlank
=
function
(
isBlank
)
{
Scale
.
prototype
.
setBlank
=
function
(
isBlank
)
{
this
.
_isBlank
=
isBlank
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录