GithubHelp home page GithubHelp logo

lineupjs / vue-lineup Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 566 KB

LineUp Library for Visual Analysis of Multi-Attribute Rankings

Home Page: https://lineup.js.org

License: MIT License

JavaScript 1.71% HTML 1.68% Vue 84.77% TypeScript 11.84%
javascript typescript lineup vue vuejs vue-components visualization visualisation ranking table

vue-lineup's Introduction

LineUp.js Vue.js Wrapper

License: MIT NPM version CircleCI

LineUp is an interactive technique designed to create, visualize and explore rankings of items based on a set of heterogeneous attributes. This is a Vue.js wrapper around the JavaScript library LineUp.js. Details about the LineUp visualization technique can be found at http://lineup.caleydo.org.

Usage

Installation

npm install --save vue-lineup

Minimal Usage Example

const cats = ['c1', 'c2', 'c3'];
const data = [];
for (let i = 0; i < 100; ++i) {
  data.push({
    a: Math.random() * 10,
    d: 'Row ' + i,
    cat: cats[Math.floor(Math.random() * 3)],
    cat2: cats[Math.floor(Math.random() * 3)],
  });
}

// enable plugin to register components
Vue.use(VueLineUp);

const app = new Vue({
  el: '#app',
  template: `<LineUp v-bind:data="data" />`,
  data: {
    cats,
    data
  }
});

CodePen

Minimal Result

Advanced Usage Example

App.vue:

const app = new Vue({
  el: '#app',
  template: `<LineUp v-bind:data="data" defaultRanking="true" style="height: 800px">
    <LineUpStringColumnDesc column="d" label="Label" v-bind:width="100" />
    <LineUpCategoricalColumnDesc column="cat" v-bind:categories="cats" color="green" />
    <LineUpCategoricalColumnDesc column="cat2" v-bind:categories="cats" color="blue" />
    <LineUpNumberColumnDesc column="a" v-bind:domain="[0, 10]" color="blue" />
    <LineUpRanking groupBy="cat" sortBy="a:desc">
      <LineUpSupportColumn type="*" />
      <LineUpColumn column="*" />
    </LineUpRanking>
  </LineUp>`,
  data: {
    cats,
    data
  }
});

CodePen

Advanced Result

Supported Browsers

  • Chrome 64+ (best performance)
  • Firefox 57+
  • Edge 16+

Development Environment

Installation

git clone https://github.com/lineupjs/vue-lineup.git
cd vue-lineup
npm install
# install peer dependency
npm install --no-save vue

Build distribution packages

npm run build

Run Linting

npm run lint

Serve integrated webserver

npm start

Authors

  • Samuel Gratzl (@sgratzl)

vue-lineup's People

Contributors

dependabot[bot] avatar sgratzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue-lineup's Issues

vue cli compatible

  • Release number or git hash:
  • Web browser version and OS:

Steps to reproduce

  1. vue cli build

Observed behavior

normal render

Expected behavior

  • LineUpNumberColumnDesc cant work
    but when i use
    "dev-build": "vue-cli-service build --mode development",
    this case ๏ผŒ LineUpNumberColumnDesc can work

Uncaught TypeError: Object prototype may only be an Object or null: undefined

when i use the file in dist folder , get the error ,

import * as VueLineUp from './vue-lineup.umd.js'

vue-lineup.umd.js:982 Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at extendStatics (vue-lineup.umd.js:982)
    at __extends (vue-lineup.umd.js:986)
    at vue-lineup.umd.js:1325
    at Module.fae3 (vue-lineup.umd.js:1599)
    at __webpack_require__ (vue-lineup.umd.js:30)
    at vue-lineup.umd.js:94
    at vue-lineup.umd.js:97
    at webpackUniversalModuleDefinition (vue-lineup.umd.js:9)
    at `vue-lineup.umd.js:10`

is there anybody know why ? thx

:data prop not reactive

  • Release number or git hash: vue-lineup: 1.0.7
  • Web browser version and OS: Chrome 73.0.3683.103 64bit on macOS

Steps to reproduce

  1. render <LineUp :data="data" />
  2. change data, LineUp does not reactive update new data

The use case could be the data is fetched from backend, or changes based on user settings, so the data would change.

Observed behavior

  • No errors or warnings, just nothing happens when data changes.

Expected behavior

  • LineUp chart reactively re-renders with the new data.

I see that in LineUp.vue, in the updated() hook, it only detects if things in IBuilderAdapterProps has changed, but not data.

Maybe could add a vue watch: data to detect and act on data changes?

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.