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
a2137e8a
Commit
a2137e8a
authored
Feb 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix page scroll when mouse on chart - #42
parent
f73bebc1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
c3.js
c3.js
+21
-16
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
a2137e8a
...
@@ -1435,10 +1435,9 @@
...
@@ -1435,10 +1435,9 @@
//-- Define brush/zoom -//
//-- Define brush/zoom -//
var
brush
=
d3
.
svg
.
brush
().
on
(
"brush"
,
redrawForBrush
);
var
brush
,
zoom
=
function
()
{};
var
zoom
=
d3
.
behavior
.
zoom
().
on
(
"zoomstart"
,
function
()
{
zoom
.
altDomain
=
d3
.
event
.
sourceEvent
.
altKey
?
x
.
orgDomain
()
:
null
;
}).
on
(
"zoom"
,
__zoom_enabled
?
redrawForZoom
:
null
);
// define functions for c3
brush
=
d3
.
svg
.
brush
().
on
(
"brush"
,
redrawForBrush
);
brush
.
update
=
function
()
{
brush
.
update
=
function
()
{
if
(
context
)
{
context
.
select
(
'.x.brush'
).
call
(
this
);
}
if
(
context
)
{
context
.
select
(
'.x.brush'
).
call
(
this
);
}
return
this
;
return
this
;
...
@@ -1446,18 +1445,24 @@
...
@@ -1446,18 +1445,24 @@
brush
.
scale
=
function
(
scale
)
{
brush
.
scale
=
function
(
scale
)
{
return
__axis_rotated
?
this
.
y
(
scale
)
:
this
.
x
(
scale
);
return
__axis_rotated
?
this
.
y
(
scale
)
:
this
.
x
(
scale
);
};
};
zoom
.
scale
=
function
(
scale
)
{
return
__axis_rotated
?
this
.
y
(
scale
)
:
this
.
x
(
scale
);
if
(
__zoom_enabled
)
{
};
zoom
=
d3
.
behavior
.
zoom
()
zoom
.
orgScaleExtent
=
function
()
{
.
on
(
"zoomstart"
,
function
()
{
zoom
.
altDomain
=
d3
.
event
.
sourceEvent
.
altKey
?
x
.
orgDomain
()
:
null
;
})
var
extent
=
__zoom_extent
?
__zoom_extent
:
[
1
,
10
];
.
on
(
"zoom"
,
__zoom_enabled
?
redrawForZoom
:
null
);
return
[
extent
[
0
],
Math
.
max
(
getMaxDataCount
()
/
extent
[
1
],
extent
[
1
])];
zoom
.
scale
=
function
(
scale
)
{
};
return
__axis_rotated
?
this
.
y
(
scale
)
:
this
.
x
(
scale
);
zoom
.
updateScaleExtent
=
function
()
{
};
var
ratio
=
diffDomain
(
x
.
orgDomain
())
/
diffDomain
(
orgXDomain
),
extent
=
this
.
orgScaleExtent
();
zoom
.
orgScaleExtent
=
function
()
{
this
.
scaleExtent
([
extent
[
0
]
*
ratio
,
extent
[
1
]
*
ratio
]);
var
extent
=
__zoom_extent
?
__zoom_extent
:
[
1
,
10
];
return
this
;
return
[
extent
[
0
],
Math
.
max
(
getMaxDataCount
()
/
extent
[
1
],
extent
[
1
])];
};
};
zoom
.
updateScaleExtent
=
function
()
{
var
ratio
=
diffDomain
(
x
.
orgDomain
())
/
diffDomain
(
orgXDomain
),
extent
=
this
.
orgScaleExtent
();
this
.
scaleExtent
([
extent
[
0
]
*
ratio
,
extent
[
1
]
*
ratio
]);
return
this
;
};
}
/*-- Draw Chart --*/
/*-- Draw Chart --*/
...
@@ -2044,7 +2049,7 @@
...
@@ -2044,7 +2049,7 @@
if
(
withUpdateOrgXDomain
)
{
if
(
withUpdateOrgXDomain
)
{
x
.
domain
(
d3
.
extent
(
getXDomain
(
c3
.
data
.
targets
)));
x
.
domain
(
d3
.
extent
(
getXDomain
(
c3
.
data
.
targets
)));
orgXDomain
=
x
.
domain
();
orgXDomain
=
x
.
domain
();
zoom
.
scale
(
x
).
updateScaleExtent
();
if
(
__zoom_enabled
)
{
zoom
.
scale
(
x
).
updateScaleExtent
();
}
subX
.
domain
(
x
.
domain
());
subX
.
domain
(
x
.
domain
());
brush
.
scale
(
subX
);
brush
.
scale
(
subX
);
}
}
...
...
c3.min.js
View file @
a2137e8a
This diff is collapsed.
Click to expand it.
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