1.4.7 • Published 11 months ago

calliope-chart v1.4.7

Weekly downloads
421
License
ISC
Repository
github
Last release
11 months ago

Documentation Overview

Getting Started

Installation

Use npm/yarn to install the libraries

npm install calliope-chart

or

yarn add calliope-chart

Import calliope-chart

import {AutoVis} from "calliope-chart";

Usage

(1) Create a DOM element that the visualization will be attached to.

<div id="vis"></div>

(2) Then, build your visualization specification.

var yourSpec = {...}

(3) Finally, visualize the chart with the specification.

const autovis = new AutoVis();
autovis.container('#vis');
autovis.paragraph('#caption');
autovis.load(yourSpec);
autovis.generate();

Single Visualization Specification

{
    // Properties for data (Required)
    "data": {
        "url": ...,
        "schema": [...]
    },

    // Properties for fact (Required)
    "fact": {
        "type": ...,
        "subspace": [...],
        "measure": [...],
        "breakdown": [...],
        "focus": [...]
    },

    // Properties for chart (Optional)
    "chart": {
        "size": ...,
        "type": ...,
        "style": ...,
        "duration": ...,
        "caption": ...,
    }
}

Properties for data

1. Data from URL

PropertyTypeDescription
urlStringRequired. A string describing the data source.For example: {"url": "data/cars.csv"}
schemaObject[]An array of field objects. Default: []

2. Inline Data

PropertyTypeDescription
valuesObject[]Required. The full data set, included inline.For example: {"values": [{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43}]}
schemaObject[]An array of field objects. Default: []

Properties for fact

PropertyTypeDescription
typeStringRequired. A string describing the fact type (one of "trend", "categorization", "value", "difference", "distribution", "proportion", "rank", "extreme", "outlier", and "association")
subspaceObject[]Subspace describes the data scope of the fact, which is defined by a set of data filters.Default: []
breakdownObject[]Breakdown is a set of temporal or categorical data fields based on which the data items in the subspace are further divided into groups. Default: according to the fact type.
measureObject[]Measure is a set of numerical data fields based on which we can retrieve a data value or calculate a derived value, such as count, sum, avg, min, or max, by aggregating the subspace or each data group. Default: according to the fact type.
focusObject[]Focus indicates a set of specific data items in the subspace that require attention. Default: according to the fact type.

Properties for chart

PropertyTypeDescription
sizeStringA string describing the chart size (one of "small" (235x150), "middle" (360x200), "wide" (560x220), and "large" (640x640))Default: large
typeStringA string describing the chart type (one of "verticalbarchart", "horizentalbarchart", "progresschart", "areachart", "bubblechart", "bubblemap", "donutchart", "filledmap", "linechart", "piechart", "scatterplot", "treemap", "textchart", "isotypebar", "isotypecluster", "isotypeproportion")Default: Automatic recommendation based on fact
styleStringA string describing the chart style (one of "business", "comics", "pictograph", ...)Default: "business"
durationNumberTime duration for chart animationDefault: 0 (static chart)
captionStringA string describing the chartDefault: ""

An Example

{
    "data": {
        "url": "url/carsales.csv",
        "schema": [
            {
                "field": "Sales",
                "type": "numerical"
            },
            {
                "field": "Brand",
                "type": "categorical"
            },
            {
                "field": "Category",
                "type": "categorical"
            }
        ]
    },
    "fact": {
        "type": "difference",
        "subspace": [
            {
                "field": "Brand",
                "value": "Hyundai"
            }
        ],
        "measure": [
            {
                "field": "Sales",
                "aggregate": "sum"
            }
        ],
        "breakdown": [
            {
                "field": "Category"
            }
        ],
        "focus": [
            {
                "field": "Category",
                "value": "SUV"
            },
            {
                "field": "Category",
                "value": "MPV"
            }
        ]
    },
    "chart": {
        "size": "large",
        "type": "verticalbarchart",
        "style": "business",
        "duration": 1000
    }
}
1.4.7

11 months ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.13

3 years ago

1.2.14

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.10

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.9.41

3 years ago

0.9.40

3 years ago

0.9.39

3 years ago

0.9.38

3 years ago

0.9.34

3 years ago

0.9.35

3 years ago

0.9.36

3 years ago

0.9.37

3 years ago

0.9.33

3 years ago

0.9.32

3 years ago

0.9.31

3 years ago

0.9.30

3 years ago

0.9.29

3 years ago

0.9.28

3 years ago

0.9.26

3 years ago

0.9.27

3 years ago

0.9.25

3 years ago

0.9.24

3 years ago

0.9.18

3 years ago

0.9.19

3 years ago

0.9.23

3 years ago

0.9.20

3 years ago

0.9.21

3 years ago

0.9.22

3 years ago

0.9.15

3 years ago

0.9.16

3 years ago

0.9.17

3 years ago

0.9.14

3 years ago

0.9.13

3 years ago

0.9.12

3 years ago

0.9.11

3 years ago

0.9.10

3 years ago

0.9.8

3 years ago

0.9.7

3 years ago

0.9.6

3 years ago

0.9.5

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.16

4 years ago

0.6.15

4 years ago

0.6.14

4 years ago

0.6.13

4 years ago

0.6.12

4 years ago

0.6.11

4 years ago

0.6.10

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.5.0

4 years ago

0.4.3

4 years ago

0.4.1

4 years ago

0.4.2

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago