Giter Club home page Giter Club logo

canvasjs-example-parser's Introduction

CanvasJS Example Parser

For reusability of data visualization examples provided by CanvasJS.

canvasjs-example-parser is consist of three main purposes.

  • Generate reusable templates from examples.
  • Extract embedded data from examples.
  • Apply other data to templates.

Prerequisite

  • node v8.5.0
  • npm v5.4.0

Install npm modules

$ npm install

Fetch CanvasJS examples

$ npm run fetch

Quick example

Generate reusable templates from examples

Generate a template of basic-line-chart.

$ node templateGenerate.js examples/01-line-chart/basic-line-chart.html

The output template file will be in the same path as the source.

Extract embedded data from examples

Extract embedded data in basic-line-chart to a json file.

$ node dataExtract.js examples/01-line-chart/basic-line-chart.html

The output json file will be in the same path as the source.

Apply other data to templates

Embed other json file to basic-line-chart and specify the mapping of column names.

$ node applyData.js examples/01-line-chart/basic-line-chart.template example.json --x=a --y=b

The column "a" and "b" will be apply to the axis "x" and "y" of basic-line-chart, respectively.

The output data visulization file will be output.html.

  • example.json
[
    {
        "a": 10,
        "b": 13
    },
    {
        "a": 20,
        "b": 53
    },
    {
        "a": 30,
        "b": 32
    },
    {
        "a": 40,
        "b": 28
    }
]
  • Sepecify relationships of columns between templates and files
--<template-column-name>=<file-column-name>

canvasjs-example-parser's People

Contributors

miksin avatar

Watchers

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