Error when rendering visualization plugin

I am using Kibana master branch to develop a new visualization
I am using Base Visualization Type like
visualizations.createBaseVisualization(getExampleVisDefinition());

I am getting this error when trying to render my visulization
Can someone tel what is the issue exactly ?

Uncaught TypeError: this.visualization.render is not a function

This is the sample i use for my controller

import { VisParams, ExprVis } from '../../../../src/plugins/visualizations/public';
export function ExampleVisualizationProvider() {

  return class ExampleBaseVisualization {

    vis: ExprVis | undefined = undefined;
    el: HTMLElement | undefined = undefined;

    constructor(el: HTMLElement, vis: ExprVis) {
      this.el = el;
      this.vis = vis;
    }

    async render(visData: any, visParams: VisParams) {
      return 'done rendering';
    }

    destroy() {
      // eslint-disable-next-line no-console
      console.log('destroying');
      if (this.el !== undefined) {
        this.el.innerHTML = '';
      }
    }
  };
}

There is not enough information to tell for sure, can you share your complete plugin, e.g. on Github?

Tagcloud is a good example for this kind of a visualization till then: https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_tagcloud/public

Thanks @flash1293 for your feedback
Exactly i was inspired by the example you provided me
I was able to use ReactVisualization without issue, but got issue with BaseViz
Could you please check the example in github

Thanks @flash1293 for your quick help
I was able to fixe the issue
I forgot to call my controller as a function in the visualization Type

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