Convert Figma logo to code with AI

vizzuhq logovizzu-lib

Library for animated data visualizations and data stories.

1,898
81
1,898
4

Top Related Projects

64,568

Simple HTML5 Charts using the <canvas> tag

108,427

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

16,856

Open-source JavaScript charting library behind Plotly and Dash

60,384

Apache ECharts is a powerful, interactive charting and data visualization library for browser

101,622

JavaScript 3D Library.

Highcharts JS, the JavaScript charting framework

Quick Overview

Vizzu-lib is an open-source JavaScript/C++ library for animated data visualizations. It allows users to create interactive, customizable charts and graphs with smooth transitions between different views of the data. The library focuses on providing a simple API for creating complex, animated data stories.

Pros

  • Highly customizable and flexible chart creation
  • Smooth animations between different data views
  • Supports various chart types and data transformations
  • Lightweight and performant, with a small footprint

Cons

  • Learning curve for complex animations and advanced features
  • Limited built-in chart types compared to some other visualization libraries
  • Documentation could be more comprehensive for advanced use cases
  • Relatively new project, so the community and ecosystem are still growing

Code Examples

Creating a simple animated bar chart:

import Vizzu from 'https://cdn.jsdelivr.net/npm/vizzu@latest/dist/vizzu.min.js';

let chart = new Vizzu('myCanvas');

chart.animate({
  data: {
    series: [
      { name: 'Fruit', values: ['Apple', 'Banana', 'Orange'] },
      { name: 'Amount', values: [5, 7, 3] }
    ],
  },
  config: {
    channels: {
      x: 'Fruit',
      y: 'Amount'
    },
    geometry: 'rectangle'
  }
});

Transitioning from a bar chart to a pie chart:

chart.animate({
  config: {
    channels: {
      x: ['Fruit'],
      y: 'Amount',
      color: 'Fruit'
    },
    coordSystem: 'polar',
    geometry: 'circle'
  }
});

Adding data labels and customizing colors:

chart.animate({
  config: {
    channels: {
      label: 'Amount'
    },
    style: {
      plot: {
        marker: {
          colorPalette: '#9E6B5E #E4B7A0 #F2DABD'
        },
        label: {
          fontSize: 14,
          position: 'center'
        }
      }
    }
  }
});

Getting Started

To use Vizzu-lib in your project, you can include it via CDN or install it using npm:

<script type="module">
  import Vizzu from 'https://cdn.jsdelivr.net/npm/vizzu@latest/dist/vizzu.min.js';
  
  let chart = new Vizzu('myCanvas');
  
  // Your chart configuration and animation code here
</script>

Or install via npm:

npm install vizzu

Then import and use in your JavaScript file:

import Vizzu from 'vizzu';

let chart = new Vizzu('myCanvas');
// Your chart configuration and animation code here

Competitor Comparisons

64,568

Simple HTML5 Charts using the <canvas> tag

Pros of Chart.js

  • Extensive documentation and large community support
  • Wide range of chart types and customization options
  • Lightweight and easy to integrate into existing projects

Cons of Chart.js

  • Less flexible for creating complex, animated visualizations
  • Limited support for data-driven animations and transitions
  • Steeper learning curve for advanced customizations

Code Comparison

Chart.js:

const ctx = document.getElementById('myChart').getContext('2d');
new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ['Red', 'Blue', 'Yellow'],
        datasets: [{
            label: 'My Dataset',
            data: [12, 19, 3]
        }]
    }
});

Vizzu-lib:

const chart = new Vizzu('myChart');
chart.animate({
    data: {
        series: [
            { name: 'Categories', values: ['Red', 'Blue', 'Yellow'] },
            { name: 'Values', values: [12, 19, 3] }
        ]
    },
    config: { geometry: 'rectangle' }
});

Both libraries offer straightforward ways to create charts, but Vizzu-lib focuses more on data-driven animations and transitions. Chart.js provides a more traditional approach to chart creation with extensive configuration options, while Vizzu-lib emphasizes dynamic, animated visualizations with a more concise API.

108,427

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

Pros of d3

  • Highly flexible and customizable, allowing for complex and unique visualizations
  • Large and active community, extensive documentation, and numerous examples
  • Supports a wide range of chart types and data visualization techniques

Cons of d3

  • Steeper learning curve, especially for those new to data visualization
  • Requires more code to create basic charts compared to higher-level libraries
  • Performance can be an issue with large datasets or complex visualizations

Code Comparison

d3:

const svg = d3.select("body").append("svg")
    .attr("width", 400)
    .attr("height", 300);

svg.selectAll("rect")
    .data(data)
    .enter()
    .append("rect")
    .attr("x", (d, i) => i * 40)
    .attr("y", d => 300 - d * 10)
    .attr("width", 35)
    .attr("height", d => d * 10);

vizzu-lib:

const chart = new Vizzu('myCanvas');

chart.animate({
    data: data,
    config: {
        x: 'Category',
        y: 'Value',
        geometry: 'rectangle'
    }
});

The code comparison shows that vizzu-lib provides a more concise and higher-level API for creating charts, while d3 offers more granular control over individual elements.

16,856

Open-source JavaScript charting library behind Plotly and Dash

Pros of Plotly.js

  • Extensive library of chart types and customization options
  • Strong community support and extensive documentation
  • Built-in interactivity features like zooming and panning

Cons of Plotly.js

  • Larger file size, which may impact page load times
  • Steeper learning curve for complex visualizations
  • Less focus on animated transitions between chart types

Code Comparison

Plotly.js:

Plotly.newPlot('myDiv', [{
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  type: 'scatter'
}]);

Vizzu-lib:

chart.animate({
  data: {
    series: [
      { name: 'X', values: [1, 2, 3, 4] },
      { name: 'Y', values: [10, 15, 13, 17] }
    ]
  },
  config: { geometry: 'line' }
});

Both libraries offer declarative ways to create charts, but Vizzu-lib focuses more on animation and transitions between different chart types. Plotly.js provides a more traditional approach with a wide range of built-in chart types and options.

60,384

Apache ECharts is a powerful, interactive charting and data visualization library for browser

Pros of ECharts

  • Extensive library of chart types and customization options
  • Strong community support and regular updates
  • Built-in support for responsive design and mobile optimization

Cons of ECharts

  • Steeper learning curve due to its extensive feature set
  • Larger file size, which may impact page load times
  • More complex configuration for simple charts

Code Comparison

ECharts:

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [{
    data: [120, 200, 150, 80, 70, 110, 130],
    type: 'bar'
  }]
};

Vizzu-lib:

chart.animate({
  data: {
    series: [
      { name: 'Day', values: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] },
      { name: 'Value', values: [120, 200, 150, 80, 70, 110, 130] }
    ]
  },
  config: { geometry: 'rectangle' }
});

Both libraries offer powerful charting capabilities, but ECharts provides a wider range of chart types and customization options out of the box. Vizzu-lib, on the other hand, focuses on simplicity and animation-driven data visualization, making it easier to create basic charts with smooth transitions.

101,622

JavaScript 3D Library.

Pros of three.js

  • Extensive 3D rendering capabilities, ideal for complex 3D visualizations and games
  • Large, active community with numerous examples and resources
  • Supports a wide range of 3D features, including animations, lighting, and textures

Cons of three.js

  • Steeper learning curve due to its comprehensive 3D functionality
  • Larger file size, which may impact load times for simpler projects
  • Potentially overkill for basic 2D data visualizations

Code Comparison

three.js:

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

vizzu-lib:

const chart = new Vizzu('myCanvas');
chart.animate({
  data: { ... },
  config: { ... }
});

Summary

While three.js excels in 3D graphics and offers extensive capabilities, Vizzu-lib focuses on data visualization with a simpler API. Three.js is better suited for complex 3D projects, while Vizzu-lib is more appropriate for creating interactive charts and graphs with less overhead.

Highcharts JS, the JavaScript charting framework

Pros of Highcharts

  • Extensive documentation and examples
  • Wide range of chart types and customization options
  • Strong community support and regular updates

Cons of Highcharts

  • Commercial license required for most use cases
  • Steeper learning curve for complex visualizations
  • Larger file size compared to Vizzu-lib

Code Comparison

Highcharts:

Highcharts.chart('container', {
  chart: { type: 'bar' },
  series: [{
    data: [1, 2, 3, 4, 5]
  }]
});

Vizzu-lib:

const chart = new Vizzu('myCanvas');
chart.animate({
  data: { series: [{ values: [1, 2, 3, 4, 5] }] },
  config: { geometry: 'rectangle' }
});

Both libraries offer straightforward ways to create basic charts, but Highcharts provides more built-in options and configurations out of the box. Vizzu-lib focuses on animated transitions between chart types and offers a more streamlined API for creating dynamic visualizations.

Highcharts is well-established and feature-rich, making it suitable for complex enterprise applications. Vizzu-lib, being newer and more lightweight, is ideal for projects requiring animated data storytelling and a smaller footprint.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Vizzu

Vizzu - Library for animated data visualizations and data stories.

Documentation · Examples · Code reference · Repository · Blog

npm version install size Tweet

Vizzu

About The Project

Vizzu is a free, open-source Javascript/C++ library utilizing a generic dataviz engine that generates many types of charts and seamlessly animates between them. It can be used to create static charts but more importantly, it is designed for building animated data stories and interactive explorers as Vizzu enables showing different perspectives of the data that the viewers can easily follow due to the animation.

Main features:

  • Designed with animation in focus;
  • Defaults based on data visualization guidelines;
  • Automatic data aggregation & data filtering;
  • HTML5 canvas rendering;
  • Written in C++ compiled to WebAssembly;
  • Dependency-free.

Installation

Install via npm:

npm install vizzu

Or use it from CDN:

<html>
 <head>
  <script type="module">
   import Vizzu from 'https://cdn.jsdelivr.net/npm/vizzu@latest/dist/vizzu.min.js';
  </script>
 </head>
</html>

Usage

Create a placeholder element that will contain the rendered chart:

<html>
 <body>
  <div id="myVizzu" style="width:800px; height:480px;">
  </div>
 </body>
</html>

Create a simple bar chart:

import Vizzu from 'https://cdn.jsdelivr.net/npm/vizzu@latest/dist/vizzu.min.js';

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

let chart = new Vizzu('myVizzu', {
    data
});
chart.animate({
    x: 'Foo',
    y: 'Bar'
});

Then turn it into a scatter plot:

chart.animate({
    color: 'Foo',
    x: 'Baz',
    geometry: 'circle'
});

Try it!

Example chart

FAQ

You can find answers to the most frequently asked questions about using the library in our FAQ.

Projects

List of external projects (extensions, bindings, templates, etc) for Vizzu: Projects.

Roadmap

We have a comprehensive list of features we plan to implement, on our Roadmap.

Contributing

We welcome contributions to the project, visit our contributing guide for further info.

Contact

License

Copyright © 2021-2024 Vizzu Inc.

Released under the Apache 2.0 License.

NPM DownloadsLast 30 Days