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

vizzu-story

v0.7.0

Published

Build and present animated data stories

Downloads

216

Readme

npm version install size

Vizzu-Story

About The Extension

Vizzu-Story is an extension for the Vizzu JavaScript library that allows users to create interactive presentations from the animated data visualizations built with Vizzu.

The extension provides a Web Component that contains the presentation and adds controls for navigating between slides - predefined stages within the story.

Installation

Install via npm:

npm install vizzu-story

Or use it from CDN:

import VizzuPlayer from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vizzu-story.min.js';

Usage

Example story

Create a vizzu-player element that will contain the rendered story:

<vizzu-player controller></vizzu-player>

In a script module element import the extension from CDN or local install:

<script type="module">
  import VizzuPlayer from 
  'https://cdn.jsdelivr.net/npm/[email protected]/dist/vizzu-story.min.js';
</script>

Add the underlying data for the data story. You can use the same data definition formats as in the Vizzu library, but you must add the entire data set for the whole story in the initial step; you can not change this later. See Data chapter for more details on data formats.

const data = {
    series: [{
        name: 'Foo',
        values: ['Alice', 'Bob', 'Ted']
    }, {
        name: 'Bar',
        values: [15, 32, 12]
    }, {
        name: 'Baz',
        values: [5, 3, 2]
    }]
};

Create the data story by defining a sequence of slides. A slide can be a single chart corresponding to an animate call from Vizzu. Or a slide can be a sequence of animation calls, in which case all of these animations will be played until the last one in the sequence, allowing for more complex transitions between slides.

const slides = [{
    config: {
        x: 'Foo',
        y: 'Bar'
    }
}, {
    config: {
        color: 'Foo',
        x: 'Baz',
        geometry: 'circle'
    }
}];

Navigation controls beneath the chart will navigate between the slides. You can use the PgUp and PgDn buttons, left and right arrows to navigate between slides, and the Home and End buttons to jump to the first or last slide.

On each chart, you can define the chart configuration and style with the same objects as in Vizzu. However, you can not modify the underlying data between the slides, only the data filter used.

interface Chart {
  config?: Vizzu.Config.Chart;
  filter?: Vizzu.Data.FilterCallback | null;
  style?: Vizzu.Styles.Chart;
  animOptions?: Vizzu.Anim.Options;
}

Put the data and the slide list into the story descriptor object. Here you can also set the story style property to set the chart style used for the whole story.

const story = {
    data: data,
    slides: slides
};

Then set up the created element with the configuration object:

const vp = document.querySelector('vizzu-player');
vp.slides = story;

Check out a live example in JSFiddle!

Documentation

Visit our Documentation site for more details and a step-by-step tutorial into Vizzu-Story or check out our Example gallery.

Contributing

We welcome contributions to the project; visit our Contributing guide for further info.

Contact

License

Copyright © 2022-2023 Vizzu Inc.

Released under the Apache 2.0 License.