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
c76c8927
Commit
c76c8927
authored
Nov 04, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply clip path to subchart - #448
parent
b52fdaee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
c3.js
c3.js
+9
-2
c3.min.js
c3.min.js
+0
-0
core.js
src/core.js
+8
-1
subchart.js
src/subchart.js
+1
-1
No files found.
c3.js
View file @
c76c8927
...
...
@@ -77,10 +77,12 @@
$$
.
clipIdForXAxis
=
$$
.
clipId
+
'-xaxis'
,
$$
.
clipIdForYAxis
=
$$
.
clipId
+
'-yaxis'
,
$$
.
clipIdForGrid
=
$$
.
clipId
+
'-grid'
,
$$
.
clipIdForSubchart
=
$$
.
clipId
+
'-subchart'
,
$$
.
clipPath
=
$$
.
getClipPath
(
$$
.
clipId
),
$$
.
clipPathForXAxis
=
$$
.
getClipPath
(
$$
.
clipIdForXAxis
),
$$
.
clipPathForYAxis
=
$$
.
getClipPath
(
$$
.
clipIdForYAxis
);
$$
.
clipPathForGrid
=
$$
.
getClipPath
(
$$
.
clipIdForGrid
),
$$
.
clipPathForSubchart
=
$$
.
getClipPath
(
$$
.
clipIdForSubchart
),
$$
.
dragStart
=
null
;
$$
.
dragging
=
false
;
...
...
@@ -206,6 +208,7 @@
$$
.
clipXAxis
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForXAxis
);
$$
.
clipYAxis
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForYAxis
);
$$
.
clipGrid
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForGrid
);
$$
.
clipSubchart
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForSubchart
);
$$
.
updateSvgSize
();
// Define regions
...
...
@@ -751,7 +754,8 @@
};
c3_chart_internal_fn
.
updateSvgSize
=
function
()
{
var
$$
=
this
;
var
$$
=
this
,
brush
=
$$
.
svg
.
select
(
".c3-brush .background"
);
$$
.
svg
.
attr
(
'width'
,
$$
.
currentWidth
).
attr
(
'height'
,
$$
.
currentHeight
);
$$
.
svg
.
selectAll
([
'#'
+
$$
.
clipId
,
'#'
+
$$
.
clipIdForGrid
]).
select
(
'rect'
)
.
attr
(
'width'
,
$$
.
width
)
...
...
@@ -766,6 +770,9 @@
.
attr
(
'y'
,
$$
.
getYAxisClipY
.
bind
(
$$
))
.
attr
(
'width'
,
$$
.
getYAxisClipWidth
.
bind
(
$$
))
.
attr
(
'height'
,
$$
.
getYAxisClipHeight
.
bind
(
$$
));
$$
.
svg
.
select
(
'#'
+
$$
.
clipIdForSubchart
).
select
(
'rect'
)
.
attr
(
'width'
,
$$
.
width
)
.
attr
(
'height'
,
brush
.
size
()
?
brush
.
attr
(
'height'
)
:
0
);
$$
.
svg
.
select
(
'.'
+
CLASS
.
zoomRect
)
.
attr
(
'width'
,
$$
.
width
)
.
attr
(
'height'
,
$$
.
height
);
...
...
@@ -4946,7 +4953,7 @@
// Define g for chart area
context
.
append
(
'g'
)
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
"clip-path"
,
$$
.
clipPath
ForSubchart
)
.
attr
(
'class'
,
CLASS
.
chart
);
// Define g for bar chart area
...
...
c3.min.js
View file @
c76c8927
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/core.js
View file @
c76c8927
...
...
@@ -72,10 +72,12 @@ c3_chart_internal_fn.initParams = function () {
$$
.
clipIdForXAxis
=
$$
.
clipId
+
'-xaxis'
,
$$
.
clipIdForYAxis
=
$$
.
clipId
+
'-yaxis'
,
$$
.
clipIdForGrid
=
$$
.
clipId
+
'-grid'
,
$$
.
clipIdForSubchart
=
$$
.
clipId
+
'-subchart'
,
$$
.
clipPath
=
$$
.
getClipPath
(
$$
.
clipId
),
$$
.
clipPathForXAxis
=
$$
.
getClipPath
(
$$
.
clipIdForXAxis
),
$$
.
clipPathForYAxis
=
$$
.
getClipPath
(
$$
.
clipIdForYAxis
);
$$
.
clipPathForGrid
=
$$
.
getClipPath
(
$$
.
clipIdForGrid
),
$$
.
clipPathForSubchart
=
$$
.
getClipPath
(
$$
.
clipIdForSubchart
),
$$
.
dragStart
=
null
;
$$
.
dragging
=
false
;
...
...
@@ -201,6 +203,7 @@ c3_chart_internal_fn.initWithData = function (data) {
$$
.
clipXAxis
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForXAxis
);
$$
.
clipYAxis
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForYAxis
);
$$
.
clipGrid
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForGrid
);
$$
.
clipSubchart
=
$$
.
appendClip
(
defs
,
$$
.
clipIdForSubchart
);
$$
.
updateSvgSize
();
// Define regions
...
...
@@ -746,7 +749,8 @@ c3_chart_internal_fn.transformAll = function (withTransition, transitions) {
};
c3_chart_internal_fn
.
updateSvgSize
=
function
()
{
var
$$
=
this
;
var
$$
=
this
,
brush
=
$$
.
svg
.
select
(
".c3-brush .background"
);
$$
.
svg
.
attr
(
'width'
,
$$
.
currentWidth
).
attr
(
'height'
,
$$
.
currentHeight
);
$$
.
svg
.
selectAll
([
'#'
+
$$
.
clipId
,
'#'
+
$$
.
clipIdForGrid
]).
select
(
'rect'
)
.
attr
(
'width'
,
$$
.
width
)
...
...
@@ -761,6 +765,9 @@ c3_chart_internal_fn.updateSvgSize = function () {
.
attr
(
'y'
,
$$
.
getYAxisClipY
.
bind
(
$$
))
.
attr
(
'width'
,
$$
.
getYAxisClipWidth
.
bind
(
$$
))
.
attr
(
'height'
,
$$
.
getYAxisClipHeight
.
bind
(
$$
));
$$
.
svg
.
select
(
'#'
+
$$
.
clipIdForSubchart
).
select
(
'rect'
)
.
attr
(
'width'
,
$$
.
width
)
.
attr
(
'height'
,
brush
.
size
()
?
brush
.
attr
(
'height'
)
:
0
);
$$
.
svg
.
select
(
'.'
+
CLASS
.
zoomRect
)
.
attr
(
'width'
,
$$
.
width
)
.
attr
(
'height'
,
$$
.
height
);
...
...
src/subchart.js
View file @
c76c8927
...
...
@@ -19,7 +19,7 @@ c3_chart_internal_fn.initSubchart = function () {
// Define g for chart area
context
.
append
(
'g'
)
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
"clip-path"
,
$$
.
clipPath
ForSubchart
)
.
attr
(
'class'
,
CLASS
.
chart
);
// Define g for bar chart area
...
...
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