0.5.0 • Published 5 years ago

@mvsde/vue-project-timeline v0.5.0

Weekly downloads
11
License
-
Repository
-
Last release
5 years ago

Vue.js Project Timeline

Gantt chart-like project timeline for Vue.js.

npm.io

  1. Installation
  2. Basic usage
  3. API
    1. Props
    2. Projects Array
      1. Available fields
      2. Team members
      3. Example
  4. Contributing

Installation

npm install @mvsde/vue-project-timeline

Basic usage

<template>
  <project-timeline
    :start-month="startMonth"
    :end-month="endMonth"
    :projects="projects"
  />
</template>

<script>
import ProjectTimeline from '@mvsde/vue-project-timeline'

export default {
  components: {
    ProjectTimeline
  },

  data () {
    return {
      startMonth: new Date('2018-11'),
      endMonth: new Date('2019-02'),
      projects: [
        {
          name: 'Visualize vertical interfaces',
          start: new Date('2018-11-20'),
          end: new Date('2019-01-28')
        }
      ]
    }
  }
}
</script>

<style src="@mvsde/vue-project-timeline/dist/ProjectTimeline.css"></style>

More advanced demo code can be found within the demo project.

API

Props

NameTypeRequiredDefaultDescription
startMonthDateFirst month displayed in the timeline. The first day of the month for the given date will be automatically calculated.
endMonthDateLast month displayed in the timeline. The last day of the month for the given date will be calculated.
projectsArrayList of projects. See Projects array for a detailed format description.
visibleMonthsInteger12Number of visible months. A scrollbar will be displayed if the timeline has more months than this value.
autoScrollTodayBooleanfalseAutomatically scroll “today” into view.
localeStringen-USSet the localization with a locale string.

Projects array

Available fields

NameTypeRequiredDescription
nameStringName of the project.
startDateStart date of the project.
endDateEnd date of the project.
plannedStartDatePlanned start date of the project. Displayed as a thin line below the project.
plannedEndDatePlanned end date of the project. Displayed as a thin line below the project.
colorStringSet a specific color for a project by using a valid CSS color.
teamArrayTeam members of the project. See Team members for a detailed format description.
onClickFunctionClick handler for the project name. The project name will be a button if a function is provided.

Team members

NameTypeRequiredDescription
nameStringName of the team member.
avatarStringAvatar of the team member.

Example

The following is an example with all fields populated:

[
  {
    name: 'Visualize vertical interfaces',
    start: new Date('2018-11-20'),
    end: new Date('2019-01-28'),
    plannedStart: new Date('2018-11-10'),
    plannedEnd: new Date('2019-01-13'),
    team: [
      {
        name: 'Nellie Bender',
        avatar: 'https://source.unsplash.com/3402kvtHhOo/32x32'
      },
      {
        name: 'Alex Wilkerson',
        avatar: 'https://source.unsplash.com/das6NrjLoM0/32x32'
      }
    ],
    onClick () {
      console.log('Hello World!')
    }
  }
]

Contributing

# Start development server
npm run serve

# Run JavaScript linter
npm run lint:js

# Run unit tests
npm run test:unit
0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago