GraphNG: bring back tooltip (#29910)
This commit is contained in:
@@ -6,6 +6,34 @@ import { expect } from '../../../../../../public/test/lib/common';
|
||||
import { AreaGradientMode, AxisPlacement, DrawStyle, PointVisibility, ScaleDistribution } from '../config';
|
||||
|
||||
describe('UPlotConfigBuilder', () => {
|
||||
describe('default config', () => {
|
||||
it('builds default config', () => {
|
||||
const builder = new UPlotConfigBuilder();
|
||||
expect(builder.getConfig()).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"axes": Array [],
|
||||
"cursor": Object {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
"stroke": [Function],
|
||||
"width": [Function],
|
||||
},
|
||||
},
|
||||
"scales": Object {},
|
||||
"series": Array [
|
||||
Object {},
|
||||
],
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
describe('scales config', () => {
|
||||
it('allows scales configuration', () => {
|
||||
const builder = new UPlotConfigBuilder();
|
||||
@@ -24,6 +52,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
@@ -82,6 +113,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
@@ -121,6 +155,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
@@ -161,6 +198,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
@@ -234,6 +274,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
@@ -337,6 +380,9 @@ describe('UPlotConfigBuilder', () => {
|
||||
"drag": Object {
|
||||
"setScale": false,
|
||||
},
|
||||
"focus": Object {
|
||||
"prox": 30,
|
||||
},
|
||||
"points": Object {
|
||||
"fill": [Function],
|
||||
"size": [Function],
|
||||
|
||||
@@ -85,6 +85,9 @@ export class UPlotConfigBuilder {
|
||||
/*@ts-ignore*/
|
||||
fill: (u, seriesIdx) => u.series[seriesIdx].points.stroke(u, seriesIdx),
|
||||
},
|
||||
focus: {
|
||||
prox: 30,
|
||||
},
|
||||
};
|
||||
|
||||
defaultsDeep(config.cursor, cursorDefaults);
|
||||
|
||||
Reference in New Issue
Block a user