Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: functions, sequences, conditionals, editable constant #13

Merged
merged 46 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
70c9030
implement conditionals
39bytes Nov 28, 2023
6960e03
properly dispose when cancel
39bytes Nov 28, 2023
5387362
trying returning observables directly
39bytes Nov 28, 2023
ff4a9a3
Merge branch 'main' into jeff/iteration-and-functions
39bytes Nov 29, 2023
c30dd7b
merge fixes
39bytes Nov 29, 2023
09d0d91
better logging
39bytes Nov 29, 2023
a1c56df
fix stupid bug
39bytes Nov 30, 2023
57964c9
make blocks library scrollable
39bytes Nov 30, 2023
dac1ccf
lets gooo
39bytes Dec 1, 2023
32c5e22
intrinsic parameters
39bytes Dec 1, 2023
244e402
make immer work
39bytes Dec 1, 2023
31479c3
remove import
39bytes Dec 1, 2023
5f77f30
Merge branch 'main' into jeff/iteration-and-functions
39bytes Dec 4, 2023
7a5ed11
chore: format
39bytes Dec 4, 2023
d5c1cbc
chore: remove testing file
39bytes Dec 4, 2023
74fa0ef
chore: add back eslint config
39bytes Dec 4, 2023
a5b63c0
rstrip
39bytes Dec 4, 2023
c2e5bfb
bruh
39bytes Dec 4, 2023
25a3763
accidentally deleted the start observable being fired
39bytes Dec 4, 2023
53687b5
fix putting blocks in subflow
39bytes Dec 11, 2023
525f333
Merge branch 'main' into jeff/iteration-and-functions
39bytes Dec 11, 2023
eb3a57c
format
39bytes Dec 11, 2023
77cbcb1
add context menu for adding params/outputs for functions
39bytes Dec 12, 2023
e6f3c8a
pass function blocks to join_function_edges
39bytes Dec 12, 2023
bb15e8d
joining multiple edges works
39bytes Dec 13, 2023
fa83071
save/instance function definition
39bytes Dec 13, 2023
9a7a986
fix error
39bytes Dec 13, 2023
037ed2a
very close
39bytes Dec 13, 2023
3ce63c6
it works
39bytes Dec 14, 2023
cbd085e
lookup function definitions before running
39bytes Dec 15, 2023
f508b97
properly sync function inputs with instances
39bytes Dec 15, 2023
f7015a4
just use text input for numbers
39bytes Dec 15, 2023
47992fc
separate function instance data
39bytes Dec 18, 2023
d7f34cf
sync function name with definition block
39bytes Dec 18, 2023
b0aa6df
no way it works wow
39bytes Dec 18, 2023
fcf4e02
add basic tests
39bytes Dec 18, 2023
207dbd1
fix ts errors
39bytes Dec 18, 2023
f32c1d8
update lockfile
39bytes Dec 19, 2023
6b09ebd
remove definition when definition block is deleted
39bytes Dec 19, 2023
49ccca5
fix ts error
39bytes Dec 19, 2023
288f89f
debugging
39bytes Dec 19, 2023
d2a8738
fix nested function instances
39bytes Dec 19, 2023
e74c60e
fix test
39bytes Dec 19, 2023
a5c3fe0
fix: mirror deletions between control panel and flow chart (#15)
39bytes Dec 19, 2023
e2deae6
feat: include error view
itsjoeoui Dec 22, 2023
6431f3e
remove function instances when def is deleted
39bytes Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blocks/flojoy/control/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


@ui_input
def slider(x):
def slider(x: int) -> int:
return x
6 changes: 6 additions & 0 deletions blocks/flojoy/control/toggle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from captain.decorators import ui_input


@ui_input
def toggle(x: bool):
return x
5 changes: 5 additions & 0 deletions blocks/flojoy/logic/clock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import reactivex as rx


def clock():
return rx.interval(1 / 60)
14 changes: 14 additions & 0 deletions blocks/flojoy/logic/conditional.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from typing import TypedDict
from captain.types.builtins import Ignore


class Output(TypedDict):
true: Ignore | None
false: Ignore | None


def conditional(b: bool) -> Output:
return Output(
true=None if b else Ignore(),
false=Ignore() if b else None,
)
2 changes: 2 additions & 0 deletions blocks/flojoy/logic/false.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def false() -> bool:
return False
5 changes: 5 additions & 0 deletions blocks/flojoy/logic/sequence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import reactivex as rx


def sequence(start: int = 0, stop: int | None = None, step: int | None = None):
return rx.range(start=start, stop=stop, step=step)
2 changes: 2 additions & 0 deletions blocks/flojoy/logic/true.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def true() -> bool:
return True
2 changes: 1 addition & 1 deletion blocks/flojoy/math/arithmetic/add.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def add(x, y):
def add(x: int, y: int) -> int:
return x + y
2 changes: 1 addition & 1 deletion blocks/flojoy/math/arithmetic/subtract.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def subtract(x, y):
def subtract(x: int, y: int) -> int:
return x - y
4 changes: 2 additions & 2 deletions blocks/flojoy/math/constant.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def constant():
return 2
def constant(val: int) -> int:
return val
6 changes: 6 additions & 0 deletions blocks/flojoy/math/rand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import random
from typing import Any


def rand(x: Any = None) -> int:
return random.randint(0, 100)
Loading