d3plus-common
Advanced tools
Comparing version 0.6.47 to 0.6.48
/* | ||
d3plus-common v0.6.47 | ||
d3plus-common v0.6.48 | ||
Common functions and methods used across D3plus modules. | ||
@@ -355,2 +355,3 @@ Copyright (c) 2019 D3plus - https://d3plus.org | ||
var BaseClass = function BaseClass() { | ||
this._locale = "en-US"; | ||
this._on = {}; | ||
@@ -402,2 +403,23 @@ this._uuid = uuid(); | ||
@memberof BaseClass | ||
@desc If *value* is specified, sets the locale to the specified string and returns the current class instance. This method supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). In another case, you can define an Object with a custom locale. | ||
@param {Object|String} [*value* = "en-US"] | ||
@chainable | ||
@example | ||
{ | ||
separator: "", | ||
suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"], | ||
grouping: [3], | ||
delimiters: { | ||
thousands: ",", | ||
decimal: "." | ||
}, | ||
currency: ["$", ""] | ||
} | ||
*/ | ||
BaseClass.prototype.locale = function locale (_) { | ||
return arguments.length ? (this._locale = _, this) : this._locale; | ||
}; | ||
/** | ||
@memberof BaseClass | ||
@desc Adds or removes a *listener* to each object for the specified event *typenames*. If a *listener* is not specified, returns the currently assigned listener for the specified event *typename*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior. | ||
@@ -404,0 +426,0 @@ @param {String} [*typenames*] |
/* | ||
d3plus-common v0.6.47 | ||
d3plus-common v0.6.48 | ||
Common functions and methods used across D3plus modules. | ||
@@ -7,2 +7,2 @@ Copyright (c) 2019 D3plus - https://d3plus.org | ||
*/ | ||
if(typeof Object.assign!=="function"){Object.defineProperty(Object,"assign",{value:function e(t){"use strict";if(t===null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(t);for(var r=1;r<arguments.length;r++){var i=arguments[r];if(i!==null){for(var o in i){if(Object.prototype.hasOwnProperty.call(i,o)){n[o]=i[o]}}}}return n},writable:true,configurable:true})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function e(t,n){var r=Object(this);var i=r.length>>>0;if(i===0)return false;var o=n|0;var f=Math.max(o>=0?o:i-Math.abs(o),0);function s(e,t){return e===t||typeof e==="number"&&typeof t==="number"&&isNaN(e)&&isNaN(t)}while(f<i){if(s(r[f],t)){return true}f++}return false}})}if(!String.prototype.includes){Object.defineProperty(String.prototype,"includes",{value:function(e,t){if(typeof t!=="number"){t=0}if(t+e.length>this.length){return false}else{return this.indexOf(e,t)!==-1}}})}if(!Array.prototype.find){Object.defineProperty(Array.prototype,"find",{value:function(e){if(this==null){throw new TypeError('"this" is null or not defined')}var t=Object(this);var n=t.length>>>0;if(typeof e!=="function"){throw new TypeError("predicate must be a function")}var r=arguments[1];var i=0;while(i<n){var o=t[i];if(e.call(r,o,i,t)){return o}i++}return undefined},configurable:true,writable:true})}if(!String.prototype.startsWith){Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){t=!t||t<0?0:+t;return this.substring(t,t+e.length)===e}})}if(typeof window!=="undefined"){(function(){var r=function(e,t){var n=e.nodeType;if(n===3){t.push(e.textContent.replace(/&/,"&").replace(/</,"<").replace(">",">"))}else if(n===1){t.push("<",e.tagName);if(e.hasAttributes()){[].forEach.call(e.attributes,function(e){t.push(" ",e.item.name,"='",e.item.value,"'")})}if(e.hasChildNodes()){t.push(">");[].forEach.call(e.childNodes,function(e){r(e,t)});t.push("</",e.tagName,">")}else{t.push("/>")}}else if(n==8){t.push("\x3c!--",e.nodeValue,"--\x3e")}};Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var e=[];var t=this.firstChild;while(t){r(t,e);t=t.nextSibling}return e.join("")},set:function(e){while(this.firstChild){this.removeChild(this.firstChild)}try{var t=new DOMParser;t.async=false;var n="<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+e+"</svg>";var r=t.parseFromString(n,"text/xml").documentElement;var i=r.firstChild;while(i){this.appendChild(this.ownerDocument.importNode(i,true));i=i.nextSibling}}catch(e){}}});Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}})})()}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports,require("d3-selection"),require("d3-transition"),require("d3-array"),require("d3-collection")):typeof define==="function"&&define.amd?define("d3plus-common",["exports","d3-selection","d3-transition","d3-array","d3-collection"],t):t(e.d3plus={},e.d3Selection,e.d3Transition,e.d3Array,e.d3Collection)})(this,function(e,a,u,s,t){"use strict";function n(t,n){if(n===void 0){return function(e){return e[t]}}return function(e){return e[t]===void 0?n:e[t]}}function l(e){return e&&typeof e==="object"&&(typeof window==="undefined"||e!==window&&e!==window.document&&!(e instanceof Element))&&!Array.isArray(e)?true:false}function o(e){if(typeof window==="undefined"){return true}else{return e!==window&&e!==document}}function c(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=t[0];var n=function(e){var n=t[e];Object.keys(n).forEach(function(e){var t=n[e];if(l(t)&&o(t)){if(r.hasOwnProperty(e)&&l(r[e])){r[e]=c({},r[e],t)}else{r[e]=c({},t)}}else if(Array.isArray(t)){r[e]=t.slice()}else{r[e]=t}})};for(var i=1;i<t.length;i++)n(i);return r}function d(e,t){if(t===void 0)t={};for(var n in t){if({}.hasOwnProperty.call(t,n)){e.attr(n,t[n])}}}function r(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}function i(){return""+r()+r()+"-"+r()+"-"+r()+"-"+r()+"-"+r()+r()+r()}var h="D3PLUS-COMMON-RESET";function p(e,t){if(l(e)){for(var n in e){if({}.hasOwnProperty.call(e,n)&&!n.startsWith("_")){var r=t&&l(t)?t[n]:undefined;if(e[n]===h){e[n]=r}else if(l(e[n])){p(e[n],r)}}}}}var f=function e(){this._on={};this._uuid=i()};f.prototype.config=function e(t){if(!this._configDefault){var e={};for(var n in this.__proto__){if(n.indexOf("_")!==0&&!["config","constructor","render"].includes(n)){var r=this[n]();e[n]=l(r)?c({},r):r}}this._configDefault=e}if(arguments.length){for(var i in t){if({}.hasOwnProperty.call(t,i)&&i in this){var o=t[i];if(o===h){if(i==="on"){this._on=this._configDefault[i]}else{this[i](this._configDefault[i])}}else{p(o,this._configDefault[i]);this[i](o)}}}return this}else{var f={};for(var s in this.__proto__){if(s.indexOf("_")!==0&&!["config","constructor","render"].includes(s)){f[s]=this[s]()}}return f}};f.prototype.on=function e(t,n){return arguments.length===2?(this._on[t]=n,this):arguments.length?typeof t==="string"?this._on[t]:(this._on=Object.assign({},this._on,t),this):this._on};function v(n,e){if(e===void 0)e=[];if(!e||!(e instanceof Array)||!e.length){return undefined}return e.reduce(function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e})}function y(e,r,t){var o=this;if(e===void 0)e=this._shapeConfig;if(r===void 0)r="shape";if(t===void 0)t=false;var n={duration:this._duration,on:{}};var i=function(i){return function(e,t,n){var r;while(e.__d3plus__){if(r){e.__d3plusParent__=r}r=e;t=e.i;e=e.data||e.feature}return i.bind(o)(e,t,n||r)}};var f=function(e,t){for(var n in t){if({}.hasOwnProperty.call(t,n)&&!n.includes(".")||n.includes("."+r)){e.on[n]=i(t[n])}}};var s=function(e,t){for(var n in t){if({}.hasOwnProperty.call(t,n)){if(n==="on"){f(e,t[n])}else if(typeof t[n]==="function"){e[n]=i(t[n])}else if(typeof t[n]==="object"&&!(t instanceof Array)){e[n]={on:{}};s(e[n],t[n])}else{e[n]=t[n]}}}};s(n,e);if(this._on){f(n,this._on)}if(t&&e[t]){s(n,e[t]);if(e[t].on){f(n,e[t].on)}}return n}function g(t){return function e(){return t}}function m(e,t){t=Object.assign({},{condition:true,enter:{},exit:{},parent:a.select("body"),transition:u.transition().duration(0),update:{}},t);var n=/\.([^#]+)/g.exec(e),r=/#([^\.]+)/g.exec(e),i=/^([^.^#]+)/g.exec(e)[1];var o=t.parent.selectAll(e.includes(":")?e.split(":")[1]:e).data(t.condition?[null]:[]);var f=o.enter().append(i).call(d,t.enter);if(r){f.attr("id",r[1])}if(n){f.attr("class",n[1])}o.exit().transition(t.transition).call(d,t.exit).remove();var s=f.merge(o);s.transition(t.transition).call(d,t.update);return s}function b(i,o){if(o===void 0)o={};var e=new Set(s.merge(i.map(function(e){return t.keys(e)}))),f={};e.forEach(function(t){var e=i.map(function(e){return e[t]});var n;if(o[t]){n=o[t](e)}else{var r=e.map(function(e){return e||e===false?e.constructor:e}).filter(function(e){return e!==void 0});if(!r.length){n=undefined}else if(r.indexOf(Array)>=0){n=s.merge(e.map(function(e){return e instanceof Array?e:[e]}));n=Array.from(new Set(n));if(n.length===1){n=n[0]}}else if(r.indexOf(String)>=0){n=Array.from(new Set(e));if(n.length===1){n=n[0]}}else if(r.indexOf(Number)>=0){n=s.sum(e)}else if(r.indexOf(Object)>=0){n=b(e.filter(function(e){return e}))}else{n=Array.from(new Set(e.filter(function(e){return e!==void 0})));if(n.length===1){n=n[0]}}}f[t]=n});return f}function w(e){var i;if(typeof e==="number"){i=[e]}else{i=e.split(/\s+/)}if(i.length===1){i=[i[0],i[0],i[0],i[0]]}else if(i.length===2){i=i.concat(i)}else if(i.length===3){i.push(i[1])}return["top","right","bottom","left"].reduce(function(e,t,n){var r=parseFloat(i[n]);e[t]=r||0;return e},{})}function _(){if("-webkit-transform"in document.body.style){return"-webkit-"}else if("-moz-transform"in document.body.style){return"-moz-"}else if("-ms-transform"in document.body.style){return"-ms-"}else if("-o-transform"in document.body.style){return"-o-"}else{return""}}function O(e,t){if(t===void 0)t={};for(var n in t){if({}.hasOwnProperty.call(t,n)){e.style(n,t[n])}}}e.accessor=n;e.assign=c;e.attrize=d;e.BaseClass=f;e.closest=v;e.configPrep=y;e.constant=g;e.elem=m;e.isObject=l;e.merge=b;e.parseSides=w;e.prefix=_;e.RESET=h;e.stylize=O;e.uuid=i;Object.defineProperty(e,"__esModule",{value:true})}); | ||
if(typeof Object.assign!=="function"){Object.defineProperty(Object,"assign",{value:function e(t){"use strict";if(t===null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(t);for(var r=1;r<arguments.length;r++){var i=arguments[r];if(i!==null){for(var o in i){if(Object.prototype.hasOwnProperty.call(i,o)){n[o]=i[o]}}}}return n},writable:true,configurable:true})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function e(t,n){var r=Object(this);var i=r.length>>>0;if(i===0)return false;var o=n|0;var f=Math.max(o>=0?o:i-Math.abs(o),0);function s(e,t){return e===t||typeof e==="number"&&typeof t==="number"&&isNaN(e)&&isNaN(t)}while(f<i){if(s(r[f],t)){return true}f++}return false}})}if(!String.prototype.includes){Object.defineProperty(String.prototype,"includes",{value:function(e,t){if(typeof t!=="number"){t=0}if(t+e.length>this.length){return false}else{return this.indexOf(e,t)!==-1}}})}if(!Array.prototype.find){Object.defineProperty(Array.prototype,"find",{value:function(e){if(this==null){throw new TypeError('"this" is null or not defined')}var t=Object(this);var n=t.length>>>0;if(typeof e!=="function"){throw new TypeError("predicate must be a function")}var r=arguments[1];var i=0;while(i<n){var o=t[i];if(e.call(r,o,i,t)){return o}i++}return undefined},configurable:true,writable:true})}if(!String.prototype.startsWith){Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){t=!t||t<0?0:+t;return this.substring(t,t+e.length)===e}})}if(typeof window!=="undefined"){(function(){var r=function(e,t){var n=e.nodeType;if(n===3){t.push(e.textContent.replace(/&/,"&").replace(/</,"<").replace(">",">"))}else if(n===1){t.push("<",e.tagName);if(e.hasAttributes()){[].forEach.call(e.attributes,function(e){t.push(" ",e.item.name,"='",e.item.value,"'")})}if(e.hasChildNodes()){t.push(">");[].forEach.call(e.childNodes,function(e){r(e,t)});t.push("</",e.tagName,">")}else{t.push("/>")}}else if(n==8){t.push("\x3c!--",e.nodeValue,"--\x3e")}};Object.defineProperty(SVGElement.prototype,"innerHTML",{get:function(){var e=[];var t=this.firstChild;while(t){r(t,e);t=t.nextSibling}return e.join("")},set:function(e){while(this.firstChild){this.removeChild(this.firstChild)}try{var t=new DOMParser;t.async=false;var n="<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>"+e+"</svg>";var r=t.parseFromString(n,"text/xml").documentElement;var i=r.firstChild;while(i){this.appendChild(this.ownerDocument.importNode(i,true));i=i.nextSibling}}catch(e){}}});Object.defineProperty(SVGElement.prototype,"innerSVG",{get:function(){return this.innerHTML},set:function(e){this.innerHTML=e}})})()}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports,require("d3-selection"),require("d3-transition"),require("d3-array"),require("d3-collection")):typeof define==="function"&&define.amd?define("d3plus-common",["exports","d3-selection","d3-transition","d3-array","d3-collection"],t):t(e.d3plus={},e.d3Selection,e.d3Transition,e.d3Array,e.d3Collection)})(this,function(e,a,u,s,t){"use strict";function n(t,n){if(n===void 0){return function(e){return e[t]}}return function(e){return e[t]===void 0?n:e[t]}}function l(e){return e&&typeof e==="object"&&(typeof window==="undefined"||e!==window&&e!==window.document&&!(e instanceof Element))&&!Array.isArray(e)?true:false}function o(e){if(typeof window==="undefined"){return true}else{return e!==window&&e!==document}}function c(){var t=[],e=arguments.length;while(e--)t[e]=arguments[e];var r=t[0];var n=function(e){var n=t[e];Object.keys(n).forEach(function(e){var t=n[e];if(l(t)&&o(t)){if(r.hasOwnProperty(e)&&l(r[e])){r[e]=c({},r[e],t)}else{r[e]=c({},t)}}else if(Array.isArray(t)){r[e]=t.slice()}else{r[e]=t}})};for(var i=1;i<t.length;i++)n(i);return r}function d(e,t){if(t===void 0)t={};for(var n in t){if({}.hasOwnProperty.call(t,n)){e.attr(n,t[n])}}}function r(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}function i(){return""+r()+r()+"-"+r()+"-"+r()+"-"+r()+"-"+r()+r()+r()}var h="D3PLUS-COMMON-RESET";function p(e,t){if(l(e)){for(var n in e){if({}.hasOwnProperty.call(e,n)&&!n.startsWith("_")){var r=t&&l(t)?t[n]:undefined;if(e[n]===h){e[n]=r}else if(l(e[n])){p(e[n],r)}}}}}var f=function e(){this._locale="en-US";this._on={};this._uuid=i()};f.prototype.config=function e(t){if(!this._configDefault){var e={};for(var n in this.__proto__){if(n.indexOf("_")!==0&&!["config","constructor","render"].includes(n)){var r=this[n]();e[n]=l(r)?c({},r):r}}this._configDefault=e}if(arguments.length){for(var i in t){if({}.hasOwnProperty.call(t,i)&&i in this){var o=t[i];if(o===h){if(i==="on"){this._on=this._configDefault[i]}else{this[i](this._configDefault[i])}}else{p(o,this._configDefault[i]);this[i](o)}}}return this}else{var f={};for(var s in this.__proto__){if(s.indexOf("_")!==0&&!["config","constructor","render"].includes(s)){f[s]=this[s]()}}return f}};f.prototype.locale=function e(t){return arguments.length?(this._locale=t,this):this._locale};f.prototype.on=function e(t,n){return arguments.length===2?(this._on[t]=n,this):arguments.length?typeof t==="string"?this._on[t]:(this._on=Object.assign({},this._on,t),this):this._on};function y(n,e){if(e===void 0)e=[];if(!e||!(e instanceof Array)||!e.length){return undefined}return e.reduce(function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e})}function v(e,r,t){var o=this;if(e===void 0)e=this._shapeConfig;if(r===void 0)r="shape";if(t===void 0)t=false;var n={duration:this._duration,on:{}};var i=function(i){return function(e,t,n){var r;while(e.__d3plus__){if(r){e.__d3plusParent__=r}r=e;t=e.i;e=e.data||e.feature}return i.bind(o)(e,t,n||r)}};var f=function(e,t){for(var n in t){if({}.hasOwnProperty.call(t,n)&&!n.includes(".")||n.includes("."+r)){e.on[n]=i(t[n])}}};var s=function(e,t){for(var n in t){if({}.hasOwnProperty.call(t,n)){if(n==="on"){f(e,t[n])}else if(typeof t[n]==="function"){e[n]=i(t[n])}else if(typeof t[n]==="object"&&!(t instanceof Array)){e[n]={on:{}};s(e[n],t[n])}else{e[n]=t[n]}}}};s(n,e);if(this._on){f(n,this._on)}if(t&&e[t]){s(n,e[t]);if(e[t].on){f(n,e[t].on)}}return n}function g(t){return function e(){return t}}function m(e,t){t=Object.assign({},{condition:true,enter:{},exit:{},parent:a.select("body"),transition:u.transition().duration(0),update:{}},t);var n=/\.([^#]+)/g.exec(e),r=/#([^\.]+)/g.exec(e),i=/^([^.^#]+)/g.exec(e)[1];var o=t.parent.selectAll(e.includes(":")?e.split(":")[1]:e).data(t.condition?[null]:[]);var f=o.enter().append(i).call(d,t.enter);if(r){f.attr("id",r[1])}if(n){f.attr("class",n[1])}o.exit().transition(t.transition).call(d,t.exit).remove();var s=f.merge(o);s.transition(t.transition).call(d,t.update);return s}function b(i,o){if(o===void 0)o={};var e=new Set(s.merge(i.map(function(e){return t.keys(e)}))),f={};e.forEach(function(t){var e=i.map(function(e){return e[t]});var n;if(o[t]){n=o[t](e)}else{var r=e.map(function(e){return e||e===false?e.constructor:e}).filter(function(e){return e!==void 0});if(!r.length){n=undefined}else if(r.indexOf(Array)>=0){n=s.merge(e.map(function(e){return e instanceof Array?e:[e]}));n=Array.from(new Set(n));if(n.length===1){n=n[0]}}else if(r.indexOf(String)>=0){n=Array.from(new Set(e));if(n.length===1){n=n[0]}}else if(r.indexOf(Number)>=0){n=s.sum(e)}else if(r.indexOf(Object)>=0){n=b(e.filter(function(e){return e}))}else{n=Array.from(new Set(e.filter(function(e){return e!==void 0})));if(n.length===1){n=n[0]}}}f[t]=n});return f}function w(e){var i;if(typeof e==="number"){i=[e]}else{i=e.split(/\s+/)}if(i.length===1){i=[i[0],i[0],i[0],i[0]]}else if(i.length===2){i=i.concat(i)}else if(i.length===3){i.push(i[1])}return["top","right","bottom","left"].reduce(function(e,t,n){var r=parseFloat(i[n]);e[t]=r||0;return e},{})}function _(){if("-webkit-transform"in document.body.style){return"-webkit-"}else if("-moz-transform"in document.body.style){return"-moz-"}else if("-ms-transform"in document.body.style){return"-ms-"}else if("-o-transform"in document.body.style){return"-o-"}else{return""}}function O(e,t){if(t===void 0)t={};for(var n in t){if({}.hasOwnProperty.call(t,n)){e.style(n,t[n])}}}e.accessor=n;e.assign=c;e.attrize=d;e.BaseClass=f;e.closest=y;e.configPrep=v;e.constant=g;e.elem=m;e.isObject=l;e.merge=b;e.parseSides=w;e.prefix=_;e.RESET=h;e.stylize=O;e.uuid=i;Object.defineProperty(e,"__esModule",{value:true})}); |
@@ -33,2 +33,3 @@ import assign from "./assign"; | ||
var BaseClass = function BaseClass() { | ||
this._locale = "en-US"; | ||
this._on = {}; | ||
@@ -80,2 +81,23 @@ this._uuid = uuid(); | ||
@memberof BaseClass | ||
@desc If *value* is specified, sets the locale to the specified string and returns the current class instance. This method supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). In another case, you can define an Object with a custom locale. | ||
@param {Object|String} [*value* = "en-US"] | ||
@chainable | ||
@example | ||
{ | ||
separator: "", | ||
suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"], | ||
grouping: [3], | ||
delimiters: { | ||
thousands: ",", | ||
decimal: "." | ||
}, | ||
currency: ["$", ""] | ||
} | ||
*/ | ||
BaseClass.prototype.locale = function locale (_) { | ||
return arguments.length ? (this._locale = _, this) : this._locale; | ||
}; | ||
/** | ||
@memberof BaseClass | ||
@desc Adds or removes a *listener* to each object for the specified event *typenames*. If a *listener* is not specified, returns the currently assigned listener for the specified event *typename*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior. | ||
@@ -82,0 +104,0 @@ @param {String} [*typenames*] |
{ | ||
"name": "d3plus-common", | ||
"version": "0.6.47", | ||
"version": "0.6.48", | ||
"description": "Common functions and methods used across D3plus modules.", | ||
@@ -5,0 +5,0 @@ "main": "build/d3plus-common.js", |
# d3plus-common | ||
[![NPM Release](http://img.shields.io/npm/v/d3plus-common.svg?style=flat)](https://www.npmjs.org/package/d3plus-common) [![Build Status](https://travis-ci.org/d3plus/d3plus-common.svg?branch=master)](https://travis-ci.org/d3plus/d3plus-common) [![Dependency Status](http://img.shields.io/david/d3plus/d3plus-common.svg?style=flat)](https://david-dm.org/d3plus/d3plus-common) [![Gitter](https://img.shields.io/badge/-chat_on_gitter-brightgreen.svg?style=flat&logo=gitter-white)](https://gitter.im/d3plus/) [![1.0 progress](https://img.shields.io/badge/1.0_progress-50%25-orange.svg?style=flat)](https://github.com/d3plus/d3plus-common/projects/1) | ||
[![NPM Release](http://img.shields.io/npm/v/d3plus-common.svg?style=flat)](https://www.npmjs.org/package/d3plus-common) [![Build Status](https://travis-ci.org/d3plus/d3plus-common.svg?branch=master)](https://travis-ci.org/d3plus/d3plus-common) [![Dependency Status](http://img.shields.io/david/d3plus/d3plus-common.svg?style=flat)](https://david-dm.org/d3plus/d3plus-common) [![Gitter](https://img.shields.io/badge/-chat_on_gitter-brightgreen.svg?style=flat&logo=gitter-white)](https://gitter.im/d3plus/) [![1.0 progress](https://img.shields.io/badge/1.0_progress-100%25-brightgreen.svg?style=flat)](https://github.com/d3plus/d3plus-common/projects/1) | ||
@@ -50,6 +50,7 @@ Common functions and methods used across D3plus modules. | ||
* [.config([*value*])](#BaseClass.config) ↩︎ | ||
* [.locale([*value*])](#BaseClass.locale) ↩︎ | ||
* [.on([*typenames*], [*listener*])](#BaseClass.on) ↩︎ | ||
<a name="BaseClass.config" href="#BaseClass.config">#</a> BaseClass.**config**([*value*]) [<>](https://github.com/d3plus/d3plus-common/blob/master/src/BaseClass.js#L50) | ||
<a name="BaseClass.config" href="#BaseClass.config">#</a> BaseClass.**config**([*value*]) [<>](https://github.com/d3plus/d3plus-common/blob/master/src/BaseClass.js#L51) | ||
@@ -62,4 +63,26 @@ If *value* is specified, sets the methods that correspond to the key/value pairs and returns this class. If *value* is not specified, returns the current configuration. | ||
<a name="BaseClass.on" href="#BaseClass.on">#</a> BaseClass.**on**([*typenames*], [*listener*]) [<>](https://github.com/d3plus/d3plus-common/blob/master/src/BaseClass.js#L99) | ||
<a name="BaseClass.locale" href="#BaseClass.locale">#</a> BaseClass.**locale**([*value*]) [<>](https://github.com/d3plus/d3plus-common/blob/master/src/BaseClass.js#L102) | ||
If *value* is specified, sets the locale to the specified string and returns the current class instance. This method supports the locales defined in [d3plus-format](https://github.com/d3plus/d3plus-format/blob/master/src/locale.js). In another case, you can define an Object with a custom locale. | ||
This is a static method of [<code>BaseClass</code>](#BaseClass), and is chainable with other methods of this Class. | ||
```js | ||
{ | ||
separator: "", | ||
suffixes: ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "B", "t", "q", "Q", "Z", "Y"], | ||
grouping: [3], | ||
delimiters: { | ||
thousands: ",", | ||
decimal: "." | ||
}, | ||
currency: ["$", ""] | ||
} | ||
``` | ||
<a name="BaseClass.on" href="#BaseClass.on">#</a> BaseClass.**on**([*typenames*], [*listener*]) [<>](https://github.com/d3plus/d3plus-common/blob/master/src/BaseClass.js#L121) | ||
Adds or removes a *listener* to each object for the specified event *typenames*. If a *listener* is not specified, returns the currently assigned listener for the specified event *typename*. Mirrors the core [d3-selection](https://github.com/d3/d3-selection#selection_on) behavior. | ||
@@ -329,2 +352,2 @@ | ||
###### <sub>Documentation generated on Fri, 17 May 2019 15:10:24 GMT</sub> | ||
###### <sub>Documentation generated on Fri, 31 May 2019 16:59:30 GMT</sub> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123042
1045
351