Last active
July 17, 2017 18:51
-
-
Save dslmeinte/d8f0777201226799eb97e07848efcbda to your computer and use it in GitHub Desktop.
Projection of a directed graph (pseudo-TS-code)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export enum Style { | |
none, selected, highlighted | |
} | |
export abstract class Element { | |
abstract style(): Style; | |
} | |
export class ProjectedVertex extends Element { | |
id: number; | |
position: Point; | |
style() { /* ... */ } | |
} | |
export class Edge extends Element { | |
fromVertex: ProjectedVertex; | |
toVertex: ProjectedVertex; | |
style() { /* ... */ } | |
} | |
export type Projection = Element[]; | |
export function projectStore(store: Store): Projection { | |
// ... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment