Git Product home page Git Product logo

vue-vega's Introduction

vue-vega

Vega-Lite and Vega bridge to Vue.js ecosystem

Intro

vue-vega is a set of components and utilises dedicated to help developer access vega-lite and vega functionality through convenient API for Vue.js ecosystem

It's in development, API isn't stable, only after removing alpha prefix from the version that project would have stable API

Documentation

To check out live examples and docs, visit https://github.com/nesterone/vue-vega

Contributing

Our crafted Contributing Guide

Build

# serve with hot reload at localhost:8080
npm run dev

# distribution build with minification
npm run build:bundle

# build the _docs into docs
npm run build:docs

# build all
npm run build

# run unit tests
npm run test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

License

MIT

Copyright (c) 2017-present, Igor Nesterenko

vue-vega's People

Contributors

domoritz avatar kuzya-zz avatar nesterone avatar xmnlab 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

Watchers

 avatar  avatar  avatar  avatar  avatar

vue-vega's Issues

Organize browser sample as real world use cases

  • fetch real data from remote resources and render them with vega
  • update visualizatoin (fire base etc)
  • make accessible from docs
  • make jsfiddles and intefrate them in docs
  • provide acceptance check for browser samples

Changes in 'data' recreate view intance

It's because specs computed depends from data and view instance recreation listen for spec change

Here few caveats: by excluding data prop from vegaLiteSpec prop we would make it's not clear for devs, especially when they interested in vega/lite spec values, from other side changes in data -(which should be streamed to changeset) would run recompilation and full recreation of vega view

  • recreate vega view only if non-data parts of spec were changed
  • stream data change to vega view, it shoudn't recompile specs and recreate vega view
  • changes in data should be represented in vegaSpec and vegaLiteSpec

Update vega and vega-lite

@nesterone

Currently there are some functionalities that are not working, such as:

  • line with point
  • tootip
  • datasets

for datasets I could workaround and fix that in my backend before send the spec, but it would be good if it could work without any workaround.

My first guess was update the dependencies #44

But it seems it is not enough.

Could you provide any information to guide me to fix this issue?

Publish to NPM register

  • choose version
  • move github project from private to public
  • provide proper tags for project

Initial TODO List

  • eslint config
  • editor config
  • precommit hooks
  • unit test
  • setup CI (trigger on push/)
  • cover mixing with unit tests without adding new functionality
  • switch from mixin to plugin
  • create a dist with simple standalone html example
  • move samples to sepatate folder (docs), src contains only plugin
  • create more sexy docs page
  • fill with existing functionality, no new fetaures
  • publish to gh-pages
  • synch readme with docs

Define Public API

  • review existing API and tune it, take to account that vega also in a plan to be part of integration
  • update/write API reference

Line Chart with Point Markers seems not working

Hi,

The "Line Chart with Point Markers" seems broken. The points are not shown.

I even tested with the demo chart with spec below.

<vega-lite :spec="demo_spec"></vega-lite>

