{"size": 2822, "ext": "js", "max_stars_repo_path": "public/kbn_dotplot.js", "max_stars_repo_name": "sduenas/kbn_dotplot", "max_stars_repo_stars_event_min_datetime": "2017-08-17T04:54:45.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-16T20:36:42.000Z", "max_issues_repo_path": "public/kbn_dotplot.js", "max_issues_repo_name": "sduenas/kbn_dotplot", "max_issues_repo_issues_event_min_datetime": "2017-10-10T04:10:02.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-11T10:15:00.000Z", "max_forks_repo_path": "public/kbn_dotplot.js", "max_forks_repo_name": "sduenas/kbn_dotplot", "max_forks_repo_forks_event_min_datetime": "2017-09-19T14:50:59.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-17T12:21:40.000Z"}
{"max_stars_count": 19, "max_issues_count": 12, "max_forks_count": 9, "avg_line_length": 28.7959183673, "max_line_length": 85, "alphanum_fraction": 0.6459957477}
import 'plugins/kbn_dotplot/kbn_dotplot.less';
import 'plugins/kbn_dotplot/kbn_dotplot_controller';
import 'plugins/kbn_dotplot/kbn_dotplot_params';
import 'ui/agg_table';
import 'ui/agg_table/agg_table_group';
import { VisVisTypeProvider } from 'ui/vis/vis_type';
import { TemplateVisTypeProvider } from 'ui/template_vis_type/template_vis_type';
import { VisSchemasProvider } from 'ui/vis/schemas';
import DotplotVisTemplate from 'plugins/kbn_dotplot/kbn_dotplot.html';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';
import image from './images/dots.svg';
// 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(DotplotVisTypeProvider);

// define the DotplotVisType
function DotplotVisTypeProvider(Private) {
  const VisType = Private(VisVisTypeProvider);
  const TemplateVisType = Private(TemplateVisTypeProvider);
  const Schemas = Private(VisSchemasProvider);

  // define the DotplotVisController 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 new TemplateVisType({
    name: 'dotplot',
    title: 'Dot plot',
    icon: 'fa-ellipsis-v',
    description: 'Display values in a dot plot',
    category: VisType.CATEGORY.DATA,
    template: DotplotVisTemplate,
    params: {
      defaults: {
        perPage: 10,
        showPartialRows: false,
        showMeticsAtAllLevels: false,
        sort: {
          columnIndex: null,
          direction: null
        },
        showTotal: false,
        totalFunc: 'sum',
        caseSensitive: true
      },
      editor: '<dotplot-vis-params></dotplot-vis-params>'
    },
    implementsRenderComplete: true,
    hierarchicalData: function (vis) {
      return Boolean(vis.params.showPartialRows || vis.params.showMeticsAtAllLevels);
    },
    schemas: new Schemas([
      {
        group: 'metrics',
        name: 'x-axis',
        title: 'X-Axis',
        aggFilter: '!geo_centroid',
        min: 1,
        max: 1
      },
      {
        group: 'metrics',
        name: 'y-axis',
        title: 'Y-Axis',
        aggFilter: '!geo_centroid',
        min: 1,
        max: 1
      },
      {
        group: 'metrics',
        name: 'dotsize',
        title: 'Dot Size',
        aggFilter: '!geo_centroid',
        min: 1,
        max: 1
      },
      {
        group: 'buckets',
        name: 'field',
        title: 'Field',
        max: 2,
        min: 1,
        aggFilter: ['terms']
      }
    ])
  });
}

export default DotplotVisTypeProvider;
