Git Product home page Git Product logo

peter-gy / visrecly Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 1.0 15.65 MB

📊 A task-based visualization recommendation app, aiming to be the Grammarly for stories written with charts. Built with draco and vega-lite.

Home Page: https://visrecly.vercel.app

TypeScript 97.52% JavaScript 2.34% CSS 0.12% Shell 0.02%
draco mui nx-workspace react recommendation-system tailwindcss typescript visrec visualization vega

visrecly's Introduction

VisRecly

VisRecly Demo

What Is This All About?

VisRecly is a task-based visualization-recommendation tool with the goal in mind to allow novice VIS users to create novel visualizations quickly for their dataset, solely by uploading it, then specifying what they would like to achieve with their data (e.g. correlate, find differences, cluster, etc.).

This idea and project were so interesting to me that I decided to make it the project for my Bachelor's Thesis at the CS department of Universität Wien. I enjoy the supervision of Torsten Möller and Manfred Klaffenböck.

You can read the full thesis here.

Decomposing the Project's Name and Ambitions

The first part, VisRec, stands for Visualization Recommendation, while the ly segment is a tribute to Grammarly (the grammar checker) which inspired me to jump into this project. As I exposed myself to formal, academic concepts of visualization and visual data analysis, I realized that a Grammarly-like tool for visualization would be beneficial to VIS novices.

There is an untold story behind every single set of data and visualizations provide great means to tell these stories. Yet, just as people do not enjoy written stories being full of grammar or spelling mistakes or being out of tone, they also do not enjoy looking at visualizations violating fundamental design guidelines or being out of context regarding the task at hand.

On the one hand, as Grammarly dictates grammar and spelling rules for writing, VisRecly aims at enforcing non-negotiable visualization design guidelines in its recommendations. On the other hand, just as Grammarly allows for recommending synonyms and alternative sentence structures based on the communication goals and target audience of the author, VisRecly attempts to help its users find the "tone" of their visualization by ranking recommendations across tasks and highlighting the most suitable ones.

Tech Overview

In an attempt to make this tool as intriguing and accessible as possible, I am building it with modern web technologies, such as:

  • React, Next.js
  • Material-UI, TailwindCSS
  • Pure TypeScript & WebAssembly

This monorepo is made up of the modules below:

  • libs/data: Houses example data sets and related utilities.
  • libs/draco: The core of the underlying recommendation engine, defining learning and visualization design guidelines as Answer Set Programming (ASP) problems. It is a custom fork of draco by UW Interactive Data Lab.
  • libs/draco-web: Custom web-API leveraging the core API introduced in libs/draco and clingo-wasm to solve ASP programs in the browser, eliminating the need for a server component.
  • libs/ranking: Defines the ranking algorithm and aggregator utilities, considering both data-oriented costs (obtained from libs/draco-web) and VIS-task-relevant preferences.
  • libs/vis-tasks: Defines the VIS tasks and their associated mark-preferences.
  • apps/dashboard: The actual client of the above modules, the dashboard that allows users to steer their desired tasks and marvel at the generated vega-lite-based visualizations.

Architectural Overview

visrecly-arch

  • (a) Input: accepts user input (apps/dashboard)
  • (b) Preprocess: prepare data schema (libs/draco)
  • (c) Generate: Solve ASP problems and produce Vega-Lite specifications (libs/draco-web)
  • (e) Rank: Compute recommendation costs and rank visualizations (libs/ranking)
  • (g) Output: Render the ranked visualizations (apps/dashboard)
  • (d) and (e) are knowledge sources for design guidelines and VIS tasks (libs/data, libs/vis-tasks)

Development

Make sure to install the monorepo dependencies.

npm install

Starting the Project Locally

npm run start

The dashboard should be running on localhost:4200.

Running Tests

Running what?

Tests are available for libs/draco. They can be executed by running:

npx nx test draco

visrecly's People

Contributors

peter-gy avatar

Stargazers

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

Watchers

 avatar

Forkers

ziedbouf

visrecly's Issues

feat: heatmap UI

Description

Implement the heatmap UI & support rendering vega-lite charts

feat: draco-web

Description

Due to performance drawbacks of traditional client-server architecture, instead of using a python-based rec-server for recommendation generation, the usage of clingo-wasm with draco-core should be preferred.

