-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WID-100: add functionality to display the description of the componen…
…t arguments
- Loading branch information
1 parent
2daab9e
commit a42d19d
Showing
11 changed files
with
195 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,4 +136,7 @@ labextension/ | |
mlruns/ | ||
|
||
# Pytorch dataset default dir | ||
data | ||
data | ||
|
||
# pycharm files | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as React from "react"; | ||
import Toggle from 'react-toggle' | ||
import {useRef} from "react"; | ||
import {WithToggleProps} from "./types"; | ||
import ToolTip from 'react-portal-tooltip'; | ||
|
||
|
||
export default function WithToggle(props: WithToggleProps){ | ||
const ref = useRef(null); | ||
|
||
return ( | ||
<div ref ={ref} className="alignToggle"> | ||
{props.renderToggleBeforeChildren ? | ||
<> | ||
{ | ||
props.description && | ||
<Toggle | ||
className='description' | ||
name='Description' | ||
checked={props.showDescription} | ||
onChange={() => props.setShowDescription(!props.showDescription)} | ||
/> | ||
} | ||
<span> | ||
{props.children} | ||
</span> | ||
</> | ||
: | ||
<> | ||
<span> | ||
{props.children} | ||
</span> | ||
{ | ||
props.description && | ||
<Toggle | ||
className='description' | ||
name='Description' | ||
checked={props.showDescription} | ||
onChange={() => props.setShowDescription(!props.showDescription)} | ||
/> | ||
} | ||
</> | ||
} | ||
|
||
{props.showDescription && | ||
<ToolTip active={props.showDescription} position="left" arrow="center" parent={ref.current}> | ||
<div>{props.description}</div> | ||
</ToolTip> | ||
} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {ReactElement} from "react"; | ||
|
||
export type WithToggleProps = { | ||
renderToggleBeforeChildren : boolean; | ||
children: ReactElement[] | ReactElement | string; | ||
showDescription: boolean; | ||
setShowDescription: any; | ||
description: string; | ||
} | ||
|
||
export type WithToggleState = { | ||
showDescription : boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
xai_components/xai_learning/description/kerastransferlearningmodel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"description" : "keras_transfer_learning description", | ||
"arguments" : { | ||
"base_model_name" : "base_model_name description", | ||
"include_top" : "include_top description", | ||
"weights" : "weights description", | ||
"input_shape" : "input_shape description", | ||
"freeze_all" : "freeze_all description", | ||
"fine_tune_from" : "fine_tune_from description", | ||
"classes" : "classes description", | ||
"binary" : "binary description", | ||
"classifier_activation" : "classifier_activation description", | ||
"kwargs" : "kwargs description", | ||
"model" : "model description" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters