0

配置选项似乎在 vis.js 时间轴中cluster不起作用

以下是我使用 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 ...

在调试控制台中,我收到此错误:

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

Perhaps it was misplaced?

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

是我设置不正确还是该选项有问题?我所做的一切都是渲染和正常工作。

4

1 回答 1

0

vis-timeline如果您最初仅使用,请安装和使用所有必需的依赖项vis

vis.js 具有 vis-timeline.js 的部分但不是全部功能

于 2020-03-05T17:29:50.970 回答