Ejemplo n.º 1
0
 */

import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { TimelionRequestHandlerProvider } from './timelion_request_handler';
import { DefaultEditorSize } from 'ui/vis/editor_size';

// we also need to load the controller and directive used by the template
import './timelion_vis_controller';
import '../directives/timelion_expression_input';

import visConfigTemplate from './timelion_vis.html';
import editorConfigTemplate from './timelion_vis_params.html';

// register the provider with the visTypes registry so that other know it exists
VisTypesRegistryProvider.register(TimelionVisProvider);

export default function TimelionVisProvider(Private, i18n) {
  const VisFactory = Private(VisFactoryProvider);
  const timelionRequestHandler = Private(TimelionRequestHandlerProvider);

  // return the visType object, which kibana will use to display and configure new
  // Vis object of this type.
  return VisFactory.createAngularVisualization({
    name: 'timelion',
    title: 'Timelion',
    icon: 'visTimelion',
    description: i18n('timelion.timelionDescription', {
      defaultMessage: 'Build time-series using functional expressions',
    }),
    visConfig: {
Ejemplo n.º 2
0
import 'plugins/metric_vis/metric_vis.less';
import 'plugins/metric_vis/metric_vis_params';
import 'plugins/metric_vis/metric_vis_controller';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { CATEGORY } from 'ui/vis/vis_category';
import { VisSchemasProvider } from 'ui/vis/editors/default/schemas';
import metricVisTemplate from 'plugins/metric_vis/metric_vis.html';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { vislibColorMaps } from 'ui/vislib/components/color/colormaps';
import image from './images/icon-number.svg';
// we need to load the css ourselves

// we also need to load the controller and used by the template

// register the provider with the visTypes registry
VisTypesRegistryProvider.register(MetricVisProvider);

function MetricVisProvider(Private) {
  const Schemas = Private(VisSchemasProvider);
  const VisFactory = Private(VisFactoryProvider);

  // return the visType object, which kibana will use to display and configure new
  // Vis object of this type.
  return VisFactory.createAngularVisualization({
    name: 'metric',
    title: 'Metric',
    image,
    description: 'Display a calculation as a single number',
    category: CATEGORY.DATA,
    visConfig: {
      defaults: {
Ejemplo n.º 3
0
 * under the License.
 */

import './markdown_vis.less';
import { MarkdownVisWrapper } from './markdown_vis_controller';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { CATEGORY } from 'ui/vis/vis_category';
import markdownVisParamsTemplate from './markdown_vis_params.html';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { DefaultEditorSize } from 'ui/vis/editor_size';
// we need to load the css ourselves

// we also need to load the controller and used by the template

// register the provider with the visTypes registry so that other know it exists
VisTypesRegistryProvider.register(MarkdownVisProvider);

function MarkdownVisProvider(Private) {
  const VisFactory = Private(VisFactoryProvider);

  // return the visType object, which kibana will use to display and configure new
  // Vis object of this type.
  return VisFactory.createReactVisualization({
    name: 'markdown',
    title: 'Markdown',
    isAccessible: true,
    icon: 'visText',
    description: 'Create a document using markdown syntax',
    category: CATEGORY.OTHER,
    visConfig: {
      component: MarkdownVisWrapper,
        },
        {
          group: 'buckets',
          name: 'viewBy',
          icon: 'fa fa-eye',
          title: 'View by',
          mustBeFirst: true,
          min: 0,
          max: 1,
          aggFilter: ['terms']
        },
        {
          group: 'buckets',
          name: 'timeSplit',
          icon: 'fa fa-th',
          title: 'Time field',
          min: 1,
          max: 1,
          aggFilter: ['date_histogram']
        }
      ])
    }
  });
}

// register the provider with the visTypes registry
VisTypesRegistryProvider.register(PrelertSwimlaneProvider);

// export the provider so that the visType can be required with Private()
export default PrelertSwimlaneProvider;
  import 'plugins/kbn_picture_values_vis/kbn_picture_values_vis.less';
  import 'plugins/kbn_picture_values_vis/kbn_picture_values_vis_controller';

  import {
    TemplateVisTypeProvider
  } from 'ui/template_vis_type/template_vis_type';
  import {
    VisSchemasProvider
  } from 'ui/vis/schemas';
  import kbnPictureValuesVisTemplate from 'plugins/kbn_picture_values_vis/kbn_picture_values_vis.html';

  import {
    VisTypesRegistryProvider
  } from 'ui/registry/vis_types';

  VisTypesRegistryProvider.register(KbnPictureValuesVisProvider);

  function KbnPictureValuesVisProvider(Private) {
    const TemplateVisType = Private(TemplateVisTypeProvider);
    const Schemas = Private(VisSchemasProvider);

    var options = [{
      text: 'CUENTA',
      letter: '\uf119',
      numeralFormat: '$0,0.0',
      ranges: [{
        min: 0,
        max: 2000,
        valueColor: 'red',
        letter: '\uf119'
      }, {
Ejemplo n.º 6
0
VisTypesRegistryProvider.register(function TileMapVisType(Private, getAppState, courier, config) {

  const Schemas = Private(VisSchemasProvider);
  const geoJsonConverter = Private(AggResponseGeoJsonProvider);
  const VisFactory = Private(VisFactoryProvider);
  const CoordinateMapsVisualization = Private(CoordinateMapsVisualizationProvider);

  return VisFactory.createBaseVisualization({
    name: 'tile_map',
    title: 'Coordinate Map',
    image,
    description: 'Plot latitude and longitude coordinates on a map',
    category: CATEGORY.MAP,
    visConfig: {
      canDesaturate: !!supports.cssFilters,
      defaults: {
        mapType: 'Scaled Circle Markers',
        isDesaturated: true,
        addTooltip: true,
        heatClusterSize: 1.5,
        legendPosition: 'bottomright',
        mapZoom: 2,
        mapCenter: [0, 0],
        wms: config.get('visualization:tileMap:WMSdefaults')
      }
    },
    responseConverter: geoJsonConverter,
    responseHandler: 'basic',
    visualization: CoordinateMapsVisualization,
    editorConfig: {
      collections: {
        legendPositions: [{
          value: 'bottomleft',
          text: 'bottom left',
        }, {
          value: 'bottomright',
          text: 'bottom right',
        }, {
          value: 'topleft',
          text: 'top left',
        }, {
          value: 'topright',
          text: 'top right',
        }],
        mapTypes: [
          'Scaled Circle Markers',
          'Shaded Circle Markers',
          'Shaded Geohash Grid',
          'Heatmap'
        ],
        baseLayers: []
      },
      optionsTemplate: '<tile-map-vis-params></tile-map-vis-params>',
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: 'Value',
          min: 1,
          max: 1,
          aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          title: 'Geo Coordinates',
          aggFilter: 'geohash_grid',
          min: 1,
          max: 1
        }
      ])
    }
  });

});
Ejemplo n.º 7
0
        updateFiltersOnChange: false,
        useTimeFilter: false,
        pinFilters: false,
      },
    },
    editor: 'default',
    editorConfig: {
      optionTabs: [
        {
          name: 'controls',
          title: 'Controls',
          editor: ControlsTab
        },
        {
          name: 'options',
          title: 'Options',
          editor: OptionsTab
        }
      ]
    },
    requestHandler: 'none',
    responseHandler: 'none',
  });
}

// register the provider with the visTypes registry
VisTypesRegistryProvider.register(InputControlVisProvider);

// export the provider so that the visType can be required with Private()
export default InputControlVisProvider;
Ejemplo n.º 8
0
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import { VisTypesRegistryProvider } from 'ui/registry/vis_types';

import histogramVisTypeProvider from './histogram';
import lineVisTypeProvider from './line';
import pieVisTypeProvider from './pie';
import areaVisTypeProvider from './area';
import heatmapVisTypeProvider from './heatmap';
import horizontalBarVisTypeProvider from './horizontal_bar';
import gaugeVisTypeProvider from './gauge';
import goalVisTypeProvider from './goal';

VisTypesRegistryProvider.register(histogramVisTypeProvider);
VisTypesRegistryProvider.register(lineVisTypeProvider);
VisTypesRegistryProvider.register(pieVisTypeProvider);
VisTypesRegistryProvider.register(areaVisTypeProvider);
VisTypesRegistryProvider.register(heatmapVisTypeProvider);
VisTypesRegistryProvider.register(horizontalBarVisTypeProvider);
VisTypesRegistryProvider.register(gaugeVisTypeProvider);
VisTypesRegistryProvider.register(goalVisTypeProvider);
Ejemplo n.º 9
0
VisTypesRegistryProvider.register(function TagCloudProvider(Private) {
  const VisFactory = Private(VisFactoryProvider);
  const Schemas = Private(VisSchemasProvider);

  return VisFactory.createAngularVisualization({
    name: 'tagcloud',
    title: 'Tag Cloud',
    image,
    description: 'A group of words, sized according to their importance',
    category: CATEGORY.OTHER,
    visConfig: {
      defaults: {
        scale: 'linear',
        orientation: 'single',
        minFontSize: 18,
        maxFontSize: 72
      },
      template: tagCloudTemplate,
    },
    responseHandler: 'tabify',
    editorConfig: {
      collections: {
        scales: ['linear', 'log', 'square root'],
        orientations: ['single', 'right angled', 'multiple'],
      },
      optionsTemplate: '<tagcloud-vis-params></tagcloud-vis-params>',
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: 'Tag Size',
          min: 1,
          max: 1,
          aggFilter: ['!std_dev', '!percentiles', '!percentile_ranks', '!derivative','!geo_bounds','!geo_centroid'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          icon: 'fa fa-cloud',
          title: 'Tags',
          min: 1,
          max: 1,
          aggFilter: ['terms']
        }
      ])
    }
  });
});
Ejemplo n.º 10
0
VisTypesRegistryProvider.register(function TileMapVisType(Private, getAppState, courier, config) {

  const VisFactory = Private(VisFactoryProvider);
  const CoordinateMapsVisualization = Private(CoordinateMapsVisualizationProvider);

  return VisFactory.createBaseVisualization({
    name: 'tile_map',
    title: 'Coordinate Map',
    icon: 'visMapCoordinate',
    description: 'Plot latitude and longitude coordinates on a map',
    category: CATEGORY.MAP,
    visConfig: {
      canDesaturate: !!supports.cssFilters,
      defaults: {
        colorSchema: 'Yellow to Red',
        mapType: 'Scaled Circle Markers',
        isDesaturated: true,
        addTooltip: true,
        heatClusterSize: 1.5,
        legendPosition: 'bottomright',
        mapZoom: 2,
        mapCenter: [0, 0],
        wms: config.get('visualization:tileMap:WMSdefaults')
      }
    },
    requiresUpdateStatus: [Status.AGGS, Status.PARAMS, Status.RESIZE, Status.UI_STATE],
    responseHandler: makeGeoJsonResponseHandler(),
    requiresPartialRows: true,
    visualization: CoordinateMapsVisualization,
    editorConfig: {
      collections: {
        colorSchemas: Object.keys(truncatedColorMaps),
        legendPositions: [{
          value: 'bottomleft',
          text: 'bottom left',
        }, {
          value: 'bottomright',
          text: 'bottom right',
        }, {
          value: 'topleft',
          text: 'top left',
        }, {
          value: 'topright',
          text: 'top right',
        }],
        mapTypes: [
          'Scaled Circle Markers',
          'Shaded Circle Markers',
          'Shaded Geohash Grid',
          'Heatmap'
        ],
        tmsLayers: [],
      },
      optionsTemplate: '<tile-map-vis-params></tile-map-vis-params>',
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: 'Value',
          min: 1,
          max: 1,
          aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          title: 'Geo Coordinates',
          aggFilter: 'geohash_grid',
          min: 1,
          max: 1
        }
      ])
    }
  });

});
Ejemplo n.º 11
0
import { Schemas } from 'ui/vis/editors/default/schemas';
import tableVisTemplate from './table_vis.html';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import { LegacyResponseHandlerProvider as legacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy';
import { VisFiltersProvider } from 'ui/vis/vis_filters';

// we need to load the css ourselves

// we also need to load the controller and used by the template

// our params are a bit complex so we will manage them with a directive

// require the directives that we use as well

// register the provider with the visTypes registry
VisTypesRegistryProvider.register(TableVisTypeProvider);

const legacyTableResponseHandler = legacyResponseHandlerProvider().handler;

// define the TableVisType
function TableVisTypeProvider(Private) {
  const VisFactory = Private(VisFactoryProvider);
  const visFilters = Private(VisFiltersProvider);

  // define the TableVisController which is used in the template
  // by angular's ng-controller directive

  // return the visType object, which kibana will use to display and configure new
  // Vis object of this type.
  return VisFactory.createAngularVisualization({
    type: 'table',
Ejemplo n.º 12
0
VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config) {
  const VisFactory = Private(VisFactoryProvider);
  const Schemas = Private(VisSchemasProvider);
  const RegionMapsVisualization = Private(RegionMapsVisualizationProvider);

  const vectorLayers = regionmapsConfig.layers.map(mapToLayerWithId.bind(null, 'self_hosted'));
  const selectedLayer = vectorLayers[0];
  const selectedJoinField = selectedLayer ? vectorLayers[0].fields[0] : null;

  return VisFactory.createBaseVisualization({
    name: 'region_map',
    title: 'Region Map',
    description: 'Show metrics on a thematic map. Use one of the provide base maps, or add your own. ' +
    'Darker colors represent higher values.',
    category: CATEGORY.MAP,
    image,
    visConfig: {
      defaults: {
        legendPosition: 'bottomright',
        addTooltip: true,
        colorSchema: 'Yellow to Red',
        selectedLayer: selectedLayer,
        selectedJoinField: selectedJoinField,
        isDisplayWarning: true,
        wms: config.get('visualization:tileMap:WMSdefaults'),
        mapZoom: 2,
        mapCenter: [0, 0],
        outlineWeight: 1,
        showAllShapes: true//still under consideration
      }
    },
    visualization: RegionMapsVisualization,
    editorConfig: {
      optionsTemplate: '<region_map-vis-params></region_map-vis-params>',
      collections: {
        legendPositions: [{
          value: 'bottomleft',
          text: 'bottom left',
        }, {
          value: 'bottomright',
          text: 'bottom right',
        }, {
          value: 'topleft',
          text: 'top left',
        }, {
          value: 'topright',
          text: 'top right',
        }],
        colorSchemas: Object.keys(truncatedColorMaps),
        vectorLayers: vectorLayers,
        baseLayers: []
      },
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: 'Value',
          min: 1,
          max: 1,
          aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits',
            'sum_bucket', 'min_bucket', 'max_bucket', 'avg_bucket'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          icon: 'fa fa-globe',
          title: 'shape field',
          min: 1,
          max: 1,
          aggFilter: ['terms']
        }
      ])
    },
    responseHandler: 'tabify'

  });
});
Ejemplo n.º 13
0
import { SelfChangingComponent } from './self_changing_components';

