Skip to content

Commit

Permalink
[7.x] [Vislib] Removes old implementation of xy chart (#110786) (#111558
Browse files Browse the repository at this point in the history
)

* [Vislib] Removes old implementation of xy chart (#110786)

* [Vislib] Remove xy chart

* Update i18n

* Remove uncecessary file

* Fix types

* More fixes

* Fix functional tests part 1

* Fix functional tests part 2

* Fix bug with shard-delay

* Fix functional tests part 3

* fix functional tests part4

* Fix async_serch FT

* Fix functional dashboard async test

* REplace screenshot area chart image

* Cleanup vislib from xy charts

* Remove unused fixtures

* Address PR comments

* Remove miaou :D

* Address PR comments

* Fix i18n

Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	docs/management/advanced-options.asciidoc
#	test/functional/screenshots/baseline/area_chart.png

* Fixes

* Remove setting from docs

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
stratoula and kibanamachine authored Sep 8, 2021
1 parent d381d36 commit 705d2b0
Show file tree
Hide file tree
Showing 100 changed files with 883 additions and 5,317 deletions.
4 changes: 0 additions & 4 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,6 @@ The maximum geoHash precision displayed in tile maps. 7 is high, 10 is very high
and 12 is the maximum. For more information, refer to
{ref}/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator[Cell dimensions at the equator].

[[visualization-visualize-chartslibrary]]`visualization:visualize:legacyChartsLibrary`::
**The legacy XY charts are deprecated and will not be supported as of 7.16.**
The visualize editor uses a new XY charts library with improved performance, color palettes, fill capacity, and more. Enable this option if you prefer to use the legacy charts library.

[[visualization-visualize-pieChartslibrary]]`visualization:visualize:legacyPieChartsLibrary`::
The visualize editor uses new pie charts with improved performance, color palettes, label positioning, and more. Enable this option if you prefer to use to the legacy charts library.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'visualization:visualize:legacyChartsLibrary': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'visualization:visualize:legacyPieChartsLibrary': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export interface UsageStats {
'autocomplete:useTimeRange': boolean;
'autocomplete:valueSuggestionMethod': string;
'search:timeout': number;
'visualization:visualize:legacyChartsLibrary': boolean;
'visualization:visualize:legacyPieChartsLibrary': boolean;
'doc_table:legacy': boolean;
'discover:modifyColumnsOnSwitch': boolean;
Expand Down
6 changes: 0 additions & 6 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7759,12 +7759,6 @@
"description": "Non-default value of setting."
}
},
"visualization:visualize:legacyChartsLibrary": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
}
},
"visualization:visualize:legacyPieChartsLibrary": {
"type": "boolean",
"_meta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const TimelionVisComponent = ({
}, [chart]);

