Git Product home page Git Product logo

backchart's Introduction

Backchart

Backchart is a lightweight JavaScript library based on Backbone and many chart libraries(current just support CanvasJS) This project support AMD&COMMONJS standard and the aim of this project is make a MVC wrapper for char library and render it easily.

##Install If you async loading your modules by AMD or CommonJS ,please copy all js files in dist directory but not browser directory to your library location. Otherwise, please copy all js files in browser directory to your target.

##Import ###AMD (require.js) Add package configure in your path config, exmaple(load CanvasJS):

	require.config({
		path :{
			backbone : "you/backbone/path",
        	underscore : "you/underscore/path",

			//import the chart library you want to use.
        	CanvasJS : "../libs/charts/canvasjs/canvasjs",

			//import the backchart to support your chart library
			"backchart" : "backchart.canvasjs"
		  	//...code...
		}
		//...code...
	});

Require the package and Backchart library script your want to use.

	require(["backchart"], function(){
        require(["backchart.canvasjs"],function(backchart){
			var _model = backchart.model,
				_collection = backchart.collection,
				_view = backchart.view;
			//...write codes...
		});
	});

###Browser Add Backchart base scripts and Backchart library script your want to use.

   <!-- Import backbone -->
   <script type="text/javascript" src="underscore.min.js"></script>
   <script type="text/javascript" src="backbone.min.js"></script>

   <!-- Import CanvasJS and Backchart support -->
   <script type="text/javascript" src="canvasjs.min.js"></script>
   <script type="text/javascript" src="browser/backchart.canvasjs.js"></script>

The global namespace which named backchart will be created if load script succeed.

   //Get MVC object
   (function(window){
		var _model = backchart.canvasjs.model,
			_collection = backchart.canvasjs.collection,
			_view = backchart.canvasjs.view;

		//...write codes...
   })(window);

Documentation

http://www.jonecasper.com/backchart/index.html.

Examples

http://www.jonecasper.com/backchart/index.html.

Compiling JavaScript

Install Grunt

From the command line:

  1. Install grunt-cli globally with npm install -g grunt-cli.
  2. Navigate to the root directory, then run npm install. npm will look at package.json and automatically install the necessary local dependencies listed there.

When completed, you'll be able to run the various Grunt commands provided from the command line.

Unfamiliar with npm? Don't have node installed? That's a-okay. npm stands for node packaged modules and is a way to manage development dependencies through node.js. Download and install node.js before proceeding.

Build - grunt

Run grunt to run tests locally and compile the JavaScript into /dist.

Build JSDoc - jsdoc

  1. Install JSDoc >= 3.30 with npm install jsdoc
  2. Run grunt jsdoc

Release History

0.1.0 Released

backchart's People

Contributors

xch89820 avatar

Watchers

 avatar  avatar  avatar

Forkers

liorcode

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.