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

a-react-grid

v1.0.29

Published

A-Chart is a ReactJS Library/Package to address all posibilities of Reporting Functionality

Downloads

16

Readme

A-Chart is a customisable ReactJS Library/Package to address all posibilities of Reporting Functionality, Including different types data representations like Grid, Charts, etc... Any bug fixes, feature request or feedback you can write us to [email protected], We are happy to help you.

Also it is easy to configure and lots of stunning featurs are in pipeline.

  • Feature in Development: #Editable Columns fine tune .

Completed Features (Available)

  • Dynamic Data Grid *Now Supports only for Array of Objects
  • Custom formating of column values
  • Hide and Show Columns
  • Editable Columns
  • Get changed value sets
  • Column Header Managing
  • Column Sorting
  • Analytical Columns( Show sum of numeric fields if configured)
  • Excel Or CSV export
  • Multi Selection mode (User can select specfic items and get it for custom data processing)

Public Methods (Component Scope)

  • getSelectedItems() -- This will return selected items if mode:"Multi"
  • getChangedItems() -- This will return Cahnged items if fieldsToEdit has configured"
  • setEditable(true/false) -- this will enable/disable edit functionality of fields which are configured,Default false
  • setMode(Multi/false) -- this will enable/disable selection of items

Usage (Working example).

import React, { Component } from 'react';
import List from 'a-chart'
class App extends React.Component {
  render() {
    const data = [
      { id: 1, make: "Toyota", model: "RAV4", price: 26500, cur: "USD" },
      { id: 2, make: "Toyota", model: "Camry Hybrid", price: 27562, cur: "USD" },
      { id: 3, make: "Mazda", model: "CX-5", price: 32345, cur: "USD" },
      { id: 4, make: "Mazda", model: "CX-3", price: 20390, cur: "USD" }
    ];
    var config = {
       width:"555",// width of chart
      headers: ["Sl. No.", "Make", "Model", "Price", "Currency"],
       headerConfig: {"id":{width:"80px", align:"center"},"price":{align:"right"}},// configure style properties of header with and align etc (more fetures will support)
      formatters: {
        price: function (val) {
          return val.toFixed(2) + " " + this.cur;
        }
      },
      columnsToHide: "cur", //Comma seprated string, to hide specific column from grid,  **optional
      columnsForSort: "make,model,price", //Comma seprated string, to enable sorting for columns  **optional
      analyticalColumns: "price", //Comma seprated string, to show sum of numerical columns  **optional
      rowFocus: false, // Default  false   **optional
      export: "xls",// export data to xls or csv (now will support only one type in single config)  Default  false   **optional
      exportFileName: "DataExport",
      mode: "Multi", //multi,single,none   Default  none   **optional,
      fieldsToEdit:"make,model",//Comma seprated string, these fields can edit from grid  **optional
    }
    function getSelected() {
      var items = List.getSelectedItems();
      alert(items);
    }

    return (<div>
      <button onClick={getSelected}>Get Selected Items</button><br /><br />
      <List items={data} config={config} />
    </div>);
  }
}

render(<App />, document.getElementById("root"));

Complete default config


defConfig = {
            header: true, // Default  true
            headers: [],    //  **optional
            formatters:{},  //**optional
            //Type:collection of ojects// property of dsiplay array
            //formatters are giving a option to apply your formatting logic(display format like amount and currency format) while rendering cells.
            //Also inside the function you will get hte complete scope of the cuurent row in "this" Object
            //Example:   name is column property
            // formatters: {
            //     name: function(val){
            //       return  this.col2+"---"+val
            //     }
            //   }

            columnsToHide: "", //Comma seprated string, to hide specific columns from grid   **optional
            columnsForSort: "", //Comma seprated string, to enable sorting for columns  **optional
            analyticalColumns:"", //Comma seprated string, to show sum of numerical columns  **optional
            rowFocus:false, // Default  false   **optional
            export: "xls",// export data to xls or csv (now will support only one type in single config)  Default  false   **optional

        }

How to change style of grid(CSS config)

You have full control over css to change display, below are some exmaples Explore more....

/* How to change main table display*/
.aChart table.achart-grid{ margin: 0px; border-collapse: collapse; border-radius: 5px; width: auto;
    table-layout: fixed;font-family:inherit; font-size: 85%}
/* How to change main table header style*/
    .aChart .achart-gridHeader th {

    }

/* class to change sorting icons */
.aChart .achart-column-header-sort::after {
  position: absolute; content: '\21C5';right:2px;
	top: 22%;cursor: pointer}