-
Notifications
You must be signed in to change notification settings - Fork 353
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
Feature info chart fixes. #7156
Conversation
@na9da I've verified the above testing examples. Also have verified with my own datasets. They all work nicely. |
act() does not return a promise.
if (yColumnId === undefined || yColumn === undefined) { | ||
return undefined; | ||
} |
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.
Same as before but just convinces TS that value is not undefined
when using yColumnId
below.
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.
Use styled-components.
item: chartItem, | ||
xAxisLabel: attrs.previewXLabel, | ||
// Currently implementation supports showing only one column in the | ||
// feature info panel chart | ||
yColumn: attrs.yColumns?.[0], |
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.
Pass y-column
as prop to the FeatureInfoPanelChart
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.
I feel like adding a y-column
to FeatureInfoPanelChart
kind of skips the TableStyle
system. This behaviour is different from ChartView
/ChartPanel
- which uses ChartItem.showChartInPanel
to determine which charts should be showing.
Ideally CsvChartCustomComponent
y-columns
attribute is used to set TableChartLineStyleTraits.isSelectedInWorkbench
- and then FeatureInfoPanelChart
shows the first applicable chart item.
What do you think?
I also wonder if it is worth reverting if it is no longer needed here - as this was the only use of |
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.
After discussion: it is difficult to do what I suggested - so merge this in as short-term solution
For more context, the reason why we are not able to implement the recommended fix to use terriajs/lib/Table/TableAutomaticStylesStratum.ts Lines 162 to 165 in b73909e
To override that programmatically, we'll need to know what columns exists, but that is not known until the chart catalog item is loaded here in FeatureInfoPanelChart. It is easier then, to just pass the chosen |
What this PR does
Alternate approach to #6960 for making y-column of feature info charts configurable.
This PR
y-columns
to be used with<chart>
component in feature info templates without changing the merge strategy of chart traits. It does it by passing they-column
as a prop to theFeatureInfoPanelChart
.FeatureInfoPanelChart
and purges somescss
it depends on.${y-column-name}(${y-units}) x ${x-column-name}(${x-units})
Test me
Checklist
doc/
.