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
9643a7ae
Commit
9643a7ae
authored
Apr 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor redraw
parent
d482cd34
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
45 deletions
+22
-45
c3.js
c3.js
+22
-45
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
9643a7ae
...
...
@@ -3095,7 +3095,7 @@
var
mainCircle
,
mainBar
,
mainRegion
,
mainText
,
contextBar
,
eventRect
,
eventRectUpdate
;
var
barIndices
=
getBarIndices
(),
maxDataCountTarget
;
var
rectX
,
rectW
;
var
withY
,
withSubchart
,
withTransition
,
withTransitionForExit
,
withTransitionForAxis
,
withTrans
itionForHorizontalAxis
,
withTrans
form
,
withUpdateXDomain
,
withUpdateOrgXDomain
,
withLegend
;
var
withY
,
withSubchart
,
withTransition
,
withTransitionForExit
,
withTransitionForAxis
,
withTransform
,
withUpdateXDomain
,
withUpdateOrgXDomain
,
withLegend
;
var
hideAxis
=
hasArcType
(
c3
.
data
.
targets
);
var
drawBar
,
drawBarOnSub
,
xForText
,
yForText
;
var
transitions
,
duration
,
durationForExit
,
durationForAxis
;
...
...
@@ -3112,16 +3112,15 @@
withTransitionForExit
=
isDefined
(
options
.
withTransitionForExit
)
?
options
.
withTransitionForExit
:
withTransition
;
withTransitionForAxis
=
isDefined
(
options
.
withTransitionForAxis
)
?
options
.
withTransitionForAxis
:
withTransition
;
withTransitionForHorizontalAxis
=
isDefined
(
options
.
withTransitionForHorizontalAxis
)
?
options
.
withTransitionForHorizontalAxis
:
withTransition
;
duration
=
withTransition
?
__transition_duration
:
0
;
durationForExit
=
withTransitionForExit
?
duration
:
0
;
durationForAxis
=
withTransitionForAxis
?
duration
:
0
;
xaxis
=
main
.
select
(
'.'
+
CLASS
.
axisX
);
yaxis
=
main
.
select
(
'.'
+
CLASS
.
axisY
);
y2axis
=
main
.
select
(
'.'
+
CLASS
.
axisY2
);
subxaxis
=
context
.
select
(
'.'
+
CLASS
.
axisX
);
xaxis
=
main
.
select
(
'.'
+
CLASS
.
axisX
)
.
style
(
"opacity"
,
hideAxis
?
0
:
1
)
;
yaxis
=
main
.
select
(
'.'
+
CLASS
.
axisY
)
.
style
(
"opacity"
,
hideAxis
?
0
:
1
)
;
y2axis
=
main
.
select
(
'.'
+
CLASS
.
axisY2
)
.
style
(
"opacity"
,
hideAxis
?
0
:
1
)
;
subxaxis
=
context
.
select
(
'.'
+
CLASS
.
axisX
)
.
style
(
"opacity"
,
hideAxis
?
0
:
1
)
;
transitions
=
{
axisX
:
xaxis
.
transition
().
duration
(
durationForAxis
),
...
...
@@ -3135,6 +3134,13 @@
updateLegend
(
mapToIds
(
c3
.
data
.
targets
),
options
,
transitions
);
}
if
(
isCategorized
)
{
// ATTENTION: need to update domain with current domain when categoryAxis
if
(
targetsToShow
.
length
===
0
||
!
withUpdateOrgXDomain
||
withUpdateXDomain
)
{
x
.
domain
([
0
,
xaxis
.
selectAll
(
'.tick'
).
size
()]);
}
}
if
(
targetsToShow
.
length
)
{
if
(
withUpdateOrgXDomain
)
{
x
.
domain
(
d3
.
extent
(
getXDomain
(
targetsToShow
)));
...
...
@@ -3148,11 +3154,6 @@
x
.
domain
(
brush
.
empty
()
?
orgXDomain
:
brush
.
extent
());
if
(
__zoom_enabled
)
{
zoom
.
scale
(
x
).
updateScaleExtent
();
}
}
}
else
{
// ticks increase without this when no data shown
if
(
isCategorized
)
{
x
.
domain
([
0
,
xaxis
.
selectAll
(
'.tick'
).
size
()]);
}
}
y
.
domain
(
getYDomain
(
targetsToShow
,
'y'
));
...
...
@@ -3165,33 +3166,11 @@
subXAxis
.
tickValues
(
tickValues
);
}
// x axis
xaxis
.
style
(
"opacity"
,
hideAxis
?
0
:
1
);
if
(
__axis_rotated
||
withTransitionForHorizontalAxis
)
{
xaxis
=
transitions
.
axisX
;
}
xaxis
.
call
(
xAxis
);
// y axis
yaxis
.
style
(
"opacity"
,
hideAxis
?
0
:
1
);
if
(
!
__axis_rotated
||
withTransitionForHorizontalAxis
)
{
yaxis
=
transitions
.
axisY
;
}
yaxis
.
call
(
yAxis
);
// y2 axis
y2axis
.
style
(
"opacity"
,
hideAxis
?
0
:
1
);
if
(
!
__axis_rotated
||
withTransitionForHorizontalAxis
)
{
y2axis
=
transitions
.
axisY2
;
}
y2axis
.
call
(
y2Axis
);
// sub x axis
subxaxis
.
style
(
"opacity"
,
hideAxis
?
0
:
1
);
if
(
__axis_rotated
||
withTransitionForHorizontalAxis
)
{
subxaxis
=
transitions
.
axisSubX
;
}
subxaxis
.
call
(
subXAxis
);
// axes
transitions
.
axisX
.
call
(
xAxis
);
transitions
.
axisY
.
call
(
yAxis
);
transitions
.
axisY2
.
call
(
y2Axis
);
transitions
.
axisSubX
.
call
(
subXAxis
);
// show/hide if manual culling needed
if
(
withUpdateXDomain
)
{
...
...
@@ -3907,14 +3886,12 @@
.
style
(
'visibility'
,
'visible'
)
.
transition
()
.
style
(
'opacity'
,
opacityForLegend
);
updateLegend
(
mapToIds
(
c3
.
data
.
targets
));
}
function
hideLegend
(
targetIds
)
{
addHiddenLegendIds
(
targetIds
);
legend
.
selectAll
(
selectorLegends
(
targetIds
))
.
style
(
'opacity'
,
0
)
.
style
(
'visibility'
,
'hidden'
);
updateLegend
(
mapToIds
(
c3
.
data
.
targets
));
}
function
updateLegend
(
targetIds
,
options
,
transitions
)
{
...
...
@@ -4163,7 +4140,7 @@
.
style
(
'opacity'
,
1
);
}
redraw
({
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
,
with
TransitionForHorizontalAxis
:
fals
e
});
redraw
({
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
,
with
Legend
:
tru
e
});
};
c3
.
hide
=
function
(
targetIds
,
options
)
{
...
...
@@ -4184,7 +4161,7 @@
.
style
(
'opacity'
,
legendOpacityForHidden
);
}
redraw
({
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
,
with
TransitionForHorizontalAxis
:
fals
e
});
redraw
({
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
,
with
Legend
:
tru
e
});
};
c3
.
toggle
=
function
(
targetId
)
{
...
...
@@ -4454,15 +4431,15 @@
legend
.
style
(
'visibility'
,
'visible'
);
}
showLegend
(
mapToTargetIds
(
targetIds
));
redraw
({
with
TransitionForHorizontalAxis
:
fals
e
});
redraw
({
with
Legend
:
tru
e
});
};
c3
.
legend
.
hide
=
function
(
targetIds
)
{
hideLegend
(
mapToTargetIds
(
targetIds
));
redraw
({
withLegend
:
true
});
if
(
__legend_show
&&
isEmpty
(
targetIds
))
{
__legend_show
=
false
;
legend
.
style
(
'visibility'
,
'hidden'
);
}
hideLegend
(
mapToTargetIds
(
targetIds
));
redraw
({
withTransitionForHorizontalAxis
:
false
});
};
c3
.
resize
=
function
(
size
)
{
...
...
c3.min.js
View file @
9643a7ae
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