visjs/ngx-vis

Unable to import VisTimeline and VisTimelineItems from 3.0.3 in Angular 9 RC 12

DelphiWorlds opened this issue · 4 comments

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository

Current Behavior

VisTimeline and VisTimelineItems appear to be not exported

Expected Behavior

VisTimeline and VisTimelineItems should be importable

Failure Information

When writing an import statement, e.g.:

import { VisTimeline, VisTimelineItems, VisTimelineService } from 'ngx-vis/components/timeline';

ngx-vis/components/timeline is underlined in red, i.e. they are not exported from there. This import works:

import { VisTimelineService } from 'ngx-vis';

This one has VisTimeline and VisTimelineItems underlined in red:

import { VisTimeline, VisTimelineItems, VisTimelineService } from 'ngx-vis';

Reproduce code snippet

StackBlitz link

Did you update from a previous ngx version? According to semver versioning version 3 was a major upgrade with breaking changes.

So these Items aren't existing anymore

Why were they removed, or what are the alternatives? Your comment was very unhelpful

I'm sorry about that, they we're dropped in favour to using the vis.js classes directly. in previous vis.js versions (which we're not build with typescript) all typings we're built on top of the library and now with a fully ts-pure implementation it's rather easy to directly use them instead of mapping additional classes and trying to catch up the mappings with vis
If you really need these classes, feel free to open up a feature request and we'll so, who else really needs it

I ran in to the same issue, and took me a while to find the right imports to update, so for anyone else... Not too much documentation on the upgrade from versions.

Change
import { VisTimelineItems, VisTimelineService, VisTimelineOptions, VisTimelineGroups } from 'ngx-vis';

to

import { DataItem, TimelineService, TimelineOptions, } from 'ngx-vis';
import { DataSetDataGroup, DataSetDataItem } from 'vis-timeline';