Skip to content

Commit

Permalink
completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed-baban committed Apr 16, 2024
1 parent a34d82b commit 2cbdf8d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const StyledRange = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
padding: 0 10px;
`;

const StyledPopper = styled.div`
Expand Down Expand Up @@ -88,7 +89,7 @@ const StyledRangePopover = styled.div`

const StyledRangeLabel = styled.label`
font-weight: 600;
color: ${({ theme }) => theme.colors.dvt.text.label};
color: ${({ theme }) => theme.colors.grayscale.dark2};
`;

export {
Expand Down
7 changes: 7 additions & 0 deletions superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@ const DvtSidebarData: SidebarDataProps[] = [
label: t('LABEL COLUMN'),
active: 'linear_regression',
},
{
placeholder: t('Training Data Ratio'),
name: 'training_data_ratio',
label: t('TRAINING DATA RATIO'),
active: 'linear_regression',
status: 'range',
},
{
placeholder: t('EPSİLON'),
name: 'epsilon',
Expand Down
26 changes: 26 additions & 0 deletions superset-frontend/src/components/DvtSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
StyledCollapseScroll,
ChartDatasetName,
} from './dvt-sidebar.module';
import DvtRange from '../DvtRange';

interface DvtSidebarProps {
pathName: string;
Expand Down Expand Up @@ -474,6 +475,7 @@ const DvtSidebar: React.FC<DvtSidebarProps> = ({ pathName, minWidth }) => {
'featureColumn',
'groupColumn',
'labelColumn',
'training_data_ratio',
],
},
{
Expand Down Expand Up @@ -891,6 +893,30 @@ const DvtSidebar: React.FC<DvtSidebarProps> = ({ pathName, minWidth }) => {
typeDesign="chartsForm"
/>
)}
{data.status === 'range' &&
data.active ===
newTrainedTableSelector.algorithm.value && (
<DvtRange
min={0}
max={1}
step={0.01}
value={
pathTitles(pathName) === 'newTrainedTable'
? newTrainedTableSelector[data.name]
: undefined
}
setValue={value => {
updateProperty(
sidebarDataFindPathname.key,
data.name,
value,
);
}}
label={data.label}
important
popoverDirection="top"
/>
)}
{data.status === 'datepicker' && (
<DvtDatePicker
isOpen
Expand Down
4 changes: 4 additions & 0 deletions superset-frontend/src/pages/DvtNewTrainedTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ function DvtNewTainedTable() {
label_column: newTainedTableAddSelector.labelColumn?.value
? newTainedTableAddSelector.labelColumn?.value
: undefined,
training_data_ratio: newTainedTableAddSelector.training_data_ratio
? newTainedTableAddSelector.training_data_ratio
: undefined,
},
}
: {
Expand Down Expand Up @@ -154,6 +157,7 @@ function DvtNewTainedTable() {
{ key: 'featureColumn' },
{ key: 'groupColumn' },
{ key: 'labelColumn' },
{ key: 'training_data_ratio' },
];

useEffect(() => {
Expand Down

0 comments on commit 2cbdf8d

Please sign in to comment.