Coder Social home page Coder Social logo

query-graphs's Introduction

Query Graphs

Helping people see and understand queries.

Description

Query Graphs is an investigation into graph visualization for query processing, such as for logical queries and their physical query evaluation plans. The project tag line is "Helping people see and understand queries." The technology stack for query visualization consists of browserify, d3.js, d3-tip.js, http-server, and xml2js. Browserify is used to satisfy required dependencies.

The following additional resources are required for query visualization as an express service: body-parser.js, bootstrap, crypto.js, express.js, fs.js, multer.js, and node.js. Node is used to start the Express service. If running query visualization as a service, then a separate http-server is not required.

There is also a side-by-side comparison layout for comparing two queries at once.

Directory Structure

Directory       | Description
---------       | -----------
d3              | query visualization artifacts
media           | screen captures, sample queries, uploads
result-table    | for side-by-side query comparisons

Installation

Install latest stable version (at least 5.8.0) of Node.js from http://nodejs.org.

Run git clone on the query-graphs project, install node module dependencies, and start the visualization service. Install also creates browserify bundles for the visualization service and for use in the Tableau Log Viewer.

git clone https://github.com/tableau/query-graphs.git
cd query-graphs
npm install (or npm install --production for an install with no development dependencies)
node upload-server.js

Example Visualizations

Open an examplar query html file at

Open the upload form at http://localhost:3000/d3/upload-form.html. LogicalQuery XML, QueryFunction XML, or HyPer query-plan JSON, as files or text, may be uploaded to the express service for visualization.

Open the side-by-side query comparison at http://localhost:3000/result-table/compare_layout.html?left=3d5c935c.xml&right=3d5c935c.xml&left-label=before&right-label=after.

Query String Parameters

The following URL parameters are supported for query visualization:

Parameter       | Description
---------       | -----------
collapse        | node collapse style: n - no/none, y - yes/some, s - streamline all secondary nodes (default)
debug           | debug mode: any setting will enable (disabled by default)
file            | name of XML file: (default file name if not specified)
format          | format of the file: 'tableau', 'hyper', 'xml', 'json' (default: file format will be inferred)
orientation     | graph orientation: top-to-bottom (default), right-to-left, bottom-to-top, left-to-right
upload          | query uploaded: y - query was uploaded to the visualization service, n - (default)
properties      | JSON object with additional properties to be displayed in the tree label

The following URL parameters are supported for side-by-side comparisons:

Parameter       | Description
---------       | -----------
left            | name of file to render in the left iframe
left-label      | label of the left iframe
right           | name of file to render in the right iframe
right-label     | label of the right iframe

Browserify and ESLint

Build instructions to create the JavaScript bundle containing all required dependencies. Run after any changes to query-graphs.js or its module dependencies.

npm run bundle

To create an archive containing the bundle and associated files for the Tableau Log Viewer, run the following. Extract the archive in tlv-qt/query-graphs, a subdirectory in the tlv-qt project.

npm run bundle-tlv

To run eslint on the appropriate JavaScript files, do the following within the project root. (The eslint is a development dependency in package.json; its installation could be avoided by using npm install --production above.)

npm run lint

Acknowledgements

The dragging, zooming, panning, panning, collapsing functionality originated from “D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with Auto-Sizing” (Rob Schmuecker’s block #7880033).

query-graphs's People

Contributors

benlower avatar fgamador avatar luiseeo avatar rickcole avatar vogelsgesang 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.