{"id":36502298,"url":"https://github.com/rp8/candlejs","last_synced_at":"2026-01-12T02:24:17.988Z","repository":{"id":30842944,"uuid":"34400409","full_name":"rp8/candlejs","owner":"rp8","description":"Candlestick Charting for Time Series","archived":false,"fork":false,"pushed_at":"2019-03-09T14:06:36.000Z","size":361,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T16:24:46.739Z","etag":null,"topics":["candlestick","chart","js","real-time","streaming"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rp8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-22T16:00:38.000Z","updated_at":"2025-02-06T15:59:12.000Z","dependencies_parsed_at":"2022-09-15T22:20:11.614Z","dependency_job_id":null,"html_url":"https://github.com/rp8/candlejs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rp8/candlejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp8%2Fcandlejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp8%2Fcandlejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp8%2Fcandlejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp8%2Fcandlejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rp8","download_url":"https://codeload.github.com/rp8/candlejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp8%2Fcandlejs/sbom","scorecard":{"id":786098,"data":{"date":"2025-08-11","repo":{"name":"github.com/rp8/candlejs","commit":"da40d02b3a1e7a5fe542b60b36f09df0130f6eca"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"64 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-957j-59c2-j692","Warn: Project is vulnerable to: GHSA-m5pj-vjjf-4m3h","Warn: Project is vulnerable to: GHSA-j383-35pm-c5h4","Warn: Project is vulnerable to: GHSA-rm36-94g8-835r","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T06:08:12.892Z","repository_id":30842944,"created_at":"2025-08-23T06:08:12.892Z","updated_at":"2025-08-23T06:08:12.892Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["candlestick","chart","js","real-time","streaming"],"created_at":"2026-01-12T02:24:14.065Z","updated_at":"2026-01-12T02:24:17.980Z","avatar_url":"https://github.com/rp8.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![candlejs](./icon.ico) candlejs  \n\n## Candlestick Charting for Time Series  \n**candlejs** is used for charting real-time market data such as stock or future prices. It's light weight and high performance with no dependency on other packages. It's optimal for intra-day trading scenarios.\n\n[![License](https://img.shields.io/github/license/rp8/candlejs.svg)](./LICENSE.txt)\n[![npm](https://img.shields.io/npm/v/candlejs.svg)](https://www.npmjs.com/package/candlejs)\n[![npm](https://img.shields.io/npm/dt/candlejs.svg)](https://www.npmjs.com/package/candlejs)\n\n![Example](candle.png)\n\n## Installations\n### Fork \u0026 Development\n```\ngit clone https://github.com/rp8/candlejs.git\ncd candlejs\nnpm install\n```\n### Use Only\n```\nnpm install candlejs --save\n```\n\n## Dev \u0026 Test\n1. npm run build\n2. open test/candle.html in Chrome to test simple simulator \u0026 chart\n3. open test/candle.html in Chrome to test more with tick data from files and simulator\n4. npm run test\n\n## Usages\n```js\nvar cjs = require('candle');\n```\n### TickSeries - Tick time series\n```js\nvar ticks = new cjs.TickSeries('AAPL');\nticks.on('changed', () =\u003e {\n  ...\n};\nticks.add(time, price, volume);\nticks.trimOldData(1000, 10000);\nticks.clear();\nfor var tick in ticks.data {\n  ...\n}\n```\n### Bars - Bar time series of intervals such as daily, hourly, 5 min, etc\n```js\nvar dailyBars = new cjs.Bars('AAPL', 24*3600*1000);\ndailyBars.add(time, open, high, low, close, volume);\ndailyBars.addTick(tick);\ndailyBars.addTicks(ticks);\ndailyBars.on('changed', () =\u003e {\n  ...\n});\n...\ndailyBars.clear();\n```\n### Simulator - Simulating price time series\n```js\nvar s = new cjs.Simulator(0.10, 100.00, 100);\ns.onData((err, data) =\u003e {\n  ...\n});\ns.start();\ns.stop();\n```\n### CandleChart\n```js\nvar chart = new cjs.CandleChart({candleWidth: 4});\nvar bars = new cjs.Bars('AAPL', 24*3600*1000);\nchart.addSeries(bars);\nchart.outputTo(canvas);\nchart.render();\nchart.setDisplayRange(openTime, closeTime);\n...\nchart will update with the streaming data coming from bars.\n```\n### LineReader - Reading data from a local file\n```js\nvar lr = new cjs.LineReader();\nvar bars = new cjs.Bars('AAPL', 24*3600*1000);\nbars.sort(function(a, b) {\n  return a[0] - b[0];\n});\n\nvar bars0 = [];\nlr.on('end', function() {\n  for (i = 0; i \u003c bars0.length; i++) {\n    var b = bars0[i];\n    bars.add(b[0], b[1], b[2], b[3], b[4], b[5]);\n  }\n});\n\nlr.on('line', function (line, next) {\n  if (line.indexOf('Date') === -1) {\n    var bar = line.split(',');\n    bars0.push([\n      new Date(bar[0]).getTime(),\n      parseFloat(bar[1]), \n      parseFloat(bar[2]), \n      parseFloat(bar[3]), \n      parseFloat(bar[4]), \n      parseFloat(bar[5])\n    ]);\n  } \n  next();\n});\n\nlr.read($('file').files[0]);\n```\n### HTML\n```html\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cscript type=\"text/javascript\" src=\"../dist/candle.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cbutton id=\"start\"\u003eStart\u003c/button\u003e\n  \u003cbutton id=\"stop\"\u003eStop\u003c/button\u003e\n  \u003chr\u003e\n  \u003ccanvas id=\"chart\" width=\"800\" height=\"300\"\u003e\u003c/canvas\u003e\n\n  \u003cscript type=\"text/javascript\"\u003e\n    function $(name) {\n      return document.getElementById(name);\n    };\n\n    var cjs = require('candle');\n\n    var chart = new cjs.CandleChart({candleWidth: 4});\n    chart.outputTo($('chart'));\n\n    var bars = new cjs.Bars('TSL', 3600*24*1000);\n    chart.addSeries(bars);\n\n    var s = new cjs.Simulator(0.10, 99, 10);\n    var openTime;\n    s.onData((err, data) =\u003e {\n      openTime += bars.interval/20;\n      bars.addTick([openTime, data[1], data[2]]);\n      chart.render();\n    });\n\n    $('start').addEventListener('click', function() {\n      console.log('simulated price started...');\n      bars.clear();\n      openTime = new Date().getTime();\n      s.start();\n    });\n\n    $('stop').addEventListener('click', function() {\n      console.log('simulated price stopped...');\n      s.stop();\n    });\n\n  \u003c/script\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## FAQ\n\n## Issues\n\n## Changelog\n1/20/2019: \n1. added a new parameter \"fixed\" to fix number of digits, default to 2\n```js\n    var Simulator = function (vol, value, delay, fixed) {...}\n```\n2. added new method to draw horizontal lines\n```js\n    CandleChart.prototype.addYLine = function(color, text, price) {..}\n```\n## License\n*candlejs* is licensed under the [MIT License](https://opensource.org/licenses/MIT)\n© 2015-2019 [Ronggen Pan](https://github.com/rp8)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frp8%2Fcandlejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frp8%2Fcandlejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frp8%2Fcandlejs/lists"}