Coder Social home page Coder Social logo

claudinoac / vue-dag-next Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aleximb/vue-dag

0.0 0.0 0.0 1.99 MB

๐Ÿ— Data-driven directed acyclic graph (DAG) builder for Vue.js

Home Page: https://vue-dag.netlify.app

License: MIT License

JavaScript 5.03% HTML 3.05% Vue 82.45% TypeScript 2.47% SCSS 6.99%

vue-dag-next's Introduction

๐Ÿ—Vue DAG Buildr (VueJS 3+)

Data-driven directed acyclic graph (DAG) visual builder for Vue.js

GitHub Actions Netlify Status npm npm vue3 GitHub

Examples

vue-dag-example.netlify.app

Screenshot

eddy-analytics.org

Screenshot Eddy

Installation

npm install --save vue-dag-next

or

yarn add vue-dag-next

Import and register the component

import VueDag from 'vue-dag-next';
components: {
    VueDag
}

Define the graph data

data() {
    return {
        graphData: {
            config: {
                scale: 1,
                width: '100%',
                height: '100vh',
                readonly: false,
            },
            nodes: [
                {
                    id: 0,
                    x: 500 * Math.random(),
                    y: 500 * Math.random(),
                    component: <<custom component>>,
                    props: { exampleProp: 'โœจ' },
                },
                {
                    id: 1,
                    x: 500 * Math.random(),
                    y: 500 * Math.random(),
                    content: 'Example content',
                },
                { id: 2, x: 500 * Math.random(), y: 500 * Math.random() },
            ],
            edges: [
                {
                    id: 0, from: 0, to: 1, edgeColor: 'red', arrowColor: 'red',
                },
                { id: 1, from: 1, to: 2 },
            ],
        },
    }
}

Use it in templates

<vue-dag v-model="graphData"></vue-dag>

The component does not include any CSS. You'll need to import it separately:

import 'vue-dag-next/dist/vue-dag-next.css';

Alternatively, you can import the SCSS version and overrite variables and styles

@import 'vue-dag-next/src/scss/vue-dag.scss';

Full documentation: https://vue-dag-next.netlify.com/

Project development setup

Installs dependencies

yarn install

Compiles and hot-reloads for development

yarn run serve

Lints and fixes files

yarn run lint

Runs unit tests

yarn run test:unit

Builds as library

yarn run build:library

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.