Git Product home page Git Product logo

blackprint / blackprint Goto Github PK

View Code? Open in Web Editor NEW
166.0 8.0 12.0 2.29 MB

A general purpose visual programming. This is the main repository for Blackprint that contains source code of cable, node, and container sketch for visualization.

Home Page: https://blackprint.github.io/

License: MIT License

JavaScript 100.00%
html5 blackprint visual-programming blueprint flow-based-programming javascript

blackprint's Introduction

Blackprint

Blackprint

A general purpose visual programming interface for lowering programming language's steep learning curve, and introduce an easy way to experimenting with your beautiful project for other developer.

Preview_with_example_nodes.mp4

Blackprint Sketch is built using ScarletsFrame (performance and features).
Blackprint Engine is distributed separately for different runtime environment.
Blackprint Editor is created as a online IDE for browser.

Note

Please use Chromium based browser for better rendering performance.

Default Node's UI design was inspired by UE4 Blueprint and can be modified with HTML/CSS. If you're using Blackprint Editor you can choose different theme on the settings, and here's the code for reference if you want to create your own theme.

Documentation

Documentation is included in the editor, if you want to help contributing or modify you can fork the editor and modify files in this directory. Blackprint Engine and Sketch does have a TypeScript definition files, so if you working with TypeScript you may see a code suggestion in your code editor like Visual Studio Code.

Example

If you're looking for minimal sketch example to get started integrate for your editor project:

If you just want to execute exported Blackprint JSON, you can just use the engine. I also provide few simple example for different framework in case you want to use integrate to your frontend framework. For non-browser engine, there are example on it's repository. You can copy and paste the JSON to Blackprint Editor to see the nodes arrangement. The example below is using this arrangement.


Video Example:

  1. Build Telegram bot with Blackprint
Example-Creating-Telegram-bot.mp4

Available Shortcut for Blackprint Sketch

Mouse + Keyboard Touchscreen Target Description
LeftClick + move 1 touch + move Container Select nodes and cable
branch
Middle/Right click + move 2 touch + move Container Move the container
Ctrl + MouseWheel
RightClick + MouseWheel
3 touch + move Container Zoom the container
RightClick tap hold 1 sec Node, Cable, Container Context menu
Ctrl + LeftClick - Cable Create cable branch
Ctrl + RightClick - Port, Cable Node suggestion
Shift + LeftClick - Port Detach last connected cable

Available Shortcut for Blackprint Editor

Mouse + Keyboard Touchscreen Target Description
Ctrl + C - Selected Node Copy nodes
Ctrl + V - Selected Node Paste copied nodes
Delete - Selected Node Delete node
Ctrl + Alt + LeftClick - Anything ScarletsFrame's element
inspector (dev mode)

Blackprint Roadmap

This roadmap could be changed on the future, feel free to request feature or report an issue.

Name JavaScript PHP Golang Python C#
Browser Deno/Node.js
Blackprint Engine -
Minimal example ✔️ Link ✔️ Link ✔️ Link ✔️ Link ✔️ Link -
Environment variables ✔️ ✔️ ✔️ 🚧 ✔️ -
Import modules from URL ✔️ ✔️
Pausable and routable data flow ✔️ ✔️ 🧪 🚧 🧪 -
Remote control 🧪 🧪 - 🧪 -
Code generation 🧪 🧪 🚧 🚧 🧪 🚧

