[![npm version](https://badge.fury.io/js/@druid-toolkit%2Fcore.svg)](https://badge.fury.io/js/@druid-toolkit%2Fcore)

# @druid-tookit/core

A framework to make building applications that talk to Druid hassle-free.

## Concepts


```
  ┌────────┐   ┌────────┐
  │ Store  │   │ Druid  │
  └────────┘   └────────┘
      ▲            ▲                                   ┌────────────────────────┐
      │ state      │ SQL                           ┌───┤  Visualization Module  │
      ▼            ▼                               │   └────────────────────────┘
  ┌─────────────────────┐                          │
  │                     │        register to       │   ┌────────────────────────┐
  │ Host                │ ◄────────────────────────┼───┤  Visualization Module  │
  │                     │                          │   └────────────────────────┘
  └──────────────┬──────┘                          │
                 │  ▲                              │   ┌────────────────────────┐
    renders with │  │      give new values         └───┤  Visualization Module  │
parameter values │  └─────────────────────────┐        └────────────────────────┘
                 │                            │
                 ├─────────────────────────┐  │
                 │                         │  │
                 │                         │  │
                 ▼                         ▼  │
 ┌────────────────────────┐       ┌───────────┴─────┐
 │ Selected module        │       │ Controls        │
 └────────────────────────┘       └─────────────────┘
```


### Host

The host synchronizes different parts of your application. In other words, it acts as the model (by storing and persisting your application's state) and as the controller (by providing a variety of convenience functions to modify the state).


### Visual Module

A visual module:

 - gives a SQL query (or several) and receives data
 - receives an HTML container and renders in it
 - gives parameters definitions and receives parameters values


## License

[Apache 2.0](LICENSE)