return (
<div className="timelionChart" data-test-subj="visTypeXyChart">
<div className="timelionChart" data-test-subj="timelionChart">
{title && (
<EuiTitle className="timelionChart__topTitle" size="xxxs">
<h4>{title}</h4>
Expand Down
18 changes: 0 additions & 18 deletions src/plugins/vis_types/vislib/public/area.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions src/plugins/vis_types/vislib/public/histogram.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/plugins/vis_types/vislib/public/horizontal_bar.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/plugins/vis_types/vislib/public/line.ts

This file was deleted.

12 changes: 2 additions & 10 deletions src/plugins/vis_types/vislib/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,11 @@ import { VisualizationsSetup } from '../../../visualizations/public';
import { ChartsPluginSetup } from '../../../charts/public';
import { DataPublicPluginStart } from '../../../data/public';
import { KibanaLegacyStart } from '../../../kibana_legacy/public';
import { LEGACY_CHARTS_LIBRARY } from '../../xy/common/index';
import { LEGACY_PIE_CHARTS_LIBRARY } from '../../pie/common/index';

import { createVisTypeVislibVisFn } from './vis_type_vislib_vis_fn';
import { createPieVisFn } from './pie_fn';
import {
convertedTypeDefinitions,
pieVisTypeDefinition,
visLibVisTypeDefinitions,
} from './vis_type_vislib_vis_types';
import { visLibVisTypeDefinitions, pieVisTypeDefinition } from './vis_type_vislib_vis_types';
import { setFormatService, setDataActions } from './services';
import { getVislibVisRenderer } from './vis_renderer';

Expand Down Expand Up @@ -51,11 +46,8 @@ export class VisTypeVislibPlugin
core: VisTypeVislibCoreSetup,
{ expressions, visualizations, charts }: VisTypeVislibPluginSetupDependencies
) {
const typeDefinitions = !core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false)
? convertedTypeDefinitions
: visLibVisTypeDefinitions;
// register vislib XY axis charts
typeDefinitions.forEach(visualizations.createBaseVisualization);
visLibVisTypeDefinitions.forEach(visualizations.createBaseVisualization);
expressions.registerRenderer(getVislibVisRenderer(core, charts));
expressions.registerFunction(createVisTypeVislibVisFn());

Expand Down
5 changes: 0 additions & 5 deletions src/plugins/vis_types/vislib/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export const GaugeType = Object.freeze({
export type GaugeType = $Values<typeof GaugeType>;

export const VislibChartType = Object.freeze({
Histogram: 'histogram' as const,
HorizontalBar: 'horizontal_bar' as const,
Line: 'line' as const,
Pie: 'pie' as const,
Area: 'area' as const,
PointSeries: 'point_series' as const,
Heatmap: 'heatmap' as const,
Gauge: 'gauge' as const,
Goal: 'goal' as const,
Expand Down
14 changes: 0 additions & 14 deletions src/plugins/vis_types/vislib/public/vis_type_vislib_vis_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,13 @@
*/

import { VisTypeDefinition } from 'src/plugins/visualizations/public';
import { histogramVisTypeDefinition } from './histogram';
import { lineVisTypeDefinition } from './line';
import { areaVisTypeDefinition } from './area';
import { heatmapVisTypeDefinition } from './heatmap';
import { horizontalBarVisTypeDefinition } from './horizontal_bar';
import { gaugeVisTypeDefinition } from './gauge';
import { goalVisTypeDefinition } from './goal';

export { pieVisTypeDefinition } from './pie';

export const visLibVisTypeDefinitions: Array<VisTypeDefinition<any>> = [
histogramVisTypeDefinition,
lineVisTypeDefinition,
areaVisTypeDefinition,
heatmapVisTypeDefinition,
horizontalBarVisTypeDefinition,
gaugeVisTypeDefinition,
goalVisTypeDefinition,
];

export const convertedTypeDefinitions: Array<VisTypeDefinition<any>> = [
heatmapVisTypeDefinition,
gaugeVisTypeDefinition,
goalVisTypeDefinition,
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/vis_types/vislib/public/vislib/VISLIB.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Vislib general overview
# Charts supported

Vislib supports the heatmap and gauge/goal charts from the aggregation-based visualizations. It also contains the legacy implemementation of the pie chart (enabled by the visualization:visualize:legacyPieChartsLibrary advanced setting).

# General overview

`vis.js` constructor accepts vis parameters and render method accepts data. it exposes event emitter interface so we can listen to certain events like 'renderComplete'.

Expand All @@ -18,7 +22,4 @@ All base visualizations extend from `visualizations/_chart`

### Point series chart

`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them.

currently there are 3 series types available (line, area, bars), they all extend from `visualizations/point_series/_point_series`.

`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them.
1 change: 0 additions & 1 deletion src/plugins/vis_types/vislib/public/vislib/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
@import './components/tooltip/index';
@import './components/legend/index';

@import './visualizations/point_series/index';
@import './visualizations/gauges/index';
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('Vislib Axis Class Test Suite', function () {

const visConfig = new VisConfig(
{
type: 'histogram',
type: 'heatmap',
},
data,
mockUiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Vislib AxisTitle Class Test Suite', function () {
dataObj = new Data(data, getMockUiState(), () => undefined);
visConfig = new VisConfig(
{
type: 'histogram',
type: 'heatmap',
},
data,
getMockUiState(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Vislib xAxis Class Test Suite', function () {

const visConfig = new VisConfig(
{
type: 'histogram',
type: 'heatmap',
},
data,
mockUiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function createData(seriesData) {
buildYAxis = function (params) {
const visConfig = new VisConfig(
{
type: 'histogram',
type: 'heatmap',
},
data,
mockUiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Vislib ChartTitle Class Test Suite', function () {

const visConfig = new VisConfig(
{
type: 'histogram',
type: 'heatmap',
title: {
text: 'rows',
},
Expand Down
Loading

0 comments on commit 705d2b0

Please sign in to comment.