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

binary-charts

v9.2.7

Published

Binary trade and contract visualisation library, written in React

Downloads

55

Readme

Binary Charts

Build Status Coverage Status Code Climate

Demos

Install by running:

npm install binary-charts --save

Or by including the file via CDN and a script tag:

<script src="https://unpkg.com/[email protected]/lib/binary-charts.js"></script>

See Demos

npm install
npm start
open localhost:9001

Build

To build the project:

npm install
npm run compile

To run unit tests:

npm test

For live rebuild during development:

webpack --watch
open example/index.html

Usage

Install in your project:

npm i binary-charts --save

Render the component and pass ticks array to visualize:

<BinaryCharts ticks={ticks} />

Ticks array is in a format [{ epoch, quote }]. Like:

var ticks = [
    { epoch: 123, quote: 95.4 },
    { epoch: 124, quote: 95.3 },
    { epoch: 125, quote: 95.6 }
];

API

| Props | Default | Description | -------|---------|------------- contract | N/A | description of a bought contract, check response of https://developers.binary.com/api/#proposal_open_contract id | N/A | id of dom element noData | false | if true, indicate no data for chart, message 'Data not availablewill be shown pipSize | 0 | decimal places of data to be shown, if zero, 9.02 will be shown as 9 onRangeChange | N/A | function with signature(count, type) => void, called when user clicked one of the range selector buttons, useful when library client want to load more data when user click those buttons showAllRangeSelector | true | enable all rangeSelector button if true, disable out of range button if false, eg. If all your data is within 1 hour, the 1D button will be disabled symbol | N/A | string represent symbol of data, eg. 'R_100' shiftMode | 'fixed' | only allowed fixedordynamic, if fixed, no of data shown will be fix when new data is added, if dynamic, the scroller will expand when new data added ticks | [ ] | data for charts, can be in ticks structure or ohlc structure, check below for data shape theme | 'light' | lightor 'dark' type | 'area' | can be eitherareaorcandlestick, defines chart type onTypeChange | N/A | function with signature (type) => void`, called when user change chart type WIP trade | N/A | an object describe proposal that user might want to buy, check request of https://developers.binary.com/api/#proposal trading times | N/A | trading times of symbol, check https://developers.binary.com/api/#trading_times

Ticks data structure

TICKS:

[
    {
        epoch: number,
        quote: number
    },
    ...
]

OHLC:

[
    {
        epoch: number,
        open: number,
        high: number,
        low: number,
        close: number,
    },
    ...
]

Contract visualization

The component can optionally display the trade parameters or contract already bought.

<BinaryCharts ticks={ticks} trade={trade} />

or

<BinaryCharts ticks={ticks} contract={contract} />

Trade and contract properties have the exact format as accepted or returned by the API.

Trading Times

You can optionally provide a trading times object and the Chart will display plot lines visialising open, close and settlement times.

Dynamic data

Dynamically loading more data when needed by the chart will be available soon.

Usage outside React projects

The project is currently lightly dependent on React, but will soon be usable without it. Until then, you can integrate a React component in non-React project like this:

React components as jQuery plugins

Integrating React.js into Existing jQuery Web Applications