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
db7cf3a9
Commit
db7cf3a9
authored
Apr 18, 2013
by
Zachary Tong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ordinal scale for string-based fields
parent
6a799b6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
panels/parallelcoordinates/module.js
+20
-18
No files found.
panels/parallelcoordinates/module.js
View file @
db7cf3a9
...
...
@@ -46,7 +46,6 @@ angular.module('kibana.parallelcoordinates', [])
$scope
.
get_data
();
});
eventBus
.
register
(
$scope
,
'selected_fields'
,
function
(
event
,
fields
)
{
console
.
log
(
"selected_fields"
,
fields
);
$scope
.
panel
.
fields
=
_
.
clone
(
fields
)
$scope
.
$emit
(
'render'
);
});
...
...
@@ -55,8 +54,6 @@ angular.module('kibana.parallelcoordinates', [])
$scope
.
get_data
=
function
(
segment
,
query_id
)
{
console
.
log
(
"get_data"
);
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
panel
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
;
...
...
@@ -119,10 +116,6 @@ angular.module('kibana.parallelcoordinates', [])
}
else
{
return
;
}
console
.
log
(
"emit render"
);
console
.
log
(
"data"
,
$scope
.
data
);
$scope
.
$emit
(
'render'
)
});
...
...
@@ -146,7 +139,6 @@ angular.module('kibana.parallelcoordinates', [])
$scope
.
$watch
(
'activeDocs'
,
function
(
v
)
{
//console.log("Watch", $scope.activeDocs);
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
"table_documents"
,
{
query
:
$scope
.
panel
.
query
,
docs
:
$scope
.
activeDocs
});
});
...
...
@@ -335,17 +327,32 @@ angular.module('kibana.parallelcoordinates', [])
scope
.
panel
.
fields
.
forEach
(
function
(
d
)
{
scope
.
y
[
d
]
=
d3
.
scale
.
linear
()
.
domain
(
d3
.
extent
(
scope
.
data
,
function
(
p
)
{
return
+
p
[
d
];
}))
.
range
([
scope
.
h
,
0
]);
if
(
_
.
isString
(
scope
.
data
[
0
][
d
]))
{
var
value
=
function
(
v
)
{
return
v
[
d
];
};
var
values
=
_
.
map
(
_
.
uniq
(
scope
.
data
,
value
),
value
);
scope
.
y
[
d
]
=
d3
.
scale
.
ordinal
()
.
domain
(
values
)
.
rangeBands
([
scope
.
h
,
0
]);
}
else
if
(
_
.
isNumber
(
scope
.
data
[
0
][
d
]))
{
scope
.
y
[
d
]
=
d3
.
scale
.
linear
()
.
domain
(
d3
.
extent
(
scope
.
data
,
function
(
p
)
{
return
+
p
[
d
];
}))
.
range
([
scope
.
h
,
0
]);
}
scope
.
y
[
d
].
brush
=
d3
.
svg
.
brush
()
.
y
(
scope
.
y
[
d
])
.
on
(
"brush"
,
brush
);
});
console
.
log
(
"render y"
,
scope
.
y
);
var
activeData
=
_
.
map
(
scope
.
data
,
function
(
d
)
{
...
...
@@ -377,10 +384,6 @@ angular.module('kibana.parallelcoordinates', [])
scope
.
foregroundLines
.
exit
().
remove
();
console
.
log
(
"Render Fields"
,
scope
.
panel
.
fields
);
...
...
@@ -428,7 +431,6 @@ angular.module('kibana.parallelcoordinates', [])
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"axis"
)
.
each
(
function
(
d
)
{
console
.
log
(
"axis"
,
d
)
d3
.
select
(
this
)
.
call
(
scope
.
axis
.
scale
(
scope
.
y
[
d
]))
.
attr
(
"transform"
,
function
(
d
)
{
return
"translate("
+
scope
.
x
(
d
)
+
")"
;
});
...
...
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