GithubHelp home page GithubHelp logo

doc22940 / muze Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chartshq/muze

1.0 1.0 0.0 89.09 MB

Composable data visualisation library for web with a data-first approach

Home Page: https://muzejs.org/

License: Other

JavaScript 97.45% HTML 1.62% CSS 0.89% Shell 0.04%

muze's Introduction




NPM version NPM total downloads Contributors License

What is Muze?

Muze is a data visualization library which uses a layered Grammar of Graphics (GoG) to create composable and interactive data visualization for web. It uses a data-first approach to define the constructs and layers of the chart, automatically generates cross-chart interactivity, and allows you to over-ride any behavior or interaction on the chart.

Muze uses an in-browser DataModel to store and transform data, and control the behaviour of every component in the visualization, thereby enabling creating of complex and cross-connected charts.

Features

  • ๐Ÿš€ Build complex and interactive visualizations by using composable layer constructs.
  • ๐Ÿ”จ Use rich data operators to transform, visualize and interact with data.
  • ๐Ÿ‘ฏ Define custom interactions by configuring physical behavioural model and side effect.
  • โœ‚๏ธ Use css to change look and feel of the charts.
  • โ˜€๏ธ Have a single source of truth for all your visualization and interaction controlled from data.
  • ๐Ÿ”ฉ Integrate easily with your existing application by dispatching actions on demand.

Installation

CDN

Insert the muze build and the required CSS into the <head>:

<link href="https://cdn.muzejs.org/lib/muze/core/latest/themes/muze.css" rel="stylesheet">
<script src="https://cdn.muzejs.org/lib/muze/core/latest/muze.js" type="text/javascript"></script>

NPM

Install muze from NPM:

$ npm install --save muze

Also import the required stylesheet:

import 'muze/dist/muze.css';

Getting started

  1. Prepare the data and the corresponding schema using DataModel:
// Prepare the schema for data
const schema = [
  {
    name: 'Name',
    type: 'dimension'
  },
  {
    name: 'Maker',
    type: 'dimension'
  },
  {
    name: 'Horsepower',
    type: 'measure',
    defAggFn: 'avg'
  },
  {
    name: 'Origin',
    type: 'dimension'
  }
]

// Prepare the data
const data = [
   {
    "Name": "chevrolet chevelle malibu",
    "Maker": "chevrolet",
    "Horsepower": 130,
    "Origin": "USA"
  },
  {
    "Name": "buick skylark 320",
    "Maker": "buick",
    "Horsepower": 165,
    "Origin": "USA"
  },
  {
    "Name": "datsun pl510",
    "Maker": "datsun",
    "Horsepower": 88,
    "Origin": "Japan"
  }
]
  1. Pass the data and schema to DataModel and create a new DataModel instance:
const DataModel = muze.DataModel;
const dm = new DataModel(data, schema);
  1. Pass the DataModel instance to muze and create your first chart:
import muze from 'muze';
import 'muze/dist/muze.css';

// Create a global environment to share common configs across charts
const env = muze();
// Create a new canvas instance from the global environment
const canvas = env.canvas();
canvas
  .data(dm) 
  .rows(["Horsepower"]) // Fields drawn on Y axis
  .columns(["Origin"]) // Fields drawn on X axis
  .mount("#chart"); // Specify an element to mount on using a CSS selector

See muzejs.org/docs for more documentation!

You also can checkout our Yeoman Generator generator-muze to try out the muze through a boilerplate app.

Documentation

You can find detailed tutorials, concepts and API references at muzejs.org/docs.

Support

Please raise a Github issue here.

Roadmap

Please contribute to our public wishlist or upvote an existing feature at Muze Public Wishlist & Roadmap

Contributing

Your PRs and stars are always welcome :). Checkout the Contributing guides.

License

MIT

muze's People

Contributors

mridulmeh avatar adarshlilha avatar ud-ud avatar rousan avatar ranajitbanerjee avatar adotg avatar sanjaymahto avatar chartshq-eng avatar

Stargazers

Acampbell 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.