function SelfChangingVisType(Private) {
  const VisFactory = Private(VisFactoryProvider);

  return VisFactory.createReactVisualization({
    name: 'self_changing_vis',
    title: 'Self Changing Vis',
    icon: 'visControls',
    description: 'This visualization is able to change its own settings, that you could also set in the editor.',
    visConfig: {
      component: SelfChangingComponent,
      defaults: {
        counter: 0,
      },
    },
    editorConfig: {
      optionTabs: [
        {
          name: 'options',
          title: 'Options',
          editor: SelfChangingEditor,
        },
      ],
    },
    requestHandler: 'none',
  });
}

VisTypesRegistryProvider.register(SelfChangingVisType);
Ejemplo n.º 14
0
VisTypesRegistryProvider.register(function (Private) {

  const VisFactory = Private(VisFactoryProvider);

  return VisFactory.createBaseVisualization({
    name: 'tagcloud',
    title: 'Tag Cloud',
    icon: 'visTagCloud',
    description: 'A group of words, sized according to their importance',
    category: CATEGORY.OTHER,
    visConfig: {
      defaults: {
        scale: 'linear',
        orientation: 'single',
        minFontSize: 18,
        maxFontSize: 72,
        showLabel: true
      }
    },
    requiresUpdateStatus: [Status.PARAMS, Status.RESIZE, Status.DATA],
    visualization: TagCloudVisualization,
    responseHandler: 'tabify',
    editorConfig: {
      collections: {
        scales: ['linear', 'log', 'square root'],
        orientations: ['single', 'right angled', 'multiple'],
      },
      optionsTemplate: '<tagcloud-vis-params></tagcloud-vis-params>',
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: 'Tag Size',
          min: 1,
          max: 1,
          aggFilter: ['!std_dev', '!percentiles', '!percentile_ranks', '!derivative', '!geo_bounds', '!geo_centroid'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          icon: 'fa fa-cloud',
          title: 'Tags',
          min: 1,
          max: 1,
          aggFilter: ['terms', 'significant_terms']
        }
      ])
    },
    useCustomNoDataScreen: true
  });
});
Ejemplo n.º 15
0
import { CATEGORY } from 'ui/vis/vis_category';

import 'plugins/agents/agents_vis.css';
import 'plugins/agents/agents_controller';
import visTemplate from 'plugins/agents/agents_vis.html';
import visParamTemplate from 'plugins/agents/agents_vis_params.html';

VisTypesRegistryProvider.register(function AgentsListProvider(Private) {
  const VisFactory = Private(VisFactoryProvider);

  return VisFactory.createAngularVisualization({
    name: 'WebitelAgentsStatus',
    title: "Member counts",
    icon: 'fa-crosshairs',
    category: CATEGORY.OTHER,
    description: 'Gives you access to the real-time users information such as status, state or endpoint registrations.',
    visConfig: {
      template: visTemplate,
    },
    editorConfig: {
      optionsTemplate: visParamTemplate
    },
    requiresSearch: false,
    requestHandler: 'none',
    responseHandler: 'none',
    options: {
      showIndexSelection: false
    }
  })
});
Ejemplo n.º 16
0
VisTypesRegistryProvider.register(function RegionMapProvider(Private, regionmapsConfig, config, i18n) {

  const VisFactory = Private(VisFactoryProvider);
  const RegionMapsVisualization = Private(RegionMapsVisualizationProvider);

  const vectorLayers = regionmapsConfig.layers.map(mapToLayerWithId.bind(null, ORIGIN.KIBANA_YML));

  const selectedLayer = vectorLayers[0];
  const selectedJoinField = selectedLayer ? vectorLayers[0].fields[0] : null;

  return VisFactory.createBaseVisualization({
    name: 'region_map',
    title: i18n('regionMap.mapVis.regionMapTitle', { defaultMessage: 'Region Map' }),
    description: i18n('regionMap.mapVis.regionMapDescription', { defaultMessage: 'Show metrics on a thematic map. Use one of the \
provided base maps, or add your own. Darker colors represent higher values.' }),
    icon: 'visMapRegion',
    visConfig: {
      defaults: {
        legendPosition: 'bottomright',
        addTooltip: true,
        colorSchema: 'Yellow to Red',
        selectedLayer: selectedLayer,
        emsHotLink: '',
        selectedJoinField: selectedJoinField,
        isDisplayWarning: true,
        wms: config.get('visualization:tileMap:WMSdefaults'),
        mapZoom: 2,
        mapCenter: [0, 0],
        outlineWeight: 1,
        showAllShapes: true//still under consideration
      }
    },
    requiresUpdateStatus: [Status.AGGS, Status.PARAMS, Status.RESIZE, Status.DATA, Status.UI_STATE],
    visualization: RegionMapsVisualization,
    editorConfig: {
      optionsTemplate: '<region_map-vis-params></region_map-vis-params>',
      collections: {
        legendPositions: [{
          value: 'bottomleft',
          text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomLeftText', { defaultMessage: 'bottom left' }),
        }, {
          value: 'bottomright',
          text: i18n('regionMap.mapVis.regionMapEditorConfig.bottomRightText', { defaultMessage: 'bottom right' }),
        }, {
          value: 'topleft',
          text: i18n('regionMap.mapVis.regionMapEditorConfig.topLeftText', { defaultMessage: 'top left' }),
        }, {
          value: 'topright',
          text: i18n('regionMap.mapVis.regionMapEditorConfig.topRightText', { defaultMessage: 'top right' }),
        }],
        colorSchemas: Object.values(truncatedColorMaps).map(value => ({ id: value.id, label: value.label })),
        vectorLayers: vectorLayers,
        tmsLayers: []
      },
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.metricTitle', { defaultMessage: 'Value' }),
          min: 1,
          max: 1,
          aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality', 'top_hits',
            'sum_bucket', 'min_bucket', 'max_bucket', 'avg_bucket'],
          defaults: [
            { schema: 'metric', type: 'count' }
          ]
        },
        {
          group: 'buckets',
          name: 'segment',
          icon: 'fa fa-globe',
          title: i18n('regionMap.mapVis.regionMapEditorConfig.schemas.segmentTitle', { defaultMessage: 'shape field' }),
          min: 1,
          max: 1,
          aggFilter: ['terms']
        }
      ])
    }
  });
});
Ejemplo n.º 17
0
import { CATEGORY } from 'ui/vis/vis_category';

import 'plugins/calls/calls_vis.css';
import 'plugins/calls/calls_controller';
import visTemplate from 'plugins/calls/calls_vis.html';
import visParamTemplate from 'plugins/calls/calls_vis_params.html';

VisTypesRegistryProvider.register(function CallsProvider(Private) {
  const VisFactory = Private(VisFactoryProvider);

  return VisFactory.createAngularVisualization({
    name: 'WebitelCallStatus',
    title: "Calls monitor",
    icon: 'fa-phone',
    category: CATEGORY.OTHER,
    description: 'Shows Real-Time call sessions detailed information.',
    visConfig: {
      template: visTemplate,
    },
    editorConfig: {
      optionsTemplate: visParamTemplate
    },
    requiresSearch: false,
    requestHandler: 'none',
    responseHandler: 'none',
    options: {
      showIndexSelection: false
    }
  })
});