Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@anderson-fv/vis-timeline
Advanced tools
Create a fully customizable, interactive timeline with items and ranges.
NOTE: This is a fork of the original vis-timeline found here: https://github.com/visjs/vis-timeline
The Timeline/Graph2D is an interactive visualization chart to visualize data in time. The data items can take place on a single date, or have a start and end date (a range). You can freely move and zoom in the timeline by dragging and scrolling in the Timeline. Items can be created, edited, and deleted in the timeline. The time scale on the axis is adjusted automatically, and supports scales ranging from milliseconds to years.
Install via npm:
$ npm install vis-timeline
A basic example on loading a Timeline is shown below. More examples can be found in the examples directory of the project.
<!DOCTYPE html>
<html>
<head>
<title>Timeline</title>
<script
type="text/javascript"
src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"
></script>
<link
href="https://unpkg.com/vis-timeline@latest/styles/vis-timeline-graph2d.min.css"
rel="stylesheet"
type="text/css"
/>
<style type="text/css">
#visualization {
width: 600px;
height: 400px;
border: 1px solid lightgray;
}
</style>
</head>
<body>
<div id="visualization"></div>
<script type="text/javascript">
// DOM element where the Timeline will be attached
var container = document.getElementById("visualization");
// Create a DataSet (allows two way data-binding)
var items = new vis.DataSet([
{ id: 1, content: "item 1", start: "2014-04-20" },
{ id: 2, content: "item 2", start: "2014-04-14" },
{ id: 3, content: "item 3", start: "2014-04-18" },
{ id: 4, content: "item 4", start: "2014-04-16", end: "2014-04-19" },
{ id: 5, content: "item 5", start: "2014-04-25" },
{ id: 6, content: "item 6", start: "2014-04-27", type: "point" },
]);
// Configuration for the Timeline
var options = {};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
</script>
</body>
</html>
There are four builds provided at the moment.
<script
type="text/javascript"
src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"
></script>
import { Timeline } from "vis-timeline/standalone";
This has no dependencies and therefore is great for things like MWEs but has more issues with interoperability and bundle bloat. For more information see the following example.
<script
type="text/javascript"
src="https://unpkg.com/vis-timeline@latest/peer/umd/vis-timeline-graph2d.min.js"
></script>
import { Timeline } from "vis-timeline/peer";
For this build to work you have to load Vis Data and Moment (including locales except English) packages yourself. The advantage here is that it works well with other packages. For more information see the following example.
<script
type="text/javascript"
src="https://unpkg.com/vis-timeline@latest/esnext/umd/vis-timeline-graph2d.min.js"
></script>
import { Timeline } from "vis-timeline/esnext";
This is the same as the peer build but without any bundled dependencies or pollyfills. It's indented to be used with bundlers like Rollup or Webpack which will fetch the dependencies, prevent duplicate dependencies in the bundle, use transpilers to add necessary polyfills etc.
<script
type="text/javascript"
src="https://unpkg.com/vis-timeline@latest/dist/vis-timeline-graph2d.min.js"
></script>
import { Timeline } from "vis-timeline";
This is solely kept for backwards compatibility. It is deprecated and will be removed in case of URLs and replaced by the peer build in case of Node.js/bundlers. Don't use this, please.
To build the library from source, clone the project from github
$ git clone git://github.com/visjs/vis-timeline.git
The source code uses the module style of node (require and module.exports) to
organize dependencies. To install all dependencies and build the library,
run npm install
in the root of the project.
$ cd vis-timeline
$ npm install
Then, the project can be build running:
$ npm run build
External dependencies such as moment, hammerjs can be excluded in the build by running:
$ npm run build -- -e [comma separated module names]
Example:
$ npm run build -- -e moment,hammerjs
To test the library, install the project dependencies once:
$ npm install
Then run the tests:
$ npm run test
Contributions to the vis.js library are very welcome! We can't do this alone!
Thank you to all our backers! 🙏
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Copyright (c) 2014-2017 Almende B.V. and contributors Copyright (c) 2017-2019 vis.js contributors
This work is dual-licensed under Apache-2.0 and MIT. You can choose between one of them if you use this work.
SPDX-License-Identifier: Apache-2.0 OR MIT
2014-06-06, version 1.1.0
Timeline.repaint()
to Timeline.redraw()
to be consistent with
the other visualisations of vis.js.Timeline.clear()
not resetting a configured options.start
and
options.end
.FAQs
Create a fully customizable, interactive timeline with items and ranges.
We found that @anderson-fv/vis-timeline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.