Programmatic Drawing With Workflows

Demo to preview the plugin:

Introduction

Try out this handy Programmatic Drawing With Workflows no-code plugin that allows you to programmatically draw lines, circles, and rectangles with various colors, styles, and more.
After placing the canvas element on your page, you can use dynamic properties to draw circles, rectangles, and lines in any color.
A handy feature included in this plugin is the ‘Continue’ option, which allows your next stroke on the canvas to continue from the last. This is useful if you need to draw a certain number of pixels in lines and have them continue seamlessly.
Once you have created your masterpiece, you can save the image to your Bubble app as a .png file.
Image without caption

How to setup

  1. Add the Drawing Canvas element to your page.
    1. Element → Drawing Canvas element
      Element → Drawing Canvas element
  1. Drawing shapes on the Drawing Canvas:
      • In the Workflow, add an action of type:
        • Element Actions > Draw Circle A Drawing Canvas
          • Workflow action → Draw Circle A Drawing Canvas.
            Workflow action → Draw Circle A Drawing Canvas.
        • Element Actions > Draw Line A Drawing Canvas
          • Workflow action → Draw Line A Drawing Canvas.
            Workflow action → Draw Line A Drawing Canvas.
        • Element Actions > Draw Rectangle A Drawing Canvas
          • Workflow action → Draw Rectangle A Drawing Canvas.
            Workflow action → Draw Rectangle A Drawing Canvas.
  1. Converting the drawing into an image:
      • To transform the drawing into an image and save it, use the Make Image A Drawing Canvas action in the Workflow.
        • Workflow action → Make Image A Drawing Canvas.
          Workflow action → Make Image A Drawing Canvas.
  1. Clearing the canvas:
      • To allow users to clear the canvas and draw again, add the Erase A Drawing Canvas action to remove all content.
        • Workflow action → Erase A Drawing Canvas.
          Workflow action → Erase A Drawing Canvas.
  1. Handling upload failures:
      • If the image upload fails, the A Drawing Canvas Image Not Uploaded event will be triggered.
      • You can configure an alert or display a message to inform the user of the error.
        • Workflow event →  A Drawing Canvas Image Not Uploaded.
          Workflow event → A Drawing Canvas Image Not Uploaded.

Plugin Element Properties

Drawing Canvas

Element properties → Drawing Canvas.
Element properties → Drawing Canvas.

Element Actions

  1. Draw Circle - The Draw Circle action allows you to draw a circular or arc shape on the Drawing Canvas by specifying its position, size, and colors.
    1. Workflow action → Draw Circle.
      Workflow action → Draw Circle.
      Title
      Description
      Type
      X
      X
      Number
      Y
      Y
      Number
      Radius
      Radius
      Number
      Start Angle
      Start Angle
      Number
      End Angle
      End Angle
      Number
      Draw Anticlockwise?
      Draw Anticlockwise?
      Checkbox (yes/no)
      Stroke Color
      Stroke Color
      Color (optional)
      Fill Color
      Fill Color
      Color (optional)
      Line Width
      Line Width
      Number
  1. Make Image - The Make Image action converts the current canvas drawing into an image file, which can be saved or uploaded.
    1. Workflow action → Make Image.
      Workflow action → Make Image.
      Title
      Description
      Type
      File Name
      File Name
      Text
      Make Private?
      Make Private?
      Checkbox (yes/no)
      Attach To (private)
      Attach To (private)
      App Type (optional)
      Attach To (private)
      Attach To (private)
      Item reperesenting Attach To (private) (optional)
  1. Draw Line - The Draw Line action allows you to draw a straight line between two defined points on the canvas.
    1. Image without caption
      Title
      Description
      Type
      Start X
      Start X
      Number
      Start Y
      Start Y
      Number
      End X
      End X
      Number
      End Y
      End Y
      Number
      Stroke Color
      Stroke Color
      Color
      Line Width
      Line Width
      Number
      Continue?
      Continue?
      Checkbox (yes/no)
  1. Erase - The Erase action clears the entire canvas, removing all existing drawings.
    1. Image without caption
  1. Draw Rectangle - The Draw Rectangle action allows you to create a rectangle shape by defining its position, dimensions, and colors.
    1. Image without caption
      Title
      Description
      Type
      X
      X
      Number
      Y
      Y
      Number
      Height
      Height
      Number
      Width
      Width
      Number
      Stroke Color
      Stroke Color
      Color (optional)
      Fill Color
      Fill Color
      Color (optional)
      Line Width
      Line Width
      Number

Exposed states

Title
Description
Type
New Image URL
New Image URL
Text

Element Events

Title
Description
Image Uploaded
Image Uploaded
Image Not Uploaded
Image Not Uploaded
Image without caption

Changelogs