Commit e8e1c140 by Dominik Prokop Committed by GitHub

GraphNG: bring back tooltip (#29910)

parent 6c1f8b9c
...@@ -6,6 +6,34 @@ import { expect } from '../../../../../../public/test/lib/common'; ...@@ -6,6 +6,34 @@ import { expect } from '../../../../../../public/test/lib/common';
import { AreaGradientMode, AxisPlacement, DrawStyle, PointVisibility, ScaleDistribution } from '../config'; import { AreaGradientMode, AxisPlacement, DrawStyle, PointVisibility, ScaleDistribution } from '../config';
describe('UPlotConfigBuilder', () => { 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', () => { describe('scales config', () => {
it('allows scales configuration', () => { it('allows scales configuration', () => {
const builder = new UPlotConfigBuilder(); const builder = new UPlotConfigBuilder();
...@@ -24,6 +52,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -24,6 +52,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
...@@ -82,6 +113,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -82,6 +113,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
...@@ -121,6 +155,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -121,6 +155,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
...@@ -161,6 +198,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -161,6 +198,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
...@@ -234,6 +274,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -234,6 +274,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
...@@ -337,6 +380,9 @@ describe('UPlotConfigBuilder', () => { ...@@ -337,6 +380,9 @@ describe('UPlotConfigBuilder', () => {
"drag": Object { "drag": Object {
"setScale": false, "setScale": false,
}, },
"focus": Object {
"prox": 30,
},
"points": Object { "points": Object {
"fill": [Function], "fill": [Function],
"size": [Function], "size": [Function],
......
...@@ -85,6 +85,9 @@ export class UPlotConfigBuilder { ...@@ -85,6 +85,9 @@ export class UPlotConfigBuilder {
/*@ts-ignore*/ /*@ts-ignore*/
fill: (u, seriesIdx) => u.series[seriesIdx].points.stroke(u, seriesIdx), fill: (u, seriesIdx) => u.series[seriesIdx].points.stroke(u, seriesIdx),
}, },
focus: {
prox: 30,
},
}; };
defaultsDeep(config.cursor, cursorDefaults); defaultsDeep(config.cursor, cursorDefaults);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment