-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable toggling off for players on chart
- Loading branch information
Tim Slatcher
committed
Oct 19, 2018
1 parent
aa08760
commit 1266dd2
Showing
16 changed files
with
115 additions
and
49 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
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
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
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,34 +1,34 @@ | ||
import * as React from "react"; | ||
|
||
declare module "victory" { | ||
export interface VictoryTooltipProps { | ||
active?: any | ||
activateData?: any | ||
angle?: any | ||
cornerRadius?: any | ||
data?: any | ||
datum?: any | ||
dx?: any | ||
dy?: any | ||
events?: any | ||
flyoutStyle?: any | ||
flyoutComponent?: any | ||
groupComponent?: any | ||
height?: any | ||
horizontal?: any | ||
index?: any | ||
labelComponent?: any | ||
orientation?: any | ||
pointerLength?: any | ||
pointerWidth?: any | ||
renderInPortal?: any | ||
style?: any | ||
text?: any | ||
width?: any | ||
x?: any | ||
y?: any | ||
} | ||
export interface VictoryTooltipProps { | ||
active?: any; | ||
activateData?: any; | ||
angle?: any; | ||
cornerRadius?: any; | ||
data?: any; | ||
datum?: any; | ||
dx?: any; | ||
dy?: any; | ||
events?: any; | ||
flyoutStyle?: any; | ||
flyoutComponent?: any; | ||
groupComponent?: any; | ||
height?: any; | ||
horizontal?: any; | ||
index?: any; | ||
labelComponent?: any; | ||
orientation?: any; | ||
pointerLength?: any; | ||
pointerWidth?: any; | ||
renderInPortal?: any; | ||
style?: any; | ||
text?: any; | ||
width?: any; | ||
x?: any; | ||
y?: any; | ||
} | ||
|
||
export class VictoryTooltip extends React.Component<VictoryTooltipProps, any> {} | ||
export class VictoryVoronoiContainer extends React.Component<any, any> {} | ||
} | ||
export class VictoryTooltip extends React.PureComponent<VictoryTooltipProps, any> {} | ||
export class VictoryVoronoiContainer extends React.PureComponent<any, any> {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { IGame, IPlayer } from ".."; | ||
import { IGameAnalysis } from "./api"; | ||
import { PlayerSetResult } from "./PlayerSet"; | ||
|
||
export interface PlayerSetResult { | ||
players: Set<IPlayer>; | ||
} | ||
|
||
function emptyResult() { | ||
return { | ||
players: new Set<IPlayer>(), | ||
}; | ||
} | ||
|
||
export function gameValid(game: IGame) { | ||
if (!game.players || game.players.length === 0) { | ||
return false; | ||
} | ||
if (game.players.some(p => p == null) || game.hands == null || game.hands.length === 0) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
/** | ||
* This requires that games be iterated on in temporal order. | ||
*/ | ||
export class PlayerSet implements IGameAnalysis<PlayerSetResult> { | ||
public initialState() { | ||
return emptyResult(); | ||
} | ||
|
||
public analyze(current: PlayerSetResult, game: IGame): PlayerSetResult { | ||
if (!gameValid(game)) { | ||
return current; | ||
} | ||
game.players!.forEach(player => current.players.add(player!)); | ||
return current; | ||
} | ||
} |
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