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

Fix Block Size Issue #181

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 frontend/src/components/blocks/basic/code/code-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class CodeBlockWidget extends React.Component<CodeBlockWidgetProps, CodeB
*/
handleResize: MouseEventHandler<HTMLDivElement> = (event) => {
const element = event.target as HTMLDivElement;
this.props.node.setSize(element.clientWidth, element.clientHeight);
this.props.node.setSize(Math.max(element.clientWidth, 300), Math.max(element.clientHeight, 300));
}


Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/src/components/blocks/collection/opencv/Blur.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"editor":{"id":"6eab41ed-7b8c-4490-89dd-47ddf297a2bb","offsetX":0,"offsetY":0,"zoom":100,"gridSize":0,"layers":[{"id":"db6bab49-b903-450d-ae20-556122b31edb","type":"diagram-links","isSvg":true,"transformed":true,"models":{"950da9a7-9f76-4615-942e-a3ffa725102a":{"id":"950da9a7-9f76-4615-942e-a3ffa725102a","type":"default","selected":false,"source":"81a5ded8-2c3d-4e94-8269-0978733af109","sourcePort":"cae71fac-2888-443f-9746-3c16c16fb9be","target":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","targetPort":"9ce8ac58-40c4-4b0b-a570-750ae8a293fe","points":[{"id":"7dfdabdf-a7f9-400d-b0bb-b9d3e5cccad8","type":"point","x":1012.0125122070312,"y":368},{"id":"7bb8808f-d01a-4916-8376-40aa5a582b27","type":"point","x":1136.5,"y":369.8000183105469}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"1adf3351-5457-4ddd-817f-37634df590f8":{"id":"1adf3351-5457-4ddd-817f-37634df590f8","type":"default","selected":false,"source":"9b2c8136-5657-4204-b999-60019fa9c5e5","sourcePort":"005c49ba-05a4-4872-8324-56ede7d28291","target":"81a5ded8-2c3d-4e94-8269-0978733af109","targetPort":"a6a9cb43-5e85-4fa9-b4dd-b757aafb5f09","points":[{"id":"1a1d9723-d8c3-460c-8b54-8dfd218f95ce","type":"point","x":311.5,"y":363.8000183105469},{"id":"de824d3d-61ec-4c02-9ce0-a6bda1bb5797","type":"point","x":454.5,"y":368}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"}}},{"id":"1d15be77-4b43-4c28-8267-7e494ac02519","type":"diagram-nodes","isSvg":false,"transformed":true,"models":{"81a5ded8-2c3d-4e94-8269-0978733af109":{"id":"81a5ded8-2c3d-4e94-8269-0978733af109","type":"basic.code","selected":false,"x":446,"y":120,"ports":[{"id":"a6a9cb43-5e85-4fa9-b4dd-b757aafb5f09","type":"port.input","x":447,"y":360.5,"name":"Enable","alignment":"left","parentNode":"81a5ded8-2c3d-4e94-8269-0978733af109","links":["1adf3351-5457-4ddd-817f-37634df590f8"],"in":true,"label":"Enable","hideLabel":false},{"id":"cae71fac-2888-443f-9746-3c16c16fb9be","type":"port.output","x":1004.5125122070312,"y":360.5,"name":"Img","alignment":"right","parentNode":"81a5ded8-2c3d-4e94-8269-0978733af109","links":["950da9a7-9f76-4615-942e-a3ffa725102a"],"in":false,"label":"Img","hideLabel":false}],"data":{"code":"import cv2\n\n\ndef main(inputs, outputs, parameters, synchronise):\n cap = cv2.VideoCapture(0)\n auto_enable = False\n try:\n enable = inputs.read_number('Enable')\n except Exception:\n auto_enable = True\n try:\n while cap.isOpened() and (auto_enable or inputs.read_number('Enable')):\n ret, frame = cap.read()\n if not ret:\n continue\n\n outputs.share_image(\"Img\", frame)\n synchronise()\n except Exception as e:\n print('Error:', e)\n pass\n finally:\n print(\"Exiting\")\n cap.release()","frequency":"30","params":[],"ports":{"in":[{"name":"Enable"}],"out":[{"name":"Img"}]},"size":{"width":"777px","height":"19px"}}},"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee":{"id":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","type":"basic.output","selected":false,"x":1128,"y":342,"ports":[{"id":"9ce8ac58-40c4-4b0b-a570-750ae8a293fe","type":"port.input","x":1129,"y":362.3000183105469,"name":"output-in","alignment":"left","parentNode":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","links":["950da9a7-9f76-4615-942e-a3ffa725102a"],"in":true,"label":"output-in","hideLabel":true}],"data":{"name":"Img"}},"9b2c8136-5657-4204-b999-60019fa9c5e5":{"id":"9b2c8136-5657-4204-b999-60019fa9c5e5","type":"basic.input","selected":false,"x":218,"y":336,"ports":[{"id":"005c49ba-05a4-4872-8324-56ede7d28291","type":"port.output","x":304,"y":356.3000183105469,"name":"input-out","alignment":"right","parentNode":"9b2c8136-5657-4204-b999-60019fa9c5e5","links":["1adf3351-5457-4ddd-817f-37634df590f8"],"in":false,"label":"Enable","hideLabel":true}],"data":{"name":"Enable"}}}}]},"version":"3.0","package":{"name":"Camera","version":"2.0.0","description":"Captures Video Stream from Camera","author":"Muhammad Taha Suhail, Suhas Gopal","image":"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MnB0IiB2aWV3Qm94PSIwIC04NyA0NzIgNDcyIiB3aWR0aD0iNDcycHQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQ2MiAzNS4xMjEwOTR2MjI3LjgyMDMxMmwtMTIxLjg3ODkwNi02Ni41NTA3ODFoLTEuMjEwOTM4di05NC43MTg3NWgxLjIxMDkzOHptMCAwIiBmaWxsPSIjMDBhY2VhIi8+PHBhdGggZD0ibTMzOC45MTAxNTYgMTk2LjM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jQ4LjkxMDE1NmMtMTYuNTYyNS0uMDE5NTMxLTI5Ljk4MDQ2OS0xMy40NDE0MDYtMzAtMzB2LTE5Ny40MjE4NzVjLjAxOTUzMS0xNi41NjI1IDEzLjQzNzUtMjkuOTgwNDY5IDMwLTMwaDI0OC45MTAxNTZjMTYuNTYyNS4wMTk1MzEgMjkuOTgwNDY5IDEzLjQzNzUgMzAgMzB6bTEyMy4wODk4NDQtMS4zMzU5MzctMTAzLjA4OTg0NC01Ni4yODkwNjN2LTgxLjUzMTI1bDEwMy4wODk4NDQtNTYuMjkyOTY5em0wIDAiIGZpbGw9IiMwODM4NjMiLz48L3N2Zz4="},"design":{"board":"Python3-Noetic","graph":{"blocks":[{"id":"81a5ded8-2c3d-4e94-8269-0978733af109","type":"basic.code","data":{"code":"import cv2\n\n\ndef main(inputs, outputs, parameters, synchronise):\n cap = cv2.VideoCapture(0)\n auto_enable = False\n try:\n enable = inputs.read_number('Enable')\n except Exception:\n auto_enable = True\n try:\n while cap.isOpened() and (auto_enable or inputs.read_number('Enable')):\n ret, frame = cap.read()\n if not ret:\n continue\n\n outputs.share_image(\"Img\", frame)\n synchronise()\n except Exception as e:\n print('Error:', e)\n pass\n finally:\n print(\"Exiting\")\n cap.release()","frequency":"30","params":[],"ports":{"in":[{"name":"Enable"}],"out":[{"name":"Img"}]},"size":{"width":"777px","height":"19px"}},"position":{"x":446,"y":120}},{"id":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","type":"basic.output","data":{"name":"Img"},"position":{"x":1128,"y":342}},{"id":"9b2c8136-5657-4204-b999-60019fa9c5e5","type":"basic.input","data":{"name":"Enable"},"position":{"x":218,"y":336}}],"wires":[{"source":{"block":"81a5ded8-2c3d-4e94-8269-0978733af109","port":"Img","name":"Img"},"target":{"block":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","port":"output-in","name":"output-in"}},{"source":{"block":"9b2c8136-5657-4204-b999-60019fa9c5e5","port":"input-out","name":"Enable"},"target":{"block":"81a5ded8-2c3d-4e94-8269-0978733af109","port":"Enable","name":"Enable"}}]}},"dependencies":{}}
{"editor":{"id":"6eab41ed-7b8c-4490-89dd-47ddf297a2bb","offsetX":0,"offsetY":0,"zoom":100,"gridSize":0,"layers":[{"id":"db6bab49-b903-450d-ae20-556122b31edb","type":"diagram-links","isSvg":true,"transformed":true,"models":{"950da9a7-9f76-4615-942e-a3ffa725102a":{"id":"950da9a7-9f76-4615-942e-a3ffa725102a","type":"default","selected":false,"source":"81a5ded8-2c3d-4e94-8269-0978733af109","sourcePort":"cae71fac-2888-443f-9746-3c16c16fb9be","target":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","targetPort":"9ce8ac58-40c4-4b0b-a570-750ae8a293fe","points":[{"id":"7dfdabdf-a7f9-400d-b0bb-b9d3e5cccad8","type":"point","x":1012.0125122070312,"y":368},{"id":"7bb8808f-d01a-4916-8376-40aa5a582b27","type":"point","x":1136.5,"y":369.8000183105469}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"},"1adf3351-5457-4ddd-817f-37634df590f8":{"id":"1adf3351-5457-4ddd-817f-37634df590f8","type":"default","selected":false,"source":"9b2c8136-5657-4204-b999-60019fa9c5e5","sourcePort":"005c49ba-05a4-4872-8324-56ede7d28291","target":"81a5ded8-2c3d-4e94-8269-0978733af109","targetPort":"a6a9cb43-5e85-4fa9-b4dd-b757aafb5f09","points":[{"id":"1a1d9723-d8c3-460c-8b54-8dfd218f95ce","type":"point","x":311.5,"y":363.8000183105469},{"id":"de824d3d-61ec-4c02-9ce0-a6bda1bb5797","type":"point","x":454.5,"y":368}],"labels":[],"width":3,"color":"gray","curvyness":50,"selectedColor":"rgb(0,192,255)"}}},{"id":"1d15be77-4b43-4c28-8267-7e494ac02519","type":"diagram-nodes","isSvg":false,"transformed":true,"models":{"81a5ded8-2c3d-4e94-8269-0978733af109":{"id":"81a5ded8-2c3d-4e94-8269-0978733af109","type":"basic.code","selected":false,"x":446,"y":120,"ports":[{"id":"a6a9cb43-5e85-4fa9-b4dd-b757aafb5f09","type":"port.input","x":447,"y":360.5,"name":"Enable","alignment":"left","parentNode":"81a5ded8-2c3d-4e94-8269-0978733af109","links":["1adf3351-5457-4ddd-817f-37634df590f8"],"in":true,"label":"Enable","hideLabel":false},{"id":"cae71fac-2888-443f-9746-3c16c16fb9be","type":"port.output","x":1004.5125122070312,"y":360.5,"name":"Img","alignment":"right","parentNode":"81a5ded8-2c3d-4e94-8269-0978733af109","links":["950da9a7-9f76-4615-942e-a3ffa725102a"],"in":false,"label":"Img","hideLabel":false}],"data":{"code":"import cv2\n\n\ndef main(inputs, outputs, parameters, synchronise):\n cap = cv2.VideoCapture(0)\n auto_enable = False\n try:\n enable = inputs.read_number('Enable')\n except Exception:\n auto_enable = True\n try:\n while cap.isOpened() and (auto_enable or inputs.read_number('Enable')):\n ret, frame = cap.read()\n if not ret:\n continue\n\n outputs.share_image(\"Img\", frame)\n synchronise()\n except Exception as e:\n print('Error:', e)\n pass\n finally:\n print(\"Exiting\")\n cap.release()","frequency":"30","params":[],"ports":{"in":[{"name":"Enable"}],"out":[{"name":"Img"}]},"size":{"width":"777px","height":"500px"}}},"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee":{"id":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","type":"basic.output","selected":false,"x":1128,"y":342,"ports":[{"id":"9ce8ac58-40c4-4b0b-a570-750ae8a293fe","type":"port.input","x":1129,"y":362.3000183105469,"name":"output-in","alignment":"left","parentNode":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","links":["950da9a7-9f76-4615-942e-a3ffa725102a"],"in":true,"label":"output-in","hideLabel":true}],"data":{"name":"Img"}},"9b2c8136-5657-4204-b999-60019fa9c5e5":{"id":"9b2c8136-5657-4204-b999-60019fa9c5e5","type":"basic.input","selected":false,"x":218,"y":336,"ports":[{"id":"005c49ba-05a4-4872-8324-56ede7d28291","type":"port.output","x":304,"y":356.3000183105469,"name":"input-out","alignment":"right","parentNode":"9b2c8136-5657-4204-b999-60019fa9c5e5","links":["1adf3351-5457-4ddd-817f-37634df590f8"],"in":false,"label":"Enable","hideLabel":true}],"data":{"name":"Enable"}}}}]},"version":"3.0","package":{"name":"Camera","version":"2.0.0","description":"Captures Video Stream from Camera","author":"Muhammad Taha Suhail, Suhas Gopal","image":"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MnB0IiB2aWV3Qm94PSIwIC04NyA0NzIgNDcyIiB3aWR0aD0iNDcycHQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTQ2MiAzNS4xMjEwOTR2MjI3LjgyMDMxMmwtMTIxLjg3ODkwNi02Ni41NTA3ODFoLTEuMjEwOTM4di05NC43MTg3NWgxLjIxMDkzOHptMCAwIiBmaWxsPSIjMDBhY2VhIi8+PHBhdGggZD0ibTMzOC45MTAxNTYgMTk2LjM5MDYyNXY1MS4wMzEyNWMwIDIyLjA4OTg0NC0xNy45MTAxNTYgNDAtNDAgNDBoLTI0OC45MTAxNTZjLTIyLjA4OTg0NCAwLTQwLTE3LjkxMDE1Ni00MC00MHYtMTk3LjQyMTg3NWMwLTIyLjA4OTg0NCAxNy45MTAxNTYtNDAgNDAtNDBoMjQ4LjkxMDE1NmMyMi4wODk4NDQgMCA0MCAxNy45MTAxNTYgNDAgNDB6bTAgMCIgZmlsbD0iIzAwZWZkMSIvPjxwYXRoIGQ9Im00NjcuMTAxNTYyIDI2LjUxOTUzMWMtMy4wMzkwNjItMS44MDA3ODEtNi43OTY4NzQtMS44NjcxODctOS44OTg0MzctLjE3NTc4MWwtMTA4LjI5Njg3NSA1OS4xMzI4MTJ2LTM1LjQ3NjU2MmMtLjAzMTI1LTI3LjYwMTU2Mi0yMi4zOTg0MzgtNDkuOTY4NzUtNTAtNTBoLTI0OC45MDYyNWMtMjcuNjAxNTYyLjAzMTI1LTQ5Ljk2ODc1IDIyLjM5ODQzOC01MCA1MHYxOTcuNDIxODc1Yy4wMzEyNSAyNy41OTc2NTYgMjIuMzk4NDM4IDQ5Ljk2NDg0NCA1MCA1MGgyNDguOTEwMTU2YzI3LjYwMTU2My0uMDM1MTU2IDQ5Ljk2ODc1LTIyLjQwMjM0NCA1MC01MHYtMzQuODM5ODQ0bDEwOC4zMDA3ODIgNTkuMTMyODEzYzMuMDk3NjU2IDEuNjkxNDA2IDYuODU1NDY4IDEuNjI1IDkuODkwNjI0LS4xNzU3ODIgMy4wMzUxNTctMS44MDQ2ODcgNC44OTg0MzgtNS4wNzAzMTIgNC44OTg0MzgtOC42MDE1NjJ2LTIyNy44MTY0MDZjMC0zLjUzMTI1LTEuODYzMjgxLTYuODAwNzgyLTQuODk4NDM4LTguNjAxNTYzem0tMTM4LjE5MTQwNiAyMjAuOTAyMzQ0Yy0uMDE5NTMxIDE2LjU1ODU5NC0xMy40Mzc1IDI5Ljk4MDQ2OS0zMCAzMGgtMjQ4LjkxMDE1NmMtMTYuNTYyNS0uMDE5NTMxLTI5Ljk4MDQ2OS0xMy40NDE0MDYtMzAtMzB2LTE5Ny40MjE4NzVjLjAxOTUzMS0xNi41NjI1IDEzLjQzNzUtMjkuOTgwNDY5IDMwLTMwaDI0OC45MTAxNTZjMTYuNTYyNS4wMTk1MzEgMjkuOTgwNDY5IDEzLjQzNzUgMzAgMzB6bTEyMy4wODk4NDQtMS4zMzU5MzctMTAzLjA4OTg0NC01Ni4yODkwNjN2LTgxLjUzMTI1bDEwMy4wODk4NDQtNTYuMjkyOTY5em0wIDAiIGZpbGw9IiMwODM4NjMiLz48L3N2Zz4="},"design":{"board":"Python3-Noetic","graph":{"blocks":[{"id":"81a5ded8-2c3d-4e94-8269-0978733af109","type":"basic.code","data":{"code":"import cv2\n\n\ndef main(inputs, outputs, parameters, synchronise):\n cap = cv2.VideoCapture(0)\n auto_enable = False\n try:\n enable = inputs.read_number('Enable')\n except Exception:\n auto_enable = True\n try:\n while cap.isOpened() and (auto_enable or inputs.read_number('Enable')):\n ret, frame = cap.read()\n if not ret:\n continue\n\n outputs.share_image(\"Img\", frame)\n synchronise()\n except Exception as e:\n print('Error:', e)\n pass\n finally:\n print(\"Exiting\")\n cap.release()","frequency":"30","params":[],"ports":{"in":[{"name":"Enable"}],"out":[{"name":"Img"}]},"size":{"width":"777px","height":"500px"}},"position":{"x":446,"y":120}},{"id":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","type":"basic.output","data":{"name":"Img"},"position":{"x":1128,"y":342}},{"id":"9b2c8136-5657-4204-b999-60019fa9c5e5","type":"basic.input","data":{"name":"Enable"},"position":{"x":218,"y":336}}],"wires":[{"source":{"block":"81a5ded8-2c3d-4e94-8269-0978733af109","port":"Img","name":"Img"},"target":{"block":"914a97c9-1f81-4f4f-a0f5-56e6ed9d53ee","port":"output-in","name":"output-in"}},{"source":{"block":"9b2c8136-5657-4204-b999-60019fa9c5e5","port":"input-out","name":"Enable"},"target":{"block":"81a5ded8-2c3d-4e94-8269-0978733af109","port":"Enable","name":"Enable"}}]}},"dependencies":{}}
Loading