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
654739db
Commit
654739db
authored
Mar 28, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix selection for bar
parent
8124aeef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
c3.js
c3.js
+16
-7
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
654739db
...
...
@@ -1459,6 +1459,13 @@
return
closest
;
}
function
getPathBox
(
path
)
{
var
box
=
path
.
getBoundingClientRect
(),
items
=
[
path
.
pathSegList
.
getItem
(
0
),
path
.
pathSegList
.
getItem
(
1
)],
minX
=
items
[
0
].
x
,
minY
=
Math
.
min
(
items
[
0
].
y
,
items
[
1
].
y
);
return
{
x
:
minX
,
y
:
minY
,
width
:
box
.
width
,
height
:
box
.
height
};
}
function
isOrderDesc
()
{
return
__data_order
&&
__data_order
.
toLowerCase
()
===
'desc'
;
}
...
...
@@ -1729,7 +1736,7 @@
}
function
isWithinBar
(
_this
)
{
var
mouse
=
d3
.
mouse
(
_this
),
box
=
_this
.
getBBox
();
var
x
=
box
.
x
,
y
=
box
.
y
,
w
=
box
.
width
,
h
=
box
.
height
,
offset
=
10
;
var
x
=
box
.
x
,
y
=
box
.
y
,
w
=
box
.
width
,
h
=
box
.
height
,
offset
=
2
;
var
sx
=
x
-
offset
,
ex
=
x
+
w
+
offset
,
sy
=
y
+
h
+
offset
,
ey
=
y
-
offset
;
return
sx
<
mouse
[
0
]
&&
mouse
[
0
]
<
ex
&&
ey
<
mouse
[
1
]
&&
mouse
[
1
]
<
sy
;
}
...
...
@@ -2557,19 +2564,21 @@
var
_this
=
d3
.
select
(
this
),
isSelected
=
_this
.
classed
(
SELECTED
),
isIncluded
=
_this
.
classed
(
INCLUDED
),
_x
,
_y
,
_w
,
toggle
,
isWithin
=
false
;
_x
,
_y
,
_w
,
_h
,
toggle
,
isWithin
=
false
,
box
;
if
(
this
.
nodeName
===
'circle'
)
{
_x
=
_this
.
attr
(
"cx"
)
*
1
;
_y
=
_this
.
attr
(
"cy"
)
*
1
;
toggle
=
togglePoint
;
isWithin
=
minX
<
_x
&&
_x
<
maxX
&&
minY
<
_y
&&
_y
<
maxY
;
}
else
if
(
this
.
nodeName
===
'rect'
)
{
_x
=
_this
.
attr
(
"x"
)
*
1
;
_y
=
_this
.
attr
(
"y"
)
*
1
;
_w
=
_this
.
attr
(
'width'
)
*
1
;
else
if
(
this
.
nodeName
===
'path'
)
{
box
=
getPathBox
(
this
);
_x
=
box
.
x
;
_y
=
box
.
y
;
_w
=
box
.
width
;
_h
=
box
.
height
;
toggle
=
toggleBar
;
isWithin
=
minX
<
_x
+
_w
&&
_x
<
maxX
&&
_y
<
maxY
;
isWithin
=
!
(
maxX
<
_x
||
_x
+
_w
<
minX
)
&&
!
(
maxY
<
_y
||
_y
+
_h
<
minY
)
;
}
if
(
isWithin
^
isIncluded
)
{
_this
.
classed
(
INCLUDED
,
!
isIncluded
);
...
...
c3.min.js
View file @
654739db
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