Compare commits
25 Commits
live-table
...
colonelpan
| Author | SHA1 | Date | |
|---|---|---|---|
| feeb5b7038 | |||
| 3340314166 | |||
| 6b8fdd4262 | |||
| bfaed33c89 | |||
|
|
1ce3aaed1b | ||
| 1bd03f2bbe | |||
|
|
4a1c41aae1 | ||
|
|
4122284bbd | ||
| b30dbd01f5 | |||
| 6d13dc3eb1 | |||
| e3524cab97 | |||
| 303261f2d7 | |||
| 20a70fad2a | |||
|
|
35c7c23ba9 | ||
|
|
40c4b82a59 | ||
| 9ebe2e61df | |||
|
|
6f356f9535 | ||
|
|
5c0ff8c31b | ||
|
|
582c20170d | ||
| dc02fd8387 | |||
| ef4782fc14 | |||
| 905a1ca6db | |||
| 6f63189703 | |||
| 958057764c | |||
| a150e1a300 |
1221
src/index.tsx
1221
src/index.tsx
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,7 @@ fragment VideoCardFields on VideoGQL {
|
|||||||
stream {
|
stream {
|
||||||
id
|
id
|
||||||
lastIntendedSegmentBound
|
lastIntendedSegmentBound
|
||||||
|
uploadCompletionCursor
|
||||||
streamSegmentType
|
streamSegmentType
|
||||||
isCompleted
|
isCompleted
|
||||||
lastSegmentUploadedAt
|
lastSegmentUploadedAt
|
||||||
|
|||||||
34
src/operations/live_streams.gql
Normal file
34
src/operations/live_streams.gql
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Lightweight listing of live (in-progress) streams for pickers like the
|
||||||
|
# Shot Lab "follow a live stream" flow. Selects only what a picker card
|
||||||
|
# needs; intentionally avoids the heavy VideoCardFields fragment.
|
||||||
|
query GetLiveStreams($limit: Int! = 25) {
|
||||||
|
getFeedVideos(
|
||||||
|
limit: $limit
|
||||||
|
filters: { isStreamCompleted: false, requireCursorCompletion: false }
|
||||||
|
includePrivate: MINE
|
||||||
|
feedInput: { allUsers: true }
|
||||||
|
) {
|
||||||
|
videos {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
startTime
|
||||||
|
createdAt
|
||||||
|
screenshotUri
|
||||||
|
elapsedTime
|
||||||
|
owner {
|
||||||
|
id
|
||||||
|
username
|
||||||
|
profileImageUri
|
||||||
|
}
|
||||||
|
stream {
|
||||||
|
id
|
||||||
|
isCompleted
|
||||||
|
lastSegmentUploadedAt
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pageInfo {
|
||||||
|
hasNextPage
|
||||||
|
endCursor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/operations/recorded_shots.gql
Normal file
62
src/operations/recorded_shots.gql
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# Lightweight two-step picker data for loading a recorded shot into Shot Lab.
|
||||||
|
query GetRecordedStreams($limit: Int! = 25) {
|
||||||
|
getFeedVideos(
|
||||||
|
limit: $limit
|
||||||
|
filters: { isStreamCompleted: true, excludeVideosWithNoShots: true }
|
||||||
|
includePrivate: MINE
|
||||||
|
feedInput: { allUsers: true }
|
||||||
|
) {
|
||||||
|
videos {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
createdAt
|
||||||
|
screenshotUri
|
||||||
|
framesPerSecond
|
||||||
|
totalShots
|
||||||
|
owner {
|
||||||
|
id
|
||||||
|
username
|
||||||
|
profileImageUri
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetRecordedStreamShots($videoId: Int!, $limit: Int! = 200) {
|
||||||
|
getOrderedShots(
|
||||||
|
filterInput: { videoId: [$videoId] }
|
||||||
|
shotsOrdering: { orderings: [{ startFrame: { descending: false } }] }
|
||||||
|
limit: $limit
|
||||||
|
) {
|
||||||
|
shots {
|
||||||
|
id
|
||||||
|
videoId
|
||||||
|
startFrame
|
||||||
|
endFrame
|
||||||
|
serializedShotPaths {
|
||||||
|
b64EncodedBuffer
|
||||||
|
}
|
||||||
|
cueObjectFeatures {
|
||||||
|
cueObjectDistance
|
||||||
|
cueObjectAngle
|
||||||
|
cueBallSpeed
|
||||||
|
shotDirection
|
||||||
|
spinType
|
||||||
|
}
|
||||||
|
pocketingIntentionFeatures {
|
||||||
|
make
|
||||||
|
targetPocketDistance
|
||||||
|
targetPocketAngle
|
||||||
|
targetPocketAngleDirection
|
||||||
|
marginOfErrorInDegrees
|
||||||
|
intendedPocketType
|
||||||
|
difficulty
|
||||||
|
}
|
||||||
|
pocketingIntentionInfo {
|
||||||
|
ballId
|
||||||
|
pocketId
|
||||||
|
pathMetadataIndex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
51
src/operations/session-coach.gql
Normal file
51
src/operations/session-coach.gql
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
query GetSessionCoach($videoId: Int!) {
|
||||||
|
getSessionCoach(videoId: $videoId) {
|
||||||
|
videoId
|
||||||
|
processingId
|
||||||
|
analysisVersion
|
||||||
|
state
|
||||||
|
generatedAt
|
||||||
|
processingStatus
|
||||||
|
ineligibilityReason
|
||||||
|
summary
|
||||||
|
shotCount
|
||||||
|
madeCount
|
||||||
|
missedCount
|
||||||
|
unknownOutcomeCount
|
||||||
|
analyzedShotCount
|
||||||
|
makePercentage
|
||||||
|
primaryCandidate {
|
||||||
|
...SessionCoachCandidateFields
|
||||||
|
}
|
||||||
|
candidates {
|
||||||
|
...SessionCoachCandidateFields
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fragment SessionCoachCandidateFields on SessionCoachCandidateGQL {
|
||||||
|
id
|
||||||
|
rank
|
||||||
|
family
|
||||||
|
kind
|
||||||
|
title
|
||||||
|
body
|
||||||
|
action
|
||||||
|
supportingShotIds
|
||||||
|
drillId
|
||||||
|
limitations
|
||||||
|
evidence {
|
||||||
|
bucketKey
|
||||||
|
bucketLabel
|
||||||
|
attemptCount
|
||||||
|
madeCount
|
||||||
|
missedCount
|
||||||
|
makePercentage
|
||||||
|
comparisonAttemptCount
|
||||||
|
comparisonMadeCount
|
||||||
|
comparisonMakePercentage
|
||||||
|
patternShotCount
|
||||||
|
score
|
||||||
|
rankReason
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,36 @@ query GetTableState(
|
|||||||
useHomography: $useHomography
|
useHomography: $useHomography
|
||||||
) {
|
) {
|
||||||
identifierToPosition
|
identifierToPosition
|
||||||
|
identifierToColor {
|
||||||
|
hex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetLiveTableState($videoId: Int!) {
|
||||||
|
getLiveTableState(videoId: $videoId) {
|
||||||
|
videoId
|
||||||
|
frameIndex
|
||||||
|
tableState {
|
||||||
|
identifierToPosition
|
||||||
|
identifierToColor {
|
||||||
|
hex
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query GetShotTableState($shotId: Int!) {
|
||||||
|
getShotTableState(shotId: $shotId) {
|
||||||
|
shotId
|
||||||
|
videoId
|
||||||
|
frameIndex
|
||||||
|
tableState {
|
||||||
|
identifierToPosition
|
||||||
|
identifierToColor {
|
||||||
|
hex
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
45
src/operations/usage_stats.gql
Normal file
45
src/operations/usage_stats.gql
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
query getUsageStats($days: Int! = 30) {
|
||||||
|
getUsageStats(days: $days) {
|
||||||
|
funnel {
|
||||||
|
freemiumEpoch
|
||||||
|
eraSignups
|
||||||
|
eraPaying
|
||||||
|
activationCohort
|
||||||
|
activationActivated
|
||||||
|
payingUsers
|
||||||
|
newPaid7d
|
||||||
|
newPaid30d
|
||||||
|
retentionPrevActive
|
||||||
|
retentionReturned
|
||||||
|
}
|
||||||
|
cohorts {
|
||||||
|
weekStart
|
||||||
|
signups
|
||||||
|
activated7d
|
||||||
|
paid7d
|
||||||
|
activatedNotPaid7d
|
||||||
|
}
|
||||||
|
totalUsers
|
||||||
|
totalVideos
|
||||||
|
totalShots
|
||||||
|
totalRuns
|
||||||
|
windows {
|
||||||
|
label
|
||||||
|
newUsers
|
||||||
|
activeUsers
|
||||||
|
sessions
|
||||||
|
shots
|
||||||
|
}
|
||||||
|
daily {
|
||||||
|
day
|
||||||
|
newUsers
|
||||||
|
activeUsers
|
||||||
|
sessions
|
||||||
|
shots
|
||||||
|
}
|
||||||
|
processingLast24h {
|
||||||
|
status
|
||||||
|
count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
162
src/schema.gql
162
src/schema.gql
@@ -65,6 +65,7 @@ type Query {
|
|||||||
limit: Int! = 500
|
limit: Int! = 500
|
||||||
countRespectsLimit: Boolean! = false
|
countRespectsLimit: Boolean! = false
|
||||||
): GetRunsResult!
|
): GetRunsResult!
|
||||||
|
getSessionCoach(videoId: Int!): SessionCoachGQL!
|
||||||
videoPlayerClusters(videoId: Int!): [PlayerClusterGQL!]!
|
videoPlayerClusters(videoId: Int!): [PlayerClusterGQL!]!
|
||||||
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
|
getShotAnnotationTypes(errorTypes: Boolean = false): [ShotAnnotationTypeGQL!]!
|
||||||
getTableState(
|
getTableState(
|
||||||
@@ -72,6 +73,8 @@ type Query {
|
|||||||
tableSize: Float = 100
|
tableSize: Float = 100
|
||||||
useHomography: HomographyInputGQL = null
|
useHomography: HomographyInputGQL = null
|
||||||
): TableStateGQL!
|
): TableStateGQL!
|
||||||
|
getLiveTableState(videoId: Int!): LiveTableStateGQL!
|
||||||
|
getShotTableState(shotId: Int!): ShotTableStateGQL!
|
||||||
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
||||||
computePotAim(
|
computePotAim(
|
||||||
simulationInput: SimulateShotInputGQL!
|
simulationInput: SimulateShotInputGQL!
|
||||||
@@ -99,6 +102,7 @@ type Query {
|
|||||||
countRespectsLimit: Boolean! = false
|
countRespectsLimit: Boolean! = false
|
||||||
): [ShotGQL!]!
|
): [ShotGQL!]!
|
||||||
getShotsByIds(ids: [Int!]!): [ShotGQL!]!
|
getShotsByIds(ids: [Int!]!): [ShotGQL!]!
|
||||||
|
getUsageStats(days: Int! = 30): UsageStatsGQL!
|
||||||
getUser(userId: Int!): UserGQL
|
getUser(userId: Int!): UserGQL
|
||||||
doesUsernameExist(candidateUsername: String!): Boolean!
|
doesUsernameExist(candidateUsername: String!): Boolean!
|
||||||
getLoggedInUser: UserGQL
|
getLoggedInUser: UserGQL
|
||||||
@@ -607,7 +611,7 @@ type VideoTagClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HomographyInfoGQL {
|
type HomographyInfoGQL {
|
||||||
id: Int!
|
id: Int
|
||||||
frameIndex: Int!
|
frameIndex: Int!
|
||||||
crop: BoundingBoxGQL!
|
crop: BoundingBoxGQL!
|
||||||
pockets: [BoundingBoxGQL!]!
|
pockets: [BoundingBoxGQL!]!
|
||||||
@@ -992,6 +996,81 @@ input DatetimeOrdering {
|
|||||||
startingAt: DateTime = null
|
startingAt: DateTime = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SessionCoachGQL {
|
||||||
|
videoId: Int!
|
||||||
|
processingId: Int
|
||||||
|
analysisVersion: String!
|
||||||
|
state: SessionCoachStateEnum!
|
||||||
|
generatedAt: DateTime!
|
||||||
|
processingStatus: String
|
||||||
|
ineligibilityReason: SessionCoachIneligibilityReasonEnum
|
||||||
|
summary: String
|
||||||
|
shotCount: Int!
|
||||||
|
madeCount: Int!
|
||||||
|
missedCount: Int!
|
||||||
|
unknownOutcomeCount: Int!
|
||||||
|
analyzedShotCount: Int!
|
||||||
|
makePercentage: Float
|
||||||
|
primaryCandidate: SessionCoachCandidateGQL
|
||||||
|
candidates: [SessionCoachCandidateGQL!]!
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionCoachStateEnum {
|
||||||
|
PROCESSING
|
||||||
|
READY
|
||||||
|
NO_TRACKED_SHOTS
|
||||||
|
INELIGIBLE
|
||||||
|
FAILED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionCoachIneligibilityReasonEnum {
|
||||||
|
MULTIPLAYER
|
||||||
|
}
|
||||||
|
|
||||||
|
type SessionCoachCandidateGQL {
|
||||||
|
id: ID!
|
||||||
|
rank: Int!
|
||||||
|
family: SessionCoachCandidateFamilyEnum!
|
||||||
|
kind: SessionCoachCandidateKindEnum!
|
||||||
|
title: String!
|
||||||
|
body: String!
|
||||||
|
action: String!
|
||||||
|
supportingShotIds: [Int!]!
|
||||||
|
drillId: String
|
||||||
|
evidence: SessionCoachEvidenceGQL!
|
||||||
|
limitations: [String!]!
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionCoachCandidateFamilyEnum {
|
||||||
|
AIMING
|
||||||
|
CUT_ANGLE
|
||||||
|
SPIN
|
||||||
|
OBJECT_TO_POCKET_DISTANCE
|
||||||
|
CUE_TO_OBJECT_DISTANCE
|
||||||
|
BACK_CUT
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SessionCoachCandidateKindEnum {
|
||||||
|
DIRECTIONAL_MISS
|
||||||
|
OUTCOME_PATTERN
|
||||||
|
USAGE_PATTERN
|
||||||
|
}
|
||||||
|
|
||||||
|
type SessionCoachEvidenceGQL {
|
||||||
|
bucketKey: String!
|
||||||
|
bucketLabel: String!
|
||||||
|
attemptCount: Int!
|
||||||
|
madeCount: Int!
|
||||||
|
missedCount: Int!
|
||||||
|
makePercentage: Float!
|
||||||
|
comparisonAttemptCount: Int!
|
||||||
|
comparisonMadeCount: Int!
|
||||||
|
comparisonMakePercentage: Float
|
||||||
|
patternShotCount: Int!
|
||||||
|
score: Float!
|
||||||
|
rankReason: String!
|
||||||
|
}
|
||||||
|
|
||||||
type PlayerClusterGQL {
|
type PlayerClusterGQL {
|
||||||
videoId: Int!
|
videoId: Int!
|
||||||
clusterId: Int!
|
clusterId: Int!
|
||||||
@@ -1019,6 +1098,14 @@ type PlayerClusterShotGQL {
|
|||||||
type TableStateGQL {
|
type TableStateGQL {
|
||||||
identifierToPosition: [[Float!]!]!
|
identifierToPosition: [[Float!]!]!
|
||||||
homography: HomographyInfoGQL
|
homography: HomographyInfoGQL
|
||||||
|
identifierToColor: [RGBColorGQL]!
|
||||||
|
}
|
||||||
|
|
||||||
|
type RGBColorGQL {
|
||||||
|
r: Int!
|
||||||
|
g: Int!
|
||||||
|
b: Int!
|
||||||
|
hex: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
input HomographyInputGQL {
|
input HomographyInputGQL {
|
||||||
@@ -1049,6 +1136,19 @@ input IntPoint2DInput {
|
|||||||
y: Int!
|
y: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LiveTableStateGQL {
|
||||||
|
videoId: Int!
|
||||||
|
frameIndex: Int!
|
||||||
|
tableState: TableStateGQL!
|
||||||
|
}
|
||||||
|
|
||||||
|
type ShotTableStateGQL {
|
||||||
|
shotId: Int!
|
||||||
|
videoId: Int!
|
||||||
|
frameIndex: Int!
|
||||||
|
tableState: TableStateGQL!
|
||||||
|
}
|
||||||
|
|
||||||
type ShotProjectionGQL {
|
type ShotProjectionGQL {
|
||||||
trajectories: [BallTrajectoryGQL!]!
|
trajectories: [BallTrajectoryGQL!]!
|
||||||
events: [SimulationEventGQL!]!
|
events: [SimulationEventGQL!]!
|
||||||
@@ -1153,6 +1253,60 @@ input CreatedAfter @oneOf {
|
|||||||
createdAt: DateTime
|
createdAt: DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UsageStatsGQL {
|
||||||
|
funnel: FunnelStatsGQL!
|
||||||
|
totalUsers: Int!
|
||||||
|
totalVideos: Int!
|
||||||
|
totalShots: Int!
|
||||||
|
totalRuns: Int!
|
||||||
|
cohorts: [CohortStatsGQL!]!
|
||||||
|
windows: [UsageStatsWindowGQL!]!
|
||||||
|
daily: [UsageStatsDailyGQL!]!
|
||||||
|
processingLast24h: [ProcessingStatusCountGQL!]!
|
||||||
|
}
|
||||||
|
|
||||||
|
type FunnelStatsGQL {
|
||||||
|
freemiumEpoch: Date!
|
||||||
|
eraSignups: Int!
|
||||||
|
eraPaying: Int!
|
||||||
|
activationCohort: Int!
|
||||||
|
activationActivated: Int!
|
||||||
|
payingUsers: Int!
|
||||||
|
newPaid7d: Int!
|
||||||
|
newPaid30d: Int!
|
||||||
|
retentionPrevActive: Int!
|
||||||
|
retentionReturned: Int!
|
||||||
|
}
|
||||||
|
|
||||||
|
type CohortStatsGQL {
|
||||||
|
weekStart: Date!
|
||||||
|
signups: Int!
|
||||||
|
activated7d: Int!
|
||||||
|
paid7d: Int!
|
||||||
|
activatedNotPaid7d: Int!
|
||||||
|
}
|
||||||
|
|
||||||
|
type UsageStatsWindowGQL {
|
||||||
|
label: String!
|
||||||
|
newUsers: Int!
|
||||||
|
activeUsers: Int!
|
||||||
|
sessions: Int!
|
||||||
|
shots: Int!
|
||||||
|
}
|
||||||
|
|
||||||
|
type UsageStatsDailyGQL {
|
||||||
|
day: Date!
|
||||||
|
newUsers: Int!
|
||||||
|
activeUsers: Int!
|
||||||
|
sessions: Int!
|
||||||
|
shots: Int!
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProcessingStatusCountGQL {
|
||||||
|
status: String!
|
||||||
|
count: Int!
|
||||||
|
}
|
||||||
|
|
||||||
type UserRelationshipsResult {
|
type UserRelationshipsResult {
|
||||||
inquiringUser: UserGQL!
|
inquiringUser: UserGQL!
|
||||||
relationships: [UserRelationship!]!
|
relationships: [UserRelationship!]!
|
||||||
@@ -1747,6 +1901,7 @@ input VideoMetadataInput {
|
|||||||
clientUploadStatus: ClientUploadStatusEnum = null
|
clientUploadStatus: ClientUploadStatusEnum = null
|
||||||
resolution: VideoResolution = null
|
resolution: VideoResolution = null
|
||||||
framesPerSecond: Float = null
|
framesPerSecond: Float = null
|
||||||
|
homographyBackend: HomographyBackendGQL = null
|
||||||
}
|
}
|
||||||
|
|
||||||
input VideoResolution {
|
input VideoResolution {
|
||||||
@@ -1754,6 +1909,11 @@ input VideoResolution {
|
|||||||
height: Int!
|
height: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum HomographyBackendGQL {
|
||||||
|
CLASSIC
|
||||||
|
TABLENET
|
||||||
|
}
|
||||||
|
|
||||||
type GetUploadLinkReturn {
|
type GetUploadLinkReturn {
|
||||||
value: UploadLinkGetUploadLinkErrors!
|
value: UploadLinkGetUploadLinkErrors!
|
||||||
stream: UploadStreamGQL
|
stream: UploadStreamGQL
|
||||||
|
|||||||
Reference in New Issue
Block a user