diff --git a/x-pack/plugins/ml/index.js b/x-pack/plugins/ml/index.js index ce511ad3f7d84..68971bd91cd2c 100644 --- a/x-pack/plugins/ml/index.js +++ b/x-pack/plugins/ml/index.js @@ -24,6 +24,7 @@ import { filtersRoutes } from './server/routes/filters'; import { resultsServiceRoutes } from './server/routes/results_service'; import { jobServiceRoutes } from './server/routes/job_service'; import { jobAuditMessagesRoutes } from './server/routes/job_audit_messages'; +import { fileDataVisualizerRoutes } from './server/routes/file_data_visualizer'; export const ml = (kibana) => { return new kibana.Plugin({ @@ -38,9 +39,10 @@ export const ml = (kibana) => { description: 'Machine Learning for the Elastic Stack', icon: 'plugins/ml/ml.svg', main: 'plugins/ml/app', + styleSheetPath: `${__dirname}/public/index.scss`, }, hacks: ['plugins/ml/hacks/toggle_app_link_in_nav'], - home: ['plugins/ml/register_feature'] + home: ['plugins/ml/register_feature'], }, @@ -72,7 +74,8 @@ export const ml = (kibana) => { const config = server.config(); return { kbnIndex: config.get('kibana.index'), - esServerUrl: config.get('elasticsearch.url') + esServerUrl: config.get('elasticsearch.url'), + maxPayloadBytes: config.get('server.maxPayloadBytes'), }; }); @@ -90,6 +93,7 @@ export const ml = (kibana) => { resultsServiceRoutes(server, commonRouteConfig); jobServiceRoutes(server, commonRouteConfig); jobAuditMessagesRoutes(server, commonRouteConfig); + fileDataVisualizerRoutes(server, commonRouteConfig); } }); diff --git a/x-pack/plugins/ml/public/app.js b/x-pack/plugins/ml/public/app.js index ad76c56cfdf19..1af1b28286b98 100644 --- a/x-pack/plugins/ml/public/app.js +++ b/x-pack/plugins/ml/public/app.js @@ -32,6 +32,7 @@ import 'plugins/ml/components/confirm_modal'; import 'plugins/ml/components/nav_menu'; import 'plugins/ml/components/loading_indicator'; import 'plugins/ml/settings'; +import 'plugins/ml/file_datavisualizer'; import uiRoutes from 'ui/routes'; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/_file_datavisualizer.scss b/x-pack/plugins/ml/public/file_datavisualizer/_file_datavisualizer.scss new file mode 100644 index 0000000000000..4e3f6c009ece3 --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/_file_datavisualizer.scss @@ -0,0 +1,5 @@ +@import 'components/index'; + +.file-datavisualizer-container { + padding: 20px; +} diff --git a/x-pack/plugins/ml/public/file_datavisualizer/_index.scss b/x-pack/plugins/ml/public/file_datavisualizer/_index.scss new file mode 100644 index 0000000000000..9e91116dfcf62 --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/_index.scss @@ -0,0 +1 @@ +@import 'file_datavisualizer'; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/_index.scss b/x-pack/plugins/ml/public/file_datavisualizer/components/_index.scss new file mode 100644 index 0000000000000..eef52ad53a14f --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/_index.scss @@ -0,0 +1,4 @@ +@import 'file_datavisualizer_view/index'; +@import 'results_view/index'; +@import 'summary/index'; +@import 'fields_stats/index'; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_field_stats_card.scss b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_field_stats_card.scss new file mode 100644 index 0000000000000..66d1ec2c16c1d --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_field_stats_card.scss @@ -0,0 +1,13 @@ +.card-container { + display: inline-grid; + padding: 0px 10px 10px 0px; +} + +.ml-field-data-card { + height: 408px; + + .card-contents { + height: 378px; + line-height: 21px; + } +} diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_fields_stats.scss b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_fields_stats.scss new file mode 100644 index 0000000000000..ac04fad0ef3e3 --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_fields_stats.scss @@ -0,0 +1,8 @@ +.fields-stats { + padding: 10px; +} +.field { + margin-bottom: 10px; +} + + diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_index.scss b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_index.scss new file mode 100644 index 0000000000000..fe6a232f016a3 --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/_index.scss @@ -0,0 +1,2 @@ +@import 'fields_stats'; +@import 'field_stats_card'; diff --git a/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/field_stats_card.js b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/field_stats_card.js new file mode 100644 index 0000000000000..b5430326dadd5 --- /dev/null +++ b/x-pack/plugins/ml/public/file_datavisualizer/components/fields_stats/field_stats_card.js @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + + +import React from 'react'; + +import { + EuiSpacer, + +} from '@elastic/eui'; + +import { FieldTypeIcon } from '../../../components/field_type_icon'; + +export function FieldStatsCard({ field }) { + + const percent = Math.round(field.percent * 100) / 100; + + let type = field.type; + if (type === 'double' || type === 'long') { + type = 'number'; + } + + return ( + +
+
+
+ +
{field.name}
+
+ +
+
+
+