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
ffa7f52d
Commit
ffa7f52d
authored
Mar 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix data selection when grouped and not multiple - #79
parent
eb6625ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
c3.js
c3.js
+12
-10
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
ffa7f52d
...
@@ -2424,7 +2424,7 @@
...
@@ -2424,7 +2424,7 @@
cancelClick
=
false
;
cancelClick
=
false
;
return
;
return
;
}
}
main
.
selectAll
(
'.-shape-'
+
i
).
each
(
function
(
d
)
{
select
Shape
(
this
,
d
,
i
);
});
main
.
selectAll
(
'.-shape-'
+
i
).
each
(
function
(
d
)
{
toggle
Shape
(
this
,
d
,
i
);
});
})
})
.
call
(
.
call
(
d3
.
behavior
.
drag
().
origin
(
Object
)
d3
.
behavior
.
drag
().
origin
(
Object
)
...
@@ -2488,7 +2488,7 @@
...
@@ -2488,7 +2488,7 @@
// select if selection enabled
// select if selection enabled
if
(
dist
(
closest
,
mouse
)
<
100
)
{
if
(
dist
(
closest
,
mouse
)
<
100
)
{
main
.
select
(
'.-circles-'
+
getTargetSelectorSuffix
(
closest
.
id
)).
select
(
'.-circle-'
+
closest
.
index
).
each
(
function
()
{
main
.
select
(
'.-circles-'
+
getTargetSelectorSuffix
(
closest
.
id
)).
select
(
'.-circle-'
+
closest
.
index
).
each
(
function
()
{
select
Shape
(
this
,
closest
,
closest
.
index
);
toggle
Shape
(
this
,
closest
,
closest
.
index
);
});
});
}
}
})
})
...
@@ -2501,9 +2501,9 @@
...
@@ -2501,9 +2501,9 @@
.
call
(
zoom
).
on
(
"dblclick.zoom"
,
null
);
.
call
(
zoom
).
on
(
"dblclick.zoom"
,
null
);
}
}
function
select
Shape
(
target
,
d
,
i
)
{
function
toggle
Shape
(
target
,
d
,
i
)
{
var
_this
=
d3
.
select
(
target
),
var
shape
=
d3
.
select
(
target
),
isSelected
=
_this
.
classed
(
SELECTED
);
isSelected
=
shape
.
classed
(
SELECTED
);
var
isWithin
=
false
,
toggle
;
var
isWithin
=
false
,
toggle
;
if
(
target
.
nodeName
===
'circle'
)
{
if
(
target
.
nodeName
===
'circle'
)
{
isWithin
=
isWithinCircle
(
target
,
__point_select_r
*
1.5
);
isWithin
=
isWithinCircle
(
target
,
__point_select_r
*
1.5
);
...
@@ -2515,12 +2515,14 @@
...
@@ -2515,12 +2515,14 @@
}
}
if
(
__data_selection_grouped
||
isWithin
)
{
if
(
__data_selection_grouped
||
isWithin
)
{
if
(
__data_selection_enabled
&&
__data_selection_isselectable
(
d
))
{
if
(
__data_selection_enabled
&&
__data_selection_isselectable
(
d
))
{
if
(
__data_selection_multiple
)
{
if
(
!
__data_selection_multiple
)
{
_this
.
classed
(
SELECTED
,
!
isSelected
);
main
.
selectAll
(
'.-shapes'
+
(
__data_selection_grouped
?
getTargetSelectorSuffix
(
d
.
id
)
:
""
)).
selectAll
(
'.-shape'
).
each
(
function
(
d
,
i
)
{
toggle
(
!
isSelected
,
_this
,
d
,
i
);
var
shape
=
d3
.
select
(
this
);
}
else
{
if
(
shape
.
classed
(
SELECTED
))
{
toggle
(
false
,
shape
.
classed
(
SELECTED
,
false
),
d
,
i
);
}
isSelected
?
c3
.
unselect
()
:
c3
.
select
([
d
.
id
],
[
i
],
true
);
}
);
}
}
shape
.
classed
(
SELECTED
,
!
isSelected
);
toggle
(
!
isSelected
,
shape
,
d
,
i
);
}
}
__data_onclick
(
d
,
target
);
__data_onclick
(
d
,
target
);
}
}
...
...
c3.min.js
View file @
ffa7f52d
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