Giter VIP home page Giter VIP logo

polestar's Introduction

Vega: A Visualization Grammar

Vega Examples

Vega is a visualization grammar, a declarative format for creating, saving, and sharing interactive visualization designs. With Vega you can describe data visualizations in a JSON format, and generate interactive views using either HTML5 Canvas or SVG.

For documentation, tutorials, and examples, see the Vega website. For a description of changes between Vega 2 and later versions, please refer to the Vega Porting Guide.

Build Instructions

For a basic setup allowing you to build Vega and run examples:

  • Clone https://github.com/vega/vega.
  • Run yarn to install dependencies for all packages. If you don't have yarn installed, see https://yarnpkg.com/en/docs/install. We use Yarn workspaces to manage multiple packages within this monorepo.
  • Once installation is complete, run yarn test to run test cases, or run yarn build to build output files for all packages.
  • After running either yarn test or yarn build, run yarn serve to launch a local web server — your default browser will open and you can browse to the "test" folder to view test specifications.

This repository includes the Vega website and documentation in the docs folder. To launch the website locally, first run bundle install in the docs folder to install the necessary Jekyll libraries. Afterwards, use yarn docs to build the documentation and launch a local webserver. After launching, you can open http://127.0.0.1:4000/vega/ to see the website.

Internet Explorer Support

For backwards compatibility, Vega includes a babel-ified IE-compatible version of the code in the packages/vega/build-es5 directory. Older browser would also require several polyfill libraries:

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.4/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/runtime.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js"></script>

Contributions, Development, and Support

Interested in contributing to Vega? Please see our contribution and development guidelines, subject to our code of conduct.

Looking for support, or interested in sharing examples and tips? Post to the Vega discussion forum or join the Vega slack organization! We also have examples available as Observable notebooks.

If you're curious about system performance, see some in-browser benchmarks. Read about future plans in our roadmap.

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

Count

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

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

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.

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)

Information Tooltips

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

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.

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"
  }
}

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

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

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)

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)

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

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)

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.

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)

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)

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)

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

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!)

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)

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

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.

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)

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.