Git Product home page Git Product logo

dii-helper's Introduction

Dii-Helper

This little object contains some functionality what help us to develop D3 Visualizations easier.

  • First of all, the nestForD3 with the nestKeys function is a little modification of d3.nest(). I changed some attribute, but the most of the code is from the original D3. With this, we can create flare with key,value pairs without writing complicated functions or installing Underscore or other library.

  • DiiHelper also contains some function what help to find numbers in the flare what we generated. This is good if we use Integers to give colors to the graphs

Usage

This is a simple example how can we use the DiiHelper

const DiiHelper = require('dii-helper');

const data = []; //Your data array with objects
const nestKeys = ['category','country','id']; // The key/property name, what we use for filtering in the nest.

const flare = {
     name: 'Root',
     children: DiiHelper.nestKeys(data, nestKeys),
 };

In this example

  • the first layer will be the categories,
  • second layer/depth is the countries
  • and the last one is the ID-s.

It is easy to represent if we make a Tree Map (i will do in github)


Original D3 Library is on the web page: https://d3js.org

dii-helper's People

Contributors

reterics avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.