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
ce5b4089
Commit
ce5b4089
authored
Oct 22, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new-units' of
https://github.com/counsyl/grafana
into counsyl-new-units
parents
0903aa45
882a9881
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
public/app/components/kbn.js
+0
-0
public/test/specs/kbn-format-specs.js
+31
-0
No files found.
public/app/components/kbn.js
View file @
ce5b4089
This diff is collapsed.
Click to expand it.
public/test/specs/kbn-format-specs.js
View file @
ce5b4089
...
@@ -4,6 +4,25 @@ define([
...
@@ -4,6 +4,25 @@ define([
],
function
(
kbn
,
dateMath
)
{
],
function
(
kbn
,
dateMath
)
{
'use strict'
;
'use strict'
;
describe
(
'unit format menu'
,
function
()
{
var
menu
=
kbn
.
getUnitFormats
();
menu
.
map
(
function
(
submenu
)
{
describe
(
'submenu '
+
submenu
.
text
,
function
()
{
it
(
'should have a title'
,
function
()
{
expect
(
submenu
.
text
).
to
.
be
.
a
(
'string'
);
});
it
(
'should have a submenu'
,
function
()
{
expect
(
submenu
.
submenu
).
to
.
be
.
an
(
'array'
);
});
submenu
.
submenu
.
map
(
function
(
entry
)
{
describe
(
'entry '
+
entry
.
text
,
function
()
{
it
(
'should have a title'
,
function
()
{
expect
(
entry
.
text
).
to
.
be
.
a
(
'string'
);
});
it
(
'should have a format'
,
function
()
{
expect
(
entry
.
value
).
to
.
be
.
a
(
'string'
);
});
it
(
'should have a valid format'
,
function
()
{
expect
(
kbn
.
valueFormats
[
entry
.
value
]).
to
.
be
.
a
(
'function'
);
});
});
});
});
});
});
function
describeValueFormat
(
desc
,
value
,
tickSize
,
tickDecimals
,
result
)
{
function
describeValueFormat
(
desc
,
value
,
tickSize
,
tickDecimals
,
result
)
{
describe
(
'value format: '
+
desc
,
function
()
{
describe
(
'value format: '
+
desc
,
function
()
{
...
@@ -26,6 +45,18 @@ define([
...
@@ -26,6 +45,18 @@ define([
describeValueFormat
(
'none'
,
2.75
e
-
10
,
0
,
10
,
'3e-10'
);
describeValueFormat
(
'none'
,
2.75
e
-
10
,
0
,
10
,
'3e-10'
);
describeValueFormat
(
'none'
,
0
,
0
,
2
,
'0'
);
describeValueFormat
(
'none'
,
0
,
0
,
2
,
'0'
);
describeValueFormat
(
'dB'
,
10
,
1000
,
2
,
'10.00 dB'
);
describeValueFormat
(
'percent'
,
0
,
0
,
0
,
'0%'
);
describeValueFormat
(
'percent'
,
53
,
0
,
1
,
'53.0%'
);
describeValueFormat
(
'percentunit'
,
0.0
,
0
,
0
,
'0%'
);
describeValueFormat
(
'percentunit'
,
0.278
,
0
,
1
,
'27.8%'
);
describeValueFormat
(
'percentunit'
,
1.0
,
0
,
0
,
'100%'
);
describeValueFormat
(
'currencyUSD'
,
7.42
,
10000
,
2
,
'$7.42'
);
describeValueFormat
(
'currencyUSD'
,
1532.82
,
1000
,
1
,
'$1.53K'
);
describeValueFormat
(
'currencyUSD'
,
18520408.7
,
10000000
,
0
,
'$19M'
);
describeValueFormat
(
'bytes'
,
-
1.57
e
+
308
,
-
1.57
e
+
308
,
2
,
'NA'
);
describeValueFormat
(
'bytes'
,
-
1.57
e
+
308
,
-
1.57
e
+
308
,
2
,
'NA'
);
describeValueFormat
(
'ns'
,
25
,
1
,
0
,
'25 ns'
);
describeValueFormat
(
'ns'
,
25
,
1
,
0
,
'25 ns'
);
...
...
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