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
b52fdaee
Commit
b52fdaee
authored
Nov 03, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix selection when zoom enabled - #598
parent
a1370f4e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
14 deletions
+22
-14
c3.js
c3.js
+11
-7
c3.min.js
c3.min.js
+0
-0
interaction.js
src/interaction.js
+2
-4
zoom.js
src/zoom.js
+9
-3
No files found.
c3.js
View file @
b52fdaee
...
...
@@ -2294,8 +2294,7 @@
.
on
(
'drag'
,
function
()
{
$$
.
drag
(
d3
.
mouse
(
this
));
})
.
on
(
'dragstart'
,
function
()
{
$$
.
dragstart
(
d3
.
mouse
(
this
));
})
.
on
(
'dragend'
,
function
()
{
$$
.
dragend
();
})
)
.
on
(
"dblclick.zoom"
,
null
);
);
};
c3_chart_internal_fn
.
generateEventRectsForMultipleXs
=
function
(
eventRectEnter
)
{
...
...
@@ -2383,8 +2382,7 @@
.
on
(
'drag'
,
function
()
{
$$
.
drag
(
d3
.
mouse
(
this
));
})
.
on
(
'dragstart'
,
function
()
{
$$
.
dragstart
(
d3
.
mouse
(
this
));
})
.
on
(
'dragend'
,
function
()
{
$$
.
dragend
();
})
)
.
on
(
"dblclick.zoom"
,
null
);
);
};
c3_chart_internal_fn
.
dispatchEvent
=
function
(
type
,
index
,
mouse
)
{
var
$$
=
this
,
...
...
@@ -5120,10 +5118,11 @@
};
c3_chart_internal_fn
.
initZoom
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
;
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
,
startEvent
;
$$
.
zoom
=
d3
.
behavior
.
zoom
()
.
on
(
"zoomstart"
,
function
()
{
startEvent
=
d3
.
event
.
sourceEvent
;
$$
.
zoom
.
altDomain
=
d3
.
event
.
sourceEvent
.
altKey
?
$$
.
x
.
orgDomain
()
:
null
;
config
.
zoom_onzoomstart
.
call
(
$$
.
api
,
d3
.
event
.
sourceEvent
);
})
...
...
@@ -5131,6 +5130,11 @@
$$
.
redrawForZoom
.
call
(
$$
);
})
.
on
(
'zoomend'
,
function
()
{
var
event
=
d3
.
event
.
sourceEvent
;
// if click, do nothing. otherwise, click interaction will be canceled.
if
(
event
&&
startEvent
.
x
===
event
.
x
&&
startEvent
.
y
===
event
.
y
)
{
return
;
}
$$
.
redrawEventRect
();
$$
.
updateZoom
();
config
.
zoom_onzoomend
.
call
(
$$
.
api
,
$$
.
x
.
orgDomain
());
...
...
@@ -5151,8 +5155,8 @@
};
c3_chart_internal_fn
.
updateZoom
=
function
()
{
var
$$
=
this
,
z
=
$$
.
config
.
zoom_enabled
?
$$
.
zoom
:
function
()
{};
$$
.
main
.
select
(
'.'
+
CLASS
.
zoomRect
).
call
(
z
);
$$
.
main
.
selectAll
(
'.'
+
CLASS
.
eventRect
).
call
(
z
);
$$
.
main
.
select
(
'.'
+
CLASS
.
zoomRect
).
call
(
z
)
.
on
(
"dblclick.zoom"
,
null
)
;
$$
.
main
.
selectAll
(
'.'
+
CLASS
.
eventRect
).
call
(
z
)
.
on
(
"dblclick.zoom"
,
null
)
;
};
c3_chart_internal_fn
.
redrawForZoom
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
,
zoom
=
$$
.
zoom
,
x
=
$$
.
x
;
...
...
c3.min.js
View file @
b52fdaee
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/interaction.js
View file @
b52fdaee
...
...
@@ -231,8 +231,7 @@ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
.
on
(
'drag'
,
function
()
{
$$
.
drag
(
d3
.
mouse
(
this
));
})
.
on
(
'dragstart'
,
function
()
{
$$
.
dragstart
(
d3
.
mouse
(
this
));
})
.
on
(
'dragend'
,
function
()
{
$$
.
dragend
();
})
)
.
on
(
"dblclick.zoom"
,
null
);
);
};
c3_chart_internal_fn
.
generateEventRectsForMultipleXs
=
function
(
eventRectEnter
)
{
...
...
@@ -320,8 +319,7 @@ c3_chart_internal_fn.generateEventRectsForMultipleXs = function (eventRectEnter)
.
on
(
'drag'
,
function
()
{
$$
.
drag
(
d3
.
mouse
(
this
));
})
.
on
(
'dragstart'
,
function
()
{
$$
.
dragstart
(
d3
.
mouse
(
this
));
})
.
on
(
'dragend'
,
function
()
{
$$
.
dragend
();
})
)
.
on
(
"dblclick.zoom"
,
null
);
);
};
c3_chart_internal_fn
.
dispatchEvent
=
function
(
type
,
index
,
mouse
)
{
var
$$
=
this
,
...
...
src/zoom.js
View file @
b52fdaee
c3_chart_internal_fn
.
initZoom
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
;
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
,
startEvent
;
$$
.
zoom
=
d3
.
behavior
.
zoom
()
.
on
(
"zoomstart"
,
function
()
{
startEvent
=
d3
.
event
.
sourceEvent
;
$$
.
zoom
.
altDomain
=
d3
.
event
.
sourceEvent
.
altKey
?
$$
.
x
.
orgDomain
()
:
null
;
config
.
zoom_onzoomstart
.
call
(
$$
.
api
,
d3
.
event
.
sourceEvent
);
})
...
...
@@ -10,6 +11,11 @@ c3_chart_internal_fn.initZoom = function () {
$$
.
redrawForZoom
.
call
(
$$
);
})
.
on
(
'zoomend'
,
function
()
{
var
event
=
d3
.
event
.
sourceEvent
;
// if click, do nothing. otherwise, click interaction will be canceled.
if
(
event
&&
startEvent
.
x
===
event
.
x
&&
startEvent
.
y
===
event
.
y
)
{
return
;
}
$$
.
redrawEventRect
();
$$
.
updateZoom
();
config
.
zoom_onzoomend
.
call
(
$$
.
api
,
$$
.
x
.
orgDomain
());
...
...
@@ -30,8 +36,8 @@ c3_chart_internal_fn.initZoom = function () {
};
c3_chart_internal_fn
.
updateZoom
=
function
()
{
var
$$
=
this
,
z
=
$$
.
config
.
zoom_enabled
?
$$
.
zoom
:
function
()
{};
$$
.
main
.
select
(
'.'
+
CLASS
.
zoomRect
).
call
(
z
);
$$
.
main
.
selectAll
(
'.'
+
CLASS
.
eventRect
).
call
(
z
);
$$
.
main
.
select
(
'.'
+
CLASS
.
zoomRect
).
call
(
z
)
.
on
(
"dblclick.zoom"
,
null
)
;
$$
.
main
.
selectAll
(
'.'
+
CLASS
.
eventRect
).
call
(
z
)
.
on
(
"dblclick.zoom"
,
null
)
;
};
c3_chart_internal_fn
.
redrawForZoom
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
,
config
=
$$
.
config
,
zoom
=
$$
.
zoom
,
x
=
$$
.
x
;
...
...
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