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
2e77578b
Commit
2e77578b
authored
Mar 30, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add onenter/onleave callback for data
parent
494bfaad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
c3.js
c3.js
+23
-2
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
2e77578b
...
@@ -132,6 +132,8 @@
...
@@ -132,6 +132,8 @@
__data_selection_isselectable
=
getConfig
([
'data'
,
'selection'
,
'isselectable'
],
function
()
{
return
true
;
}),
__data_selection_isselectable
=
getConfig
([
'data'
,
'selection'
,
'isselectable'
],
function
()
{
return
true
;
}),
__data_selection_multiple
=
getConfig
([
'data'
,
'selection'
,
'multiple'
],
true
),
__data_selection_multiple
=
getConfig
([
'data'
,
'selection'
,
'multiple'
],
true
),
__data_onclick
=
getConfig
([
'data'
,
'onclick'
],
function
()
{}),
__data_onclick
=
getConfig
([
'data'
,
'onclick'
],
function
()
{}),
__data_onenter
=
getConfig
([
'data'
,
'onenter'
],
function
()
{}),
__data_onleave
=
getConfig
([
'data'
,
'onleave'
],
function
()
{}),
__data_onselected
=
getConfig
([
'data'
,
'onselected'
],
function
()
{}),
__data_onselected
=
getConfig
([
'data'
,
'onselected'
],
function
()
{}),
__data_onunselected
=
getConfig
([
'data'
,
'onunselected'
],
function
()
{}),
__data_onunselected
=
getConfig
([
'data'
,
'onunselected'
],
function
()
{}),
__data_ondragstart
=
getConfig
([
'data'
,
'ondragstart'
],
function
()
{}),
__data_ondragstart
=
getConfig
([
'data'
,
'ondragstart'
],
function
()
{}),
...
@@ -260,7 +262,7 @@
...
@@ -260,7 +262,7 @@
isCategorized
=
(
__axis_x_type
===
'categorized'
),
isCategorized
=
(
__axis_x_type
===
'categorized'
),
isCustomX
=
!
isTimeSeries
&&
(
__data_x
||
notEmpty
(
__data_xs
));
isCustomX
=
!
isTimeSeries
&&
(
__data_x
||
notEmpty
(
__data_xs
));
var
dragStart
=
null
,
dragging
=
false
,
cancelClick
=
false
;
var
dragStart
=
null
,
dragging
=
false
,
cancelClick
=
false
,
mouseover
=
false
;
var
color
=
generateColor
(
__data_colors
,
__color_pattern
);
var
color
=
generateColor
(
__data_colors
,
__color_pattern
);
...
@@ -2462,6 +2464,11 @@
...
@@ -2462,6 +2464,11 @@
// Expand shapes if needed
// Expand shapes if needed
if
(
__point_focus_expand_enabled
)
{
expandCircles
(
i
);
}
if
(
__point_focus_expand_enabled
)
{
expandCircles
(
i
);
}
expandBars
(
i
);
expandBars
(
i
);
// Call event handler
main
.
selectAll
(
'.'
+
CLASS
.
shape
+
'-'
+
i
).
each
(
function
(
d
)
{
__data_onenter
(
d
);
});
})
})
.
on
(
'mouseout'
,
function
(
_
,
i
)
{
.
on
(
'mouseout'
,
function
(
_
,
i
)
{
if
(
hasArcType
(
c3
.
data
.
targets
))
{
return
;
}
if
(
hasArcType
(
c3
.
data
.
targets
))
{
return
;
}
...
@@ -2470,6 +2477,10 @@
...
@@ -2470,6 +2477,10 @@
// Undo expanded shapes
// Undo expanded shapes
unexpandCircles
(
i
);
unexpandCircles
(
i
);
unexpandBars
();
unexpandBars
();
// Call event handler
main
.
selectAll
(
'.'
+
CLASS
.
shape
+
'-'
+
i
).
each
(
function
(
d
)
{
__data_onleave
(
d
);
});
})
})
.
on
(
'mousemove'
,
function
(
_
,
i
)
{
.
on
(
'mousemove'
,
function
(
_
,
i
)
{
var
selectedData
;
var
selectedData
;
...
@@ -2566,7 +2577,17 @@
...
@@ -2566,7 +2577,17 @@
showXGridFocus
(
selectedData
);
showXGridFocus
(
selectedData
);
// Show cursor as pointer if point is close to mouse position
// Show cursor as pointer if point is close to mouse position
svg
.
select
(
'.'
+
CLASS
.
eventRect
).
style
(
'cursor'
,
dist
(
closest
,
mouse
)
<
100
?
'pointer'
:
null
);
if
(
dist
(
closest
,
mouse
)
<
100
)
{
svg
.
select
(
'.'
+
CLASS
.
eventRect
).
style
(
'cursor'
,
'pointer'
);
if
(
!
mouseover
)
{
__data_onenter
(
closest
);
mouseover
=
true
;
}
}
else
{
svg
.
select
(
'.'
+
CLASS
.
eventRect
).
style
(
'cursor'
,
null
);
__data_onleave
(
closest
);
mouseover
=
false
;
}
})
})
.
on
(
'click'
,
function
()
{
.
on
(
'click'
,
function
()
{
var
mouse
,
closest
;
var
mouse
,
closest
;
...
...
c3.min.js
View file @
2e77578b
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