Skip to content

Commit

Permalink
sorted legends
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 2, 2024
1 parent a2af36b commit 0f744c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ async function fetchData(pageNumber = 1) {
}

export async function createPlot() {
const items = (
await Promise.all([1, 2, 3, 4, 5, 6].map(fetchData))
).flat()
const items = (await Promise.all([1, 2, 3, 4, 5, 6].map(fetchData))).flat()

// const data = Object.groupBy(json.items, ({ entity_id }) => entity_id)

Expand All @@ -30,9 +28,11 @@ export async function createPlot() {
return memo
}, {})

const tempSensorIds = Object.keys(data).filter((sensorId) =>
sensorId.includes('temp'),
)
const tempSensorIds = Object.keys(data)
.filter((sensorId) => sensorId.includes('temp'))
.sort((a, b) =>
(SENSOR_LABELS[a] ?? a).localeCompare(SENSOR_LABELS[b] ?? b),
)

console.log('Temp sensors:', tempSensorIds)

Expand Down

0 comments on commit 0f744c7

Please sign in to comment.