Search code examples
angularvis.jsvis.js-timeline

Cluster option does not exist in vis.js timeline


The configuration option for cluster does not seem to work in vis.js timeline

Here is how I am setting things up with TypeScript:

  const options = {
    height: '400px',
    zoomMin: 5000,
    stack: true,
    cluster: {
      showStipes: true,
      maxItems: 2,
    },
    template: (item, element, data) => {
      return this.timelineItemService.toHTMLElement(
        this.timelineItemComponents.filter((x) => x.instance.id === item.id)[0]);
    }
  };

  const groups = [
      { id: 'Item', content: 'Item' },
      { id: 'Event', content: 'Event' },
  ];

  this.contentElement.subscribe((domEl) => {
    this.timeline = new vis.Timeline(domEl, items, groups, options);
  ... other code omitted ...

In the debug console I am getting this error:

Unknown option detected: "cluster" in
options = {
  cluster
}

Perhaps it was misplaced?

Matching option found at: options = {
  configure: {
    filter
  }
}

Am I setting it up incorrectly or is there an issue with that option? Everything else I have done is rendering and working properly.


Solution

  • Install and usevis-timeline along with all the required dependencies if you were originally only using vis

    vis.js has some but not all the functionality that vis-timeline.js has