Code Monkey home page Code Monkey logo

graphicsjs's Introduction

AnyChart - Robust JavaScript/HTML5 Chart library for any project AnyChart Travis Build AnyChart NPM Version AnyChart Releases AnyChart Download

AnyChart Data Visualization Framework

AnyChart is a flexible JavaScript (HTML5, SVG, VML) charting framework that fits any solution in need of data visualization.

Table of Contents

Download and install

There are several ways to download/install AnyChart.

Direct download

All binaries are located in dist folder.

CDN

If you don't want to download and host AnyChart yourself, you can include it from the AnyChart CDN (Content Delivery Network): https://www.anychart.com/download/cdn

<head>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-base.min.js"></script>
</head>

Package managers

You can install AnyChart using npm, bower or yarn:

  • npm install anychart
  • bower install anychart
  • yarn add anychart

Getting started

The fastest way to start with AnyChart is to include framework into a webpage and write some code. Look at this simple HTML snippet below:

<!doctype html>
<body>
<div id="container" style="width: 500px; height: 400px;"></div>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-base.min.js" type="text/javascript"></script>
<script>
    anychart.onDocumentReady(function() {
        // create a pie chart
        var chart = anychart.pie([
            ["Chocolate", 5],
            ["Rhubarb compote", 2],
            ["Crêpe Suzette", 2],
            ["American blueberry", 2],
            ["Buttermilk", 1]
        ]);
        chart.title("Top 5 pancake fillings");
        // set the container where chart will be drawn
        chart.container("container");
        //  draw the chart on the page
        chart.draw();
    });
</script>
</body>
</html>

Step by step quick start guides

Plugins

AnyChart provides wide variety of plugins for different kind of technologies, which includes:

Using AnyChart with TypeScript

You can use AnyChart in your TypeScript projects - we have definition file for our library which you can find in distribution folder. Please, take a look at webpack and typescript integration example for more details.

Using AnyChart with ECMAScript 6

You can use AnyChart in your ECMAScript 6 projects over two ways:

Plain ECMAScript 6

To add AnyChart on a page use <script> section with type="module" attribute.

<script type="module">
    import '_localpath_to_anychart/anychart-bundle.min.js'
    
    // regular AnyChart code here
</script>

For more details, take a look at AnyChart ES6 example.

Bundling tools and Module Loaders

You can use AnyChart with any bundling tool or module loader such as WebPack, Browserify, Require.js and others. For more details, take a look at AnyChart Webpack example.

Technical Integrations

AnyChart can run on any platform and with any database. These samples were created to demonstrate how AnyChart can be easily integrated into your environment. All examples are distributed under an Apache 2.0 License and can be customized to your application. If you are interested in a particular integration not listed here, please contact us.

ASP.NET, C# and MySQL ASP.NET, VB.NET and MySQL ASP.NET, C#, SignalR and MySQL
Go, Revel and MySQL Go and MySQL Java Servlets, Maven, JDBC, JSP and MySQL
NodeJS and MongoDB using socket.io Java Spring, Maven, Hibernate and MySQL Julia and MySQL
NodeJS Express, Jade and MongoDB PHP, Symfony and MySQL PHP, Laravel and MySQL
PHP, Slim and MySQL Perl, Catalyst Web Framework and MySQL Python, Flask and MySQL
Python, Django and MySQL R, Shiny and MySQL Ruby, Sinatra and MySQL
Ruby on Rails and MySQL Scala, Akka and MySQL Scala, Play and MySQL

Contribution guide

To contribute to AnyChart project please:

  • Fork AnyChart repository.
  • Create a branch from the develop branch.
  • Make any changes you want to contribute.
  • Create a pull request against the develop branch.

GitHub documentation: Forking repositories.
GitHub documentation: Collaborating using pull requests.

Please, note:

  1. AnyChart bears no responsibility for the code written by third-party developers until pull request is accepted.
  2. After pull request is accepted the author of pull request sign over all rights to the code to AnyChart.

Build and debug

Dependencies

AnyChart uses several third-party libraries and tools to work with JavaScript and CSS.

Building options

build.py python script is used to work with AnyChart project. You need to install python to use it.

To see all available options of the build script use -h or --help command:

./build.py -h.

To see command options use:

./build.py <command_name> -h

To install all dependencies use the deps command:

./build.py deps.

After running this command you can compile the project using the compile command:

./build.py compile

This compiles production version of anychart-bundle and all modules and puts them into the out folder. You can read more about modules in our Modules article.

To create a dev build for the debug purposes use -d or --develop option:

./build.py compile -d

