[kibana7.5] Kibana plugin generator

Hello,

I use Kibana 7.5 and make kiban plugin using " [kbn-plugin-generator] . (https://github.com/elastic/kibana/tree/master/packages/kbn-plugin-generator)

I checked manual kibana 7.5 - visualization factory. https://www.elastic.co/guide/en/kibana/current/development-visualization-factory.html

I registered using 'ui/registry/vis_types' which mentioned above documentation. But, when I install my plugin to production site kibana7.5. I got a error.

"ui/registry/vis_types" not found

I check github source code 7.5 not exsits but "ui/registry/_registry" is exists.(Not exsits registry/vis_types!).

I think I should use "ui/registry/_registry" but I don't know how to using them instead ui/registry/vis_types.

import './index.less';
import { cvpComponent } from './cvp_plugin_vis_controller';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';

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

function cvpCalcVisProvider(Private, i18n) {
  const VisFactory = Private(VisFactoryProvider);
  return VisFactory.createReactVisualization({
    type: 'metric',
    name: 'CVP-Calculator',
    title: 'CVP-Calculator',
    icon: 'visMetric',
    description: 'CVP Project caculator for compound`s intersection',
    visConfig: {
      component: cvpComponent,
      defaults: {
        type: 'metric',
        addTooltip: true,
        addLegend: false,
        metric: {
          percentageMode: false,
          useRange: false,
          colorSchema: 'Green to Red',
          metricColorMode: 'None',
          colorRange: [{ from: 0, to: 10000 }],
          labels: {
            show: true,
          },
          invertColors: false,
          style: {
            bgFill: '#000',
            bgColor: false,
            labelColor: false,
            subText: '',
            fontSize: 60,
          },
        },
      },
    },
    editorConfig: {
      schemas: new Schemas([
        {
          group: 'metrics',
          name: 'metric',
          title: i18n('metricVis.schemas.metricTitle', { defaultMessage: 'Metric' }),
          min: 1,
          aggFilter: [
            '!std_dev',
            '!geo_centroid',
            '!derivative',
            '!serial_diff',
            '!moving_avg',
            '!cumulative_sum',
            '!geo_bounds',
          ],
          defaults: [{ type: 'count', schema: 'metric' }],
        },
        {
          group: 'buckets',
          name: 'group',
          title: i18n('metricVis.schemas.splitGroupTitle', { defaultMessage: 'Split Group' }),
          min: 1,
          max: 3,
          aggFilter: ['!geohash_grid', '!filter'],
        },
      ]),
    },
  });
}

Hello,
If you want a plugin for the 7.5 version of Kibana, you need to use the plugin generator from the 7.5 branch: https://github.com/elastic/kibana/tree/7.5/packages/kbn-plugin-generator

@Marius_Dragomir.
You means that if i checkout kibana 7.5 and using "kbn-plugin-generator" then generator set the default code for 7.5?

Yes.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.