mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[explore] improve bubble viz (#2927)
* [explore] improve bubble viz * allow for custom axis formatters * reorg the control panels * Addressing comments
This commit is contained in:
committed by
GitHub
parent
591e512327
commit
3e51c61dbf
@@ -2,6 +2,7 @@ import { it, describe } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
import {
|
||||
tryNumify, slugify, formatSelectOptionsForRange, d3format,
|
||||
d3FormatPreset, d3TimeFormatPreset,
|
||||
} from '../../../javascripts/modules/utils';
|
||||
|
||||
describe('utils', () => {
|
||||
@@ -35,4 +36,20 @@ describe('utils', () => {
|
||||
expect(d3format('.3s', 1237)).to.equal('1.24k');
|
||||
expect(d3format('', 1237)).to.equal('1.24k');
|
||||
});
|
||||
describe('d3FormatPreset', () => {
|
||||
it('is a function', () => {
|
||||
assert.isFunction(d3FormatPreset);
|
||||
});
|
||||
it('returns a working formatter', () => {
|
||||
expect(d3FormatPreset('.3s')(3000000)).to.equal('3.00M');
|
||||
});
|
||||
});
|
||||
describe('d3TimeFormatPreset', () => {
|
||||
it('is a function', () => {
|
||||
assert.isFunction(d3TimeFormatPreset);
|
||||
});
|
||||
it('returns a working time formatter', () => {
|
||||
expect(d3FormatPreset('smart_date')(0)).to.equal('1970');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user