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
10e02e59
Commit
10e02e59
authored
Oct 18, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple click on step chart - #608
parent
cfc5446a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
c3.js
c3.js
+8
-6
c3.min.js
c3.min.js
+0
-0
shape.js
src/shape.js
+1
-2
shape.line.js
src/shape.line.js
+7
-4
No files found.
c3.js
View file @
10e02e59
...
@@ -2504,8 +2504,7 @@
...
@@ -2504,8 +2504,7 @@
isWithin
=
false
;
isWithin
=
false
;
}
}
else
if
(
that
.
nodeName
===
'circle'
)
{
else
if
(
that
.
nodeName
===
'circle'
)
{
// circle is hidden in step chart, so treat as within the click area
isWithin
=
$$
.
isStepType
(
d
)
?
$$
.
isWithinStep
(
that
,
$$
.
getYScale
(
d
.
id
)(
d
.
value
))
:
$$
.
isWithinCircle
(
that
,
$$
.
pointSelectR
(
d
)
*
1.5
);
isWithin
=
$$
.
isStepType
(
d
)
?
true
:
$$
.
isWithinCircle
(
that
,
$$
.
pointSelectR
(
d
)
*
1.5
);
}
}
else
if
(
that
.
nodeName
===
'path'
)
{
else
if
(
that
.
nodeName
===
'path'
)
{
isWithin
=
shape
.
classed
(
CLASS
.
bar
)
?
$$
.
isWithinBar
(
that
)
:
true
;
isWithin
=
shape
.
classed
(
CLASS
.
bar
)
?
$$
.
isWithinBar
(
that
)
:
true
;
...
@@ -2860,11 +2859,14 @@
...
@@ -2860,11 +2859,14 @@
var
$$
=
this
,
config
=
$$
.
config
;
var
$$
=
this
,
config
=
$$
.
config
;
return
config
.
point_select_r
?
config
.
point_select_r
:
$$
.
pointR
(
d
)
*
4
;
return
config
.
point_select_r
?
config
.
point_select_r
:
$$
.
pointR
(
d
)
*
4
;
};
};
c3_chart_internal_fn
.
isWithinCircle
=
function
(
_this
,
_
r
)
{
c3_chart_internal_fn
.
isWithinCircle
=
function
(
that
,
r
)
{
var
d3
=
this
.
d3
,
var
d3
=
this
.
d3
,
mouse
=
d3
.
mouse
(
_this
),
d3_this
=
d3
.
select
(
_this
),
mouse
=
d3
.
mouse
(
that
),
d3_this
=
d3
.
select
(
that
),
cx
=
d3_this
.
attr
(
"cx"
)
*
1
,
cy
=
d3_this
.
attr
(
"cy"
)
*
1
;
cx
=
+
d3_this
.
attr
(
"cx"
),
cy
=
+
d3_this
.
attr
(
"cy"
);
return
Math
.
sqrt
(
Math
.
pow
(
cx
-
mouse
[
0
],
2
)
+
Math
.
pow
(
cy
-
mouse
[
1
],
2
))
<
_r
;
return
Math
.
sqrt
(
Math
.
pow
(
cx
-
mouse
[
0
],
2
)
+
Math
.
pow
(
cy
-
mouse
[
1
],
2
))
<
r
;
};
c3_chart_internal_fn
.
isWithinStep
=
function
(
that
,
y
)
{
return
Math
.
abs
(
y
-
this
.
d3
.
mouse
(
that
)[
1
])
<
30
;
};
};
c3_chart_internal_fn
.
initBar
=
function
()
{
c3_chart_internal_fn
.
initBar
=
function
()
{
...
...
c3.min.js
View file @
10e02e59
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/shape.js
View file @
10e02e59
...
@@ -53,8 +53,7 @@ c3_chart_internal_fn.isWithinShape = function (that, d) {
...
@@ -53,8 +53,7 @@ c3_chart_internal_fn.isWithinShape = function (that, d) {
isWithin
=
false
;
isWithin
=
false
;
}
}
else
if
(
that
.
nodeName
===
'circle'
)
{
else
if
(
that
.
nodeName
===
'circle'
)
{
// circle is hidden in step chart, so treat as within the click area
isWithin
=
$$
.
isStepType
(
d
)
?
$$
.
isWithinStep
(
that
,
$$
.
getYScale
(
d
.
id
)(
d
.
value
))
:
$$
.
isWithinCircle
(
that
,
$$
.
pointSelectR
(
d
)
*
1.5
);
isWithin
=
$$
.
isStepType
(
d
)
?
true
:
$$
.
isWithinCircle
(
that
,
$$
.
pointSelectR
(
d
)
*
1.5
);
}
}
else
if
(
that
.
nodeName
===
'path'
)
{
else
if
(
that
.
nodeName
===
'path'
)
{
isWithin
=
shape
.
classed
(
CLASS
.
bar
)
?
$$
.
isWithinBar
(
that
)
:
true
;
isWithin
=
shape
.
classed
(
CLASS
.
bar
)
?
$$
.
isWithinBar
(
that
)
:
true
;
...
...
src/shape.line.js
View file @
10e02e59
...
@@ -339,9 +339,12 @@ c3_chart_internal_fn.pointSelectR = function (d) {
...
@@ -339,9 +339,12 @@ c3_chart_internal_fn.pointSelectR = function (d) {
var
$$
=
this
,
config
=
$$
.
config
;
var
$$
=
this
,
config
=
$$
.
config
;
return
config
.
point_select_r
?
config
.
point_select_r
:
$$
.
pointR
(
d
)
*
4
;
return
config
.
point_select_r
?
config
.
point_select_r
:
$$
.
pointR
(
d
)
*
4
;
};
};
c3_chart_internal_fn
.
isWithinCircle
=
function
(
_this
,
_
r
)
{
c3_chart_internal_fn
.
isWithinCircle
=
function
(
that
,
r
)
{
var
d3
=
this
.
d3
,
var
d3
=
this
.
d3
,
mouse
=
d3
.
mouse
(
_this
),
d3_this
=
d3
.
select
(
_this
),
mouse
=
d3
.
mouse
(
that
),
d3_this
=
d3
.
select
(
that
),
cx
=
d3_this
.
attr
(
"cx"
)
*
1
,
cy
=
d3_this
.
attr
(
"cy"
)
*
1
;
cx
=
+
d3_this
.
attr
(
"cx"
),
cy
=
+
d3_this
.
attr
(
"cy"
);
return
Math
.
sqrt
(
Math
.
pow
(
cx
-
mouse
[
0
],
2
)
+
Math
.
pow
(
cy
-
mouse
[
1
],
2
))
<
_r
;
return
Math
.
sqrt
(
Math
.
pow
(
cx
-
mouse
[
0
],
2
)
+
Math
.
pow
(
cy
-
mouse
[
1
],
2
))
<
r
;
};
c3_chart_internal_fn
.
isWithinStep
=
function
(
that
,
y
)
{
return
Math
.
abs
(
y
-
this
.
d3
.
mouse
(
that
)[
1
])
<
30
;
};
};
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