Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@d3fc/d3fc-technical-indicator

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d3fc/d3fc-technical-indicator - npm Package Compare versions

Comparing version 8.0.1 to 8.1.0

40

build/d3fc-technical-indicator.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('@d3fc/d3fc-rebind')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', '@d3fc/d3fc-rebind'], factory) :
(global = global || self, factory(global.fc = global.fc || {}, global.d3, global.fc));
}(this, function (exports, d3Array, d3fcRebind) { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fc = global.fc || {}, global.d3, global.fc));
}(this, (function (exports, d3Array, d3fcRebind) { 'use strict';

@@ -232,15 +232,11 @@ function identity(d) {

function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}

@@ -253,6 +249,7 @@

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];

@@ -283,8 +280,25 @@ var _n = true;

function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

@@ -588,2 +602,2 @@

}));
})));

@@ -1,1 +0,1 @@

(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-array"),require("@d3fc/d3fc-rebind")):"function"==typeof define&&define.amd?define(["exports","d3-array","@d3fc/d3fc-rebind"],b):(a=a||self,b(a.fc=a.fc||{},a.d3,a.fc))})(this,function(a,b,c){'use strict';function d(a){return a}function e(){}function f(a){return"function"==typeof a?a:function(){return a}}function g(a){return"number"==typeof a&&isNaN(a)?void 0:a}function h(){var a=function(){return 10},b=e,c=d,g=function(a){return null!=a},h=function(d){var e=a.apply(this,arguments),f=d.slice(0,e).map(c);return d.map(function(a,d){return d>=e&&(f.shift(),f.push(c(a,d))),d<e-1||f.some(function(a){return!g(a)})?b(void 0,d):b(f,d)})};return h.period=function(){return arguments.length?(a=f(0>=arguments.length?void 0:arguments[0]),h):a},h.accumulator=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],h):b},h.defined=function(){return arguments.length?(g=0>=arguments.length?void 0:arguments[0],h):g},h.value=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],h):c},h}function i(){var a=2,d=h().accumulator(function(c){var d=c&&b.deviation(c),e=c&&b.mean(c);return{average:e,upper:g(e+a*d),lower:g(e-a*d)}}),e=function(a){return d(a)};return e.multiplier=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],e):a},c.rebind(e,d,"period","value"),e}function j(){var a=d,c=function(){return 9},e=function(a){var c=[];return function(d){var e;return c.length<a&&(null==d?c=[]:c.push(d)),c.length>=a&&(e=b.mean(c)),e}},h=function(b){var f,h=c.apply(this,arguments),j=2/(h+1),k=e(h);return b.map(function(b,c){var d=a(b,c);return f=void 0===f?k(d):d*j+(1-j)*f,g(f)})};return h.period=function(){return arguments.length?(c=f(0>=arguments.length?void 0:arguments[0]),h):c},h.value=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],h):a},h}function k(){var a=d,e=j().period(12),f=j().period(26),g=j().period(9),h=function(c){e.value(a),f.value(a);var d=b.zip(e(c),f(c)).map(function(a){return void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}),h=g(d);return b.zip(d,h).map(function(a){return{macd:a[0],signal:a[1],divergence:void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}})};return h.value=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],h):a},c.rebindAll(h,e,c.includeMap({period:"fastPeriod"})),c.rebindAll(h,f,c.includeMap({period:"slowPeriod"})),c.rebindAll(h,g,c.includeMap({period:"signalPeriod"})),h}function l(a,b){return o(a)||q(a,b)||s()}function m(a){return n(a)||p(a)||r()}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}}function o(a){if(Array.isArray(a))return a}function p(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}function q(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function t(){var a=h().accumulator(function(a){return a&&b.mean(a)}),d=function(b){return a(b)};return c.rebind(d,a,"period","value"),d}function u(){var a=.1,b=d,c=function(c){return c.map(function(c){var d=g(b(c)*(1-a)),e=g(b(c)*(1+a));return{lower:d,upper:e}})};return c.factor=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],c):a},c.value=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],c):b},c}function v(){var a=function(a){return a.close},e=function(a){return a.high},f=function(a){return a.low},h=j().period(13),i=function(c){return h.value(a),b.zip(c,h(c)).map(function(a){var b=g(e(a[0])-a[1]),c=g(f(a[0])-a[1]);return{bullPower:b,bearPower:c}})};return i.closeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],i):a},i.highValue=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],i):e},i.lowValue=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],i):f},c.rebind(i,h,"period"),i}a.indicatorBollingerBands=i,a.indicatorElderRay=v,a.indicatorEnvelope=u,a.indicatorExponentialMovingAverage=j,a.indicatorForceIndex=function(){var a=function(a){return a.volume},b=function(a){return a.close},d=j().period(13),e=h().period(2).defined(function(c){return null!=b(c)&&null!=a(c)}).accumulator(function(c){return c&&g((b(c[1])-b(c[0]))*a(c[1]))}),f=function(a){var b=e(a);return d(b)};return f.volumeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],f):a},f.closeValue=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],f):b},c.rebind(f,d,"period"),f},a.indicatorMacd=k,a.indicatorMovingAverage=t,a.indicatorRelativeStrengthIndex=function(){var a=h().period(14),d=function(a,b){return b+(a[a.length-1]-b)/a.length},e=function(a){var b=l(a,2),c=b[0],d=b[1];return c<d?0:c-d},f=function(a){var b=l(a,2),c=b[0],d=b[1];return c>d?0:d-c},i=function(a,c){return void 0===c?b.mean(a):d(a,c)},j=function(){var a,c,d;return function(h){if(!h)return void(void 0!==a&&(a=NaN));if(void 0===a)return void(a=h[0]);var j=b.pairs([a].concat(m(h)));c=i(j.map(e),c),d=i(j.map(f),d);var k=isNaN(a)?NaN:d/c;return g(100-100/(1+k))}},k=function(b){var c=j();return a.accumulator(c),a(b)};return c.rebind(k,a,"period","value"),k},a.indicatorStochasticOscillator=function(){var a=function(a){return a.close},e=function(a){return a.high},f=function(a){return a.low},i=h().period(5).defined(function(b){return null!=a(b)&&null!=e(b)&&null!=f(b)}).accumulator(function(c){var d=c&&b.max(c,e),h=c&&b.min(c,f),i=c&&100*(a(c[c.length-1])-h)/(d-h);return g(i)}),j=t().period(3),k=function(a){var b=i(a),c=j(b);return b.map(function(a,b){return{k:a,d:c[b]}})};return k.closeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],k):a},k.highValue=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],k):e},k.lowValue=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],k):f},c.rebindAll(k,i,c.includeMap({period:"kPeriod"})),c.rebindAll(k,j,c.includeMap({period:"dPeriod"})),k},Object.defineProperty(a,"__esModule",{value:!0})});
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("d3-array"),require("@d3fc/d3fc-rebind")):"function"==typeof define&&define.amd?define(["exports","d3-array","@d3fc/d3fc-rebind"],b):(a="undefined"==typeof globalThis?a||self:globalThis,b(a.fc=a.fc||{},a.d3,a.fc))})(this,function(a,b,c){'use strict';function d(a){return a}function e(){}function f(a){return"function"==typeof a?a:function(){return a}}function g(a){return"number"==typeof a&&isNaN(a)?void 0:a}function h(){var a=function(){return 10},b=e,c=d,g=function(a){return null!=a},h=function(d){var e=a.apply(this,arguments),f=d.slice(0,e).map(c);return d.map(function(a,d){return d>=e&&(f.shift(),f.push(c(a,d))),d<e-1||f.some(function(a){return!g(a)})?b(void 0,d):b(f,d)})};return h.period=function(){return arguments.length?(a=f(0>=arguments.length?void 0:arguments[0]),h):a},h.accumulator=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],h):b},h.defined=function(){return arguments.length?(g=0>=arguments.length?void 0:arguments[0],h):g},h.value=function(){return arguments.length?(c=0>=arguments.length?void 0:arguments[0],h):c},h}function i(){var a=2,d=h().accumulator(function(c){var d=c&&b.deviation(c),e=c&&b.mean(c);return{average:e,upper:g(e+a*d),lower:g(e-a*d)}}),e=function(a){return d(a)};return e.multiplier=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],e):a},c.rebind(e,d,"period","value"),e}function j(){var a=d,c=function(){return 9},e=function(a){var c=[];return function(d){var e;return c.length<a&&(null==d?c=[]:c.push(d)),c.length>=a&&(e=b.mean(c)),e}},h=function(b){var f,h=c.apply(this,arguments),j=2/(h+1),k=e(h);return b.map(function(b,c){var d=a(b,c);return f=void 0===f?k(d):d*j+(1-j)*f,g(f)})};return h.period=function(){return arguments.length?(c=f(0>=arguments.length?void 0:arguments[0]),h):c},h.value=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],h):a},h}function k(){var a=d,e=j().period(12),f=j().period(26),g=j().period(9),h=function(c){e.value(a),f.value(a);var d=b.zip(e(c),f(c)).map(function(a){return void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}),h=g(d);return b.zip(d,h).map(function(a){return{macd:a[0],signal:a[1],divergence:void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}})};return h.value=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],h):a},c.rebindAll(h,e,c.includeMap({period:"fastPeriod"})),c.rebindAll(h,f,c.includeMap({period:"slowPeriod"})),c.rebindAll(h,g,c.includeMap({period:"signalPeriod"})),h}function l(a,b){return o(a)||q(a,b)||r(a,b)||u()}function m(a){return n(a)||p(a)||r(a)||t()}function n(a){if(Array.isArray(a))return s(a)}function o(a){if(Array.isArray(a))return a}function p(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function q(a,b){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a)){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}}function r(a,b){if(a){if("string"==typeof a)return s(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?s(a,b):void 0}}function s(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(){var a=h().accumulator(function(a){return a&&b.mean(a)}),d=function(b){return a(b)};return c.rebind(d,a,"period","value"),d}function w(){var a=.1,b=d,c=function(c){return c.map(function(c){var d=g(b(c)*(1-a)),e=g(b(c)*(1+a));return{lower:d,upper:e}})};return c.factor=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],c):a},c.value=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],c):b},c}function x(){var a=function(a){return a.close},e=function(a){return a.high},f=function(a){return a.low},h=j().period(13),i=function(c){return h.value(a),b.zip(c,h(c)).map(function(a){var b=g(e(a[0])-a[1]),c=g(f(a[0])-a[1]);return{bullPower:b,bearPower:c}})};return i.closeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],i):a},i.highValue=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],i):e},i.lowValue=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],i):f},c.rebind(i,h,"period"),i}a.indicatorBollingerBands=i,a.indicatorElderRay=x,a.indicatorEnvelope=w,a.indicatorExponentialMovingAverage=j,a.indicatorForceIndex=function(){var a=function(a){return a.volume},b=function(a){return a.close},d=j().period(13),e=h().period(2).defined(function(c){return null!=b(c)&&null!=a(c)}).accumulator(function(c){return c&&g((b(c[1])-b(c[0]))*a(c[1]))}),f=function(a){var b=e(a);return d(b)};return f.volumeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],f):a},f.closeValue=function(){return arguments.length?(b=0>=arguments.length?void 0:arguments[0],f):b},c.rebind(f,d,"period"),f},a.indicatorMacd=k,a.indicatorMovingAverage=v,a.indicatorRelativeStrengthIndex=function(){var a=h().period(14),d=function(a,b){return b+(a[a.length-1]-b)/a.length},e=function(a){var b=l(a,2),c=b[0],d=b[1];return c<d?0:c-d},f=function(a){var b=l(a,2),c=b[0],d=b[1];return c>d?0:d-c},i=function(a,c){return void 0===c?b.mean(a):d(a,c)},j=function(){var a,c,d;return function(h){if(!h)return void(void 0!==a&&(a=NaN));if(void 0===a)return void(a=h[0]);var j=b.pairs([a].concat(m(h)));c=i(j.map(e),c),d=i(j.map(f),d);var k=isNaN(a)?NaN:d/c;return g(100-100/(1+k))}},k=function(b){var c=j();return a.accumulator(c),a(b)};return c.rebind(k,a,"period","value"),k},a.indicatorStochasticOscillator=function(){var a=function(a){return a.close},e=function(a){return a.high},f=function(a){return a.low},i=h().period(5).defined(function(b){return null!=a(b)&&null!=e(b)&&null!=f(b)}).accumulator(function(c){var d=c&&b.max(c,e),h=c&&b.min(c,f),i=c&&100*(a(c[c.length-1])-h)/(d-h);return g(i)}),j=v().period(3),k=function(a){var b=i(a),c=j(b);return b.map(function(a,b){return{k:a,d:c[b]}})};return k.closeValue=function(){return arguments.length?(a=0>=arguments.length?void 0:arguments[0],k):a},k.highValue=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],k):e},k.lowValue=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],k):f},c.rebindAll(k,i,c.includeMap({period:"kPeriod"})),c.rebindAll(k,j,c.includeMap({period:"dPeriod"})),k},Object.defineProperty(a,"__esModule",{value:!0})});

@@ -6,2 +6,13 @@ # Change Log

# 8.1.0 (2021-04-28)
### Features
* add d3fc-chart types ([#1697](https://github.com/d3fc/d3fc/issues/1697)) ([fe9289b](https://github.com/d3fc/d3fc/commit/fe9289b))
## 8.0.1 (2020-07-14)

@@ -8,0 +19,0 @@

@@ -8,3 +8,3 @@ declare namespace fc {

interface BollingerBandsDatum {
upper: number,
upper: number;
average: number;

@@ -11,0 +11,0 @@ lower: number;

{
"name": "@d3fc/d3fc-technical-indicator",
"version": "8.0.1",
"version": "8.1.0",
"description": "Components for calculating technical indicators on data series",

@@ -48,3 +48,3 @@ "license": "MIT",

},
"gitHead": "3c6890b82dbb430bafd52420c0dd506861f16f5d"
"gitHead": "6a7e7be9f026bae7a8d97fe48d7c4930d649fcb4"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc