npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-visjs-timeline

v1.1.0

Published

Vue component for the vis.js timeline module.

Downloads

166

Readme

Vue-visjs-timeline

Vue component for the vis.js timeline module.

Installation

npm i -- save vue-visjs-timeline

Basic usage

Import and declare the component

import timeline from 'vue-visjs-timeline'
Vue.component('timeline', timeline)

Add the component in the template.

<template>
    <timeline v-bind:items="items" v-bind:groups="groups"></timeline>
</template>

Create items and groups data in the component.

export default {
	name: 'home-page',
	data() {
		return {
			groups: [
			    {id: 'a1', content:'Group one'},
			    {id: 'a2', content:'Group two'},
			    {id: 'a3', content:'Group three'}
			],
			items: [
			    {id: 'a1', content: 'Item one', group: 'Group one'},
			    {id: 'a2', content: 'Item two', group: 'Group two'},
			    {id: 'a3', content: 'Item three', group: 'Group three'}
			]
		}
	}
}

Styling

Custom CSS added to enhance the UI. Import custom CSS

require('../node_modules/vue-visjs-timeline/dist/vue-visjs-timeline.css')

Configure tools

Tools is group of options (Go today, Zoom in, Zoom out). Enabled by default. Add the configuration to disable.

<timeline v-bind:items="items" v-bind:groups="groups" :hide-tools=true></timeline>

Events

This event is triggered when item is moved or changed

<timeline v-bind:items="items" v-bind:groups="groups" v-on:item-move="updateItem"></timeline>

export default {
	name: 'home-page',
	methods: {
	    updateItem: function (item) {
	        // handle the event
	    }
	}
}

Supported events

Note: Only limited events are supported for now

| Events | Description | | --- |---| | v-on:item-move | On item position change | | v-on:range-changed | On window zoom in/out or move|

Supported props

Note: Only limited props are enabled

| Name | Description | | --- |---| | v-bind:items | List of items | | v-bind:groups | List of groups | | v-bind:option | Timeline option (If not present default option is added) | | v-bind:start | Window start (Timestamp/moment date) | | v-bind:end | Window end (Timestamp/moment date) | | :hideTools | Force tools to hide |