未验证 提交 9e718e70 编写于 作者: D Deqing Li 提交者: GitHub

Merge pull request #11481 from deqingli/master

update the description of the paper and fix #11116
......@@ -114,7 +114,7 @@ ECharts is available under the Apache License V2.
Please refer to [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html).
## Publication
## Paper
Deqing Li, Honghui Mei, Yi Shen, Shuang Su, Wenli Zhang, Junting Wang, Ming Zu, Wei Chen.
[ECharts: A Declarative Framework for Rapid Construction of Web-based Visualization](https://www.sciencedirect.com/science/article/pii/S2468502X18300068).
......
......@@ -1105,14 +1105,14 @@ listProto.indexOfName = function (name) {
* @return {number}
*/
listProto.indexOfRawIndex = function (rawIndex) {
if (!this._indices) {
return rawIndex;
}
if (rawIndex >= this._rawCount || rawIndex < 0) {
return -1;
}
if (!this._indices) {
return rawIndex;
}
// Indices are ascending
var indices = this._indices;
......
......@@ -84,28 +84,30 @@ describe('List', function () {
testCase('indexOfRawIndex', function (List) {
var list = new List(['x']);
list.initData([]);
expect(list.indexOfRawIndex(1)).toEqual(-1);
list.initData([0]);
expect(list.indexOfRawIndex(0)).toEqual(0);
expect(list.indexOfRawIndex(1)).toEqual(-1);
var list1 = new List(['x']);
list1.initData([0]);
expect(list1.indexOfRawIndex(0)).toEqual(0);
expect(list1.indexOfRawIndex(1)).toEqual(-1);
list.initData([0, 1, 2, 3]);
expect(list.indexOfRawIndex(1)).toEqual(1);
expect(list.indexOfRawIndex(2)).toEqual(2);
expect(list.indexOfRawIndex(5)).toEqual(-1);
var list2 = new List(['x']);
list2.initData([0, 1, 2, 3]);
expect(list2.indexOfRawIndex(1)).toEqual(1);
expect(list2.indexOfRawIndex(2)).toEqual(2);
expect(list2.indexOfRawIndex(5)).toEqual(-1);
list.initData([0, 1, 2, 3, 4]);
expect(list.indexOfRawIndex(2)).toEqual(2);
expect(list.indexOfRawIndex(3)).toEqual(3);
expect(list.indexOfRawIndex(5)).toEqual(-1);
var list3 = new List(['x']);
list3.initData([0, 1, 2, 3, 4]);
expect(list3.indexOfRawIndex(2)).toEqual(2);
expect(list3.indexOfRawIndex(3)).toEqual(3);
expect(list3.indexOfRawIndex(5)).toEqual(-1);
list.filterSelf(function (idx) {
list3.filterSelf(function (idx) {
return idx >= 2;
});
expect(list.indexOfRawIndex(2)).toEqual(0);
expect(list3.indexOfRawIndex(2)).toEqual(0);
});
testCase('getDataExtent', function (List) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册