Compare commits
10 Commits
live-table
...
colonelpan
| Author | SHA1 | Date | |
|---|---|---|---|
| b30dbd01f5 | |||
| 303261f2d7 | |||
|
|
6f356f9535 | ||
|
|
5c0ff8c31b | ||
|
|
582c20170d | ||
| ef4782fc14 | |||
| 905a1ca6db | |||
| 6f63189703 | |||
| 958057764c | |||
| a150e1a300 |
871
src/index.tsx
871
src/index.tsx
File diff suppressed because it is too large
Load Diff
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
38
src/operations/usage_stats.gql
Normal file
38
src/operations/usage_stats.gql
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
query getUsageStats($days: Int! = 30) {
|
||||||
|
getUsageStats(days: $days) {
|
||||||
|
funnel {
|
||||||
|
freemiumEpoch
|
||||||
|
eraSignups
|
||||||
|
eraPaying
|
||||||
|
activationCohort
|
||||||
|
activationActivated
|
||||||
|
payingUsers
|
||||||
|
newPaid7d
|
||||||
|
newPaid30d
|
||||||
|
retentionPrevActive
|
||||||
|
retentionReturned
|
||||||
|
}
|
||||||
|
totalUsers
|
||||||
|
totalVideos
|
||||||
|
totalShots
|
||||||
|
totalRuns
|
||||||
|
windows {
|
||||||
|
label
|
||||||
|
newUsers
|
||||||
|
activeUsers
|
||||||
|
sessions
|
||||||
|
shots
|
||||||
|
}
|
||||||
|
daily {
|
||||||
|
day
|
||||||
|
newUsers
|
||||||
|
activeUsers
|
||||||
|
sessions
|
||||||
|
shots
|
||||||
|
}
|
||||||
|
processingLast24h {
|
||||||
|
status
|
||||||
|
count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,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 +101,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 +610,7 @@ type VideoTagClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HomographyInfoGQL {
|
type HomographyInfoGQL {
|
||||||
id: Int!
|
id: Int
|
||||||
frameIndex: Int!
|
frameIndex: Int!
|
||||||
crop: BoundingBoxGQL!
|
crop: BoundingBoxGQL!
|
||||||
pockets: [BoundingBoxGQL!]!
|
pockets: [BoundingBoxGQL!]!
|
||||||
@@ -1019,6 +1022,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 +1060,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 +1177,51 @@ input CreatedAfter @oneOf {
|
|||||||
createdAt: DateTime
|
createdAt: DateTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UsageStatsGQL {
|
||||||
|
funnel: FunnelStatsGQL!
|
||||||
|
totalUsers: Int!
|
||||||
|
totalVideos: Int!
|
||||||
|
totalShots: Int!
|
||||||
|
totalRuns: Int!
|
||||||
|
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 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!]!
|
||||||
|
|||||||
Reference in New Issue
Block a user