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
1d6b4302
Commit
1d6b4302
authored
Nov 15, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid generating line points for performance - #553
parent
a9b0e620
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
16 deletions
+34
-16
c3.js
c3.js
+17
-8
c3.min.js
c3.min.js
+0
-0
core.js
src/core.js
+2
-2
selection.js
src/selection.js
+2
-2
shape.line.js
src/shape.line.js
+13
-4
No files found.
c3.js
View file @
1d6b4302
...
...
@@ -434,8 +434,8 @@
var
waitForDraw
,
flow
;
var
targetsToShow
=
$$
.
filterTargetsToShow
(
$$
.
data
.
targets
),
tickValues
,
i
,
intervalForCulling
,
xDomainForZoom
;
var
xv
=
$$
.
xv
.
bind
(
$$
),
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
);
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
);
options
=
options
||
{};
withY
=
getOption
(
options
,
"withY"
,
true
);
...
...
@@ -2933,10 +2933,19 @@
c3_chart_internal_fn
.
circleX
=
function
(
d
)
{
return
d
.
x
||
d
.
x
===
0
?
this
.
x
(
d
.
x
)
:
null
;
};
c3_chart_internal_fn
.
circleY
=
function
(
d
,
i
)
{
var
$$
=
this
,
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
$$
.
config
.
data_groups
.
length
>
0
?
getPoints
(
d
,
i
)[
0
][
1
]
:
$$
.
getYScale
(
d
.
id
)(
d
.
value
);
c3_chart_internal_fn
.
generateCircleY
=
function
()
{
var
$$
=
this
,
lineIndices
,
getPoints
;
if
(
$$
.
config
.
data_groups
.
length
>
0
)
{
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
function
(
d
,
i
)
{
return
getPoints
(
d
,
i
)[
0
][
1
];
};
}
else
{
return
function
(
d
)
{
return
$$
.
getYScale
(
d
.
id
)(
d
.
value
);
};
}
};
c3_chart_internal_fn
.
getCircles
=
function
(
i
,
id
)
{
var
$$
=
this
;
...
...
@@ -4916,8 +4925,8 @@
c3_chart_internal_fn
.
selectPoint
=
function
(
target
,
d
,
i
)
{
var
$$
=
this
,
config
=
$$
.
config
,
cx
=
(
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
),
cx
=
(
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
),
r
=
$$
.
pointSelectR
.
bind
(
$$
);
config
.
data_onselected
.
call
(
$$
.
api
,
d
,
target
.
node
());
// add selected-circle on low layer g
...
...
c3.min.js
View file @
1d6b4302
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/core.js
View file @
1d6b4302
...
...
@@ -429,8 +429,8 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
var
waitForDraw
,
flow
;
var
targetsToShow
=
$$
.
filterTargetsToShow
(
$$
.
data
.
targets
),
tickValues
,
i
,
intervalForCulling
,
xDomainForZoom
;
var
xv
=
$$
.
xv
.
bind
(
$$
),
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
);
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
);
options
=
options
||
{};
withY
=
getOption
(
options
,
"withY"
,
true
);
...
...
src/selection.js
View file @
1d6b4302
c3_chart_internal_fn
.
selectPoint
=
function
(
target
,
d
,
i
)
{
var
$$
=
this
,
config
=
$$
.
config
,
cx
=
(
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
),
cx
=
(
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
),
r
=
$$
.
pointSelectR
.
bind
(
$$
);
config
.
data_onselected
.
call
(
$$
.
api
,
d
,
target
.
node
());
// add selected-circle on low layer g
...
...
src/shape.line.js
View file @
1d6b4302
...
...
@@ -306,10 +306,19 @@ c3_chart_internal_fn.addTransitionForCircle = function (transitions, cx, cy) {
c3_chart_internal_fn
.
circleX
=
function
(
d
)
{
return
d
.
x
||
d
.
x
===
0
?
this
.
x
(
d
.
x
)
:
null
;
};
c3_chart_internal_fn
.
circleY
=
function
(
d
,
i
)
{
var
$$
=
this
,
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
$$
.
config
.
data_groups
.
length
>
0
?
getPoints
(
d
,
i
)[
0
][
1
]
:
$$
.
getYScale
(
d
.
id
)(
d
.
value
);
c3_chart_internal_fn
.
generateCircleY
=
function
()
{
var
$$
=
this
,
lineIndices
,
getPoints
;
if
(
$$
.
config
.
data_groups
.
length
>
0
)
{
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
function
(
d
,
i
)
{
return
getPoints
(
d
,
i
)[
0
][
1
];
};
}
else
{
return
function
(
d
)
{
return
$$
.
getYScale
(
d
.
id
)(
d
.
value
);
};
}
};
c3_chart_internal_fn
.
getCircles
=
function
(
i
,
id
)
{
var
$$
=
this
;
...
...
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