Requirements

  • Create a new TS-based NX library, called draco-web
  • Mimic the feature of draco-vis, but with fresh dependencies

Additional Context

draco-vis cannot be used as an off-the-shelf solution, as it depends on old versions of draco, vega-lite and it uses the deprecated wasm-clingo instead of clingo-wasm.

chore: finalize domain data

Description

  • The used datasets should be finalized, data with irregular column names should be removed from the app, as they lead to ASP-parsing server errors.
  • VisTask descriptions should be revised

perf: optimize rendering

Description

Currently, when resizing the window, the full ranking pipeline runs again which is wasteful & should be fixed.

feat: ui enhancements

Requirements

  • Synced scrolling
  • Proper rank ordering
  • Enhanced vis detail view
  • Enhanced responsivity
  • Additional tooltips

feat: general UX improvements

Description

Implement the ideas proposed by a kind expert.

  • remove scale labels
  • improve category color scale
  • use alphabetical labels for overall ranks
  • display overall identifier of highlighted rect

feat: rank indicator rects

Description

Small rectangles should be added to the first column of the heatmap to make it clear that the user sees a ranking horizontally.

feat: refine ranking logic

Description

The calculation of the overall ranking is embarrassingly simple and the vega-lite specs yielded by the generated ASPs are not diverse enough. Possibilities for enhancements should be explored.

feat: ranking API

Description

The full pipeline & API for ranking should be created. It should be handled by a separate library, depending on the draco and draco-web modules.

Requirements

  • Create models to represent VIS tasks and their ranking logic depending on a given encoding
  • Create default VIS tasks and their ranking logic (at least a stub)
  • Expose a single ranking function, accepting the following input:
    • data as any[]
    • encoding preferences of the user (which columns should be included)
    • maximum number of models
    • --> should output an augmented SolutionSet with $n$ costs per recommendation

Additional Context

The VIS tasks and their associated ranking logic must be declarative and easily modifiable. This is absolutely necessary to be able to enhance the tool from a domain POV without making significant changes to the codebase.

Ranking Approach

The proposed ranking algorithm has two main pillars:

  • Data-oriented: obtained from draco by reading the cost of a model for an ASP
  • Task-oriented: "hard-coded" based on relevant literature, by declaring how useful a given encoding is for a specified task

Non-exhaustive list of used literature:

The recommendations are generated as vega-lite, hence, the used marks need to be matched using its schema.

Currently, the following marks are specified in the schema:

"Mark": {
  "description": "All types of primitive marks.",
  "enum": [
    "arc",
    "area",
    "bar",
    "image",
    "line",
    "point",
    "rect",
    "rule",
    "text",
    "tick",
    "trail",
    "circle",
    "square",
    "geoshape"
  ],
  "type": "string"
},

In a very high-level overview, the steps to take are:

  1. Let draco process the raw data with its wisdom collected as .lp files as a part of uwdata/draco#51 and uwdata/draco#52, and save the SolutionSet output.
  2. Iterate through the SolutionSet, and assign a VIS-task-based weight to each solution per VIS task. After this, given that we have $n$ VIS tasks at hand, we can generate $n$ composite costs per recommendation by summing the data-based cost with the VIS-task-based cost.
  3. Clients of the library can further process these details and use them for representation

feat: linked highlighting

Description

Interactive, linked highlighting should be supported between the recommendation list and the heatmap

feat: encoding preference picker

Description

It should be possible to pick encoding preferences via the sidebar.

Requirements

  • Access data schema before recommendation generation
  • State management setup
  • Actual sidebar UI

feat: migrate to `draco2`

Description

Recommendations should be generated using draco2. The specifications should be rendered using the vega-lite-based renderer implemented in cmudig/draco2#438.

In order to do so, this monorepo needs to be extended with a Python server component wrapping draco2's server implemented in cmudig/draco2#403.

chore: update `nx`

Description

Update the workspace to the latest version

Requirements

  • No functional changes to the code

chore: migrate `nx`

Description

Migrate nx to its latest version

Requirements

  • No functional changes to the code

feat: UI scaffolding

Description

The skeleton of the dashboard's user interface should be created with basic responsivity support.

Requirements

  • Navbar with optional actions
  • Sidebar that is open by default
  • Scrollable area with dummy children
  • Placeholder for grid

Additional Context

Figma Design

P2;V2  Main - Sidebar Open

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.