Skip to content

Commit

Permalink
UI: fix show-in-order for histogram plot type (#1195)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaAmega authored Jul 9, 2024
1 parent ab9ea17 commit cd0ad77
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/evidently/nbextension/static/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/evidently/ui/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
content="Evidently - ML Monitoring Demo. Hosted example to monitor the performance of a demand forecasting model on a toy dataset."
/>
<title>Evidently - ML Monitoring Demo</title>
<script type="module" crossorigin src="/static/js/index-C5cNhiiF.js"></script>
<script type="module" crossorigin src="/static/js/index-D7UWIwGk.js"></script>
<link rel="modulepreload" crossorigin href="/static/js/vendor-DRRvL2bZ.js">
<link rel="stylesheet" crossorigin href="/static/css/index-maTzSdYn.css">
</head>
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface BigGraphWidgetProps extends AdditionalGraphInfo {

const BigGraphWidgetContent: React.FunctionComponent<BigGraphWidgetProps> = (props) => {
const viewParams = useDashboardViewParams()
const isHistogram = props.data.some(({ type }) => type === 'histogram')

return (
<div>
Expand All @@ -20,7 +21,7 @@ const BigGraphWidgetContent: React.FunctionComponent<BigGraphWidgetProps> = (pro
title: undefined,
xaxis: {
...props.layout?.xaxis,
type: viewParams?.isXaxisAsCategorical ? 'category' : undefined
type: viewParams?.isXaxisAsCategorical && !isHistogram ? 'category' : undefined
}
}}
config={{ responsive: true }}
Expand Down
4 changes: 3 additions & 1 deletion ui/packages/evidently-ui-lib/src/widgets/RichDataWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const RichDataWidget: React.FunctionComponent<RichDataParams & { widgetSize: num
) => {
const [details, setDetails] = useState<boolean>(false)
const viewParams = useDashboardViewParams()
const isHistogram = props.graph?.data.some(({ type }) => type === 'histogram')

return (
<React.Fragment>
<Grid container spacing={2} justifyContent="center" alignItems="center">
Expand Down Expand Up @@ -66,7 +68,7 @@ const RichDataWidget: React.FunctionComponent<RichDataParams & { widgetSize: num
title: undefined,
xaxis: {
...props.graph.layout?.xaxis,
type: viewParams?.isXaxisAsCategorical ? 'category' : undefined
type: viewParams?.isXaxisAsCategorical && !isHistogram ? 'category' : undefined
}
}}
config={{ responsive: true }}
Expand Down

0 comments on commit cd0ad77

Please sign in to comment.