Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Evgeny
c3-closed
Commits
e1a39c87
Commit
e1a39c87
authored
Feb 14, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
84d1ac0c
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
182 additions
and
209 deletions
+182
-209
.jshintrc
.jshintrc
+2
-0
api.data-spec.js
spec/api.data-spec.js
+1
-3
api.focus-spec.js
spec/api.focus-spec.js
+1
-3
api.grid-spec.js
spec/api.grid-spec.js
+12
-11
api.load-spec.js
spec/api.load-spec.js
+13
-12
api.zoom-spec.js
spec/api.zoom-spec.js
+18
-25
axis-spec.js
spec/axis-spec.js
+31
-26
c3-spec.js
spec/c3-spec.js
+0
-2
class-spec.js
spec/class-spec.js
+1
-3
core-spec.js
spec/core-spec.js
+1
-3
data-spec.js
spec/data-spec.js
+1
-3
domain-spec.js
spec/domain-spec.js
+1
-3
grid-spec.js
spec/grid-spec.js
+23
-22
interaction-spec.js
spec/interaction-spec.js
+1
-13
legend-spec.js
spec/legend-spec.js
+26
-27
shape.bar-spec.js
spec/shape.bar-spec.js
+18
-17
shape.line-spec.js
spec/shape.line-spec.js
+15
-14
tooltip-spec.js
spec/tooltip-spec.js
+1
-5
type-spec.js
spec/type-spec.js
+15
-14
zoom-spec.js
spec/zoom-spec.js
+1
-3
No files found.
.jshintrc
View file @
e1a39c87
...
@@ -19,8 +19,10 @@
...
@@ -19,8 +19,10 @@
"browser": true,
"browser": true,
"globals": {
"globals": {
"jasmine": false,
"describe": false,
"describe": false,
"beforeEach": false,
"beforeEach": false,
"beforeAll": false,
"it": false,
"it": false,
"expect": false,
"expect": false,
"d3": false
"d3": false
...
...
spec/api.data-spec.js
View file @
e1a39c87
describe
(
'c3 api data'
,
function
()
{
describe
(
'c3 api data'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -32,7 +31,6 @@ describe('c3 api data', function () {
...
@@ -32,7 +31,6 @@ describe('c3 api data', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'data()'
,
function
()
{
describe
(
'data()'
,
function
()
{
...
...
spec/api.focus-spec.js
View file @
e1a39c87
describe
(
'c3 api focus'
,
function
()
{
describe
(
'c3 api focus'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -16,7 +15,6 @@ describe('c3 api focus', function () {
...
@@ -16,7 +15,6 @@ describe('c3 api focus', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'focus'
,
function
()
{
describe
(
'focus'
,
function
()
{
...
...
spec/api.grid-spec.js
View file @
e1a39c87
describe
(
'c3 api grid'
,
function
()
{
describe
(
'c3 api grid'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
]
]
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'ygrid.add and ygrid.remove'
,
function
()
{
describe
(
'ygrid.add and ygrid.remove'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
]
]
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should update y grids'
,
function
(
done
)
{
it
(
'should update y grids'
,
function
(
done
)
{
var
main
=
chart
.
internal
.
main
,
var
main
=
chart
.
internal
.
main
,
expectedGrids
=
[
expectedGrids
=
[
...
...
spec/api.load-spec.js
View file @
e1a39c87
describe
(
'c3 api load'
,
function
()
{
describe
(
'c3 api load'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
5000
,
2000
,
1000
,
4000
,
1500
,
2500
]
]
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'indexed data'
,
function
()
{
describe
(
'indexed data'
,
function
()
{
describe
(
'as column'
,
function
()
{
describe
(
'as column'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
5000
,
2000
,
1000
,
4000
,
1500
,
2500
]
]
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should load additional data'
,
function
(
done
)
{
it
(
'should load additional data'
,
function
(
done
)
{
var
main
=
chart
.
internal
.
main
,
var
main
=
chart
.
internal
.
main
,
legend
=
chart
.
internal
.
legend
;
legend
=
chart
.
internal
.
legend
;
...
...
spec/api.zoom-spec.js
View file @
e1a39c87
describe
(
'c3 api zoom'
,
function
()
{
describe
(
'c3 api zoom'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
]
},
zoom
:
{
enabled
:
true
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
if
(
typeof
chart
===
'undefined'
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
window
.
initDom
();
}
chart
=
window
.
c3
.
generate
(
args
);
d3
=
chart
.
internal
.
d3
;
// chart.internal.d3.select('.jasmine_html-reporter').style('display', 'none');
window
.
setTimeout
(
function
()
{
done
();
},
10
);
});
});
describe
(
'zoom'
,
function
()
{
describe
(
'zoom'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
]
},
zoom
:
{
enabled
:
true
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should be zoomed properly'
,
function
()
{
it
(
'should be zoomed properly'
,
function
()
{
var
target
=
[
3
,
5
],
domain
;
var
target
=
[
3
,
5
],
domain
;
chart
.
zoom
(
target
);
chart
.
zoom
(
target
);
...
...
spec/axis-spec.js
View file @
e1a39c87
describe
(
'c3 chart axis'
,
function
()
{
describe
(
'c3 chart axis'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -30,16 +29,13 @@ describe('c3 chart axis', function () {
...
@@ -30,16 +29,13 @@ describe('c3 chart axis', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'axis.y.tick.count'
,
function
()
{
describe
(
'axis.y.tick.count'
,
function
()
{
var
i
=
1
;
it
(
'should update args to have only 1 tick on y axis'
,
function
()
{
args
.
axis
.
y
.
tick
.
count
=
1
;
beforeEach
(
function
()
{
expect
(
true
).
toBeTruthy
();
args
.
axis
.
y
.
tick
.
count
=
i
++
;
chart
=
window
.
c3
.
generate
(
args
);
});
});
it
(
'should have only 1 tick on y axis'
,
function
()
{
it
(
'should have only 1 tick on y axis'
,
function
()
{
...
@@ -47,11 +43,21 @@ describe('c3 chart axis', function () {
...
@@ -47,11 +43,21 @@ describe('c3 chart axis', function () {
expect
(
ticksSize
).
toBe
(
1
);
expect
(
ticksSize
).
toBe
(
1
);
});
});
it
(
'should update args to have 2 ticks on y axis'
,
function
()
{
args
.
axis
.
y
.
tick
.
count
=
2
;
expect
(
true
).
toBeTruthy
();
});
it
(
'should have 2 ticks on y axis'
,
function
()
{
it
(
'should have 2 ticks on y axis'
,
function
()
{
var
ticksSize
=
d3
.
select
(
'.c3-axis-y'
).
selectAll
(
'g.tick'
).
size
();
var
ticksSize
=
d3
.
select
(
'.c3-axis-y'
).
selectAll
(
'g.tick'
).
size
();
expect
(
ticksSize
).
toBe
(
2
);
expect
(
ticksSize
).
toBe
(
2
);
});
});
it
(
'should update args to have 3 ticks on y axis'
,
function
()
{
args
.
axis
.
y
.
tick
.
count
=
3
;
expect
(
true
).
toBeTruthy
();
});
it
(
'should have 3 ticks on y axis'
,
function
()
{
it
(
'should have 3 ticks on y axis'
,
function
()
{
var
ticksSize
=
d3
.
select
(
'.c3-axis-y'
).
selectAll
(
'g.tick'
).
size
();
var
ticksSize
=
d3
.
select
(
'.c3-axis-y'
).
selectAll
(
'g.tick'
).
size
();
expect
(
ticksSize
).
toBe
(
3
);
expect
(
ticksSize
).
toBe
(
3
);
...
@@ -63,9 +69,9 @@ describe('c3 chart axis', function () {
...
@@ -63,9 +69,9 @@ describe('c3 chart axis', function () {
var
values
=
[
100
,
500
];
var
values
=
[
100
,
500
];
beforeEach
(
function
()
{
it
(
'should update args to have only 2 ticks on y axis'
,
function
()
{
args
.
axis
.
y
.
tick
.
values
=
values
;
args
.
axis
.
y
.
tick
.
values
=
values
;
chart
=
window
.
c3
.
generate
(
args
);
expect
(
true
).
toBeTruthy
(
);
});
});
it
(
'should have only 2 tick on y axis'
,
function
()
{
it
(
'should have only 2 tick on y axis'
,
function
()
{
...
@@ -84,25 +90,24 @@ describe('c3 chart axis', function () {
...
@@ -84,25 +90,24 @@ describe('c3 chart axis', function () {
describe
(
'axis y timeseries'
,
function
()
{
describe
(
'axis y timeseries'
,
function
()
{
var
args
=
{
it
(
'should update args'
,
function
()
{
data
:
{
args
=
{
columns
:
[
data
:
{
[
"times"
,
60000
,
120000
,
180000
,
240000
]
columns
:
[
]
[
"times"
,
60000
,
120000
,
180000
,
240000
]
},
]
axis
:
{
},
y
:
{
axis
:
{
type
:
'timeseries'
,
y
:
{
tick
:
{
type
:
'timeseries'
,
time
:
{
tick
:
{
time
:
{
}
}
}
}
}
}
}
}
};
};
expect
(
true
).
toBeTruthy
();
beforeEach
(
function
()
{
chart
=
window
.
c3
.
generate
(
args
);
});
});
it
(
'should have 7 ticks on y axis'
,
function
()
{
it
(
'should have 7 ticks on y axis'
,
function
()
{
...
...
spec/c3-spec.js
View file @
e1a39c87
describe
(
'c3'
,
function
()
{
describe
(
'c3'
,
function
()
{
'use strict'
;
'use strict'
;
...
@@ -9,4 +8,3 @@ describe('c3', function () {
...
@@ -9,4 +8,3 @@ describe('c3', function () {
expect
(
typeof
c3
).
toBe
(
'object'
);
expect
(
typeof
c3
).
toBe
(
'object'
);
});
});
});
});
spec/class-spec.js
View file @
e1a39c87
describe
(
'c3 chart class'
,
function
()
{
describe
(
'c3 chart class'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -16,7 +15,6 @@ describe('c3 chart class', function () {
...
@@ -16,7 +15,6 @@ describe('c3 chart class', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'internal.getTargetSelectorSuffix'
,
function
()
{
describe
(
'internal.getTargetSelectorSuffix'
,
function
()
{
...
...
spec/core-spec.js
View file @
e1a39c87
describe
(
'c3 chart'
,
function
()
{
describe
(
'c3 chart'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -16,7 +15,6 @@ describe('c3 chart', function () {
...
@@ -16,7 +15,6 @@ describe('c3 chart', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'init'
,
function
()
{
describe
(
'init'
,
function
()
{
...
...
spec/data-spec.js
View file @
e1a39c87
describe
(
'c3 chart data'
,
function
()
{
describe
(
'c3 chart data'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -19,7 +18,6 @@ describe('c3 chart data', function () {
...
@@ -19,7 +18,6 @@ describe('c3 chart data', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'function in data.order'
,
function
()
{
describe
(
'function in data.order'
,
function
()
{
...
...
spec/domain-spec.js
View file @
e1a39c87
describe
(
'c3 chart domain'
,
function
()
{
describe
(
'c3 chart domain'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -19,7 +18,6 @@ describe('c3 chart domain', function () {
...
@@ -19,7 +18,6 @@ describe('c3 chart domain', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'axis.y.min'
,
function
()
{
describe
(
'axis.y.min'
,
function
()
{
...
...
spec/grid-spec.js
View file @
e1a39c87
describe
(
'c3 chart grid'
,
function
()
{
describe
(
'c3 chart grid'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
]
]
},
axis
:
{
y
:
{
tick
:
{
}
}
},
grid
:
{
y
:
{
show
:
false
}
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'y grid'
,
function
()
{
describe
(
'y grid'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
]
]
},
axis
:
{
y
:
{
tick
:
{
}
}
},
grid
:
{
y
:
{
show
:
false
}
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should not show y grids'
,
function
()
{
it
(
'should not show y grids'
,
function
()
{
expect
(
chart
.
internal
.
main
.
select
(
'.c3-ygrids'
).
size
()).
toBe
(
0
);
expect
(
chart
.
internal
.
main
.
select
(
'.c3-ygrids'
).
size
()).
toBe
(
0
);
});
});
...
...
spec/interaction-spec.js
View file @
e1a39c87
describe
(
'c3 chart interaction'
,
function
()
{
describe
(
'c3 chart interaction'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
]
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'generate event rects'
,
function
()
{
describe
(
'generate event rects'
,
function
()
{
...
...
spec/legend-spec.js
View file @
e1a39c87
describe
(
'c3 chart legend'
,
function
()
{
describe
(
'c3 chart legend'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
]
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
if
(
typeof
chart
===
'undefined'
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
window
.
initDom
();
}
chart
=
window
.
c3
.
generate
(
args
);
d3
=
chart
.
internal
.
d3
;
chart
.
internal
.
d3
.
select
(
'.jasmine_html-reporter'
)
.
style
(
'position'
,
'absolute'
)
.
style
(
'right'
,
0
);
window
.
setTimeout
(
function
()
{
done
();
},
10
);
});
});
describe
(
'legend position'
,
function
()
{
describe
(
'legend position'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
]
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should be located on the center of chart'
,
function
()
{
it
(
'should be located on the center of chart'
,
function
()
{
var
box
=
chart
.
internal
.
legend
.
node
().
getBoundingClientRect
();
var
box
=
chart
.
internal
.
legend
.
node
().
getBoundingClientRect
();
expect
(
box
.
left
+
box
.
right
).
toBe
(
640
);
expect
(
box
.
left
+
box
.
right
).
toBe
(
640
);
...
@@ -40,10 +31,18 @@ describe('c3 chart legend', function () {
...
@@ -40,10 +31,18 @@ describe('c3 chart legend', function () {
describe
(
'legend as inset'
,
function
()
{
describe
(
'legend as inset'
,
function
()
{
it
(
'should change the legend to "inset" successfully'
,
function
()
{
it
(
'should change the legend to "inset" successfully'
,
function
()
{
args
.
legend
=
{
args
=
{
position
:
'inset'
,
data
:
{
inset
:
{
columns
:
[
step
:
null
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
]
},
legend
:
{
position
:
'inset'
,
inset
:
{
step
:
null
}
}
}
};
};
expect
(
true
).
toBeTruthy
();
expect
(
true
).
toBeTruthy
();
...
...
spec/shape.bar-spec.js
View file @
e1a39c87
var
setMouseEvent
=
window
.
setMouseEvent
;
var
setMouseEvent
=
window
.
setMouseEvent
;
describe
(
'c3 chart shape bar'
,
function
()
{
describe
(
'c3 chart shape bar'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'bar'
},
axis
:
{
rotated
:
false
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'internal.isWithinBar'
,
function
()
{
describe
(
'internal.isWithinBar'
,
function
()
{
describe
(
'with normal axis'
,
function
()
{
describe
(
'with normal axis'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'bar'
},
axis
:
{
rotated
:
false
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should not be within bar'
,
function
()
{
it
(
'should not be within bar'
,
function
()
{
var
bar
=
d3
.
select
(
'.c3-target-data1 .c3-bar-0'
).
node
();
var
bar
=
d3
.
select
(
'.c3-target-data1 .c3-bar-0'
).
node
();
setMouseEvent
(
chart
,
'click'
,
0
,
0
);
setMouseEvent
(
chart
,
'click'
,
0
,
0
);
...
...
spec/shape.line-spec.js
View file @
e1a39c87
describe
(
'c3 chart shape line'
,
function
()
{
describe
(
'c3 chart shape line'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'line'
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'shape-rendering for line chart'
,
function
()
{
describe
(
'shape-rendering for line chart'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'line'
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
"should not have shape-rendering when it's line chart"
,
function
()
{
it
(
"should not have shape-rendering when it's line chart"
,
function
()
{
d3
.
selectAll
(
'.c3-line'
).
each
(
function
()
{
d3
.
selectAll
(
'.c3-line'
).
each
(
function
()
{
var
style
=
d3
.
select
(
this
).
style
(
'shape-rendering'
);
var
style
=
d3
.
select
(
this
).
style
(
'shape-rendering'
);
...
...
spec/tooltip-spec.js
View file @
e1a39c87
var
jasmine
=
window
.
jasmine
,
beforeAll
=
window
.
beforeAll
;
describe
(
'c3 chart tooltip'
,
function
()
{
describe
(
'c3 chart tooltip'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
tooltipConfiguration
;
var
tooltipConfiguration
;
var
args
=
function
()
{
var
args
=
function
()
{
...
@@ -22,7 +19,6 @@ describe('c3 chart tooltip', function () {
...
@@ -22,7 +19,6 @@ describe('c3 chart tooltip', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
(),
done
);
chart
=
window
.
initChart
(
chart
,
args
(),
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'tooltip position'
,
function
()
{
describe
(
'tooltip position'
,
function
()
{
...
...
spec/type-spec.js
View file @
e1a39c87
describe
(
'c3 chart types'
,
function
()
{
describe
(
'c3 chart types'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
,
args
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'pie'
}
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'internal.hasArcType'
,
function
()
{
describe
(
'internal.hasArcType'
,
function
()
{
describe
(
'with data'
,
function
()
{
describe
(
'with data'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'pie'
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should return true'
,
function
()
{
it
(
'should return true'
,
function
()
{
expect
(
chart
.
internal
.
hasArcType
()).
toBeTruthy
();
expect
(
chart
.
internal
.
hasArcType
()).
toBeTruthy
();
});
});
...
...
spec/zoom-spec.js
View file @
e1a39c87
describe
(
'c3 chart zoom'
,
function
()
{
describe
(
'c3 chart zoom'
,
function
()
{
'use strict'
;
'use strict'
;
var
chart
,
d3
;
var
chart
;
var
args
=
{
var
args
=
{
data
:
{
data
:
{
...
@@ -26,7 +25,6 @@ describe('c3 chart zoom', function () {
...
@@ -26,7 +25,6 @@ describe('c3 chart zoom', function () {
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
});
describe
(
'default extent'
,
function
()
{
describe
(
'default extent'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment