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-depth-chart

v0.2.7

Published

Configurable Depth Chart component based on Vue

Downloads

80

Readme

Vue-Depth-Chart

image

Configurable Depth Chart component based on Vue

English | 简体中文 | Article

  • 日间模式

image

  • 夜间模式

image

Installation

You can install and save an entry to your package.json with the following command:

npm i vue - depth - chart

Usage

Globally reference `vue-depth-chart` ` ` in ` ` `main.js`, you can use it directly in any component (note that the corresponding css should be introduced in the component)

  • main.js
import Vue from 'vue'
import App from './App.vue'

import "vue-depth-chart"

Vue.config.productionTip = false

new Vue({
    render: h => h(App),
}).$mount('#app')
  • App.vue
<template>
  <div id="app">
    <vue-depth-chart :data="data" :customizeOptions="options" :theme="theme" />
  </div>
</template>

<script>

export default {
  name: "App",
  data() {
    return {
      options: {
        width: 780,
        height: 540,
      },
      theme: "day",
      data: {
        buy: [
          { price: 10977.76, amount: 0.303 },
          { price: 10977.63, amount: 0.462 },
          ...more items
        ],
        sell: [
          { price: 10986, amount: 52.896 },
          { price: 10985.91, amount: 48.57 },
          ...more items
        ],
      },
    };
  },
};
</script>
<style scoped>
@import "~vue-depth-chart/dist/vue-depth-chart.css";
</style>

Config Options

  • Basic configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | width | Viewable width of depth map | `780` ` ` | ` ` `780` | | height | Visual height of depth map | `540` ` ` | ` ` `540` | | initOffset | Initial offset, to solve line blur | `0.5` ` ` | ` ` `0.5` | | bgColor | Overall background color | `rgba(255,255,255,0.1)` ` ` | ` ` `rgba(0,0,0,0.9)` |

  • Watermark configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | watermaskType | Watermark type, optional `text` ` `(text) ` ` `image` ` `(picture) | ` ` `image` ` ` | ` ` `image` | | watermaskContent | Watermark content, when `watermaskType` ` `=` ` `text` ` `, it should be a specific text string, when ` ` `watermaskType` ` `=` ` `image` ` `, it should be Is the corresponding image base64 string | ` ` `data:image/png;base64,..` ` ` | ` ` `data:image/png;base64,..` |

  • Line configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | gridLineColor | Grid line color | `#ddd` ` ` | ` ` `#333` | | rulerLineColor | Ruler line color color | `#999` ` ` | ` ` `rgb(47,47,47)` |

  • Shaft configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | xAxisGridSpace | x-axis background grid spacing | `90` ` ` | ` ` `90` | | yAxisGridSpace | y-axis background grid spacing | `30` ` ` | ` ` `30` | | xAxisFontColor | x-axis ruler scale font color | `#666` ` ` | ` ` `#999` | | yAxisFontColor | y-axis ruler scale font color | `#666` ` ` | ` ` `#999` | | xAxisFontSize | x-axis ruler scale font size | `12px Aria` ` ` | ` ` `12px Aria` | | yAxisFontSize | y-axis ruler scale font size | `12px` ` ` | ` ` `12px Aria` | | yAxisShadowColor | y-axis ruler scale shadow color | `#fff` ` ` | ` ` `#333` |

  • Pitch configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | bottomSpace | The distance between the depth map and the y-axis | `8` ` ` | ` ` `8` | | buySellSpace | End-point spacing of buy and sell orders | `10` ` ` | ` ` `10` |

  • Basic configuration of prompt box

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | tipWidth | Tip width | `120` ` ` | ` ` `120` | | tipHeight | Tip height | `60` ` ` | ` ` `60` | | tipLocationLineColor | Tip Location Line Color | `#999` ` ` | ` ` `#999` | | tipLocationDotRadius | Tip Location Dot Radius | `5` ` ` | ` ` `5` | | tipType | The type of the tip type of the mouse movement, `axis` ` ` (on the xy axis) ` ` `mouse` ` ` (absolute positioning display following the mouse position) | ` ` `mouse` ` ` | ` ` `mouse` |

  • Prompt box (sale) configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | tipBuyLocationDotBgColor | The background color of the dots of the pay prompt box | `#fff` ` ` | ` ` `#fff` | | tipBuyBorderColor | Border color of the tipBuy box | `#67c23a` ` ` | ` ` `#67c23a` | | tipBuyBgColor | Background color of the prompt box to pay | `#f0f9eb` ` ` | ` ` `#f0f9eb` | | tipBuyTextColor | Prompt text color of the buy order prompt box | `#67c23a` ` ` | ` ` `#67c23a` | | tipSellLocationDotBgColor | Dot background color of the sell order prompt box | `#fff` ` ` | ` ` `#fff` | | tipSellBorderColor | Border color of the sell order tip box | `#f56c6c` ` ` | ` ` `#f56c6c` | | tipSellBgColor | Sell order prompt box background color | `#fef0f0` ` ` | ` ` `#fef0f0` | | tipSellTextColor | Tips text color of the sell order prompt box | `#f56c6c` ` ` | ` ` `#f56c6c` |

  • Buy and sell strokes and fill configuration

| Options | Description | Day mode | Night mode | | :------| :------: | :------: | :------: | | buyStrokeColor | Buy Stroke Color | `rgb(111,168,0)` ` ` | ` ` `rgb(111,168,0)` | | sellStrokeColor | Sell Stroke Color | `rgb(234,0,112)` ` ` | ` ` `rgb(234,0,112)` | | buyLinearGradientArray | buy order fill gradient array (top to bottom) | `["rgb(141,186,51)", "rgb(160,197,87)", "rgb(189,215,138)", "rgb(228,238,206)", " rgb(250,250,241)"]` ` ` | ` ` `["rgb(80,120,3)", "rgb(72,106,4)", "rgb(51,74,5)", "rgb(35,49, 7)", "rgb(20,25,8)"]` | | sellLinearGradientArray | Sell order fill gradient array (top to bottom) | `["rgb(255,148,152)", "rgb(255,164,172)", "rgb(255,192,197)", "rgb(255,228,230)", "rgb(255,249,249) "]` ` ` | ` ` `["rgb(217,45,127)", "rgb(172,37,101)", "rgb(115,27,68)", "rgb(64,19,39)", "rgb(26,13,18)"]` |