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
8cfd52d8
Commit
8cfd52d8
authored
May 01, 2014
by
Brandon Bernal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the areaOnSub IIFE. Implemented it on the subchart.
parent
d17e6291
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
c3.js
c3.js
+50
-3
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
8cfd52d8
...
...
@@ -2221,7 +2221,7 @@
isSplineType
(
d
)
?
area
.
interpolate
(
"cardinal"
)
:
area
.
interpolate
(
"linear"
);
return
area
(
data
);
}
else
if
(
hasType
([
d
],
'area-step'
))
{
isStepType
(
d
)
?
area
.
interpolate
(
"step-after"
)
:
''
;
isStepType
(
d
)
?
area
.
interpolate
(
"step-after"
)
:
area
.
interpolate
(
"linear"
)
;
return
area
(
data
);
}
else
{
x0
=
x
(
data
[
0
].
x
);
...
...
@@ -2401,7 +2401,34 @@
.
y
(
__axis_rotated
?
subxx
:
function
(
d
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
);
return
isLineType
(
d
)
?
line
(
data
)
:
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
if
(
isLineType
(
d
))
{
return
line
(
data
);
}
else
if
(
isStepType
(
d
))
{
line
.
interpolate
(
"step-after"
);
return
line
(
data
);
}
else
{
return
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
}
};
})();
var
areaOnSub
=
(
function
()
{
var
area
=
d3
.
svg
.
area
()
.
x
(
xx
)
.
y0
(
function
(
d
,
i
)
{
return
getSubYScale
(
d
.
id
)(
0
);
})
.
y1
(
function
(
d
,
i
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
),
x0
,
y0
;
if
(
hasType
([
d
],
'area'
)
||
hasType
([
d
],
'area-spline'
))
{
isSplineType
(
d
)
?
area
.
interpolate
(
"cardinal"
)
:
area
.
interpolate
(
"linear"
);
return
area
(
data
);
}
else
if
(
hasType
([
d
],
'area-step'
))
{
isStepType
(
d
)
?
area
.
interpolate
(
"step-after"
)
:
area
.
interpolate
(
"linear"
);
return
area
(
data
);
}
else
{
x0
=
subX
(
data
[
0
].
x
);
y0
=
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
return
__axis_rotated
?
"M "
+
y0
+
" "
+
x0
:
"M "
+
x0
+
" "
+
y0
;
}
};
})();
...
...
@@ -3328,12 +3355,14 @@
// .attr("d", lineOnMain)
.
attr
(
"d"
,
drawLine
)
.
style
(
"opacity"
,
1
);
// steps
main
.
selectAll
(
'.'
+
CLASS
.
step
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
// .attr("d", lineOnMain)
.
attr
(
"d"
,
drawLine
)
.
style
(
"opacity"
,
1
);
// area
main
.
selectAll
(
'.'
+
CLASS
.
area
)
.
style
(
"opacity"
,
0
)
.
transition
().
duration
(
duration
)
...
...
@@ -3425,11 +3454,18 @@
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
lineOnSub
)
.
style
(
'opacity'
,
1
);
// steps
context
.
selectAll
(
'.'
+
CLASS
.
step
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
lineOnSub
)
.
style
(
'opacity'
,
1
);
// area
context
.
selectAll
(
'.'
+
CLASS
.
area
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
areaOnSub
)
.
style
(
'opacity'
,
orgAreaOpacity
);
}
}
...
...
@@ -3623,6 +3659,7 @@
.
attr
(
"class"
,
classLine
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Steps
mainLineEnter
.
append
(
"path"
)
.
attr
(
'class'
,
classStep
)
.
style
(
"opacity"
,
0
)
...
...
@@ -3630,7 +3667,7 @@
// Areas
mainLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classArea
)
.
style
(
"opacity"
,
function
()
{
orgAreaOpacity
=
(
__color_opacity
)
?
__color_opacity
:
1
;
return
0
;
})
//+d3.select(this).style('opacity'); return 0; })
.
style
(
"opacity"
,
function
()
{
orgAreaOpacity
=
(
__color_opacity
)
?
__color_opacity
:
1
;
return
orgAreaOpacity
;
})
//+d3.select(this).style('opacity'); return 0; })
.
style
(
"fill"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Circles for each data point on lines
mainLineEnter
.
append
(
'g'
)
...
...
@@ -3713,7 +3750,17 @@
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classLine
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
})
// Steps
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classStep
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Area
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classArea
)
.
style
(
"opacity"
,
orgAreaOpacity
)
.
style
(
"fill"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
}
/*-- Show --*/
...
...
c3.min.js
View file @
8cfd52d8
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