GithubHelp home page GithubHelp logo

ahmetkoprulu / vue2-flow Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 879 KB

simple and customizable vue 2 flow chart component.

License: MIT License

JavaScript 23.77% HTML 2.66% Vue 69.77% CSS 3.79%
vue flowchart vue2

vue2-flow's Introduction

LinkedIn


Logo

Vue2 Flow

simple and customizable vue 2 flow chart component.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contribution
  4. License

About The Project

You can build flow diagrams or develop editors to make users able to build ones with vue2 flow. The rest is your imagination.

Demo project: https://codesandbox.io/s/vue2-flow-demo-mjdogn

Features

  • Simple Use: Designed for the dummiest user
  • Easy Setup: Charts can be created with few lines of code
  • Utils: Built-in zooming and panning, dragging and resizing
  • Extensible: Lots of exposed slots, events and properties

Getting Started

To install vue2 flow, use npm i vue2-flow or yarn add vue2-flow for yarn.

Basics

Flow renders nodes and connections separately. Therefore, it expects array of nodes and connections.

The only constraint for them is that both require unique id. Even addNode method handles it, you can also use generateId method to have one.

A simple example is as follows.

<script setup>
import VFlow from "vue2-flow";

export default {
  data() {
    return {
      nodes: [
        {
          id: 1,
          x: 84,
          y: 189,
          width: 120,
          height: 50,
          name: "Start",
          type: "input",
        },
        {
          id: 2,
          x: 782,
          y: 188,
          width: 120,
          height: 50,
          name: "End",
          type: "output",
        },
      ],
      conns: [],
    };
  },
};
</script>

<template>
  <v-flow :nodes="nodes" :conns="conns" />
</template>

Definitely check documentation folder for the api and practicises.

Development

Run npm run serve command to start dev application located at dev/serve.vue. However, it requires Vue CLI to be installed.

It mounts editor example located at examples. You can change it to whichever you want and play with them or directly import vue2 flow and start fresh one.

Contribution

All contributions are welcome, there are lots of thing to do :)

Do not hesitate to create issues about bugs and ideas.

To Do

  • Tests***
  • Readonly mode
  • Connection texts
  • Shapes
  • Component based nodes
  • Improve connection paths
  • More examples

License

Distributed under the MIT License. See LICENSE.txt for more information.

vue2-flow's People

Contributors

ahmetkoprulu avatar

Stargazers

Rifal Nurjamil avatar Xudoyberdiyev Ozodbek Dilshod o'gli avatar  avatar Mohammad Amin Najafi avatar

Watchers

James Cloos avatar  avatar

vue2-flow's Issues

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.