where demon_spec is:

 {
  "$schema": "https://vega.github.io/schema/vega-lite/v2.6.0.json",
  "description": "Stock prices of 5 Tech Companies over Time.",
  "data": {"url": "https://vega.github.io/editor/data/stocks.csv"},
  "mark": {
    "type": "line",
    "point": true
  },
  "encoding": {
    "x": {"timeUnit": "year", "field": "date", "type": "temporal"},
    "y": {"aggregate":"mean", "field": "price", "type": "quantitative"},
    "color": {"field": "symbol", "type": "nominal"}
  }

-thanks

Export the vega API

Currently, it is not possible to call vega APIs directly (e.g. vega.scheme) when using the minified version of vue-vega. Simply importing from vega and calling the API has no effect, since it is a different file (from node_modules/vega* instead of the minified file) with a different scope.

This could probably be remedied by something like this (in index.js):

export * from 'vega'

That way we could use the following to access the API in the same scope:

import { scheme } from 'vue-vega'
scheme('my-scheme', [ ... ])

Alternatively, something like this could be used:

import * as vega from 'vega'
export { vega }
import { vega } from 'vue-vega'
vega.scheme('my-scheme', [ ... ])

Support for pie charts?

I was trying to include a pie-chart but the compiler was throwing a vegaSpec error:"Error: Unregistered composite mark arc". I looked up the documentation and it seems that the mark "arc" is not yet supported. Is that correct? Thanks!

[Vue warn]: You are using the runtime-only build of Vue

I've started a new project using the Vue cli, but when I install vue-vega and add a simple example I get this error:

[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

Is there anything I can do? Maybe some additional Getting started step would be good?

I'd love to combine vue-vega with VuePress where you normally compile as much as possible beforehand.

console.log

Hey @nesterone !

very nice lib! thanks!

I am playing with vue-vega and it seems awesome!

do you plan to keep maintenance of this library?

it seems each time I use the library it shows (console.log) the spec used. is there a way to silence that?

thanks!

Experiment with provide/inject

  • Is there are any use cases to use that?

  • Is it useful in building dynamic visualizations?

  • if yes then provide example with showcase, if not provide an explanation why

Streaming data updates

Provide an access to Streaming Data

  • make our data watcher smarter to separate replace/add/remove operations
  • evolve sample with data update to streaming updates
  • link from our docs to vega-lite streaming feature docs

Provide markdown based version of docs

  • Create docs within markdown, instead of pub
  • research vue.org docs, a11 calendar (How they do samples ?)
  • need separation between Guide, API (not sure about interactive samples)

Inform public about library

  • write a medium post about my project
  • generate short links to track who would follow my links from notifications
  • send the notification to Vue, Vega, Hacker News community
  • make sure that GA is enabled on docs
  • make PR to vue awesome
  • make PR to vega tools

Parse error of templates with new lines for attibures

For example

<template>
  <vega-lite
    :data="values"
    mark="bar"
    :encoding="{
        x: {field: 'a', type: 'ordinal'},
        y: {field: 'b', type: 'quantitative'}
    }"/>
</template>

gives

Template execution failed: Error: Module build failed: Error: /projects/vue-vega/node_modules/vue-loader/lib/selector.js?type=template!/projects/vue-vega/_docs/partials/examples/VegaLiteComponentExample.vue:5:13
    3|   :data="values"
    4|   mark="bar"
  > 5|   :encoding="{
-------------------^
    6|       x: {field: 'a', type: 'ordinal'},
    7|       y: {field: 'b', type: 'quantitative'} }"/>
    8| 

Syntax Error: Unterminated string constant
    at makeError (/projects/vue-vega/node_modules/pug-error/index.js:32:13)
    at Lexer.error (/projects/vue-vega/node_modules/pug-lexer/index.js:58:15)
    at Lexer.assertExpression (/projects/vue-vega/node_modules/pug-lexer/index.js:86:12)
    at Lexer.code (/projects/vue-vega/node_modules/pug-lexer/index.js:971:28)
    at Lexer.callLexerFunction (/projects/vue-vega/node_modules/pug-lexer/index.js:1319:23)
    at Lexer.advance (/projects/vue-vega/node_modules/pug-lexer/index.js:1352:15)
    at Lexer.callLexerFunction (/projects/vue-vega/node_modules/pug-lexer/index.js:1319:23)
    at Lexer.getTokens (/projects/vue-vega/node_modules/pug-lexer/index.js:1375:12)
    at lex (/projects/vue-vega/node_modules/pug-lexer/index.js:12:42)
    at Object.lex (/projects/vue-vega/node_modules/pug/lib/index.js:99:27)
    at Function.loadString [as string] (/projects/vue-vega/node_modules/pug-load/index.js:44:24)
    at compileBody (/projects/vue-vega/node_modules/pug/lib/index.js:86:18)
    at Object.exports.compileClientWithDependenciesTracked (/projects/vue-vega/node_modules/pug/lib/index.js:291:16)
    at Object.exports.compileClient (/projects/vue-vega/node_modules/pug/lib/index.js:337:18)
    at run (/projects/vue-vega/node_modules/pug-loader/index.js:136:23)
    at Object.module.exports (/projects/vue-vega/node_modules/pug-loader/index.js:133:2)

When template is written in one line all works fine
Looks like problem with pug parser

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.