Giter Club home page Giter Club logo

binary-charts-archived's Introduction

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 available` will 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 fixed or dynamic, 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' light or 'dark'
type 'area' can be either area or candlestick, 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

binary-charts-archived's People

Contributors

borisyankov avatar qingweibinary avatar aminmarashi avatar dansallau avatar ashkanx avatar aminroosta avatar shashank-in avatar chylli-deriv avatar npmcdn-to-unpkg-bot avatar

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.