-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Add state setters with options (#95)
* New: Add state setters with options * Chore: Remove leftover comments * Chore: Refactor state setter logic * Chore: Refactor state types
- Loading branch information
1 parent
0ee733d
commit c9de1cf
Showing
5 changed files
with
132 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
import { GraphObject } from '../utils/observer.utils'; | ||
|
||
// Enum is dismissed so user can define custom additional events (numbers) | ||
export const GraphObjectState = { | ||
NONE: 0, | ||
SELECTED: 1, | ||
HOVERED: 2, | ||
}; | ||
|
||
export interface IGraphObjectStateOptions { | ||
isToggle: boolean; | ||
isSingle: boolean; | ||
} | ||
|
||
export interface IGraphObjectStateParameters { | ||
state: number; | ||
options?: Partial<IGraphObjectStateOptions>; | ||
} | ||
|
||
export interface ISetStateDataPayload { | ||
id: any; | ||
type: GraphObject; | ||
options: Partial<IGraphObjectStateOptions>; | ||
} |
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