-
Notifications
You must be signed in to change notification settings - Fork 232
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
Create Dynamic Elements.md #1252
base: master
Are you sure you want to change the base?
Conversation
Try out following example.
|
Attached example file from above: |
It's ready to review @zsviczian |
Second usecase example: Spatial Coding IDE
helix-editor/helix#2177 (comment)
ztjhz/BetterChatGPT#371 (comment)
https://github.com/ChatGodSpace/GeneKeysApp/blob/master/src/pages/api/chat.ts
|
Wow! Congratulations! This is really stretching the boundaries of what is possible! We could store the code in a transparent text element with a specific ID, and build a modal like in |
@hotkartoffel |
The script allows to create dynamic elements on the canvas by connecting them with macros functions defined on the same canvas. Here's how:
Defining Macros: Start by defining a macro. Connect an arrow from a text element to an output element. The arrow should be labeled with '#' followed by the macro name. The text element should contain your JavaScript function. This connection sets the macro and updates the output element with the current timestamp to indicate that the macro is updated.
Connecting Macros: After defining the macro, you can connect it with elements. Use an arrow labeled with '=' followed by the macro's name, and connect it from an input element (or a group of them inside a rectangle) to an output element.
Input Elements: Your input elements can be a text, image, or iframe. The script will fetch the corresponding 'text', 'fileId', or 'link' properties from these elements and use them as arguments in the macro function.
Executing Macros: Once you've connected all the elements you want to be processed by the macro, you can execute it. Select all the arrows you want to execute or simply select all the elements on the canvas and run the script. It will define and then execute all the macros to update the elements on the canvas.
Output Elements: The output of your macro function will reflect in the output elements. These elements can be either an image, text, or iframe. The macro's result gets assigned to these output elements accordingly.