Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
  • Loading branch information
WeichenXu123 committed Nov 8, 2021
1 parent 3cd6ac8 commit 21a0900
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -707,7 +707,7 @@ export class ExperimentView extends Component {
ColumnSortByOrder.forEach((order) => {
sortOptions.push(
<Option
key={metricKey}
key={ExperimentViewUtil.middleTruncateKey(metricKey, 20)}
title={metricKey}
data-test-id={`sort-select-${metricKey}-${order}`}
value={`${ExperimentViewUtil.makeCanonicalKey(
Expand All @@ -732,7 +732,7 @@ export class ExperimentView extends Component {
sortOptions.push(
<Option
key={paramKey}
title={paramKey}
title={ExperimentViewUtil.middleTruncateKey(paramKey, 20)}
data-test-id={`sort-select-${paramKey}-${order}`}
value={`${ExperimentViewUtil.makeCanonicalKey(
COLUMN_TYPES.PARAMS,
Expand Down
Expand Up @@ -273,6 +273,13 @@ export default class ExperimentViewUtil {
return keyType + '.`' + keyName + '`';
}

static middleTruncateKey(keyName, maxLen) {
if keyName.length > maxLen:
return keyName.substring(0, firstPartLen) + '...' + keyName.substring(firstPartLen + 3)
else:
return keyName
}

static getExpanderHeader(cellType) {
const CellComponent = `${cellType}`;
return (
Expand Down

0 comments on commit 21a0900

Please sign in to comment.