The -df option generates property renaming report, variable renaming report, and source map location mapping files:

./build.py compile -df

Source map maps minified code to source code. Read more about using source maps in Chrome or source maps in Firefox.

Module system

AnyChart since v8.0.0 is structured as a modules, so you can use only what you need. Please look at our article Modules to start working with modules.

Package directory

├── css
│   ├── anychart.less
│   ...
├── dist
│   ├── json-schema.json
│   ├── xml-schema.xsd
│       ...
├── src
│   ├── charts
│   ├── core
│   ├── modules
│   ├── themes
│       ...
│   README.md
│   LICENSE
│   ...

css

The css folder contains .less CSS files that are compiled into one .css file.

src

The src folder contains AnyChart source code files organized according to the project structure. For example:

  • charts subfolder contains chart classes
  • core subfolder contains core classes
  • modules subfolder contains modules
  • themes contains themes

dist

The dist folder contains binaries and JSON/XML Schemas.

Contacts

Links

License

© AnyChart.com - JavaScript charts. All rights reserved.

graphicsjs's People

Contributors

anychart-vitaly avatar archangel-irk avatar blackart avatar chernetsky avatar chidori avatar grasshoppergn avatar loki20beta avatar nymphly avatar romanlubushkin avatar x09326 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphicsjs's Issues

Diagram Flow (Mxgrpah)

1.Its possible to make Diagrams like Mxgraph doing ?
2.Possible to drag n drop support ?
3.Resizing and Manipulationg Gprahs ?

How to use graphics.js with Angular 6?

There is demo project for AnyChart intergration with angular 5, however, the same approach doesn't work for graphics.js. Attempt to import the library results in error:

core.js:1633 ERROR Error: Uncaught (in promise): ReferenceError: acgraph is not defined

installed the latest version 1.3.2 via npm

Add an arrow on the line

How to add an arrow on the line?
I'm having a issue that I would like to paint a line in between of two path() objects and add an arrow at the end of the line indicates that one object points to the other. But I find no where on the manual script telling how to add the arrow. Can anybody help me on this?
Thanks in advance!

User defined functions?

Some of my graphics include grids, which can be easily programmed by sets of lines. However, it would be convenient to have a function called, say, "grid" which I can simply call when needed. For example, I have the following in the "head" part of my html document:

<script>
  function grid(nr,nc,h,w) {
  for (var i=0; i<= nr; i++ ) {
      stage.path().moveTo(0,i*h).lineTo(nc*w,i*h);
  }
  for (var i=0; i<=nc; i++ ) {
      stage.path().moveTo(i*w,0).lineTo(i*w,nr*h);
  }
  }
</script>

This creates a grid with a corner at (0,0), and with parameters as given. This is all very well, but what happens if I want to draw a grid elsewhere, or rotate a grid? I shouldn't have to include too many parameters in the function itself, and I'd hope that something like:

var g  = grid(2,4,100,50);
g.translate(200,100);

should work - but it doesn't. I also can't change the style of the grid lines using "stroke". Clearly I'm missing something.

How can I write a small function for a particular graphics element, which itself can be altered by chaining with standard graphics.js functions? Many thanks!

[I should say that I am moving some mathematics notes from LaTeX/PDF to html, using MathJax for the mathematics. And I think that graphics.js would be perfect for my diagrams - once I understand it better!]

Nodejs: Cannot find module 'graphicsjs'

After successful installation package with npm, i write to server.js
var G=require('graphicsjs')
and at startup receive Error: Cannot find module 'graphicsjs'
Package version: 1.3.2

Placing text?

Hello,

I have just discovered GraphicsJS - and it might be just what I need to create simple fixed graphics for the web. (I'm an academic, and I'm moving from PDF to HTML in the interests of accessibility). However, I often need to center text within a graphics element; say a rectangle. This could be easily done if there was a way of anchoring text by its center, rather than by the top left of its bounding box, I have fiddled with the hAlign parameter but not with much success. So what is the simplest method of centering text within a rectangle?

And also - is there a way of telling GraphicsJS to use the same text as the surrounding web page? And so if the user (or browser) changes the text, that is also reflected in the GraphicsJS output?

I apologise if these are simple questions, but I can't yet answer them myself. Many thanks!

Alasdair

Adding a demo to the readme

Hi,

Everything is in the title, it would be nice to have a small demo, without necessarily going to the official website.

Thank you. 😃

Typescript Definitions ?

New to GraphicsJS. Is it possible to provide typescript definitions? This would make using the library a breeze in Visual Studio Code or VIM with nice type checking, auto complete support and sane linting.

Thanks for making this wonderful library open source!

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.