-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
55 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def big_num(x): | ||
return x |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
def progress_bar(x): | ||
return x |
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
src/renderer/src/components/blocks/control/ProgressDisplay.tsx
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 @@ | ||
import { BlockProps } from '@/types/block'; | ||
import { useBlockState } from '@/hooks/useBlockState'; | ||
import { Progress } from '@/components/ui/Progress'; | ||
|
||
const ProgressDisplay = ({ id }: BlockProps) => { | ||
const [value] = useBlockState<number>(id); | ||
|
||
return ( | ||
<div className="flex w-64 items-center gap-2 border p-4"> | ||
<Progress value={value} /> | ||
<div>{value}%</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProgressDisplay; |
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,15 @@ | ||
import { Percent } from 'lucide-react'; | ||
import { Handle, Position } from 'reactflow'; | ||
|
||
const ProgressBlock = () => { | ||
return ( | ||
<> | ||
<div className="border p-4"> | ||
<Percent /> | ||
</div> | ||
<Handle type="target" position={Position.Left} id="x" /> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProgressBlock; |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import SliderControl from '@/components/blocks/control/SliderControl'; | ||
import BigNumberDisplay from '@/components/blocks/control/BigNumberDisplay'; | ||
import ProgressDisplay from '@/components/blocks/control/ProgressDisplay'; | ||
|
||
export const nodeTypes = { | ||
'flojoy.control.slider': SliderControl, | ||
'flojoy.visualization.bignum': BigNumberDisplay | ||
'flojoy.visualization.big_num': BigNumberDisplay, | ||
'flojoy.visualization.progress_bar': ProgressDisplay | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import AddBlock from '@/components/blocks/flow/AddBlock'; | ||
import BigNumberBlock from '@/components/blocks/flow/BigNumberBlock'; | ||
import ProgressBlock from '@/components/blocks/flow/ProgressBlock'; | ||
import SliderBlock from '@/components/blocks/flow/SliderBlock'; | ||
|
||
export const nodeTypes = { | ||
'flojoy.control.slider': SliderBlock, | ||
'flojoy.visualization.bignum': BigNumberBlock, | ||
'flojoy.visualization.big_num': BigNumberBlock, | ||
'flojoy.visualization.progress_bar': ProgressBlock, | ||
'flojoy.math.arithmetic.add': AddBlock | ||
}; |
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