discoveryjs / discovery

A framework for rapid data (JSON) analysis, shareable serverless reports and dashboards
https://discoveryjs.github.io/discovery/
MIT License
345 stars 6 forks source link
data-analysis data-visualization json

<img align="right" width="128" height="128" alt="Discovery.js project logo" src="https://user-images.githubusercontent.com/270491/48985803-1563ae80-f11d-11e8-92c0-e07fbf0bcd94.png"/>

Discovery

NPM version Twitter

Hackable JSON discovery tool

Documentation in progress...

Articles

Examples of usage

Related projects

Plugins

Install

> npm install @discoveryjs/discovery

Base concepts

Model goes through data->prepare->render chain. Data can be modified with prepare function and rendered by various views and its combinations.

View is a function(el, config, data, context) where:

Page is a root view function(el, data, context). Similar to view it has all of its arguments except config.

Page

To define a page you should call discovery.page.define(pageId, render(el, data, context), options) where:

Other handy methods for working with page:

Special pages

There are some built-in special pages:

You can override this pages with page.define() method

View

To define new view just call discovery.view.define(viewId, render, options) where:

You can render your view with discovery.view.render(el, view, data, context) where:

Special views

Also special built-in sidebar view is available you can override this view with view.define

Queries

As a query you can specify string which will be processed by Jora so your data will be a result of following flow:

jora(value) -> function(data, context) -> data

Or you can use function(data, context) as query as well. Also you can use any data as query right away.

License

MIT