Giter Site home page Giter Site logo

mikeveerman / vue-ganttastic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zunnzunn/vue-ganttastic

0.0 0.0 0.0 1.63 MB

Simple, interactive and highly customizable Gantt chart component for Vue 3

Home Page: https://infectoone.github.io/vue-ganttastic/

Shell 0.28% JavaScript 1.14% TypeScript 50.35% HTML 0.97% Vue 47.26%

vue-ganttastic's Introduction

Vue Ganttastic

Vue Ganttastic logo

Vue Ganttastic is a simple, interactive and highly customizable Gantt chart component for Vue 3.

image

Features

  • Vue 3 support
  • TypeScript support (ships with out of the box type declarations)
  • Interactivity (dynamic, movable and pushable bars)
  • Reactivity / Responsiveness (when changes occur, bars are repositioned accordingly)
  • Customization options (chart/bar styling, slots, event handlers etc.)

Using Vue 2? Check out Vue-Ganttastic v1.

Quickstart

Install using

npm install @infectoone/vue-ganttastic

Then, initalize the plugin in the starting point of your app (most likely src/main.js):

import { createApp } from "vue"
import App from "./App.vue"
...
import ganttastic from '@infectoone/vue-ganttastic'
...
createApp(App)
  .use(ganttastic)
  .mount('#app')

This will globally register the components g-gantt-chart and g-gantt-row and you will be able to use those two components right away.

<template>
  <g-gantt-chart
    chart-start="2021-07-12 12:00"
    chart-end="2021-07-14 12:00"
    precision="hour"
    bar-start="myBeginDate"
    bar-end="myEndDate"
  >
    <g-gantt-row label="My row 1" :bars="row1BarList" />
    <g-gantt-row label="My row 2" :bars="row2BarList" />
  </g-gantt-chart>
</template>

<script setup>
  import { ref } from "vue"

  const row1BarList = ref([
    {
      myBeginDate: "2021-07-13 13:00",
      myEndDate: "2021-07-13 19:00",
      ganttBarConfig: {
        // each bar must have a nested ganttBarConfig object ...
        id: "unique-id-1", // ... and a unique "id" property
        label: "Lorem ipsum dolor"
      }
    }
  ])
  const row2BarList = ref([
    {
      myBeginDate: "2021-07-13 00:00",
      myEndDate: "2021-07-14 02:00",
      ganttBarConfig: {
        id: "another-unique-id-2",
        hasHandles: true,
        label: "Hey, look at me",
        style: {
          // arbitrary CSS styling for your bar
          background: "#e09b69",
          borderRadius: "20px",
          color: "black"
        },
        class: "foo" // you can also add CSS classes to your bars!
      }
    }
  ])
</script>

Contributing

Clone the project, make some changes, test your changes out, create a pull request with a short summary of what changes you made. Contributing is warmly welcomed!

To test your changes out before creating a pull request, create a build:

npm run build

To test out the build, you should create a tarball using:

npm pack

Then, place the tarball in some other test project and install the package from the tarball by using:

npm install <name_of_the_package>.tgz

Guide and Docs

For further guides and references, check out the official docs.

About

License MIT
Author: Marko Žunić, BSc
GitHub Repository

Support the project!

In case you found the library useful, a little tip would be much appreciated!

BTC address:
image

Screenshots

image

image

image

vue-ganttastic's People

Contributors

zunnzunn avatar dpschen avatar dependabot[bot] avatar n0ah-s avatar pedrocanoas avatar

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.