How to use the vis-timeline.Timeline function in vis-timeline

To help you get started, we’ve selected a few vis-timeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sirensolutions / kibi_timeline_vis / public / kibi_timeline.js View on Github external
const initTimeline = function () {
      if (!timeline) {
        // create a new one
        $scope.timeline = timeline = new Timeline($element[0]);
        if ($scope.timelineOptions) {
          const utcOffset = TimelineHelper.changeTimezone(config.get('dateFormat:tz'));
          if (utcOffset !== 'Browser') {
            $scope.timelineOptions.moment = function (date) {
              return moment(date).utcOffset(utcOffset);
            };
          }
          timeline.setOptions($scope.timelineOptions);
        }
        timeline.on('select', onSelect);
        timeline.on('rangechanged', function (props) {
          if ($scope.visOptions.syncTime && props.byUser) {
            timefilter.time.mode = 'absolute';
            timefilter.time.from = props.start.toISOString();
            timefilter.time.to = props.end.toISOString();
          }

vis-timeline

Create a fully customizable, interactive timeline with items and ranges.

(Apache-2.0 OR MIT)
Latest version published 6 months ago

Package Health Score

86 / 100
Full package analysis