Giter Club home page Giter Club logo

polestar's Introduction

Pole✭ (Polestar) -- Alpha

WE NO LONGER PLAN TO MAINTAIN THIS PROJECT. PLEASE FOLLOW THE NEW VERSION OF VOYAGER WHICH SUPPORTS ALL INTERACTIONS IN POLESTAR

Build Status

PoleStar is Tableau-style User Interface for visual analysis, building on top of Vega-Lite. Try our online demo. Also, be sure to check our related projects.

This project is an alpha software. We are working on improving its code and documentation.

If you are using Polestar for your project(s), please let us know what are you using it for by emailing us at Vega-Lite [at] cs.washington.edu. Feedbacks are also welcomed. If you find a bug or have a feature request, please create an issue.

Team

Polestar's development is led by Dominik Moritz, Kanit Wongsuphasawat, and Jeffrey Heer at the University of Washington Interactive Data Lab, in collaboration with UW eScience Institute and Tableau Research

Setup Instruction

Install Dependencies

Make sure you have node.js. (We recommend using homebrew and simply run brew install node.)

cd into your local clone of the repository, and install all the npm and bower dependencies (bower will auto-run when npm finishes):

cd polestar
npm install

Now you should have all dependencies and should be ready to work.

Running

You can run npm start, which serves the site as well as running tests in the background. If you edit any file, our gulp task runner should automatically refresh the browser and re-run tests.

To execute other tasks, either use the npm script aliases npm run lint, npm test, or npm run build, or else install gulp globally with npm install -g gulp and run the tasks directly from gulp.

Development Guide

Folder Structure

We try to follow Google's Angular Best Practice for Angular App Structure and use generator-gulp-angular to setup the project.

All source code are under src/

  • src/app/ contains our main classes
  • src/components contains our other components
  • src/assets/images/ contains relevant images
  • src/data/ contains all data that we use in the application
  • src/vendor contains

@kanitw created gulp/gen.js for help generating angular components. For example, you can run gulp gen -d directiveName and this would create all relevant files including the javascript file, the template file, the stylesheet file and the test spec.

Coding Style

We use jshint as our linter for coding in the project.

Stylesheets

We use sass as it is a better syntax for css.

Dependencies

Managing front-end dependencies with Bower requires the bower package to be globally installed:

npm install -g bower

This project depends on Datalib for data processing, Vega-Lite as a formal model for visualization, and Vega-Lite-ui, which contains shared components between Polestar and Voyager.

If you plan to make changes to these dependencies and observe the changes without publishing / copying compiled libraries all the time, use bower link.

In each of your dependency repository, run

cd path/to/dependency-repo
bower link

Then go to this project's directory and run

bower link datalib
bower link vega-lite
bower link vega-lite-ui

Now all the changes you make in each repo will be reflected in your Vega-Lite automatically.

Since bower uses the compiled main file, make sure that each repos is compiled everytime you run npm start. Otherwise, you will get errors for missing libraries.

Releasing / Github Pages

gh-pages branch is for releasing a stable version. gh-pages should only contain the dist folder.

Use publish.sh to:

  1. publish the current version to npm
  2. deploy the current branch to gh-pages and
  3. create a release tag for github and bower.

Acknowledgement

We used generator-gulp-angular for bootstraping our project.

polestar's People

Contributors

domoritz avatar kadamwhite avatar kanitw avatar kongeo avatar light-and-salt avatar rileychang avatar vlandham 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polestar's Issues

Dropping a field sets empty the field def

It's not even taking a default but just setting a completely empty field def. This should not be the case.

Reproduce:

  • Drop a field
  • Set some property (for example grid)
  • Drop another field
  • Property is set to false (default is true in schema!)

Running `grunt serve` get undefined method error in compass:server

Running grunt serve

