Code Monkey home page Code Monkey logo

vis-graph3d's Introduction

vis-graph3d

example chart

Graph3d is an interactive visualization chart to draw data in a three dimensional graph. You can freely move and zoom in the graph by dragging and scrolling in the window. Graph3d also supports animation of a graph.

Graph3d uses HTML canvas to render graphs, and can render up to a few thousands of data points smoothly.

Badges

GitHub contributors GitHub stars

Backers on Open Collective Sponsors on Open Collective Greenkeeper badge

Install

Install via npm:

$ npm install vis-graph3d

Example

A basic example on loading a Timeline is shown below. More examples can be found in the examples directory of the project.

<!DOCTYPE html>
<html>
  <head>
    <title>Graph 3D demo</title>
    <script
      type="text/javascript"
      src="https://unpkg.com/vis-graph3d@latest/dist/vis-graph3d.min.js"
    ></script>
    <script type="text/javascript">
      var data = null;
      var graph = null;

      function custom(x, y) {
        return Math.sin(x / 50) * Math.cos(y / 50) * 50 + 50;
      }

      // Called when the Visualization API is loaded.
      function drawVisualization() {
        // Create and populate a data table.
        data = new vis.DataSet();
        // create some nice looking data with sin/cos
        var counter = 0;
        var steps = 50; // number of datapoints will be steps*steps
        var axisMax = 314;
        var axisStep = axisMax / steps;
        for (var x = 0; x < axisMax; x += axisStep) {
          for (var y = 0; y < axisMax; y += axisStep) {
            var value = custom(x, y);
            data.add({ id: counter++, x: x, y: y, z: value, style: value });
          }
        }

        // specify options
        var options = {
          width: "600px",
          height: "600px",
          style: "surface",
          showPerspective: true,
          showGrid: true,
          showShadow: false,
          keepAspectRatio: true,
          verticalRatio: 0.5,
        };

        // Instantiate our graph object.
        var container = document.getElementById("mygraph");
        graph = new vis.Graph3d(container, data, options);
      }
    </script>
  </head>
  <body onload="drawVisualization();">
    <div id="mygraph"></div>
  </body>
</html>

Build

To build the library from source, clone the project from github

$ git clone git://github.com/visjs/vis-graph3d.git

The source code uses the module style of node (require and module.exports) to organize dependencies. To install all dependencies and build the library, run npm install in the root of the project.

$ cd vis-graph3d
$ npm install

Then, the project can be build running:

$ npm run build

Test

To test the library, install the project dependencies once:

$ npm install

Then run the tests:

$ npm run test

Contribute

Contributions to the vis.js library are very welcome! We can't do this alone!

Backers

Thank you to all our backers! ๐Ÿ™

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

License

Copyright (C) 2010-2018 Almende B.V. and Contributors

Vis.js is dual licensed under both

and

Vis.js may be distributed under either license.

vis-graph3d's People

Contributors

josdejong avatar renovate[bot] avatar alexdm0 avatar mojoaxel avatar yotamberk avatar wimrijnders avatar thomaash avatar ludost avatar greenkeeper[bot] avatar macleodbroad-wf avatar cdjackson avatar gillingham avatar zackarydev avatar brendon1982 avatar coldfix avatar bradh avatar dturkenk avatar dude9177 avatar felixhayashi avatar kannonboy avatar ckane avatar eymiha avatar fabriziofortino avatar mdxs avatar vukk avatar marcinjahn avatar jimmed avatar jaderdias avatar cdituri avatar btmills avatar

Watchers

 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.