-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Changes from 2 commits
44e78b8
1f83fee
b7450cc
c9f13e5
4f6c1ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
import * as Vis from 'vis'; | ||
import { | ||
ClusterOptions, | ||
Data, | ||
DataSet, | ||
Edge, | ||
EdgeOptions, | ||
FitOptions, | ||
MoveToOptions, | ||
Network, | ||
NetworkEvents, | ||
NodeOptions, | ||
OpenClusterOptions, | ||
Options, | ||
SelectionOptions | ||
} from 'vis-network'; | ||
|
||
import { VisDataSetOptions, VisDataSetQueueOptions, VisId } from '../timeline/index'; | ||
|
||
export { VisId } from '../timeline/index'; | ||
export type VisNetworkEvents = Vis.NetworkEvents; | ||
export type VisMoveToOptions = Vis.MoveToOptions; | ||
|
||
export interface VisClusterOptions extends Vis.ClusterOptions { } | ||
export interface VisOpenClusterOptions extends Vis.OpenClusterOptions { } | ||
export interface VisNetworkData extends Vis.Data { } | ||
export interface VisNode extends Vis.Node { title?: string; } | ||
export interface VisEdge extends Vis.Edge { } | ||
export interface VisNodeSelectionOptions extends Vis.DataSelectionOptions<VisNode> { } | ||
export interface VisEdgeSelectionOptions extends Vis.DataSelectionOptions<VisEdge> { } | ||
export interface VisFitOptions extends Vis.FitOptions { } | ||
export interface VisNetworkOptions extends Vis.Options { } | ||
export interface VisEdgeOptions extends Vis.EdgeOptions { } | ||
export class VisNetwork extends Vis.Network { } | ||
export interface VisNodeOptions extends Vis.NodeOptions { } | ||
export interface VisPosition extends Vis.Position { } | ||
|
||
export class VisNodes extends Vis.DataSet<VisNode> { | ||
|
||
export type VisNetworkEvents = NetworkEvents; | ||
export type VisMoveToOptions = MoveToOptions; | ||
|
||
export interface VisClusterOptions extends ClusterOptions {} | ||
export interface VisOpenClusterOptions extends OpenClusterOptions {} | ||
export interface VisNetworkData extends Data {} | ||
export interface VisNode extends Node { | ||
} | ||
export interface VisEdge extends Edge {} | ||
export interface VisNodeSelectionOptions extends SelectionOptions<VisNode> {} | ||
export interface VisEdgeSelectionOptions extends SelectionOptions<VisEdge> {} | ||
export interface VisFitOptions extends FitOptions {} | ||
export interface VisNetworkOptions extends Options {} | ||
export interface VisEdgeOptions extends EdgeOptions {} | ||
export class VisNetwork extends Network {} | ||
export interface VisNodeOptions extends NodeOptions {} | ||
export interface VisPosition extends Position {} | ||
|
||
export class VisNodes extends DataSet<VisNode> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: |
||
public constructor(data?: VisNode[], options?: VisDataSetOptions) { | ||
super(data, options); | ||
} | ||
|
@@ -102,7 +117,7 @@ export class VisNodes extends Vis.DataSet<VisNode> { | |
} | ||
} | ||
|
||
export class VisEdges extends Vis.DataSet<VisEdge> { | ||
export class VisEdges extends DataSet<VisEdge, 'id'> { | ||
public constructor(data?: VisEdge[], options?: VisDataSetOptions) { | ||
super(data, options); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
|
There was a problem hiding this comment.
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
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed that