Rename space => view

This commit is contained in:
Max Goodhart
2020-06-18 14:13:13 -07:00
parent 1374b8af99
commit 9c379a912b
3 changed files with 7 additions and 7 deletions

View File

@@ -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()

View File

@@ -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)
}) })
}) })

View File

@@ -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) {