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
93c6a1eb
Commit
93c6a1eb
authored
Sep 09, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor toggle for path
parent
40de0881
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
30 deletions
+14
-30
c3.js
c3.js
+7
-15
c3.min.js
c3.min.js
+0
-0
drag.js
src/drag.js
+1
-1
selection.js
src/selection.js
+6
-14
No files found.
c3.js
View file @
93c6a1eb
...
...
@@ -4649,7 +4649,7 @@
_y
=
box
.
y
;
_w
=
box
.
width
;
_h
=
box
.
height
;
toggle
=
$$
.
toggle
Bar
;
toggle
=
$$
.
toggle
Path
;
isWithin
=
!
(
maxX
<
_x
||
_x
+
_w
<
minX
)
&&
!
(
maxY
<
_y
||
_y
+
_h
<
minY
);
}
else
{
// line/area selection not supported yet
...
...
@@ -4720,27 +4720,23 @@
c3_chart_internal_fn
.
togglePoint
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectPoint
(
target
,
d
,
i
)
:
this
.
unselectPoint
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
select
Bar
=
function
(
target
,
d
)
{
c3_chart_internal_fn
.
select
Path
=
function
(
target
,
d
)
{
var
$$
=
this
;
$$
.
config
.
data_onselected
.
call
(
$$
,
d
,
target
.
node
());
target
.
transition
().
duration
(
100
)
.
style
(
"fill"
,
function
()
{
return
$$
.
d3
.
rgb
(
$$
.
color
(
d
)).
brighter
(
0.75
);
});
};
c3_chart_internal_fn
.
unselect
Bar
=
function
(
target
,
d
)
{
c3_chart_internal_fn
.
unselect
Path
=
function
(
target
,
d
)
{
var
$$
=
this
;
$$
.
config
.
data_onunselected
.
call
(
$$
,
d
,
target
.
node
());
target
.
transition
().
duration
(
100
)
.
style
(
"fill"
,
function
()
{
return
$$
.
color
(
d
);
});
};
c3_chart_internal_fn
.
toggleBar
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectBar
(
target
,
d
,
i
)
:
this
.
unselectBar
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
toggleArc
=
function
(
selected
,
target
,
d
,
i
)
{
this
.
toggleBar
(
selected
,
target
,
d
,
i
);
c3_chart_internal_fn
.
togglePath
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectPath
(
target
,
d
,
i
)
:
this
.
unselectPath
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
getToggle
=
function
(
that
,
d
)
{
var
$$
=
this
,
shape
=
$$
.
d3
.
select
(
that
),
toggle
;
var
$$
=
this
,
toggle
;
if
(
that
.
nodeName
===
'circle'
)
{
if
(
$$
.
isStepType
(
d
))
{
// circle is hidden in step chart, so treat as within the click area
...
...
@@ -4750,11 +4746,7 @@
}
}
else
if
(
that
.
nodeName
===
'path'
)
{
if
(
shape
.
classed
(
CLASS
.
bar
))
{
toggle
=
$$
.
toggleBar
;
}
else
{
// would be arc
toggle
=
$$
.
toggleArc
;
}
toggle
=
$$
.
togglePath
;
}
return
toggle
;
};
...
...
c3.min.js
View file @
93c6a1eb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/drag.js
View file @
93c6a1eb
...
...
@@ -41,7 +41,7 @@ c3_chart_internal_fn.drag = function (mouse) {
_y
=
box
.
y
;
_w
=
box
.
width
;
_h
=
box
.
height
;
toggle
=
$$
.
toggle
Bar
;
toggle
=
$$
.
toggle
Path
;
isWithin
=
!
(
maxX
<
_x
||
_x
+
_w
<
minX
)
&&
!
(
maxY
<
_y
||
_y
+
_h
<
minY
);
}
else
{
// line/area selection not supported yet
...
...
src/selection.js
View file @
93c6a1eb
...
...
@@ -27,27 +27,23 @@ c3_chart_internal_fn.unselectPoint = function (target, d, i) {
c3_chart_internal_fn
.
togglePoint
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectPoint
(
target
,
d
,
i
)
:
this
.
unselectPoint
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
select
Bar
=
function
(
target
,
d
)
{
c3_chart_internal_fn
.
select
Path
=
function
(
target
,
d
)
{
var
$$
=
this
;
$$
.
config
.
data_onselected
.
call
(
$$
,
d
,
target
.
node
());
target
.
transition
().
duration
(
100
)
.
style
(
"fill"
,
function
()
{
return
$$
.
d3
.
rgb
(
$$
.
color
(
d
)).
brighter
(
0.75
);
});
};
c3_chart_internal_fn
.
unselect
Bar
=
function
(
target
,
d
)
{
c3_chart_internal_fn
.
unselect
Path
=
function
(
target
,
d
)
{
var
$$
=
this
;
$$
.
config
.
data_onunselected
.
call
(
$$
,
d
,
target
.
node
());
target
.
transition
().
duration
(
100
)
.
style
(
"fill"
,
function
()
{
return
$$
.
color
(
d
);
});
};
c3_chart_internal_fn
.
toggleBar
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectBar
(
target
,
d
,
i
)
:
this
.
unselectBar
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
toggleArc
=
function
(
selected
,
target
,
d
,
i
)
{
this
.
toggleBar
(
selected
,
target
,
d
,
i
);
c3_chart_internal_fn
.
togglePath
=
function
(
selected
,
target
,
d
,
i
)
{
selected
?
this
.
selectPath
(
target
,
d
,
i
)
:
this
.
unselectPath
(
target
,
d
,
i
);
};
c3_chart_internal_fn
.
getToggle
=
function
(
that
,
d
)
{
var
$$
=
this
,
shape
=
$$
.
d3
.
select
(
that
),
toggle
;
var
$$
=
this
,
toggle
;
if
(
that
.
nodeName
===
'circle'
)
{
if
(
$$
.
isStepType
(
d
))
{
// circle is hidden in step chart, so treat as within the click area
...
...
@@ -57,11 +53,7 @@ c3_chart_internal_fn.getToggle = function (that, d) {
}
}
else
if
(
that
.
nodeName
===
'path'
)
{
if
(
shape
.
classed
(
CLASS
.
bar
))
{
toggle
=
$$
.
toggleBar
;
}
else
{
// would be arc
toggle
=
$$
.
toggleArc
;
}
toggle
=
$$
.
togglePath
;
}
return
toggle
;
};
...
...
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