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
a57b5d68
Commit
a57b5d68
authored
May 02, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix select/unselect for arc - #158
parent
0bbdad66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
c3.js
c3.js
+10
-10
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
a57b5d68
...
@@ -2291,6 +2291,9 @@
...
@@ -2291,6 +2291,9 @@
function
toggleArc
(
selected
,
target
,
d
,
i
)
{
function
toggleArc
(
selected
,
target
,
d
,
i
)
{
toggleBar
(
selected
,
target
,
d
.
data
,
i
);
toggleBar
(
selected
,
target
,
d
.
data
,
i
);
}
}
function
getToggle
(
that
)
{
return
that
.
nodeName
===
'circle'
?
togglePoint
:
(
d3
.
select
(
that
).
classed
(
CLASS
.
bar
)
?
toggleBar
:
toggleArc
);
}
function
filterRemoveNull
(
data
)
{
function
filterRemoveNull
(
data
)
{
return
data
.
filter
(
function
(
d
)
{
return
isValue
(
d
.
value
);
});
return
data
.
filter
(
function
(
d
)
{
return
isValue
(
d
.
value
);
});
...
@@ -4337,19 +4340,17 @@
...
@@ -4337,19 +4340,17 @@
c3
.
select
=
function
(
ids
,
indices
,
resetOther
)
{
c3
.
select
=
function
(
ids
,
indices
,
resetOther
)
{
if
(
!
__data_selection_enabled
)
{
return
;
}
if
(
!
__data_selection_enabled
)
{
return
;
}
main
.
selectAll
(
'.'
+
CLASS
.
shapes
).
selectAll
(
'.'
+
CLASS
.
shape
).
each
(
function
(
d
,
i
)
{
main
.
selectAll
(
'.'
+
CLASS
.
shapes
).
selectAll
(
'.'
+
CLASS
.
shape
).
each
(
function
(
d
,
i
)
{
var
shape
=
d3
.
select
(
this
),
var
shape
=
d3
.
select
(
this
),
id
=
d
.
data
?
d
.
data
.
id
:
d
.
id
,
toggle
=
getToggle
(
this
),
select
=
(
this
.
nodeName
===
'circle'
)
?
selectPoint
:
selectBar
,
isTargetId
=
__data_selection_grouped
||
!
ids
||
ids
.
indexOf
(
id
)
>=
0
,
unselect
=
(
this
.
nodeName
===
'circle'
)
?
unselectPoint
:
unselectBar
,
isTargetId
=
__data_selection_grouped
||
!
ids
||
ids
.
indexOf
(
d
.
id
)
>=
0
,
isTargetIndex
=
!
indices
||
indices
.
indexOf
(
i
)
>=
0
,
isTargetIndex
=
!
indices
||
indices
.
indexOf
(
i
)
>=
0
,
isSelected
=
shape
.
classed
(
CLASS
.
SELECTED
);
isSelected
=
shape
.
classed
(
CLASS
.
SELECTED
);
if
(
isTargetId
&&
isTargetIndex
)
{
if
(
isTargetId
&&
isTargetIndex
)
{
if
(
__data_selection_isselectable
(
d
)
&&
!
isSelected
)
{
if
(
__data_selection_isselectable
(
d
)
&&
!
isSelected
)
{
select
(
shape
.
classed
(
CLASS
.
SELECTED
,
true
),
d
,
i
);
toggle
(
true
,
shape
.
classed
(
CLASS
.
SELECTED
,
true
),
d
,
i
);
}
}
}
else
if
(
isDefined
(
resetOther
)
&&
resetOther
)
{
}
else
if
(
isDefined
(
resetOther
)
&&
resetOther
)
{
if
(
isSelected
)
{
if
(
isSelected
)
{
unselect
(
shape
.
classed
(
CLASS
.
SELECTED
,
false
),
d
,
i
);
toggle
(
false
,
shape
.
classed
(
CLASS
.
SELECTED
,
false
),
d
,
i
);
}
}
}
}
});
});
...
@@ -4358,15 +4359,14 @@
...
@@ -4358,15 +4359,14 @@
c3
.
unselect
=
function
(
ids
,
indices
)
{
c3
.
unselect
=
function
(
ids
,
indices
)
{
if
(
!
__data_selection_enabled
)
{
return
;
}
if
(
!
__data_selection_enabled
)
{
return
;
}
main
.
selectAll
(
'.'
+
CLASS
.
shapes
).
selectAll
(
'.'
+
CLASS
.
shape
).
each
(
function
(
d
,
i
)
{
main
.
selectAll
(
'.'
+
CLASS
.
shapes
).
selectAll
(
'.'
+
CLASS
.
shape
).
each
(
function
(
d
,
i
)
{
var
shape
=
d3
.
select
(
this
),
var
shape
=
d3
.
select
(
this
),
id
=
d
.
data
?
d
.
data
.
id
:
d
.
id
,
toggle
=
getToggle
(
this
),
unselect
=
(
this
.
nodeName
===
'circle'
)
?
unselectPoint
:
unselectBar
,
isTargetId
=
__data_selection_grouped
||
!
ids
||
ids
.
indexOf
(
id
)
>=
0
,
isTargetId
=
__data_selection_grouped
||
!
ids
||
ids
.
indexOf
(
d
.
id
)
>=
0
,
isTargetIndex
=
!
indices
||
indices
.
indexOf
(
i
)
>=
0
,
isTargetIndex
=
!
indices
||
indices
.
indexOf
(
i
)
>=
0
,
isSelected
=
shape
.
classed
(
CLASS
.
SELECTED
);
isSelected
=
shape
.
classed
(
CLASS
.
SELECTED
);
if
(
isTargetId
&&
isTargetIndex
)
{
if
(
isTargetId
&&
isTargetIndex
)
{
if
(
__data_selection_isselectable
(
d
))
{
if
(
__data_selection_isselectable
(
d
))
{
if
(
isSelected
)
{
if
(
isSelected
)
{
unselect
(
shape
.
classed
(
CLASS
.
SELECTED
,
false
),
d
,
i
);
toggle
(
false
,
shape
.
classed
(
CLASS
.
SELECTED
,
false
),
d
,
i
);
}
}
}
}
}
}
...
...
c3.min.js
View file @
a57b5d68
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