Skip to content

Commit

Permalink
merge conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Advitya17 committed Nov 21, 2023
2 parents 23ce50f + eb68a1b commit 0fb19b0
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 15 deletions.
1 change: 1 addition & 0 deletions libs/core-ui/src/lib/Cohort/ShiftCohort/ShiftCohort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ShiftCohort extends React.Component<
options={this.state.options}
styles={dropdownStyles}
onChange={this.onChange}
ariaLabel={localization.Core.ShiftCohort.cohortList}
/>
<CohortStats
temporaryCohort={this.state.savedCohorts[this.state.selectedCohort]}
Expand Down
3 changes: 3 additions & 0 deletions libs/core-ui/src/lib/components/OverallMetricChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class OverallMetricChart extends React.PureComponent<
selectedKey={this.state.selectedCohortIndex}
onChange={this.setSelectedCohort}
id={"modelPerformanceCohortPicker"}
ariaLabel={
localization.Interpret.DatasetExplorer.datasetCohortDropdown
}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={labelOptions}
selectedKey={this.state.selectedLabelIndex}
onChange={this.setSelectedLabel}
ariaLabel={measuresLocalization.LabelPicker}
/>
</Stack.Item>
</Stack>
Expand All @@ -135,6 +136,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={featureOptions}
selectedKey={this.state.selectedFeatureIndex}
onChange={this.setSelectedFeature}
ariaLabel={measuresLocalization.FeaturePicker}
/>
</Stack.Item>
</Stack>
Expand All @@ -153,6 +155,7 @@ export class FeatureBalanceMeasuresChart extends React.PureComponent<
options={measureOptions}
selectedKey={this.state.selectedMeasureIndex}
onChange={this.setSelectedMeasure}
ariaLabel={measuresLocalization.MeasurePicker}
/>
</Stack.Item>
</Stack>
Expand Down
3 changes: 3 additions & 0 deletions libs/fairness/src/lib/Controls/DropdownBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={featureOptions}
disabled={false}
onChange={this.props.parentFeatureChanged}
ariaLabel={localization.Fairness.DropdownHeaders.sensitiveFeature}
/>
<Dropdown
id="performanceMetricDropdown"
Expand All @@ -67,6 +68,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={performanceDropDown}
disabled={false}
onChange={this.props.parentPerformanceChanged}
ariaLabel={localization.Fairness.DropdownHeaders.performanceMetric}
/>
<Dropdown
style={{ minWidth: "240px" }}
Expand All @@ -78,6 +80,7 @@ export class DropdownBar extends React.PureComponent<IDropdownBarProps> {
options={fairnessDropdown}
disabled={false}
onChange={this.props.parentFairnessChanged}
ariaLabel={localization.Fairness.DropdownHeaders.fairnessMetric}
/>
</Stack>
);
Expand Down
1 change: 1 addition & 0 deletions libs/fairness/src/lib/Controls/ReportChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ReportChart extends React.Component<IReportChartProps, IState> {
options={displayOptions}
disabled={false}
onChange={this.onChange}
ariaLabel={localization.Fairness.Report.chartChoiceAriaLabel}
/>
{this.state.chartKey === performanceKey && (
<PerformancePlot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export class DataCharacteristics extends React.Component<
options={this.state.labelTypeDropdownOptions}
selectedKey={this.state.labelType}
onChange={this.onLabelTypeChange}
ariaLabel={
localization.InterpretVision.Dashboard
.labelTypeAriaLabel
}
/>
</Stack.Item>
<Stack.Item>
Expand All @@ -118,6 +122,10 @@ export class DataCharacteristics extends React.Component<
}
onChange={this.onLabelVisibilitySelect}
multiSelect
ariaLabel={
localization.InterpretVision.Dashboard
.labelVisibilityAriaLabel
}
/>
</Stack.Item>
</Stack>
Expand Down Expand Up @@ -161,7 +169,7 @@ export class DataCharacteristics extends React.Component<
onRenderCell={this.onRenderCell}
loadPrevItems={this.loadPrevItems}
loadNextItems={this.loadNextItems}
getPageHeight={this.getPageHeight}
getPageHeight={(): number => this.rowHeight}
getItemCountForPage={this.getItemCountForPageWrapper(
index
)}
Expand Down Expand Up @@ -239,12 +247,11 @@ export class DataCharacteristics extends React.Component<
_event: React.FormEvent<HTMLDivElement>,
item?: IDropdownOption<any> | undefined
): void => {
if (!item) {
return;
if (item) {
this.setState(
getLabelVisibility(item, this.state, this.predOrIncorrectLabelType)
);
}
this.setState(
getLabelVisibility(item, this.state, this.predOrIncorrectLabelType)
);
};

private loadNextItems = (index: number) => (): void => {
Expand All @@ -266,11 +273,8 @@ export class DataCharacteristics extends React.Component<
this.setState({ renderStartIndex, showBackArrow });
};

private callbackWrapper = (item: IVisionListItem) => (): void => {
private callbackWrapper = (item: IVisionListItem) => (): void =>
this.props.selectItem(item);
};

private getPageHeight = (): number => this.rowHeight;

private getItemCountForPageWrapper = (
index: number
Expand All @@ -283,10 +287,7 @@ export class DataCharacteristics extends React.Component<
visibleRect?: IRectangle | undefined
): number => {
const columnCount = this.state.columnCount;
if (!visibleRect) {
return columnCount[index];
}
if (itemIndex === 0) {
if (visibleRect && itemIndex === 0) {
columnCount[index] =
Math.floor(visibleRect.width / this.props.imageDim) - 1;
this.setState({ columnCount: [...columnCount] });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class ImageList extends React.Component<
className={classNames.list}
getPageHeight={this.getPageHeight}
getItemCountForPage={this.getItemCountForPage}
tabIndex={0}
/>
</FocusZone>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class PageSizeSelectors extends React.Component<IPageSizeSelectorsProps>
defaultSelectedKey="3"
options={NumRowsOptions}
onChange={this.props.onNumRowsSelect}
ariaLabel={localization.InterpretVision.Dashboard.rowsAriaLabel}
/>
</Stack.Item>
</Stack>
Expand Down
10 changes: 9 additions & 1 deletion libs/localization/src/lib/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
"backToComparisons": "Back to all models",
"backToComparisonsLegacy": "Multimodel view",
"chartChoiceDropdownHeader": "Charts",
"chartChoiceAriaLabel": "Chart selection",
"classificationOutcomesHowToRead": "The bar chart shows the selection rate in each group, meaning the fraction of points classified as 1.",
"classificationPerformanceHowToRead1": "The bar chart shows the distribution of errors in each group.",
"classificationPerformanceHowToRead2": "Errors are split into overprediction errors (predicting 1 when the true label is 0), and underprediction errors (predicting 0 when the true label is 1).",
Expand Down Expand Up @@ -995,7 +996,7 @@
"individualDatapoints": "Individual datapoints",
"missingParameters": "This tab requires an evaluation dataset be supplied.",
"noColor": "None",
"datasetCohortDropdown": "Dataset cohort dropdown"
"datasetCohortDropdown": "Dataset cohort"
},
"DependencePlot": {
"_featureImportanceOf.comment": "axis label on chart showing the importance of a selected feature (column)",
Expand Down Expand Up @@ -1447,7 +1448,9 @@
"filter": "Filter",
"indexLabel": "Image ",
"labelTypeDropdown": "Select label type",
"labelTypeAriaLabel": "Label type",
"labelVisibilityDropdown": "Select labels to display",
"labelVisibilityAriaLabel": "Label visibility",
"legendFailure": "failure",
"legendSuccess": "success",
"loading": "Computing explanation for image of index",
Expand All @@ -1464,6 +1467,7 @@
"incorrectDetections": "Incorrect detections: ",
"prefix": "Object: ",
"rows": "Rows: ",
"rowsAriaLabel": "Number of rows per page",
"search": "Search",
"selectAll": "Select all",
"settings": "Settings",
Expand All @@ -1481,6 +1485,8 @@
"AddingTab": {
"AddButtonText": "Add",
"CalloutContent": "Adding some components (error tree view, error heat map) will allow you to filter down the data from the global cohort that you see in the components below.",
"AddComponentAriaLabel": "Add dashboard component",
"AddButtonAriaLabel": "Add dashboard button",
"CalloutTitle": "Add component",
"TabAddedMessage": {
"DataAnalysis": "Data analysis component added",
Expand Down Expand Up @@ -1514,6 +1520,7 @@
"deleteCohort": "Deleting {0}?",
"deleteConfirm": "Are you sure you want to delete this cohort?",
"selectCohort": "Select a cohort",
"selectCohortAriaLabel": "Cohort selection",
"shiftCohort": "Switch cohort",
"shiftCohortDescription": "Select a cohort from the cohort list. Apply the cohort to the dashboard."
},
Expand Down Expand Up @@ -1997,6 +2004,7 @@
"cancel": "Cancel",
"cohortList": "Time series list",
"selectCohort": "Select a time series",
"selectCohortAriaLabel": "Time series selection",
"shiftCohort": "Switch time series",
"shiftCohortDescription": "Select a time series from the time series list. Apply the time series to the dashboard."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ export class AddTabButton extends React.Component<
<Dropdown
options={this.props.availableTabs}
onChange={this.onChange}
ariaLabel={
localization.ModelAssessment.AddingTab.AddComponentAriaLabel
}
/>
<PrimaryButton
onClick={this.addTab}
text={localization.ModelAssessment.AddingTab.AddButtonText}
ariaLabel={
localization.ModelAssessment.AddingTab.AddButtonAriaLabel
}
/>
</Stack>
</Callout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class ShiftCohort extends React.Component<
selectedKey={this.state.selectedCohort}
options={this.state.options}
onChange={this.onChange}
ariaLabel={localizationBase.selectCohortAriaLabel}
/>
<CohortEditorFilterList
compositeFilters={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ export class ChartConfigurationFlyout extends React.Component<
.chartConfigDatasetCohortSelectionPlaceholder
}
disabled={!this.state.datasetCohortViewIsNewlySelected}
ariaLabel={
localization.ModelAssessment.ModelOverview
.dataCohortsChartSelectionHeader
}
/>
{this.props.featureBasedCohorts.length > 0 && (
<Dropdown
Expand All @@ -250,6 +254,10 @@ export class ChartConfigurationFlyout extends React.Component<
.chartConfigFeatureBasedCohortSelectionPlaceholder
}
disabled={this.state.datasetCohortViewIsNewlySelected}
ariaLabel={
localization.ModelAssessment.ModelOverview
.featureBasedCohortsChartSelectionHeader
}
/>
)}
</Stack>
Expand Down

0 comments on commit 0fb19b0

Please sign in to comment.