-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor input table #4375
base: master
Are you sure you want to change the base?
Refactor input table #4375
Conversation
220031f
to
aea1c76
Compare
5b465ed
to
e79f776
Compare
4a1e753
to
5c47981
Compare
e79f776
to
e4a7794
Compare
5c47981
to
cdde7f4
Compare
e4a7794
to
75a6fe6
Compare
cdde7f4
to
ff2359c
Compare
c6f2a9c
to
aea678b
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 1617 (24cd01) ❌ Edited: 2025-01-10 18:08:15 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I had some feedback, but otherwise this looks good.
For peace of mind, it would be nice if we can explicitly run the SVG tester on this set of changes (which it doesn't cleanly do here, because it's not on top of master
).
Could you do that, potentially by opening a draft PR of this-PR-rebased-onto-master?
// We need to reset the dimensions because some of them may have changed slugs in the legacy | ||
// transformation (can happen when columns use targetTime) | ||
this.setDimensionsFromConfigs(dimensions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you positive we don't need this call any more? I think it makes sense to keep it around, since dimensions can still change during this call, and therefore this.dimensions
may drift out of sync?
const valueFn = ( | ||
entityId: EntityId | undefined | ||
): string | ErrorValue => { | ||
if (!entityId) return ErrorValueTypes.UndefinedButShouldBeString | ||
const entityName = | ||
joinedVariablesTable.entityIdToNameMap.get(entityId) | ||
return entityName && selectedEntityColors | ||
? (selectedEntityColors[entityName] ?? | ||
ErrorValueTypes.UndefinedButShouldBeString) | ||
: ErrorValueTypes.UndefinedButShouldBeString | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is super odd that this fn is now based on EntityId, when it wasn't before.
Is there a particular reason for this? We have mostly deprecated entityId (as in, it is not really used within grapher code), and it is not present in explorer tables IIRC.
Could you instead use EntityName instead, unless there's a good reason not to?
const values = joinedVariablesTable.rows.map((row) => | ||
valueFn(row.entityId) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perf: computing .rows
is nontrivial (since our column store is column-based), and we should avoid it if we can.
you can instead use something like
joinedVariablesTable.entityNameColumn.valuesIncludingErrorValues.map()
aea678b
to
1f8d7f2
Compare
Refactor the creation of inputtable in anticipation of extracting the loading functionality. This PR does the following things: