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
c91efd94
Commit
c91efd94
authored
Feb 20, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix focus/defocus interface
parent
f14e7d1b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
c3.js
c3.js
+15
-3
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
c91efd94
...
@@ -2468,9 +2468,18 @@
...
@@ -2468,9 +2468,18 @@
/*-- Draw Legend --*/
/*-- Draw Legend --*/
function
focusLegend
(
id
)
{
function
focusLegend
(
id
)
{
svg
.
selectAll
(
'.legend-item'
).
filter
(
function
(
d
)
{
return
d
!==
id
;
})
var
legendItem
=
svg
.
selectAll
(
'.legend-item'
),
.
transition
().
duration
(
100
)
isTarget
=
function
(
d
)
{
return
!
id
||
d
===
id
;
},
.
style
(
'opacity'
,
0.3
);
notTarget
=
function
(
d
)
{
return
!
isTarget
(
d
);
};
legendItem
.
filter
(
notTarget
).
transition
().
duration
(
100
).
style
(
'opacity'
,
0.3
);
legendItem
.
filter
(
isTarget
).
transition
().
duration
(
100
).
style
(
'opacity'
,
1
);
}
function
defocusLegend
(
id
)
{
var
legendItem
=
svg
.
selectAll
(
'.legend-item'
),
isTarget
=
function
(
d
)
{
return
!
id
||
d
===
id
;
},
notTarget
=
function
(
d
)
{
return
!
isTarget
(
d
);
};
legendItem
.
filter
(
notTarget
).
transition
().
duration
(
100
).
style
(
'opacity'
,
1
);
legendItem
.
filter
(
isTarget
).
transition
().
duration
(
100
).
style
(
'opacity'
,
0.3
);
}
}
function
revertLegend
()
{
function
revertLegend
()
{
svg
.
selectAll
(
'.legend-item'
)
svg
.
selectAll
(
'.legend-item'
)
...
@@ -2560,6 +2569,7 @@
...
@@ -2560,6 +2569,7 @@
function
focus
(
targets
)
{
function
focus
(
targets
)
{
targets
.
transition
().
duration
(
100
).
style
(
'opacity'
,
1
);
targets
.
transition
().
duration
(
100
).
style
(
'opacity'
,
1
);
}
}
c3
.
revert
();
c3
.
defocus
();
c3
.
defocus
();
focus
(
candidatesForNoneArc
.
classed
(
'focused'
,
true
));
focus
(
candidatesForNoneArc
.
classed
(
'focused'
,
true
));
focus
(
candidatesForArc
);
focus
(
candidatesForArc
);
...
@@ -2576,11 +2586,13 @@
...
@@ -2576,11 +2586,13 @@
function
defocus
(
targets
)
{
function
defocus
(
targets
)
{
targets
.
transition
().
duration
(
100
).
style
(
'opacity'
,
0.3
);
targets
.
transition
().
duration
(
100
).
style
(
'opacity'
,
0.3
);
}
}
c3
.
revert
();
defocus
(
candidatesForNoneArc
.
classed
(
'focused'
,
false
));
defocus
(
candidatesForNoneArc
.
classed
(
'focused'
,
false
));
defocus
(
candidatesForArc
);
defocus
(
candidatesForArc
);
if
(
hasArcType
(
c3
.
data
.
targets
))
{
if
(
hasArcType
(
c3
.
data
.
targets
))
{
unexpandArc
(
target
);
unexpandArc
(
target
);
}
}
defocusLegend
(
target
);
};
};
c3
.
revert
=
function
(
target
)
{
c3
.
revert
=
function
(
target
)
{
...
...
c3.min.js
View file @
c91efd94
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