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
925e106e
Commit
925e106e
authored
Oct 21, 2013
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix zoom/drag/click conflict
parent
48cffd86
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
c3.js
c3.js
+13
-3
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
925e106e
...
...
@@ -33,6 +33,8 @@
var
__size_width
=
getConfig
([
'size'
,
'width'
],
null
),
__size_height
=
getConfig
([
'size'
,
'height'
],
280
);
var
__zoom_enabled
=
getConfig
([
'zoom'
,
'enabled'
],
false
);
// data - data configuration
checkConfig
(
'data'
,
'data is required in config'
);
...
...
@@ -137,7 +139,7 @@
var
isTimeSeries
=
(
__axis_x_type
===
'timeseries'
),
isCategorized
=
(
__axis_x_type
===
'categorized'
);
var
dragStart
=
null
,
dragging
=
false
;
var
dragStart
=
null
,
dragging
=
false
,
cancelClick
=
false
;
var
legendHeight
=
__legend_show
?
40
:
0
;
...
...
@@ -908,7 +910,7 @@
.
attr
(
'width'
,
width
)
.
attr
(
'height'
,
height
)
.
style
(
'opacity'
,
0
)
.
call
(
zoom
);
.
call
(
zoom
)
.
on
(
"dblclick.zoom"
,
null
)
;
// Grids
grid
=
main
.
append
(
'g'
)
...
...
@@ -1066,6 +1068,10 @@
});
})
.
on
(
'click'
,
function
(
d
,
i
)
{
if
(
cancelClick
)
{
cancelClick
=
false
;
return
;
}
main
.
selectAll
(
'.-shape-'
+
i
).
each
(
function
(
d
){
var
_this
=
d3
.
select
(
this
),
isSelected
=
_this
.
classed
(
SELECTED
);
...
...
@@ -1090,6 +1096,7 @@
.
call
(
d3
.
behavior
.
drag
().
origin
(
Object
).
on
(
'drag'
,
function
(
d
){
if
(
!
__data_selection_enabled
)
return
;
// do nothing if not selectable
if
(
__zoom_enabled
)
return
;
// skip if zoomable because of conflict drag dehavior
var
sx
=
dragStart
[
0
],
sy
=
dragStart
[
1
],
mouse
=
d3
.
mouse
(
this
),
...
...
@@ -1153,7 +1160,7 @@
// TODO: add callback here
})
)
.
call
(
zoom
);
.
call
(
zoom
)
.
on
(
"dblclick.zoom"
,
null
)
;
// Define g for bar chart area
main
.
select
(
".chart"
).
append
(
"g"
)
...
...
@@ -1438,6 +1445,9 @@
withSubchart
:
false
,
withUpdateXDomain
:
false
});
if
(
d3
.
event
.
sourceEvent
.
type
===
'mousemove'
)
{
cancelClick
=
true
;
}
}
function
resize
()
{
...
...
c3.min.js
View file @
925e106e
This diff is collapsed.
Click to expand it.
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