Coder Social home page Coder Social logo

waikato / metropoljs Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 0.0 11.25 MB

MetropolJS: Visualizing and Debugging Large-Scale JavaScript Program Structure with Treemaps

Home Page: https://waikato.github.io/MetropolJS

License: Apache License 2.0

HTML 0.65% TypeScript 17.63% GLSL 0.27% JavaScript 81.43% Shell 0.02%
javascript visualization

metropoljs's Introduction

MetropolJS

Contact Email: [email protected]

Paper PDF: docs/paper/metropolJS.pdf

Live Demo: https://waikato.github.io/MetropolJS/

Header Image

Introduction

As a result of the large scale and diverse composition of modern compiled JavaScript applications, comprehending overall program structure for debugging proves difficult. In this paper we present our solution MetropolJS. By using a Treemap-based visualization it is possible to get a high level view within limited screen real estate. Previous approaches to Treemaps lacked the fine detail and interactive features to be useful as a debugging tool. This paper introduces an optimized approach for visualizing complex program structure that enables new debugging techniques where the execution of programs can be displayed in real time from a bird's-eye view. The approach facilitates highlighting and visualizing method calls and distinctive code patterns on top of code segments without a high overhead for navigation. Using this approach enables fast analysis of previously difficult-to-comprehend code bases.

Getting Started

  1. Clone the repository
git clone https://github.com/Waikato/MetropolJS/ && cd MetropolJS
  1. Install dependencies with Yarn
yarn
  1. Start either Google Chrome with Remote Debugging or nodejs with the inspector enabled and copy the Websocket URL from the command line.
  2. Create a copy of the example config file dist/config.example.js and place it in the dist directory as config.js. Documentation is in the Config File section.
  3. Start the development server and compile the code. This is powered by Parcel.
yarn start:dev
  1. Visit https://localhost:8080/ and wait for scripts to be loaded.

Config File

The example config file in dist/config.example.js is reproduced below for reference.

// MetropolJS Config File
// This will be loaded when the application starts.

loadMetropolJSConfig({
    // Debugger options
    'debugger': {
        // The type of debugger to connect to ('v8'|'interpreter').
        'type': 'v8',

        // The connection string to use for the debugger (string).
        // For V8 this will be a websocket URL.
        // For interpreter it will be the script to load
        // - jquery
        // - lodash
        // - moment
        // - richards
        // - underscore
        // - underscore_test
        'connect': 'ws://localhost:9229/',
    },

    // Rendering options
    'rendering': {
        // Should the camera be set for top down pan and zoom or full orbit //
        // controls (true|false).
        '3d_mode': false,

        // Should the layers be extruded so that walls can be added? (true|false).
        'city_mode': false,

        // Should walls be rendered around each AST node for city_mode (true|false)
        'render_walls': false,
        // Should line borders be rendered around each AST node (true|false).
        'render_borders': false,
        // Should solid boxes be rendered for each AST node (true|false).
        'render_solid': true,
    },

    // Quality tuning options
    // Mostly used when city mode is enabled.
    'quality': {
        // Should lighting be enabled and added to the scene (true|false).
        'enable_lighting': false,

        // Should SSAO be enabled (true|false).
        // Warning will negatively impact performance.
        'enable_ssao': false,
    }
});

Citing MetropolJS

https://dl.acm.org/doi/10.1145/3196321.3196368

@inproceedings{10.1145/3196321.3196368,
  author = {Scarsbrook, Joshua D and Ko, Ryan K L and Rogers, Bill and Bainbridge, David},
  title = {MetropolJS: Visualizing and Debugging Large-Scale Javascript Program Structure with Treemaps},
  year = {2018},
  isbn = {9781450357142},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3196321.3196368},
  doi = {10.1145/3196321.3196368},
  booktitle = {Proceedings of the 26th Conference on Program Comprehension},
  pages = {389โ€“392},
  numpages = {4},
  keywords = {treemaps, javascript, debugging},
  location = {Gothenburg, Sweden},
  series = {ICPC '18}
}

Licence

MetropolJS is licensed under the Apache 2.0 License in LICENSE.

metropoljs's People

Contributors

dependabot[bot] avatar vbitz avatar

Stargazers

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

Watchers

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