🚧 = Under development (In the current working plan)
🧪 = Experimental/Alpha stage (Being tested and may have rapid changes)
✖ = Not supported (Either it can't be implemented or it has better solution)
❔ = Should we add the feature? (Please start a discussion if you need it)
- = Haven't been decided


With remote control you can easily manage connection to the target environment (Node.js/Python/etc) from the browser. Please always run your app inside of isolated container (like Docker) if you allow someone to remote control your system.

Example case where you may need remote control:

  • Creating Discord.js bot (because the library doesn't have support for browser)
    • Support for browser was dropped due to CORS at the Discord endpoint
  • Collaboratively work with your friend
  • Remotely modify your running application in runtime

  • Blackprint Sketch (this repository)
    • Mirrored sketch on detachable window
    • Mini sketch for preview
    • Hot Reload
    • Export single sketch to JSON
    • Importable minimal sketch for different project
    • Select and move multiple nodes at once
      • Bulk delete
      • Add feature to put nodes into a group
    • Clicked nodes should be moved on front of the other nodes (z-index)
    • Automatically put cable on suitable port when it's dropped on top of a node
    • Add feature to arrange cable (cable branching)
    • Add variable's node
    • Add feature to hide some unused port on a node
    • Add feature to import node skeleton (use default node, and no execution)
    • Create addons for VS Code for previewing exported Blackprint
      • Add JSON preview for Visual Studio Code
    • Add TypeScript definition file
  • Blackprint Editor (repository)
    • Online editor
    • Basic nodes editor
    • Detachable window and minimap
    • Add Environment Variables editor
    • Import sketch from URL
    • Move current sketch with minimap
    • Node list editor (right click and from side panel)
    • Error/log popup or overlay
    • Show overview or notice when importing nodes from URL
    • Multiple sketch workspaces or tabs
  • Auto blackprint.config.js import
  • Better documentation
    • Add in-editor node documentation in a tooltip
    • Nodes docs generator
    • Add TypeScript definition file
  • Blackprint Nodes Package Manager
    • Use NPM registry for Node.js/Deno/Browser

Currently the main focus is Blackprint for JavaScript. Blackprint Engine for PHP, Python, Golang, etc may follow the implementation of JavaScript version.

Other possible plan

Blackprint Engine:

  • Lua (because it's embeddable language)
  • Java (or maybe Kotlin)
  • Rust (may get removed from this list)
  • C++ (for Arduino if possible)
  • Zig (for Arduino if possible)

Some Note

Each engine may have different compatibilities.
For the example:

  • WebAudio is only compatible in the browser.
  • Web server is not compatible in the browser.

Blackprint will act as an interface for each engine. To use it on NodeJS, Deno, or other JavaScript runtime, you can export it to JSON and use engine-js. But it doesn't mean exporting is just like a magic, you also need to write registerNode and registerInterface on the target engine. Except if someone already write the Blackprint Module (node and interface) on target engine, you can easily plug and play the module.

Contributing

To make things easier, please make sure to read the Contributing Guide before creating a issue/request.

If you want to compile and start the editor's web server on your machine, you can run the command below:

$ cd /your/project/folder
$ git clone --depth 1 --recurse-submodules https://github.com/Blackprint/Blackprint.git .

# You can also use npm or yarn instead of pnpm
$ pnpm i
$ npm start
 >> [Browsersync] Access URLs:
 >> -----------------------------------
 >> Local: http://localhost:6789
 >> -----------------------------------

Build and run the unit test

If you're trying to run the unit test, you can use npm run compile and then npm test.

$ cd /your/project/folder
$ git clone --depth 1 --recurse-submodules https://github.com/Blackprint/Blackprint.git .

# You can also use npm or yarn instead of pnpm
$ pnpm i
$ npm run compile
$ npm test

Stability

Breaking changes may happen every increment of v0.x.0, while v0.0.x usually will have new feature or bug fixes.

After version v1.0.0 any feature addition may have long delay before actually being merged.
Feel free to request a feature or give a feedback at this moment.

License

Blackprint is a MIT licensed open source project and completely free to use.

But please consider sponsoring the people who work and contribute amount of effort to maintain and develop new features for this project. Because without their contribution, this project may get slowed down or possible to getting paused.

blackprint's People

Contributors

stefansarya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blackprint's Issues

Add Python library of equations

I have an idea: keep a repository of equation codes from primary school to college. Just drag and drop, all steps of solving a question will be visualised.

I have a Python library of some equations. I am unsure how it could be utilised as nodes here.


The feature request is about:
[ ] Blackprint Editor
[ ] Blackprint Engines

Example

Hi!

I have tried to make the code work, adding the supplied code to the linked scarletframe template.
The furthest I have got to gives an error of 'Uncaught TypeError: sf.space is not a constructor', and I am at my wits end.

Do you have a sample project planned?

Error when building

> @blackprint/[email protected] compile
> gulp compile

Error: Cannot find module './editor/utils/build-docs.js'
Require stack:
- /home/user/Blackprint/gulpfile.js
- /home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/shared/require-or-import.js
- /home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js
- /home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/index.js
- /home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
    at Function.Module._load (internal/modules/cjs/loader.js:774:27)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/home/user/Blackprint/gulpfile.js:113:3)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/user/Blackprint/gulpfile.js',
    '/home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/shared/require-or-import.js',
    '/home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js',
    '/home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp-cli/index.js',
    '/home/user/Blackprint/node_modules/.pnpm/[email protected]/node_modules/gulp/bin/gulp.js'
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.