mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-31 09:22:49 -05:00
Rename space => view
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
export function boxesFromSpaceURLMap(width, height, stateURLMap) {
|
export function boxesFromViewURLMap(width, height, stateURLMap) {
|
||||||
const boxes = []
|
const boxes = []
|
||||||
const visited = new Set()
|
const visited = new Set()
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { boxesFromSpaceURLMap } from './geometry'
|
import { boxesFromViewURLMap } from './geometry'
|
||||||
|
|
||||||
const box1 = `
|
const box1 = `
|
||||||
ab
|
ab
|
||||||
@@ -82,10 +82,10 @@ describe.each([
|
|||||||
{ url: 'a', x: 1, y: 2, w: 1, h: 1, spaces: [7] },
|
{ url: 'a', x: 1, y: 2, w: 1, h: 1, spaces: [7] },
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
])('boxesFromSpaceURLMap(%i, %i, %j)', (width, height, data, expected) => {
|
])('boxesFromViewURLMap(%i, %i, %j)', (width, height, data, expected) => {
|
||||||
test(`returns expected ${expected.length} boxes`, () => {
|
test(`returns expected ${expected.length} boxes`, () => {
|
||||||
const stateURLMap = new Map(data.map((v, idx) => [idx, v]))
|
const stateURLMap = new Map(data.map((v, idx) => [idx, v]))
|
||||||
const result = boxesFromSpaceURLMap(width, height, stateURLMap)
|
const result = boxesFromViewURLMap(width, height, stateURLMap)
|
||||||
expect(result).toStrictEqual(expected)
|
expect(result).toStrictEqual(expected)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { interpret } from 'xstate'
|
|||||||
|
|
||||||
import { pollPublicData, pollSpreadsheetData, processData } from './data'
|
import { pollPublicData, pollSpreadsheetData, processData } from './data'
|
||||||
import viewStateMachine from './viewStateMachine'
|
import viewStateMachine from './viewStateMachine'
|
||||||
import { boxesFromSpaceURLMap } from './geometry'
|
import { boxesFromViewURLMap } from './geometry'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
WIDTH,
|
WIDTH,
|
||||||
@@ -124,8 +124,8 @@ async function main() {
|
|||||||
views.push(service)
|
views.push(service)
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.on('set-videos', async (ev, spaceURLMap) => {
|
ipcMain.on('set-videos', async (ev, viewURLMap) => {
|
||||||
const boxes = boxesFromSpaceURLMap(GRID_COUNT, GRID_COUNT, spaceURLMap)
|
const boxes = boxesFromViewURLMap(GRID_COUNT, GRID_COUNT, viewURLMap)
|
||||||
|
|
||||||
const unusedViews = new Set(views)
|
const unusedViews = new Set(views)
|
||||||
for (const box of boxes) {
|
for (const box of boxes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user