0.0.0 • Published 4 years ago

@hurumap/core v0.0.0

Weekly downloads
-
License
GPL-2.0-or-later
Repository
github
Last release
4 years ago

Core Components Reference

This packages includes a library of generic HURUmap core components to be used for creating common UI elements shared between applications and the HURUmap dashboard.

Installation

Install the module

npm install @hurumap/core --save

Usage

These components can be accessed by importing from the core root directory:

/**
 * HURUmap dependencies
 */
import { Card } from '@hurumap/core';

export default function MyVisual() {
	return <Card
            id="668"
            type="hurumap"
            geoId="country-KE"
            showInsight
            showStatVisual
            definition={{
                id: 668,
                title: 'Contribution by principal donor',
                subtitle: 'Development Assistance',
                visual: {
                    type: 'column',
                    table: 'allDonors',
                    x: 'donor',
                    y: 'total',
                    typeProps: {
                        horizontal: true
                    },
                    queryAlias: 'v668'
                },
                stat: {
                    type: 'number',
                    subtitle: 'Development Assistance',
                    description: 'Donor Contribution',
                    unique: false,
                    aggregate: 'sum',
                    queryAlias: 'v668'
                },
                source: [],
                description: []
            }}
        />;
}