Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Vis Libraries): Use new libraries #321

Closed
wants to merge 5 commits into from

Conversation

hypery2k
Copy link
Collaborator

see #314

@hypery2k hypery2k mentioned this pull request Sep 10, 2019
5 tasks
package.json Outdated
"vis": "4.21.0",
"@types/vis": "4.21.19"
"vis-network": "5.4.1",
"vis-timeline": "5.1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types for Timeline has been merged but not released yet. Maybe we should wait for the next version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i would like to wait for that

@@ -385,7 +383,7 @@ export class VisTimelineService {
*
* @memberOf VisTimelineService
*/
public getWindow(visTimeline: string): { start: Date, end: Date } {
public getWindow(visTimeline: string): { start: Date; end: Date } {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other projects we reformatted through separate PRs authored by vis-bot. It doesn't give attribution to people for running prettier --write, follows one PR one thing filosophy and would also make reviewing easier by filtering out code style changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also would seperate style changes from other thinks. But I'm not sure if that's the case here. Also this is such a minor change that I have no problem with it.

export interface VisNodeOptions extends NodeOptions {}
export interface VisPosition extends Position {}

export class VisNodes extends DataSet<VisNode> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new data set types require id type to provide proper type safety: DataSet<VisNode, 'id'>. Also you can simply use DataSetNodes here instead of dealing with generic types.

export interface VisNetworkData extends Data {}
export interface VisNode extends Node {
title?: string;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node already has title?: string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed that

@@ -102,7 +118,7 @@ export class VisNodes extends Vis.DataSet<VisNode> {
}
}

export class VisEdges extends Vis.DataSet<VisEdge> {
export class VisEdges extends DataSet<VisEdge> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with nodes either DataSet<VisEdge, 'id'> or DataSetEdges.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed that

@@ -102,7 +118,7 @@ export class VisNodes extends Vis.DataSet<VisNode> {
}
}

export class VisEdges extends Vis.DataSet<VisEdge> {
export class VisEdges extends DataSet<VisEdge> {
public constructor(data?: VisEdge[], options?: VisDataSetOptions) {
super(data, options);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's exactly the point of this and the other methods that just take the arguments, pass them to the inherited method and then return it's return value? Would anything change if they weren't there?

@mojoaxel
Copy link
Member

I think @Thomaash should review this. I'm just starting with all that typescript and angular stuff...

Copy link
Member

@Thomaash Thomaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hypery2k, Vis Timeline has been released with types included. When you'll have time you can finish this.

@hypery2k
Copy link
Collaborator Author

Already added it locally, hopefully will find some time next week for this

* Drop own types
* adopt types/APIs

see #321
@hypery2k
Copy link
Collaborator Author

hypery2k commented Nov 1, 2019

I published a preview of the package for testing: [email protected]
Any comments, feel free to post here

hypery2k added a commit that referenced this pull request Nov 1, 2019
@hypery2k hypery2k closed this Nov 1, 2019
@hypery2k hypery2k deleted the feature/visjs-libraries branch November 1, 2019 13:11
hypery2k added a commit that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants