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

vizgenie

v1.0.3

Published

AI-enhanced data visualization library for effortless and insightful visualizations.

Downloads

241

Readme

VizGenie

AI-enhanced data visualization library that simplifies creating interactive and meaningful charts by leveraging AI-suggested visualizations and themes tailored to industries.


Features

  • AI-Suggested Visualizations: Automatically recommends the best visualization for your dataset.
  • Cross-Library Support: Plug-and-play with Chart.js, D3.js, and Plotly.
  • Predefined Themes: Ready-to-use themes for industries like Finance, Healthcare, and Retail.
  • Customizable and Extendable: Modify visualizations and themes to fit your specific needs.

Installation

To use VizGenie, install it via npm:

npm install vizgenie

Quick Start Guide

1. Basic Usage

import { renderChart } from 'vizgenie';
const data = [
  { category: "A", value: 10 },
  { category: "B", value: 20 },
  { category: "C", value: 15 }
];

// Create a canvas element in your HTML
const canvas = document.getElementById('myChart');

// Render a chart
renderChart(canvas, data);

2. Using Predefined Themes

import { renderChart } from 'vizgenie';
import { applyTheme } from 'vizgenie';

const data = [
  { category: "A", value: 30 },
  { category: "B", value: 50 },
  { category: "C", value: 20 }
];

// Create a container and canvas in your HTML
const container = document.getElementById('chart-container');
const canvas = document.getElementById('myChart');

// Apply a predefined theme (e.g., 'finance')
applyTheme(container, 'finance');

// Render the chart with themed styling
renderChart(canvas, data);

3. Customizing Visualization Libraries
VizGenie supports multiple charting libraries. Here’s how to use Chart.js:

import { ChartJSRenderer } from 'vizgenie/visualizers';

// Sample data
const data = [
  { label: "Sales", value: 100 },
  { label: "Revenue", value: 80 }
];

// Configure Chart.js-specific options
const chartOptions = {
  type: 'bar',
  data: {
    labels: data.map(item => item.label),
    datasets: [{
      label: 'Business Metrics',
      data: data.map(item => item.value),
      backgroundColor: ['#007BFF', '#28A745']
    }]
  }
};

// Create a canvas element in your HTML
const canvas = document.getElementById('myChart');

// Render with Chart.js renderer
ChartJSRenderer(canvas, chartOptions);

API Reference

renderChart(canvas, data, options)

Description: Renders a chart using the default library (Chart.js).

Parameters:

canvas (HTMLCanvasElement): The canvas element where the chart will render. data (Array): Array of objects with category and value fields. options (Object, optional): Chart customization options. applyTheme(container, themeName) Description: Applies a predefined theme to a chart container.

Parameters:

container (HTMLElement): The element to apply the theme to. themeName (string): Available themes are finance, healthcare, and retail. ChartJSRenderer(canvas, config) Description: Custom renderer for Chart.js. Parameters: canvas (HTMLCanvasElement): The canvas element to render the chart in. config (Object): A valid Chart.js configuration object.

Contributing

We welcome contributions! To get started:

Common Issues

Chart Not Rendering: Ensure you’ve installed chart.js as a peer dependency. Example:

npm install chart.js

Themes Not Applying:

Ensure the container is a valid HTMLElement.

Contact Author: Kunal Khare GitHub: https://github.com/kunaldevxxx Email: [email protected]