Running "compass:server" (compass) task
    directory .tmp/styles
        error app/styles/main.scss (/usr/local/lib/ruby/gems/2.1.0/gems/sass-3.4.6/lib/sass/selector/abstract_sequence.rb:96:in `block in _specificity': undefined method `specificity' for [:not(.button)]:Array)

We should add these?

  • view domain #145
  • histograms view (or at least show range of values for each field) #144
  • filter #2
  • sorting control #113

(let’s discuss at some point)

Rename files to be consistent with @kanitw’s generator

Basically all controllers, services, filters should have the follow filename format.

src: componentname.type.js
test: componentname.type.spec.js

(only directives has format directivename.js)

since we automatically inject everything under app and components. This is relatively easy.

Make tests run only once

From the vlplot test’s error, seems like tests are loaded twice….

PhantomJS 1.9.8 (Mac OS X) Directive: vlPlot should attach visualization FAILED
    Expected 0 to be 1.
        at /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/src/components/vlplot/vlplot.spec.js:42
        at invoke (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular/angular.js:4182)
        at workFn (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular-mocks/angular-mocks.js:2350)
PhantomJS 1.9.8 (Mac OS X) Directive: vlPlot should attach visualization FAILED
    Expected 0 to be 1.
        at /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/src/components/vlplot/vlplot.spec.js:42
        at invoke (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular/angular.js:4182)
        at workFn (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular-mocks/angular-mocks.js:2350)

User Friendlier Field Pill Popup

Something like this:

mock_-axure_rp_pro_7_0___licensed_to_kanit_wongsuphasawat__student

  • popup
  • clean the popup if click somewhere else
  • disable popup if there is no property available no longer applicable

Style Fix

  • Fix Style of the Dev Pane: Text Area, Stick at the bottom
  • Error Message
  • Configuration panes don't close when field is removed
  • use flex layout for horizontal stuff too. (make vis fits vertically to the screen)

Test fails

LOG: {length: 0, prevObject: {0: <function-select enc-type="encType2" pills="pills" schema="schema" class="ng-scope ng-isolate-scope"><!-- ngIf: func.list.length > 1 || func.list[0] !== '' --></function-select>, length: 1}, context: undefined, selector: 'input'}
PhantomJS 1.9.8 (Mac OS X) Directive: functionSelect should not show other options for count field FAILED
    Expected 0 to be 1.
        at /Users/domoritz/Developer/UW/vegalite-ui/src/components/functionselect/functionselect.spec.js:65
        at invoke (/Users/domoritz/Developer/UW/vegalite-ui/bower_components/angular/angular.js:4182)
        at workFn (/Users/domoritz/Developer/UW/vegalite-ui/bower_components/angular-mocks/angular-mocks.js:2350)
PhantomJS 1.9.8 (Mac OS X): Executed 29 of 29 (1 FAILED) (0.073 secs / 0.247 secs)

Count

We could have a special count field or just enable the dropdown even if there is no field (current option).

Refactor based on best practice

From The Top 10 Mistakes AngularJS Developers Make and Best Practice Recommendations for Angular App Structure, there are a couple of things we should do:

(most importantly)

  • group file by modules — this would make copying some component to facetedviz much easier.
  • make sure we always use dependency injection for all dependencies.
    For example, right now we are still using _ (lodash) and papa from global scope, which makes testing more difficult?

(nice to do)

  • group things by module

Load shorthand from url

For example, it would be great if we can access polestar from
uwdata.github.io/polestar?shorthand=<shorthand> (for the github pages hosted app)

Generate Minimalist Vegalite Encoding

(Lower Priority — not important for user study at all)

Don’t include default value in the specification.
For example, axis grid is false by default.
Let’s not include axis.grid unless it’s true.
Otherwise, the spec will be quite verbose.

{
  "marktype": "point",
  "enc": {
    "x": {
      "name": "cyl",
      "type": "Q",
      "scale": {"reverse": false,"zero": false},
      "axis": {"grid": false}
    },
    "y": {
      "name": "mpg",
      "type": "Q",
      "scale": {"reverse": false,"zero": false},
      "axis": {"grid": false}
    }
  },
  "cfg": {
    "useVegaServer": false,
    "vegaServerUrl": "http://localhost:3001",
    "dataFormatType": null,
    "dataUrl": "data/cars.json",
    "vegaServerTable": "cars_json"
  }
}

Fix vlplot’s test

PhantomJS 1.9.8 (Mac OS X) Directive: vlPlot should attach visualization FAILED
    Expected 0 to be 1.
        at /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/src/components/vlplot/vlplot.spec.js:42
        at invoke (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular/angular.js:4182)
        at workFn (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular-mocks/angular-mocks.js:2350)
PhantomJS 1.9.8 (Mac OS X) Directive: vlPlot should attach visualization FAILED
    Expected 0 to be 1.
        at /Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/src/components/vlplot/vlplot.spec.js:42
        at invoke (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular/angular.js:4182)
        at workFn (/Users/kanitw/Dropbox/_Projects/_idl/_visrec/vegalite-ui/bower_components/angular-mocks/angular-mocks.js:2350)

Refactor

I’m listing potential refactor here:

  • service/Vegalite.js —> this name is weird for me but I don’t have better suggestion yet. (Punting it for now)

Consolidate Services

consolidate vegalite spec related service in

  • move everything to one file (right now we have to import so many similar files)
  • should we name it spec.js (Spec service) — seems like everything here are related to spec
  • remove load schema (since it’s now accessible from vl.schema.spec)

Note: we can distinguish between the following spec even though they are in one file

  • spec = verbose spec that’s being edited
  • vlSpec = compiled spec — this should be a concise version.

Does not work with latest vegalite

Because we changed the schema and the instantiated schema doesn't include the field type or mark type any more. Maybe other things as well.

Different ways to sort data field list

Right now it’s always sorted by the original order of the data.

  • Sort by Type
  • Sort by Type, then by Name
  • Sort by Type, then by Cardinality (for ordinal)
  • Sort by Name

vegaliteplot.js directive shouldn’t set variables in global scope

The following part of code in directives/vegaliteplot.js is setting global scope.

var update = function() {
          $scope.vegaSpec = Vegalite.vegaSpec;
          $scope.vlSpec = Vegalite.vlSpec;
          $scope.shorthand = Vegalite.shorthand;
        };

However, my popups are currently relying on values in global variables.

(Will fix this today … need to go outside for lunch first)

Information Tooltips

  • Use description of property from schema where available could either be as very small text or tooltip
  • type
  • field name

FieldDef Model

Based on conversation in #30,

The way we structure fieldDefEditor to check if a field is empty by checking fieldDef.name==null instead of fieldDef==null makes the spec updates twice when a Field is dragged from one shelf to another.

In fieldDefEditor, it seems like ngDraggable doesn’t have eventListener for when the source draggable item’s model is updated.

For example, if I drag a field A from shelf X to shelf Y, X’s onDragStop() would be called before its ngModel is updated to null.

Therefore, I have to reset scope.fieldDef = {name: null, type: null}; using a watcher.

This will update the spec twice. We can need to either stop sending pulse through the data flow.
An alternative solution is to makes fieldDef = null or undefined by default.

Restyling, Basic Functionality

shelfviz

@domoritz Here are my proposed change (I will do them) … but wanna run them by you first.

  • make things smaller — so most of them fit on one screen 13fbce7
  • make options popup instead.
  • use flex layout instead
  • move shorthand, vegalite, vega code block to become popups on the menu bar
  • move server config to become popup
  • dropdown for aggregate type
  • disable text selection on field pill
  • add move config, dev tool to the bottom (and enable toggle expand)
    - [ ] Use dropdown button for fields #37
  • Only show things that are relevant/ usable

Log User Interactions

  • log all encoding modifications
  • log all points that users mouseover -- @domoritz -- this is probably the only thing left for this issue but doesn't make sense until we have tooltip

Properties Adjustment Pane

  • Color — where {"type": "string","role": "color","default": “steelblue”} — we want color picker
  • Opacity — should be slider
  • Size — should be slider if we have min-max

need to adjust fielddefeditor.html

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.