npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-charting

v1.0.4

Published

Vue component for showing trading view chart with custom DataFeed

Downloads

15

Readme

vue-charting

GitHub license

VueJS component for rendering the TradingView Chart Widget with custom data feed.

What is Charting Library

Charting Library is a standalone solution for displaying charts. This free, downloadable library is hosted on your servers and is connected to your data feed to be used in your website or app. Learn more and download.

Install

yarn add vue-charting or npm install --save vue-charting

Usage

Basic example

<template>
  <div class="hello">
    <VueCharting :options="options" />
  </div>
</template>

<script>
import VueCharting from 'vue-charting';
import Datafeed from './datafeed';

export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  components: {
    VueCharting,
  },
  data() {
    return {
      options: {
        datafeed: Datafeed,
        library_path: '/charting_library/'
      }
    };
  },
}
</script>
import default_data from './default_data';
const supportedResolutions = ["1", "3", "5", "15", "30", "60", "120", "240", "D"]

const config = {
    supported_resolutions: supportedResolutions
}; 

export default {
  onReady: cb => {
  console.log('=====onReady running') 
    setTimeout(() => cb(config), 0)
    
  },
  searchSymbols: (userInput, exchange, symbolType, onResultReadyCallback) => {
    console.log('====Search Symbols running')
  },
  resolveSymbol: (symbolName, onSymbolResolvedCallback, onResolveErrorCallback) => {
    // expects a symbolInfo object in response
    console.log('======resolveSymbol running')
    // console.log('resolveSymbol:',{symbolName})
    var split_data = symbolName.split(/[:/]/)
    // console.log({split_data})
    var symbol_stub = {
      name: symbolName,
      description: '',
      type: 'crypto',
      session: '24x7',
      timezone: 'Etc/UTC',
      ticker: symbolName,
      exchange: split_data[0],
      minmov: 1,
      pricescale: 100000000,
      has_intraday: true,
      intraday_multipliers: ['1', '60'],
      supported_resolution:  supportedResolutions,
      volume_precision: 8,
      data_status: 'streaming',
    }
    setTimeout(function() {
      onSymbolResolvedCallback(symbol_stub)
      console.log('Resolving that symbol....', symbol_stub)
    }, 0)
    
    
    // onResolveErrorCallback('Not feeling it today')

  },
  getBars: function(symbolInfo, resolution, from, to, onHistoryCallback, onErrorCallback, firstDataRequest) {
    console.log('=====getBars running')

    onHistoryCallback(default_data, {noData: false})
    onHistoryCallback([], {noData: true})
  },
  subscribeBars: (symbolInfo, resolution, onRealtimeCallback, subscribeUID, onResetCacheNeededCallback) => {
    console.log('=====subscribeBars runnning')
  },
  unsubscribeBars: subscriberUID => {
    console.log('=====unsubscribeBars running')
  },
  calculateHistoryDepth: (resolution, resolutionBack, intervalBack) => {
    //optional
    console.log('=====calculateHistoryDepth running',resolution, resolution < 60 ? {resolutionBack: 'D', intervalBack: '1'} : undefined)
    // while optional, this makes sure we request 24 hours of minute data at a time
    // CryptoCompare's minute data endpoint will throw an error if we request data beyond 7 days in the past, and return no data
    return resolution < 60 ? {resolutionBack: 'D', intervalBack: '1'} : undefined
  },
  getMarks: (symbolInfo, startDate, endDate, onDataCallback, resolution) => {
    //optional
    console.log('=====getMarks running')
  },
  getTimeScaleMarks: (symbolInfo, startDate, endDate, onDataCallback, resolution) => {
    //optional
    console.log('=====getTimeScaleMarks running')
  },
  getServerTime: cb => {
    console.log('=====getServerTime running')
  }
}
export default [
  {
    "time": 1533478500000,
    "low": 6966,
    "high": 6966.02,
    "open": 6966,
    "close": 6966.01,
    "volume": 3.56
  },
  {
    "time": 1533478560000,
    "low": 6965,
    "high": 6966.01,
    "open": 6966.01,
    "close": 6965,
    "volume": 2.7
  },
  {
    "time": 1533478620000,
    "low": 6950,
    "high": 6965,
    "open": 6965,
    "close": 6950,
    "volume": 3.78
  },
];