@data-ui/radial-chart
Advanced tools
Comparing version 0.0.69 to 0.0.70
@@ -1,1 +0,1 @@ | ||
import _extends from'babel-runtime/helpers/extends';import{Group}from'@vx/group';import PropTypes from'prop-types';import React from'react';import{WithTooltip,withTooltipPropTypes}from'@data-ui/shared';export var propTypes=_extends({},withTooltipPropTypes,{ariaLabel:PropTypes.string.isRequired,children:PropTypes.node.isRequired,width:PropTypes.number.isRequired,height:PropTypes.number.isRequired,margin:PropTypes.shape({top:PropTypes.number,right:PropTypes.number,bottom:PropTypes.number,left:PropTypes.number}),renderTooltip:PropTypes.func});var defaultProps={margin:{top:10,left:10,right:10,bottom:10},renderTooltip:null},MIN_SIZE=10;export default function RadialChart(a){var b=a.renderTooltip;if(b)return React.createElement(WithTooltip,{renderTooltip:b},React.createElement(RadialChart,_extends({},a,{renderTooltip:null})));var c=a.ariaLabel,d=a.children,e=a.width,f=a.height,g=a.margin,h=a.onMouseMove,i=a.onMouseLeave,j=_extends({},defaultProps.margin,g),k=e-j.left-j.right,l=f-j.top-j.bottom,m=Math.min(k,l)/2;return 10>k||10>l?null:React.createElement('svg',{"aria-label":c,role:'img',width:e,height:f},React.createElement(Group,{top:f/2-j.top,left:e/2+g.left},React.Children.map(d,function(a){return React.cloneElement(a,{onMouseMove:a.props.onMouseMove||h,onMouseLeave:a.props.onMouseLeave||i,radius:m})})))}RadialChart.propTypes=propTypes,RadialChart.defaultProps=defaultProps,RadialChart.displayName='RadialChart'; | ||
import"core-js/modules/es6.object.assign";function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}import{Group}from"@vx/group";import PropTypes from"prop-types";import React from"react";import{WithTooltip,withTooltipPropTypes}from"@data-ui/shared";export var propTypes=Object.assign({},withTooltipPropTypes,{ariaLabel:PropTypes.string.isRequired,children:PropTypes.node.isRequired,width:PropTypes.number.isRequired,height:PropTypes.number.isRequired,margin:PropTypes.shape({top:PropTypes.number,right:PropTypes.number,bottom:PropTypes.number,left:PropTypes.number}),renderTooltip:PropTypes.func});var defaultProps={margin:{top:10,left:10,right:10,bottom:10},renderTooltip:null},MIN_SIZE=10;export default function RadialChart(a){var b=a.renderTooltip;if(b)return React.createElement(WithTooltip,{renderTooltip:b},React.createElement(RadialChart,_extends({},a,{renderTooltip:null})));var c=a.ariaLabel,d=a.children,e=a.width,f=a.height,g=a.margin,h=a.onMouseMove,i=a.onMouseLeave,j=Object.assign({},defaultProps.margin,g),k=e-j.left-j.right,l=f-j.top-j.bottom,m=Math.min(k,l)/2;return k<MIN_SIZE||l<MIN_SIZE?null:React.createElement("svg",{"aria-label":c,role:"img",width:e,height:f},React.createElement(Group,{top:f/2-j.top,left:e/2+g.left},React.Children.map(d,function(a){return React.cloneElement(a,{onMouseMove:a.props.onMouseMove||h,onMouseLeave:a.props.onMouseLeave||i,radius:m})})))}RadialChart.propTypes=propTypes,RadialChart.defaultProps=defaultProps,RadialChart.displayName="RadialChart"; |
@@ -1,1 +0,1 @@ | ||
export{default as ArcLabel}from'./label/ArcLabel';export{default as ArcSeries}from'./series/ArcSeries';export{default as RadialChart,propTypes as radialChartPropTypes}from'./chart/RadialChart';export{singleHueScaleFactory,multiHueScaleFactory}from'./util/fillScaleFactory';export{WithTooltip,withTooltipPropTypes}from'@data-ui/shared'; | ||
export{default as ArcLabel}from"./label/ArcLabel";export{default as ArcSeries}from"./series/ArcSeries";export{default as RadialChart,propTypes as radialChartPropTypes}from"./chart/RadialChart";export{singleHueScaleFactory,multiHueScaleFactory}from"./util/fillScaleFactory";export{WithTooltip,withTooltipPropTypes}from"@data-ui/shared"; |
@@ -1,1 +0,3 @@ | ||
import _extends from'babel-runtime/helpers/extends';import _objectWithoutProperties from'babel-runtime/helpers/objectWithoutProperties';import React from'react';import PropTypes from'prop-types';import{svgLabel}from'@data-ui/theme';import additionalProps from'../util/additionalProps';var baseLabel=svgLabel.baseLabel,propTypes={x:PropTypes.number,y:PropTypes.number,paintOrder:PropTypes.string,arc:PropTypes.object,children:PropTypes.node},defaultProps={x:0,y:0,paintOrder:'stroke',arc:null,children:null};export default function ArcLabel(a){var b=a.x,c=a.y,d=a.children,e=a.arc,f=_objectWithoutProperties(a,['x','y','children','arc']);return React.createElement('text',_extends({x:b,y:c},baseLabel,additionalProps(f,e)),d)}ArcLabel.propTypes=propTypes,ArcLabel.defaultProps=defaultProps; | ||
import"core-js/modules/es6.object.assign";import"core-js/modules/web.dom.iterable";import"core-js/modules/es6.array.iterator";import"core-js/modules/es6.object.keys";function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}import React from"react";import PropTypes from"prop-types";import{svgLabel}from"@data-ui/theme";import additionalProps from"../util/additionalProps";var baseLabel=svgLabel.baseLabel,propTypes={x:PropTypes.number,y:PropTypes.number,paintOrder:PropTypes.string,// eslint-disable-next-line react/forbid-prop-types | ||
arc:PropTypes.object,// if passed, will be passed to any restprops | ||
children:PropTypes.node},defaultProps={x:0,y:0,paintOrder:"stroke",arc:null,children:null};export default function ArcLabel(a){var b=a.x,c=a.y,d=a.children,e=a.arc,f=_objectWithoutPropertiesLoose(a,["x","y","children","arc"]);return React.createElement("text",_extends({x:b,y:c},baseLabel,additionalProps(f,e)),d)}ArcLabel.propTypes=propTypes,ArcLabel.defaultProps=defaultProps; |
@@ -1,1 +0,7 @@ | ||
import _slicedToArray from'babel-runtime/helpers/slicedToArray';import _extends from'babel-runtime/helpers/extends';import _objectWithoutProperties from'babel-runtime/helpers/objectWithoutProperties';import{Arc}from'@vx/shape';import React from'react';import PropTypes from'prop-types';import ArcLabel from'../label/ArcLabel';import callOrValue from'../util/callOrValue';import{singleHueScaleFactory}from'../util/fillScaleFactory';var grayScale=singleHueScaleFactory(),propTypes={data:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string})).isRequired,pieValue:PropTypes.func.isRequired,pieSort:PropTypes.func,radius:PropTypes.number,innerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),outerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),labelRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),labelComponent:PropTypes.oneOfType([PropTypes.func,PropTypes.element]),label:PropTypes.func,stroke:PropTypes.oneOfType([PropTypes.func,PropTypes.string]),strokeWidth:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),fill:PropTypes.oneOfType([PropTypes.func,PropTypes.string]),fillOpacity:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),padAngle:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),padRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),cornerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),onMouseMove:PropTypes.func,onMouseLeave:PropTypes.func},INNER_RADIUS_FRACTION=.5,OUTER_RADIUS_FRACTION=.9,LABEL_RADIUS_FRACTION=.75,MIN_ANGLE_FOR_LABEL=.1,defaultProps={radius:300,pieSort:null,innerRadius:function innerRadius(a){return a*INNER_RADIUS_FRACTION},outerRadius:function outerRadius(a){return a*OUTER_RADIUS_FRACTION},labelRadius:function labelRadius(a){return a*LABEL_RADIUS_FRACTION},cornerRadius:3,fill:function fill(a){return a.data&&a.data.label?grayScale(a.data.label):'#dddddd'},fillOpacity:1,stroke:'#ffffff',strokeWidth:1,labelComponent:React.createElement(ArcLabel,null),label:null,padAngle:null,padRadius:null,onMouseMove:null,onMouseLeave:null};export default function ArcSeries(a){var b=a.data,c=a.radius,d=a.pieValue,e=a.pieSort,f=a.innerRadius,g=a.outerRadius,h=a.labelRadius,i=a.fill,j=a.fillOpacity,k=a.cornerRadius,l=a.padAngle,m=a.padRadius,n=a.stroke,o=a.strokeWidth,p=a.label,q=a.labelComponent,r=a.onMouseMove,s=a.onMouseLeave,t=_objectWithoutProperties(a,['data','radius','pieValue','pieSort','innerRadius','outerRadius','labelRadius','fill','fillOpacity','cornerRadius','padAngle','padRadius','stroke','strokeWidth','label','labelComponent','onMouseMove','onMouseLeave']);return React.createElement('g',null,React.createElement(Arc,_extends({data:b,pieValue:d,pieSort:e,outerRadius:callOrValue(g,c),innerRadius:callOrValue(f,c),fill:i,fillOpacity:j,stroke:n,strokeWidth:o,cornerRadius:k,padAngle:l,padRadius:m,onMouseMove:s&&function(a){return function(c){var d=Math.abs(a.startAngle-a.endAngle)/(2*Math.PI);r({event:c,data:b,datum:a.data,fraction:d})}},onMouseLeave:s&&function(){return function(){s()}}},t,{centroid:null})),p&&q&&React.createElement(Arc,{data:b,pieValue:d,pieSort:e,outerRadius:callOrValue(h,c),innerRadius:callOrValue(h,c),fill:'none',fillOpacity:0,stroke:'none',strokeWidth:0,centroid:function centroid(a,b){var c=_slicedToArray(a,2),d=c[0],e=c[1],f=p(b);return b.endAngle-b.startAngle<MIN_ANGLE_FOR_LABEL||!f?null:React.cloneElement(q,{x:d,y:e,arc:b},f)}}))}ArcSeries.propTypes=propTypes,ArcSeries.defaultProps=defaultProps,ArcSeries.displayName='ArcSeries'; | ||
import"core-js/modules/es6.object.assign";import"core-js/modules/web.dom.iterable";import"core-js/modules/es6.array.iterator";import"core-js/modules/es6.object.keys";import"core-js/modules/es6.array.fill";function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}import{Arc}from"@vx/shape";import React from"react";import PropTypes from"prop-types";import ArcLabel from"../label/ArcLabel";import callOrValue from"../util/callOrValue";import{singleHueScaleFactory}from"../util/fillScaleFactory";var grayScale=singleHueScaleFactory(),propTypes={data:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string})).isRequired,pieValue:PropTypes.func.isRequired,// (d) => pie value | ||
pieSort:PropTypes.func,radius:PropTypes.number,// likely passed by parent | ||
innerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),// (radius) => num | ||
outerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),// (radius) => num | ||
labelRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),// (radius) => num | ||
labelComponent:PropTypes.oneOfType([PropTypes.func,PropTypes.element]),label:PropTypes.func,// (arc) => node | ||
stroke:PropTypes.oneOfType([PropTypes.func,PropTypes.string]),strokeWidth:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),fill:PropTypes.oneOfType([PropTypes.func,PropTypes.string]),fillOpacity:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),padAngle:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),padRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),cornerRadius:PropTypes.oneOfType([PropTypes.func,PropTypes.number]),onMouseMove:PropTypes.func,onMouseLeave:PropTypes.func},INNER_RADIUS_FRACTION=.5,OUTER_RADIUS_FRACTION=.9,LABEL_RADIUS_FRACTION=.75,MIN_ANGLE_FOR_LABEL=.1,defaultProps={radius:300,pieSort:null,innerRadius:function b(a){return a*INNER_RADIUS_FRACTION},outerRadius:function b(a){return a*OUTER_RADIUS_FRACTION},labelRadius:function b(a){return a*LABEL_RADIUS_FRACTION},cornerRadius:3,fill:function b(a){return a.data&&a.data.label?grayScale(a.data.label):"#dddddd"},fillOpacity:1,stroke:"#ffffff",strokeWidth:1,labelComponent:React.createElement(ArcLabel,null),label:null,padAngle:null,padRadius:null,onMouseMove:null,onMouseLeave:null};export default function ArcSeries(a){var b=a.data,c=a.radius,d=a.pieValue,e=a.pieSort,f=a.innerRadius,g=a.outerRadius,h=a.labelRadius,i=a.fill,j=a.fillOpacity,k=a.cornerRadius,l=a.padAngle,m=a.padRadius,n=a.stroke,o=a.strokeWidth,p=a.label,q=a.labelComponent,r=a.onMouseMove,s=a.onMouseLeave,t=_objectWithoutPropertiesLoose(a,["data","radius","pieValue","pieSort","innerRadius","outerRadius","labelRadius","fill","fillOpacity","cornerRadius","padAngle","padRadius","stroke","strokeWidth","label","labelComponent","onMouseMove","onMouseLeave"]);return React.createElement("g",null,React.createElement(Arc,_extends({data:b,pieValue:d,pieSort:e,outerRadius:callOrValue(g,c),innerRadius:callOrValue(f,c),fill:i,fillOpacity:j,stroke:n,strokeWidth:o,cornerRadius:k,padAngle:l,padRadius:m,onMouseMove:s&&function(a){return function(c){var d=Math.abs(a.startAngle-a.endAngle)/(2*Math.PI);r({event:c,data:b,datum:a.data,fraction:d})}},onMouseLeave:s&&function(){return function(){s()}}},t,{centroid:null})),p&&q&&React.createElement(Arc,{data:b,pieValue:d,pieSort:e,outerRadius:callOrValue(h,c),innerRadius:callOrValue(h,c),fill:"none",fillOpacity:0,stroke:"none",strokeWidth:0,centroid:function f(a,b){var c=a[0],d=a[1],e=p(b);return b.endAngle-b.startAngle<MIN_ANGLE_FOR_LABEL||!e?null:React.cloneElement(q,{x:c,y:d,arc:b},e)}}))}ArcSeries.propTypes=propTypes,ArcSeries.defaultProps=defaultProps,ArcSeries.displayName="ArcSeries"; |
@@ -1,1 +0,1 @@ | ||
import _Object$keys from'babel-runtime/core-js/object/keys';import callOrValue from'./callOrValue';export default function additionalProps(a,b){return _Object$keys(a).reduce(function(c,d){return c[d]=callOrValue(a[d],b),c},{})} | ||
import"core-js/modules/web.dom.iterable";import"core-js/modules/es6.array.iterator";import"core-js/modules/es6.object.keys";/* eslint no-param-reassign: 'off' */import callOrValue from"./callOrValue";export default function additionalProps(a,b){return Object.keys(a).reduce(function(c,d){return c[d]=callOrValue(a[d],b),c},{})} |
@@ -1,1 +0,1 @@ | ||
export default function callOrValue(a,b){return'function'==typeof a?a(b):a} | ||
export default function callOrValue(a,b){return"function"==typeof a?a(b):a} |
@@ -1,1 +0,4 @@ | ||
import _toConsumableArray from'babel-runtime/helpers/toConsumableArray';import{scaleOrdinal}from'@vx/scale';import{allColors,grayColors,getPaletteForBrightness}from'@data-ui/theme';export function multiHueScaleFactory(a,b){return scaleOrdinal({range:getPaletteForBrightness(a,b)})}export function singleHueScaleFactory(a){return scaleOrdinal({range:[].concat(_toConsumableArray(allColors[a]||grayColors)).reverse()})} | ||
import{scaleOrdinal}from"@vx/scale";import{allColors,grayColors,getPaletteForBrightness}from"@data-ui/theme";// returns an ordinal scale of multi-hue colors with normalized/comparable brightness | ||
export function multiHueScaleFactory(a,b){return scaleOrdinal({range:getPaletteForBrightness(a,b)})}// returns an ordinal scale of single-hue colors with varying brightness (dark to light) | ||
// if no hue is specified or is invalid, returns grays | ||
export function singleHueScaleFactory(a){return scaleOrdinal({range:(allColors[a]||grayColors).concat().reverse()})} |
@@ -1,1 +0,1 @@ | ||
'use strict';var _extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2);Object.defineProperty(exports,'__esModule',{value:!0}),exports.propTypes=void 0;exports.default=RadialChart;var _group=require('@vx/group'),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_react=require('react'),_react2=_interopRequireDefault(_react),_shared=require('@data-ui/shared');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var propTypes=exports.propTypes=(0,_extends3.default)({},_shared.withTooltipPropTypes,{ariaLabel:_propTypes2.default.string.isRequired,children:_propTypes2.default.node.isRequired,width:_propTypes2.default.number.isRequired,height:_propTypes2.default.number.isRequired,margin:_propTypes2.default.shape({top:_propTypes2.default.number,right:_propTypes2.default.number,bottom:_propTypes2.default.number,left:_propTypes2.default.number}),renderTooltip:_propTypes2.default.func}),defaultProps={margin:{top:10,left:10,right:10,bottom:10},renderTooltip:null},MIN_SIZE=10;function RadialChart(a){var b=a.renderTooltip;if(b)return _react2.default.createElement(_shared.WithTooltip,{renderTooltip:b},_react2.default.createElement(RadialChart,(0,_extends3.default)({},a,{renderTooltip:null})));var c=a.ariaLabel,d=a.children,e=a.width,f=a.height,g=a.margin,h=a.onMouseMove,i=a.onMouseLeave,j=(0,_extends3.default)({},defaultProps.margin,g),k=e-j.left-j.right,l=f-j.top-j.bottom,m=Math.min(k,l)/2;return 10>k||10>l?null:_react2.default.createElement('svg',{"aria-label":c,role:'img',width:e,height:f},_react2.default.createElement(_group.Group,{top:f/2-j.top,left:e/2+g.left},_react2.default.Children.map(d,function(a){return _react2.default.cloneElement(a,{onMouseMove:a.props.onMouseMove||h,onMouseLeave:a.props.onMouseLeave||i,radius:m})})))}RadialChart.propTypes=propTypes,RadialChart.defaultProps=defaultProps,RadialChart.displayName='RadialChart'; | ||
"use strict";exports.__esModule=!0,exports.default=RadialChart,exports.propTypes=void 0,require("core-js/modules/es6.object.assign");var _group=require("@vx/group"),_propTypes=_interopRequireDefault(require("prop-types")),_react=_interopRequireDefault(require("react")),_shared=require("@data-ui/shared");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}var propTypes=Object.assign({},_shared.withTooltipPropTypes,{ariaLabel:_propTypes.default.string.isRequired,children:_propTypes.default.node.isRequired,width:_propTypes.default.number.isRequired,height:_propTypes.default.number.isRequired,margin:_propTypes.default.shape({top:_propTypes.default.number,right:_propTypes.default.number,bottom:_propTypes.default.number,left:_propTypes.default.number}),renderTooltip:_propTypes.default.func});exports.propTypes=propTypes;var defaultProps={margin:{top:10,left:10,right:10,bottom:10},renderTooltip:null},MIN_SIZE=10;function RadialChart(a){var b=a.renderTooltip;if(b)return _react.default.createElement(_shared.WithTooltip,{renderTooltip:b},_react.default.createElement(RadialChart,_extends({},a,{renderTooltip:null})));var c=a.ariaLabel,d=a.children,e=a.width,f=a.height,g=a.margin,h=a.onMouseMove,i=a.onMouseLeave,j=Object.assign({},defaultProps.margin,g),k=e-j.left-j.right,l=f-j.top-j.bottom,m=Math.min(k,l)/2;return k<MIN_SIZE||l<MIN_SIZE?null:_react.default.createElement("svg",{"aria-label":c,role:"img",width:e,height:f},_react.default.createElement(_group.Group,{top:f/2-j.top,left:e/2+g.left},_react.default.Children.map(d,function(a){return _react.default.cloneElement(a,{onMouseMove:a.props.onMouseMove||h,onMouseLeave:a.props.onMouseLeave||i,radius:m})})))}RadialChart.propTypes=propTypes,RadialChart.defaultProps=defaultProps,RadialChart.displayName="RadialChart"; |
@@ -1,1 +0,1 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _ArcLabel=require('./label/ArcLabel');Object.defineProperty(exports,'ArcLabel',{enumerable:!0,get:function get(){return _interopRequireDefault(_ArcLabel).default}});var _ArcSeries=require('./series/ArcSeries');Object.defineProperty(exports,'ArcSeries',{enumerable:!0,get:function get(){return _interopRequireDefault(_ArcSeries).default}});var _RadialChart=require('./chart/RadialChart');Object.defineProperty(exports,'RadialChart',{enumerable:!0,get:function get(){return _interopRequireDefault(_RadialChart).default}}),Object.defineProperty(exports,'radialChartPropTypes',{enumerable:!0,get:function get(){return _RadialChart.propTypes}});var _fillScaleFactory=require('./util/fillScaleFactory');Object.defineProperty(exports,'singleHueScaleFactory',{enumerable:!0,get:function get(){return _fillScaleFactory.singleHueScaleFactory}}),Object.defineProperty(exports,'multiHueScaleFactory',{enumerable:!0,get:function get(){return _fillScaleFactory.multiHueScaleFactory}});var _shared=require('@data-ui/shared');Object.defineProperty(exports,'WithTooltip',{enumerable:!0,get:function get(){return _shared.WithTooltip}}),Object.defineProperty(exports,'withTooltipPropTypes',{enumerable:!0,get:function get(){return _shared.withTooltipPropTypes}});function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}} | ||
"use strict";var _ArcLabel=_interopRequireDefault(require("./label/ArcLabel"));var _ArcSeries=_interopRequireDefault(require("./series/ArcSeries"));var _RadialChart=_interopRequireWildcard(require("./chart/RadialChart"));var _fillScaleFactory=require("./util/fillScaleFactory");var _shared=require("@data-ui/shared");exports.__esModule=!0,exports.withTooltipPropTypes=exports.WithTooltip=exports.multiHueScaleFactory=exports.singleHueScaleFactory=exports.radialChartPropTypes=exports.RadialChart=exports.ArcSeries=exports.ArcLabel=void 0;exports.ArcLabel=_ArcLabel.default;exports.ArcSeries=_ArcSeries.default;exports.RadialChart=_RadialChart.default,exports.radialChartPropTypes=_RadialChart.propTypes;exports.singleHueScaleFactory=_fillScaleFactory.singleHueScaleFactory,exports.multiHueScaleFactory=_fillScaleFactory.multiHueScaleFactory;exports.WithTooltip=_shared.WithTooltip,exports.withTooltipPropTypes=_shared.withTooltipPropTypes;function _interopRequireWildcard(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}return b.default=a,b}function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}} |
@@ -1,1 +0,3 @@ | ||
'use strict';var _extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2),_objectWithoutProperties2=require('babel-runtime/helpers/objectWithoutProperties'),_objectWithoutProperties3=_interopRequireDefault(_objectWithoutProperties2);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=ArcLabel;var _react=require('react'),_react2=_interopRequireDefault(_react),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_theme=require('@data-ui/theme'),_additionalProps=require('../util/additionalProps'),_additionalProps2=_interopRequireDefault(_additionalProps);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var baseLabel=_theme.svgLabel.baseLabel,propTypes={x:_propTypes2.default.number,y:_propTypes2.default.number,paintOrder:_propTypes2.default.string,arc:_propTypes2.default.object,children:_propTypes2.default.node},defaultProps={x:0,y:0,paintOrder:'stroke',arc:null,children:null};function ArcLabel(a){var b=a.x,c=a.y,d=a.children,e=a.arc,f=(0,_objectWithoutProperties3.default)(a,['x','y','children','arc']);return _react2.default.createElement('text',(0,_extends3.default)({x:b,y:c},baseLabel,(0,_additionalProps2.default)(f,e)),d)}ArcLabel.propTypes=propTypes,ArcLabel.defaultProps=defaultProps; | ||
"use strict";exports.__esModule=!0,exports.default=ArcLabel,require("core-js/modules/es6.object.assign"),require("core-js/modules/web.dom.iterable"),require("core-js/modules/es6.array.iterator"),require("core-js/modules/es6.object.keys");var _react=_interopRequireDefault(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_theme=require("@data-ui/theme"),_additionalProps=_interopRequireDefault(require("../util/additionalProps"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}var baseLabel=_theme.svgLabel.baseLabel,propTypes={x:_propTypes.default.number,y:_propTypes.default.number,paintOrder:_propTypes.default.string,// eslint-disable-next-line react/forbid-prop-types | ||
arc:_propTypes.default.object,// if passed, will be passed to any restprops | ||
children:_propTypes.default.node},defaultProps={x:0,y:0,paintOrder:"stroke",arc:null,children:null};function ArcLabel(a){var b=a.x,c=a.y,d=a.children,e=a.arc,f=_objectWithoutPropertiesLoose(a,["x","y","children","arc"]);return _react.default.createElement("text",_extends({x:b,y:c},baseLabel,(0,_additionalProps.default)(f,e)),d)}ArcLabel.propTypes=propTypes,ArcLabel.defaultProps=defaultProps; |
@@ -1,1 +0,7 @@ | ||
'use strict';var _slicedToArray2=require('babel-runtime/helpers/slicedToArray'),_slicedToArray3=_interopRequireDefault(_slicedToArray2),_extends2=require('babel-runtime/helpers/extends'),_extends3=_interopRequireDefault(_extends2),_objectWithoutProperties2=require('babel-runtime/helpers/objectWithoutProperties'),_objectWithoutProperties3=_interopRequireDefault(_objectWithoutProperties2);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=ArcSeries;var _shape=require('@vx/shape'),_react=require('react'),_react2=_interopRequireDefault(_react),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_ArcLabel=require('../label/ArcLabel'),_ArcLabel2=_interopRequireDefault(_ArcLabel),_callOrValue=require('../util/callOrValue'),_callOrValue2=_interopRequireDefault(_callOrValue),_fillScaleFactory=require('../util/fillScaleFactory');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var grayScale=(0,_fillScaleFactory.singleHueScaleFactory)(),propTypes={data:_propTypes2.default.arrayOf(_propTypes2.default.shape({label:_propTypes2.default.string})).isRequired,pieValue:_propTypes2.default.func.isRequired,pieSort:_propTypes2.default.func,radius:_propTypes2.default.number,innerRadius:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),outerRadius:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),labelRadius:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),labelComponent:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.element]),label:_propTypes2.default.func,stroke:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.string]),strokeWidth:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),fill:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.string]),fillOpacity:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),padAngle:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),padRadius:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),cornerRadius:_propTypes2.default.oneOfType([_propTypes2.default.func,_propTypes2.default.number]),onMouseMove:_propTypes2.default.func,onMouseLeave:_propTypes2.default.func},INNER_RADIUS_FRACTION=.5,OUTER_RADIUS_FRACTION=.9,LABEL_RADIUS_FRACTION=.75,MIN_ANGLE_FOR_LABEL=.1,defaultProps={radius:300,pieSort:null,innerRadius:function innerRadius(a){return a*INNER_RADIUS_FRACTION},outerRadius:function outerRadius(a){return a*OUTER_RADIUS_FRACTION},labelRadius:function labelRadius(a){return a*LABEL_RADIUS_FRACTION},cornerRadius:3,fill:function fill(a){return a.data&&a.data.label?grayScale(a.data.label):'#dddddd'},fillOpacity:1,stroke:'#ffffff',strokeWidth:1,labelComponent:_react2.default.createElement(_ArcLabel2.default,null),label:null,padAngle:null,padRadius:null,onMouseMove:null,onMouseLeave:null};function ArcSeries(a){var b=a.data,c=a.radius,d=a.pieValue,e=a.pieSort,f=a.innerRadius,g=a.outerRadius,h=a.labelRadius,i=a.fill,j=a.fillOpacity,k=a.cornerRadius,l=a.padAngle,m=a.padRadius,n=a.stroke,o=a.strokeWidth,p=a.label,q=a.labelComponent,r=a.onMouseMove,s=a.onMouseLeave,t=(0,_objectWithoutProperties3.default)(a,['data','radius','pieValue','pieSort','innerRadius','outerRadius','labelRadius','fill','fillOpacity','cornerRadius','padAngle','padRadius','stroke','strokeWidth','label','labelComponent','onMouseMove','onMouseLeave']);return _react2.default.createElement('g',null,_react2.default.createElement(_shape.Arc,(0,_extends3.default)({data:b,pieValue:d,pieSort:e,outerRadius:(0,_callOrValue2.default)(g,c),innerRadius:(0,_callOrValue2.default)(f,c),fill:i,fillOpacity:j,stroke:n,strokeWidth:o,cornerRadius:k,padAngle:l,padRadius:m,onMouseMove:s&&function(a){return function(c){var d=Math.abs(a.startAngle-a.endAngle)/(2*Math.PI);r({event:c,data:b,datum:a.data,fraction:d})}},onMouseLeave:s&&function(){return function(){s()}}},t,{centroid:null})),p&&q&&_react2.default.createElement(_shape.Arc,{data:b,pieValue:d,pieSort:e,outerRadius:(0,_callOrValue2.default)(h,c),innerRadius:(0,_callOrValue2.default)(h,c),fill:'none',fillOpacity:0,stroke:'none',strokeWidth:0,centroid:function centroid(a,b){var c=(0,_slicedToArray3.default)(a,2),d=c[0],e=c[1],f=p(b);return b.endAngle-b.startAngle<MIN_ANGLE_FOR_LABEL||!f?null:_react2.default.cloneElement(q,{x:d,y:e,arc:b},f)}}))}ArcSeries.propTypes=propTypes,ArcSeries.defaultProps=defaultProps,ArcSeries.displayName='ArcSeries'; | ||
"use strict";exports.__esModule=!0,exports.default=ArcSeries,require("core-js/modules/es6.object.assign"),require("core-js/modules/web.dom.iterable"),require("core-js/modules/es6.array.iterator"),require("core-js/modules/es6.object.keys"),require("core-js/modules/es6.array.fill");var _shape=require("@vx/shape"),_react=_interopRequireDefault(require("react")),_propTypes=_interopRequireDefault(require("prop-types")),_ArcLabel=_interopRequireDefault(require("../label/ArcLabel")),_callOrValue=_interopRequireDefault(require("../util/callOrValue")),_fillScaleFactory=require("../util/fillScaleFactory");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _extends(){return _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],0<=b.indexOf(c)||(e[c]=a[c]);return e}var grayScale=(0,_fillScaleFactory.singleHueScaleFactory)(),propTypes={data:_propTypes.default.arrayOf(_propTypes.default.shape({label:_propTypes.default.string})).isRequired,pieValue:_propTypes.default.func.isRequired,// (d) => pie value | ||
pieSort:_propTypes.default.func,radius:_propTypes.default.number,// likely passed by parent | ||
innerRadius:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),// (radius) => num | ||
outerRadius:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),// (radius) => num | ||
labelRadius:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),// (radius) => num | ||
labelComponent:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.element]),label:_propTypes.default.func,// (arc) => node | ||
stroke:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.string]),strokeWidth:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),fill:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.string]),fillOpacity:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),padAngle:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),padRadius:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),cornerRadius:_propTypes.default.oneOfType([_propTypes.default.func,_propTypes.default.number]),onMouseMove:_propTypes.default.func,onMouseLeave:_propTypes.default.func},INNER_RADIUS_FRACTION=.5,OUTER_RADIUS_FRACTION=.9,LABEL_RADIUS_FRACTION=.75,MIN_ANGLE_FOR_LABEL=.1,defaultProps={radius:300,pieSort:null,innerRadius:function b(a){return a*INNER_RADIUS_FRACTION},outerRadius:function b(a){return a*OUTER_RADIUS_FRACTION},labelRadius:function b(a){return a*LABEL_RADIUS_FRACTION},cornerRadius:3,fill:function b(a){return a.data&&a.data.label?grayScale(a.data.label):"#dddddd"},fillOpacity:1,stroke:"#ffffff",strokeWidth:1,labelComponent:_react.default.createElement(_ArcLabel.default,null),label:null,padAngle:null,padRadius:null,onMouseMove:null,onMouseLeave:null};function ArcSeries(a){var b=a.data,c=a.radius,d=a.pieValue,e=a.pieSort,f=a.innerRadius,g=a.outerRadius,h=a.labelRadius,i=a.fill,j=a.fillOpacity,k=a.cornerRadius,l=a.padAngle,m=a.padRadius,n=a.stroke,o=a.strokeWidth,p=a.label,q=a.labelComponent,r=a.onMouseMove,s=a.onMouseLeave,t=_objectWithoutPropertiesLoose(a,["data","radius","pieValue","pieSort","innerRadius","outerRadius","labelRadius","fill","fillOpacity","cornerRadius","padAngle","padRadius","stroke","strokeWidth","label","labelComponent","onMouseMove","onMouseLeave"]);return _react.default.createElement("g",null,_react.default.createElement(_shape.Arc,_extends({data:b,pieValue:d,pieSort:e,outerRadius:(0,_callOrValue.default)(g,c),innerRadius:(0,_callOrValue.default)(f,c),fill:i,fillOpacity:j,stroke:n,strokeWidth:o,cornerRadius:k,padAngle:l,padRadius:m,onMouseMove:s&&function(a){return function(c){var d=Math.abs(a.startAngle-a.endAngle)/(2*Math.PI);r({event:c,data:b,datum:a.data,fraction:d})}},onMouseLeave:s&&function(){return function(){s()}}},t,{centroid:null})),p&&q&&_react.default.createElement(_shape.Arc,{data:b,pieValue:d,pieSort:e,outerRadius:(0,_callOrValue.default)(h,c),innerRadius:(0,_callOrValue.default)(h,c),fill:"none",fillOpacity:0,stroke:"none",strokeWidth:0,centroid:function f(a,b){var c=a[0],d=a[1],e=p(b);return b.endAngle-b.startAngle<MIN_ANGLE_FOR_LABEL||!e?null:_react.default.cloneElement(q,{x:c,y:d,arc:b},e)}}))}ArcSeries.propTypes=propTypes,ArcSeries.defaultProps=defaultProps,ArcSeries.displayName="ArcSeries"; |
@@ -1,1 +0,1 @@ | ||
'use strict';var _keys=require('babel-runtime/core-js/object/keys'),_keys2=_interopRequireDefault(_keys);Object.defineProperty(exports,'__esModule',{value:!0});exports.default=additionalProps;var _callOrValue=require('./callOrValue'),_callOrValue2=_interopRequireDefault(_callOrValue);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function additionalProps(a,b){return(0,_keys2.default)(a).reduce(function(c,d){return c[d]=(0,_callOrValue2.default)(a[d],b),c},{})} | ||
"use strict";var _callOrValue=_interopRequireDefault(require("./callOrValue"));exports.__esModule=!0,exports.default=additionalProps,require("core-js/modules/web.dom.iterable"),require("core-js/modules/es6.array.iterator"),require("core-js/modules/es6.object.keys");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/* eslint no-param-reassign: 'off' */function additionalProps(a,b){return Object.keys(a).reduce(function(c,d){return c[d]=(0,_callOrValue.default)(a[d],b),c},{})} |
@@ -1,1 +0,1 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.default=callOrValue;function callOrValue(a,b){return'function'==typeof a?a(b):a} | ||
"use strict";exports.__esModule=!0,exports.default=callOrValue;function callOrValue(a,b){return"function"==typeof a?a(b):a} |
@@ -1,1 +0,4 @@ | ||
'use strict';var _toConsumableArray2=require('babel-runtime/helpers/toConsumableArray'),_toConsumableArray3=_interopRequireDefault(_toConsumableArray2);Object.defineProperty(exports,'__esModule',{value:!0});exports.multiHueScaleFactory=multiHueScaleFactory,exports.singleHueScaleFactory=singleHueScaleFactory;var _scale=require('@vx/scale'),_theme=require('@data-ui/theme');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function multiHueScaleFactory(a,b){return(0,_scale.scaleOrdinal)({range:(0,_theme.getPaletteForBrightness)(a,b)})}function singleHueScaleFactory(a){return(0,_scale.scaleOrdinal)({range:[].concat((0,_toConsumableArray3.default)(_theme.allColors[a]||_theme.grayColors)).reverse()})} | ||
"use strict";exports.__esModule=!0,exports.multiHueScaleFactory=multiHueScaleFactory,exports.singleHueScaleFactory=singleHueScaleFactory;var _scale=require("@vx/scale"),_theme=require("@data-ui/theme");// returns an ordinal scale of multi-hue colors with normalized/comparable brightness | ||
function multiHueScaleFactory(a,b){return(0,_scale.scaleOrdinal)({range:(0,_theme.getPaletteForBrightness)(a,b)})}// returns an ordinal scale of single-hue colors with varying brightness (dark to light) | ||
// if no hue is specified or is invalid, returns grays | ||
function singleHueScaleFactory(a){return(0,_scale.scaleOrdinal)({range:(_theme.allColors[a]||_theme.grayColors).concat().reverse()})} |
{ | ||
"name": "@data-ui/radial-chart", | ||
"version": "0.0.69", | ||
"version": "0.0.70", | ||
"description": "A package for radial-axis visualizations https://williaster.github.io/data-ui", | ||
@@ -15,10 +15,9 @@ "sideEffects": false, | ||
"build:esm": "beemo babel ./src --out-dir esm/ --react --esm --minify", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build": "yarn run build:cjs && yarn run build:esm", | ||
"jest": "beemo jest --react --color --coverage", | ||
"eslint": "beemo eslint \"./{src,test}/**/*.{js,jsx,json,md}\"", | ||
"lint": "npm run prettier && npm run eslint", | ||
"test": "npm run jest", | ||
"eslint": "beemo eslint \"./{src,test}/**/*.{js,jsx,json,md}\" --fix", | ||
"lint": "beemo create-config prettier && yarn run eslint", | ||
"test": "yarn run jest", | ||
"prettier": "beemo prettier \"./{src,test}/**/*.{js,jsx,json,md}\"", | ||
"sync:gitignore": "beemo sync-dotfiles --filter=gitignore", | ||
"prepublish": "npm run build" | ||
"prepublish": "yarn run build" | ||
}, | ||
@@ -37,4 +36,5 @@ "repository": "https://github.com/williaster/data-ui", | ||
"dependencies": { | ||
"@data-ui/shared": "^0.0.69", | ||
"@data-ui/theme": "^0.0.69", | ||
"@babel/runtime": "^7.1.2", | ||
"@data-ui/shared": "^0.0.70", | ||
"@data-ui/theme": "^0.0.70", | ||
"@vx/event": "0.0.140", | ||
@@ -45,7 +45,6 @@ "@vx/group": "0.0.140", | ||
"@vx/tooltip": "0.0.140", | ||
"babel-runtime": "^6.26.0", | ||
"prop-types": "^15.5.10" | ||
}, | ||
"devDependencies": { | ||
"@data-ui/build-config": "^0.0.12", | ||
"@data-ui/build-config": "^0.0.28", | ||
"react": "^16.0.0", | ||
@@ -70,4 +69,10 @@ "react-dom": "^16.0.0" | ||
} | ||
}, | ||
"jest": { | ||
"transform": { | ||
"^.+\\.jsx?$": "<rootDir>/node_modules/babel-jest" | ||
} | ||
} | ||
} | ||
}, | ||
"gitHead": "6f695e4c314cd0dfddc096eb7844f1228f5bf159" | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances 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
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
28696
17
38
7
0
+ Added@babel/runtime@^7.1.2
+ Added@babel/runtime@7.26.0(transitive)
+ Added@data-ui/shared@0.0.70(transitive)
+ Added@data-ui/theme@0.0.70(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
- Removedbabel-runtime@^6.26.0
- Removed@data-ui/shared@0.0.69(transitive)
- Removed@data-ui/theme@0.0.69(transitive)
Updated@data-ui/shared@^0.0.70
Updated@data-ui/theme@^0.0.70