Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5a5e4cef
Commit
5a5e4cef
authored
Apr 18, 2013
by
Zachary Tong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate keypress service for sphere dragging
parent
7dc708d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
js/services.js
+4
-3
panels/map2/module.js
+4
-5
No files found.
js/services.js
View file @
5a5e4cef
...
...
@@ -110,13 +110,14 @@ angular.module('kibana.services', [])
.
service
(
'keylistener'
,
function
(
$rootScope
)
{
var
keys
=
[];
$
(
document
).
keydown
(
function
(
e
)
{
console
.
log
(
"keydown"
,
e
.
which
);
keys
[
e
.
which
]
=
true
;
});
$
(
document
).
keyup
(
function
(
e
)
{
console
.
log
(
"keyup"
,
e
.
which
);
delete
keys
[
e
.
which
];
});
});
this
.
keyActive
=
function
(
key
)
{
return
keys
[
key
]
==
true
;
}
});
panels/map2/module.js
View file @
5a5e4cef
...
...
@@ -60,7 +60,7 @@ angular.module('kibana.map2', [])
// Now that we're all setup, request the time from our group
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'get_time'
);
$scope
.
keylistener
=
keylistener
;
};
...
...
@@ -276,7 +276,7 @@ angular.module('kibana.map2', [])
scope
.
zoom
=
d3
.
behavior
.
zoom
()
.
scaleExtent
([
1
,
8
])
.
scaleExtent
([
1
,
20
])
.
on
(
"zoom"
,
translate_map
);
//used by choropleth
...
...
@@ -410,7 +410,6 @@ angular.module('kibana.map2', [])
//If this is a sphere, set up drag and keypress listeners
//@todo implement a global "keypress service", since this fails if there are >1 spheres
if
(
scope
.
panel
.
display
.
data
.
type
===
'orthographic'
)
{
//scope.svg.focus();
...
...
@@ -429,7 +428,7 @@ angular.module('kibana.map2', [])
.
call
(
d3
.
behavior
.
drag
()
.
origin
(
function
()
{
var
rotate
=
scope
.
projection
.
rotate
();
return
{
x
:
2
*
rotate
[
0
],
y
:
-
2
*
rotate
[
1
]};
})
.
on
(
"drag"
,
function
()
{
if
(
scope
.
ctrlKey
)
{
if
(
scope
.
keylistener
.
keyActive
(
17
)
)
{
scope
.
projection
.
rotate
([
d3
.
event
.
x
/
2
,
-
d3
.
event
.
y
/
2
,
scope
.
projection
.
rotate
()[
2
]]);
scope
.
svg
.
selectAll
(
"path"
).
attr
(
"d"
,
path
);
}
...
...
@@ -472,7 +471,7 @@ angular.module('kibana.map2', [])
var
width
=
$
(
elem
[
0
]).
width
(),
height
=
$
(
elem
[
0
]).
height
();
if
(
!
scope
.
ctrlKey
)
{
if
(
!
scope
.
keylistener
.
keyActive
(
17
)
)
{
var
t
=
d3
.
event
.
translate
,
s
=
d3
.
event
.
scale
;
t
[
0
]
=
Math
.
min
(
width
/
2
*
(
s
-
1
),
Math
.
max
(
width
/
2
*
(
1
-
s
),
t
[
0
]));
...
...
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