Add length and volume units.

This commit is contained in:
Greg Look
2015-10-14 14:13:21 -07:00
parent dc5c3a3939
commit 3c7a483f5c

View File

@@ -347,12 +347,20 @@ function($, _) {
kbn.valueFormats.pressurembar = kbn.formatBuilders.fixedUnit('mbar');
kbn.valueFormats.pressurehpa = kbn.formatBuilders.fixedUnit('hPa');
// Length
kbn.valueFormats.lengthm = kbn.formatBuilders.decimalSIPrefix('m');
kbn.valueFormats.lengthkm = kbn.formatBuilders.decimalSIPrefix('m', 1);
// Velocity
kbn.valueFormats.velocityms = kbn.formatBuilders.fixedUnit('m/s');
kbn.valueFormats.velocitykmh = kbn.formatBuilders.fixedUnit('km/h');
kbn.valueFormats.velocitymph = kbn.formatBuilders.fixedUnit('mph');
kbn.valueFormats.velocityknot = kbn.formatBuilders.fixedUnit('kn');
// Volume
kbn.valueFormats.litre = kbn.formatBuilders.decimalSIPrefix('L');
kbn.valueFormats.mlitre = kbn.formatBuilders.decimalSIPrefix('L', -1);
// Time
kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz');
@@ -485,6 +493,32 @@ function($, _) {
{text: 'bytes/sec', value: 'Bps'},
]
},
{
text: 'length',
submenu: [
{text: 'millimetre (mm)', value: 'lengthmm'},
{text: 'meter (m)', value: 'lengthm' },
{text: 'kilometer (km)', value: 'lengthm' },
{text: 'inches', value: 'lengthin'},
{text: 'feet', value: 'lengthft'},
]
},
{
text: 'velocity',
submenu: [
{text: 'm/s', value: 'velocityms' },
{text: 'km/h', value: 'velocitykmh' },
{text: 'mph', value: 'velocitymph' },
{text: 'knot (kn)', value: 'velocityknot'},
]
},
{
text: 'volume',
submenu: [
{text: 'millilitre', value: 'mlitre'},
{text: 'litre', value: 'litre' },
]
},
{
text: 'energy',
submenu: [
@@ -508,15 +542,6 @@ function($, _) {
{text: 'Pressure (hPa)', value: 'pressurehpa' },
]
},
{
text: 'velocity',
submenu: [
{text: 'm/s', value: 'velocityms' },
{text: 'km/h', value: 'velocitykmh' },
{text: 'mph', value: 'velocitymph' },
{text: 'knot (kn)', value: 'velocityknot'},
]
},
];
};