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
charts
c3-closed
Commits
dadee826
Commit
dadee826
authored
May 22, 2014
by
Brandon Bernal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Errors reported by Travis CI, 3rd pass.
parent
1c30d078
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
60 deletions
+64
-60
c3.js
c3.js
+64
-60
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
dadee826
...
@@ -997,7 +997,7 @@
...
@@ -997,7 +997,7 @@
if
(
isGaugeType
(
d
.
data
))
{
if
(
isGaugeType
(
d
.
data
))
{
var
sA
=
d
.
startAngle
,
eA
=
d
.
endAngle
;
var
sA
=
d
.
startAngle
,
eA
=
d
.
endAngle
;
var
gMin
=
__gauge_min
,
gMax
=
__gauge_max
,
var
gMin
=
__gauge_min
,
gMax
=
__gauge_max
,
gF
=
Math
.
abs
(
gMin
)
+
gMax
,
fA
=
Math
.
abs
(
sA
)
+
eA
,
gF
=
Math
.
abs
(
gMin
)
+
gMax
,
aTic
=
(
Math
.
PI
)
/
gF
;
aTic
=
(
Math
.
PI
)
/
gF
;
d
.
startAngle
=
(
-
1
*
(
Math
.
PI
/
2
))
+
(
aTic
*
Math
.
abs
(
gMin
));
d
.
startAngle
=
(
-
1
*
(
Math
.
PI
/
2
))
+
(
aTic
*
Math
.
abs
(
gMin
));
d
.
endAngle
=
d
.
startAngle
+
(
aTic
*
((
d
.
value
>
gMax
)
?
gMax
:
d
.
value
));
d
.
endAngle
=
d
.
startAngle
+
(
aTic
*
((
d
.
value
>
gMax
)
?
gMax
:
d
.
value
));
...
@@ -2446,8 +2446,8 @@
...
@@ -2446,8 +2446,8 @@
if
(
__axis_rotated
)
{
if
(
__axis_rotated
)
{
area
=
d3
.
svg
.
area
()
area
=
d3
.
svg
.
area
()
.
x0
(
function
(
d
,
i
)
{
return
yScaleGetter
(
d
.
id
)(
0
);
})
.
x0
(
function
(
d
)
{
return
yScaleGetter
(
d
.
id
)(
0
);
})
.
x1
(
function
(
d
,
i
)
{
return
yScaleGetter
(
d
.
id
)(
d
.
value
);
})
.
x1
(
function
(
d
)
{
return
yScaleGetter
(
d
.
id
)(
d
.
value
);
})
.
y
(
xx
);
.
y
(
xx
);
}
else
{
}
else
{
area
=
d3
.
svg
.
area
()
area
=
d3
.
svg
.
area
()
...
@@ -2456,7 +2456,7 @@
...
@@ -2456,7 +2456,7 @@
.
y1
(
function
(
d
,
i
)
{
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
1
][
1
];
}
return
yScaleGetter
(
d
.
id
)(
d
.
value
);
});
.
y1
(
function
(
d
,
i
)
{
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
1
][
1
];
}
return
yScaleGetter
(
d
.
id
)(
d
.
value
);
});
}
}
return
function
(
d
,
i
)
{
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
),
x0
,
y0
;
var
data
=
filterRemoveNull
(
d
.
values
),
x0
,
y0
;
if
(
hasType
([
d
],
'area'
)
||
hasType
([
d
],
'area-spline'
))
{
if
(
hasType
([
d
],
'area'
)
||
hasType
([
d
],
'area-spline'
))
{
...
@@ -2556,19 +2556,19 @@
...
@@ -2556,19 +2556,19 @@
areaOffset
=
getAreaOffset
(
areaIndices
,
!!
isSub
),
areaOffset
=
getAreaOffset
(
areaIndices
,
!!
isSub
),
yScale
=
isSub
?
getSubYScale
:
getYScale
;
yScale
=
isSub
?
getSubYScale
:
getYScale
;
return
function
(
d
,
i
)
{
return
function
(
d
,
i
)
{
var
y0
=
yScale
(
d
.
id
)(
0
),
var
y0
=
yScale
(
d
.
id
)(
0
),
offset
=
areaOffset
(
d
,
i
)
||
y0
,
// offset is for stacked area chart
offset
=
areaOffset
(
d
,
i
)
||
y0
,
// offset is for stacked area chart
posX
=
x
(
d
),
posY
=
y
(
d
);
posX
=
x
(
d
),
posY
=
y
(
d
);
// fix posY not to overflow opposite quadrant
// fix posY not to overflow opposite quadrant
if
(
__axis_rotated
)
{
if
(
__axis_rotated
)
{
if
((
d
.
value
>
0
&&
posY
<
offset
)
||
(
d
.
value
<
0
&&
posY
>
offset
))
{
posY
=
offset
;
}
if
((
d
.
value
>
0
&&
posY
<
offset
)
||
(
d
.
value
<
0
&&
posY
>
offset
))
{
posY
=
offset
;
}
}
}
// 1 point that marks the area position
// 1 point that marks the area position
return
[
return
[
[
posX
,
offset
],
[
posX
,
offset
],
[
posX
,
posY
-
(
y0
-
offset
)]
[
posX
,
posY
-
(
y0
-
offset
)]
];
];
};
};
}
}
function
generateGetBarPoints
(
barIndices
,
isSub
)
{
function
generateGetBarPoints
(
barIndices
,
isSub
)
{
...
@@ -2603,18 +2603,18 @@
...
@@ -2603,18 +2603,18 @@
lineOffset
=
getLineOffset
(
lineIndices
,
!!
isSub
),
lineOffset
=
getLineOffset
(
lineIndices
,
!!
isSub
),
yScale
=
isSub
?
getSubYScale
:
getYScale
;
yScale
=
isSub
?
getSubYScale
:
getYScale
;
return
function
(
d
,
i
)
{
return
function
(
d
,
i
)
{
var
y0
=
yScale
(
d
.
id
)(
0
),
var
y0
=
yScale
(
d
.
id
)(
0
),
offset
=
lineOffset
(
d
,
i
)
||
y0
,
// offset is for stacked area chart
offset
=
lineOffset
(
d
,
i
)
||
y0
,
// offset is for stacked area chart
posX
=
x
(
d
),
posY
=
y
(
d
);
posX
=
x
(
d
),
posY
=
y
(
d
);
// fix posY not to overflow opposite quadrant
// fix posY not to overflow opposite quadrant
if
(
__axis_rotated
)
{
if
(
__axis_rotated
)
{
if
((
d
.
value
>
0
&&
posY
<
offset
)
||
(
d
.
value
<
0
&&
posY
>
offset
))
{
posY
=
offset
;
}
if
((
d
.
value
>
0
&&
posY
<
offset
)
||
(
d
.
value
<
0
&&
posY
>
offset
))
{
posY
=
offset
;
}
}
}
// 1 point that marks the line position
// 1 point that marks the line position
return
[
return
[
[
posX
,
posY
-
(
y0
-
offset
)]
[
posX
,
posY
-
(
y0
-
offset
)]
];
];
};
};
}
}
function
lineWithRegions
(
d
,
x
,
y
,
_regions
)
{
function
lineWithRegions
(
d
,
x
,
y
,
_regions
)
{
...
@@ -3729,14 +3729,14 @@
...
@@ -3729,14 +3729,14 @@
.
style
(
"cursor"
,
"pointer"
)
.
style
(
"cursor"
,
"pointer"
)
.
attr
(
"transform"
,
"scale(1,1)"
)
.
attr
(
"transform"
,
"scale(1,1)"
)
.
attr
(
"d"
,
function
(
d
)
{
.
attr
(
"d"
,
function
(
d
)
{
d
.
value
=
__gauge_max
;
d
.
value
=
__gauge_max
;
d
.
startAngle
=
-
1
*
(
Math
.
PI
/
2
);
d
.
startAngle
=
-
1
*
(
Math
.
PI
/
2
);
d
.
endAngle
=
Math
.
PI
/
2
;
d
.
endAngle
=
Math
.
PI
/
2
;
return
getArc
(
d
,
true
);
return
getArc
(
d
,
true
);
});
});
mainArc
.
exit
().
transition
().
duration
(
durationForExit
)
mainArc
.
exit
().
transition
().
duration
(
durationForExit
)
.
style
(
'opacity'
,
0
)
.
style
(
'opacity'
,
0
)
.
remove
();
.
remove
();
}
}
mainArc
.
enter
().
append
(
'path'
)
mainArc
.
enter
().
append
(
'path'
)
.
attr
(
"class"
,
classArc
)
.
attr
(
"class"
,
classArc
)
...
@@ -3798,13 +3798,17 @@
...
@@ -3798,13 +3798,17 @@
};
};
}
}
*/
*/
if
(
isNaN
(
this
.
_current
.
endAngle
))
this
.
_current
.
endAngle
=
this
.
_current
.
startAngle
;
if
(
isNaN
(
this
.
_current
.
endAngle
))
{
this
.
_current
.
endAngle
=
this
.
_current
.
startAngle
;
}
interpolate
=
d3
.
interpolate
(
this
.
_current
,
updated
);
interpolate
=
d3
.
interpolate
(
this
.
_current
,
updated
);
this
.
_current
=
interpolate
(
0
);
this
.
_current
=
interpolate
(
0
);
return
function
(
t
)
{
return
getArc
(
interpolate
(
t
),
true
);
};
return
function
(
t
)
{
return
getArc
(
interpolate
(
t
),
true
);
};
})
})
.
attr
(
"transform"
,
withTransform
?
"scale(1)"
:
""
)
.
attr
(
"transform"
,
withTransform
?
"scale(1)"
:
""
)
.
style
(
"fill"
,
function
(
d
)
{
return
(
__gauge_style
===
'arc'
&&
__color_values
)
?
levelColor
(
d
.
data
.
values
[
0
].
value
)
:
color
(
d
.
data
.
id
);
})
// Where gauge reading color would receive customization.//color(d.data); })
.
style
(
"fill"
,
function
(
d
)
{
return
(
__gauge_style
===
'arc'
&&
__color_values
)
?
levelColor
(
d
.
data
.
values
[
0
].
value
)
:
color
(
d
.
data
.
id
);
})
// Where gauge reading color would receive customization.
.
style
(
"opacity"
,
(
__color_opacity
)
?
__color_opacity
:
1
)
.
style
(
"opacity"
,
(
__color_opacity
)
?
__color_opacity
:
1
)
.
call
(
endall
,
function
()
{
.
call
(
endall
,
function
()
{
transiting
=
false
;
transiting
=
false
;
...
@@ -3819,24 +3823,24 @@
...
@@ -3819,24 +3823,24 @@
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
if
(
__gauge_style
===
"arc"
)
{
if
(
__gauge_style
===
"arc"
)
{
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.units'
)
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.units'
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
text
((
__gauge_label_show
)
?
__gauge_units
:
''
)
.
text
((
__gauge_label_show
)
?
__gauge_units
:
''
)
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.min'
)
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.min'
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
text
((
__gauge_label_show
)
?
__gauge_min
:
''
)
.
text
((
__gauge_label_show
)
?
__gauge_min
:
''
)
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.max'
)
main
.
selectAll
(
'.'
+
CLASS
.
chartArc
).
select
(
'text.max'
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
attr
(
"transform"
,
transformForArcLabel
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
text
((
__gauge_label_show
)
?
__gauge_max
:
''
)
.
text
((
__gauge_label_show
)
?
__gauge_max
:
''
)
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
.
style
(
"opacity"
,
function
(
d
)
{
return
isTargetToShow
(
d
.
data
.
id
)
&&
isArcType
(
d
.
data
)
?
1
:
0
;
});
}
}
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
.
style
(
"opacity"
,
hasDonutType
(
c3
.
data
.
targets
)
||
hasGaugeType
(
c3
.
data
.
targets
)
?
1
:
0
);
.
style
(
"opacity"
,
hasDonutType
(
c3
.
data
.
targets
)
||
hasGaugeType
(
c3
.
data
.
targets
)
?
1
:
0
);
...
@@ -4192,7 +4196,7 @@
...
@@ -4192,7 +4196,7 @@
.
style
(
'fill'
,
'#000'
)
.
style
(
'fill'
,
'#000'
)
.
style
(
"font-size"
,
width
/
15
+
"px"
);
.
style
(
"font-size"
,
width
/
15
+
"px"
);
mainPieEnter
.
append
(
"text"
)
mainPieEnter
.
append
(
"text"
)
.
attr
(
"dx"
,
-
1
*
(
innerRadius
+
((
radius
-
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dx"
,
-
1
*
(
innerRadius
+
((
radius
-
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dy"
,
"1em"
)
.
attr
(
"dy"
,
"1em"
)
.
attr
(
"class"
,
"min"
)
.
attr
(
"class"
,
"min"
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
...
@@ -4201,7 +4205,7 @@
...
@@ -4201,7 +4205,7 @@
.
style
(
'fill'
,
'#777'
)
.
style
(
'fill'
,
'#777'
)
.
style
(
"font-size"
,
width
/
20
+
"px"
);
.
style
(
"font-size"
,
width
/
20
+
"px"
);
mainPieEnter
.
append
(
"text"
)
mainPieEnter
.
append
(
"text"
)
.
attr
(
"dx"
,
innerRadius
+
((
radius
-
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dx"
,
innerRadius
+
((
radius
-
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dy"
,
"1em"
)
.
attr
(
"dy"
,
"1em"
)
.
attr
(
"class"
,
"max"
)
.
attr
(
"class"
,
"max"
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
...
@@ -5049,7 +5053,7 @@
...
@@ -5049,7 +5053,7 @@
}
}
function
generateTicks
(
scale
)
{
function
generateTicks
(
scale
)
{
var
i
,
domain
,
ticks
=
[];
var
i
,
domain
,
ticks
=
[];
if
(
scale
.
ticks
&&
tickArguments
!=
undefined
)
{
if
(
scale
.
ticks
&&
tickArguments
!=
=
undefined
)
{
return
scale
.
ticks
.
apply
(
scale
,
tickArguments
);
return
scale
.
ticks
.
apply
(
scale
,
tickArguments
);
}
}
domain
=
scale
.
domain
();
domain
=
scale
.
domain
();
...
...
c3.min.js
View file @
dadee826
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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