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
ce208470
Commit
ce208470
authored
Sep 09, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix event rect when flow called - #520
parent
ed6f738c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
10 deletions
+36
-10
c3.js
c3.js
+18
-5
c3.min.js
c3.min.js
+0
-0
api.flow.js
src/api.flow.js
+13
-1
core.js
src/core.js
+3
-2
interaction.js
src/interaction.js
+2
-2
No files found.
c3.js
View file @
ce208470
...
...
@@ -82,6 +82,7 @@
$$
.
dragStart
=
null
;
$$
.
dragging
=
false
;
$$
.
flowing
=
false
;
$$
.
cancelClick
=
false
;
$$
.
mouseover
=
false
;
$$
.
transiting
=
false
;
...
...
@@ -555,8 +556,8 @@
.
selectAll
(
'circle'
)
.
remove
();
// event rect
if
(
config
.
interaction_enabled
)
{
// event rect
s will redrawn when flow called
if
(
config
.
interaction_enabled
&&
!
options
.
flow
)
{
$$
.
redrawEventRect
();
}
...
...
@@ -2103,7 +2104,7 @@
.
on
(
'mouseover'
,
function
(
d
)
{
var
index
=
d
.
index
,
selectedData
,
newData
;
if
(
$$
.
dragging
)
{
return
;
}
// do nothing if dragg
ing
if
(
$$
.
dragging
||
$$
.
flowing
)
{
return
;
}
// do nothing while dragging/flow
ing
if
(
$$
.
hasArcType
())
{
return
;
}
selectedData
=
$$
.
data
.
targets
.
map
(
function
(
t
)
{
...
...
@@ -2149,7 +2150,7 @@
var
selectedData
,
index
=
d
.
index
,
eventRect
=
$$
.
svg
.
select
(
'.'
+
CLASS
.
eventRect
+
'-'
+
index
);
if
(
$$
.
dragging
)
{
return
;
}
// do nothing when dragg
ing
if
(
$$
.
dragging
||
$$
.
flowing
)
{
return
;
}
// do nothing while dragging/flow
ing
if
(
$$
.
hasArcType
())
{
return
;
}
if
(
$$
.
isStepType
(
d
)
&&
d3
.
mouse
(
this
)[
0
]
<
$$
.
x
(
$$
.
getXValue
(
d
.
id
,
index
)))
{
...
...
@@ -5662,6 +5663,9 @@
mainArea
=
$$
.
mainArea
||
d3
.
selectAll
([]),
mainCircle
=
$$
.
mainCircle
||
d3
.
selectAll
([]);
// set flag
$$
.
flowing
=
true
;
// remove head data after rendered
$$
.
data
.
targets
.
forEach
(
function
(
d
)
{
d
.
values
.
splice
(
0
,
flowLength
);
...
...
@@ -5697,6 +5701,10 @@
scaleX
=
(
diffDomain
(
orgDomain
)
/
diffDomain
(
domain
));
transform
=
'translate('
+
translateX
+
',0) scale('
+
scaleX
+
',1)'
;
// hide tooltip
$$
.
hideXGridFocus
();
$$
.
hideTooltip
();
d3
.
transition
().
ease
(
'linear'
).
duration
(
durationForFlow
).
each
(
function
()
{
wait
.
add
(
$$
.
axes
.
x
.
transition
().
call
(
$$
.
xAxis
));
wait
.
add
(
mainBar
.
transition
().
attr
(
'transform'
,
transform
));
...
...
@@ -5759,10 +5767,15 @@
mainRegion
.
select
(
'rect'
).
filter
(
$$
.
isRegionOnX
)
.
attr
(
"x"
,
$$
.
regionX
.
bind
(
$$
))
.
attr
(
"width"
,
$$
.
regionWidth
.
bind
(
$$
));
$$
.
updateEventRect
();
if
(
config
.
interaction_enabled
)
{
$$
.
redrawEventRect
();
}
// callback for end of flow
done
();
$$
.
flowing
=
false
;
});
};
};
...
...
c3.min.js
View file @
ce208470
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/api.flow.js
View file @
ce208470
...
...
@@ -175,6 +175,9 @@ c3_chart_internal_fn.generateFlow = function (args) {
mainArea
=
$$
.
mainArea
||
d3
.
selectAll
([]),
mainCircle
=
$$
.
mainCircle
||
d3
.
selectAll
([]);
// set flag
$$
.
flowing
=
true
;
// remove head data after rendered
$$
.
data
.
targets
.
forEach
(
function
(
d
)
{
d
.
values
.
splice
(
0
,
flowLength
);
...
...
@@ -210,6 +213,10 @@ c3_chart_internal_fn.generateFlow = function (args) {
scaleX
=
(
diffDomain
(
orgDomain
)
/
diffDomain
(
domain
));
transform
=
'translate('
+
translateX
+
',0) scale('
+
scaleX
+
',1)'
;
// hide tooltip
$$
.
hideXGridFocus
();
$$
.
hideTooltip
();
d3
.
transition
().
ease
(
'linear'
).
duration
(
durationForFlow
).
each
(
function
()
{
wait
.
add
(
$$
.
axes
.
x
.
transition
().
call
(
$$
.
xAxis
));
wait
.
add
(
mainBar
.
transition
().
attr
(
'transform'
,
transform
));
...
...
@@ -272,10 +279,15 @@ c3_chart_internal_fn.generateFlow = function (args) {
mainRegion
.
select
(
'rect'
).
filter
(
$$
.
isRegionOnX
)
.
attr
(
"x"
,
$$
.
regionX
.
bind
(
$$
))
.
attr
(
"width"
,
$$
.
regionWidth
.
bind
(
$$
));
$$
.
updateEventRect
();
if
(
config
.
interaction_enabled
)
{
$$
.
redrawEventRect
();
}
// callback for end of flow
done
();
$$
.
flowing
=
false
;
});
};
};
src/core.js
View file @
ce208470
...
...
@@ -77,6 +77,7 @@ c3_chart_internal_fn.initParams = function () {
$$
.
dragStart
=
null
;
$$
.
dragging
=
false
;
$$
.
flowing
=
false
;
$$
.
cancelClick
=
false
;
$$
.
mouseover
=
false
;
$$
.
transiting
=
false
;
...
...
@@ -550,8 +551,8 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
.
selectAll
(
'circle'
)
.
remove
();
// event rect
if
(
config
.
interaction_enabled
)
{
// event rect
s will redrawn when flow called
if
(
config
.
interaction_enabled
&&
!
options
.
flow
)
{
$$
.
redrawEventRect
();
}
...
...
src/interaction.js
View file @
ce208470
...
...
@@ -109,7 +109,7 @@ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
.
on
(
'mouseover'
,
function
(
d
)
{
var
index
=
d
.
index
,
selectedData
,
newData
;
if
(
$$
.
dragging
)
{
return
;
}
// do nothing if dragg
ing
if
(
$$
.
dragging
||
$$
.
flowing
)
{
return
;
}
// do nothing while dragging/flow
ing
if
(
$$
.
hasArcType
())
{
return
;
}
selectedData
=
$$
.
data
.
targets
.
map
(
function
(
t
)
{
...
...
@@ -155,7 +155,7 @@ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
var
selectedData
,
index
=
d
.
index
,
eventRect
=
$$
.
svg
.
select
(
'.'
+
CLASS
.
eventRect
+
'-'
+
index
);
if
(
$$
.
dragging
)
{
return
;
}
// do nothing when dragg
ing
if
(
$$
.
dragging
||
$$
.
flowing
)
{
return
;
}
// do nothing while dragging/flow
ing
if
(
$$
.
hasArcType
())
{
return
;
}
if
(
$$
.
isStepType
(
d
)
&&
d3
.
mouse
(
this
)[
0
]
<
$$
.
x
(
$$
.
getXValue
(
d
.
id
,
index
)))
{
...
...
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