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

react-d3-shape

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-d3-shape - npm Package Compare versions

Comparing version 0.3.24 to 0.3.25

40

lib/components/blank_chart.js

@@ -11,2 +11,12 @@ "use strict";

var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactD3Core = require('react-d3-core');
var _chart = require('../chart');
var _chart2 = _interopRequireDefault(_chart);
var _straightLine = require('../utils/straightLine');

@@ -24,10 +34,2 @@

var React = require('react');
var Component = require('react').Component;
var Chart = require('../../src').Chart;
var Xgrid = require('react-d3-core').Xgrid;
var Ygrid = require('react-d3-core').Ygrid;
var Xaxis = require('react-d3-core').Xaxis;
var Yaxis = require('react-d3-core').Yaxis;
/*

@@ -50,6 +52,6 @@ Renders blank chart.

value: function renderNoDataTitle(x, y, textValue) {
return React.createElement(
return _react2.default.createElement(
'g',
null,
React.createElement(
_react2.default.createElement(
'text',

@@ -77,16 +79,16 @@ { className: 'chartNoData', x: x, y: y },

if (showXGrid) xgrid = React.createElement(Xgrid, this.props);
if (showYGrid) ygrid = React.createElement(Ygrid, this.props);
if (showXGrid) xgrid = _react2.default.createElement(_reactD3Core.Xgrid, this.props);
if (showYGrid) ygrid = _react2.default.createElement(_reactD3Core.Ygrid, this.props);
textXMargin = width / 2 - margins.right;
textYMargin = height / 2 - margins.bottom;
return React.createElement(
Chart,
return _react2.default.createElement(
_chart2.default,
_extends({ width: width, height: height }, this.props),
React.createElement(_straightLine2.default, _extends({ x1: 0 - 20, y1: 0, x2: width - margins.right, y2: 0 }, this.props)),
_react2.default.createElement(_straightLine2.default, _extends({ x1: 0 - 20, y1: 0, x2: width - margins.right, y2: 0 }, this.props)),
xgrid,
ygrid,
React.createElement(Xaxis, this.props),
React.createElement(Yaxis, this.props),
React.createElement(_straightLine2.default, _extends({ x1: 0 - 20, y1: height - margins.top - margins.bottom, x2: width - 100, y2: height - margins.top - margins.bottom }, this.props)),
_react2.default.createElement(_reactD3Core.Xaxis, this.props),
_react2.default.createElement(_reactD3Core.Yaxis, this.props),
_react2.default.createElement(_straightLine2.default, _extends({ x1: 0 - 20, y1: height - margins.top - margins.bottom, x2: width - 100, y2: height - margins.top - margins.bottom }, this.props)),
noDataTitleText ? this.renderNoDataTitle(textXMargin, textYMargin, noDataTitleText) : null

@@ -98,3 +100,3 @@ );

return BlankChart;
}(Component);
}(_react.Component);

@@ -101,0 +103,0 @@ BlankChart.defaultProps = {

@@ -11,2 +11,28 @@ "use strict";

var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactD3Core = require('react-d3-core');
var _line = require('./line');
var _line2 = _interopRequireDefault(_line);
var _chart = require('../chart');
var _chart2 = _interopRequireDefault(_chart);
var _blank_chart = require('./blank_chart');
var _blank_chart2 = _interopRequireDefault(_blank_chart);
var _area = require('./area');
var _area2 = _interopRequireDefault(_area);
var _brush = require('./brush');
var _brush2 = _interopRequireDefault(_brush);
var _rectangle = require('../utils/rectangle');

@@ -28,16 +54,2 @@

var React = require('react');
var Component = require('react').Component;
var PropTypes = require('react').PropTypes;
var Chart = require('../../src').Chart;
var Line = require('../../src').Line;
var Area = require('../../src').Area;
var Xgrid = require('react-d3-core').Xgrid;
var Ygrid = require('react-d3-core').Ygrid;
var Xaxis = require('react-d3-core').Xaxis;
var Yaxis = require('react-d3-core').Yaxis;
var Legend = require('react-d3-core').Legend;
var Brush = require('../../src').Brush;
var BlankChart = require('../../src').BlankChart;
/**

@@ -61,3 +73,3 @@ Component that renders multi-line + area chart if there is a data or else blank chart.

// if there is no data render Blank chart
if (!(this.props.data && this.props.data.length > 0)) return React.createElement(BlankChart, this.props);
if (!(this.props.data && this.props.data.length > 0)) return _react2.default.createElement(_blank_chart2.default, this.props);

@@ -89,18 +101,18 @@ var _props = this.props;

// area chart
return React.createElement(Area, { chartSeries: series, key: i });
return _react2.default.createElement(_area2.default, { chartSeries: series, key: i });
} else {
series.push(d);
// simple line chart
return React.createElement(Line, { chartSeries: series, key: i });
return _react2.default.createElement(_line2.default, { chartSeries: series, key: i });
}
});
if (showXGrid) xgrid = React.createElement(Xgrid, this.props);
if (showYGrid) ygrid = React.createElement(Ygrid, this.props);
if (showXGrid) xgrid = _react2.default.createElement(_reactD3Core.Xgrid, this.props);
if (showYGrid) ygrid = _react2.default.createElement(_reactD3Core.Ygrid, this.props);
return React.createElement(
return _react2.default.createElement(
'div',
null,
React.createElement(
Chart,
_react2.default.createElement(
_chart2.default,
_extends({}, this.props, {

@@ -112,11 +124,11 @@ width: width,

chartSeries: chartSeries }),
chartClassName ? React.createElement(_rectangle2.default, _extends({}, this.props, { styleClassName: chartClassName })) : null,
isBrushable ? React.createElement(Brush, this.props) : null,
chartClassName ? _react2.default.createElement(_rectangle2.default, _extends({}, this.props, { styleClassName: chartClassName })) : null,
isBrushable ? _react2.default.createElement(_brush2.default, this.props) : null,
chartSeriesType,
React.createElement(Xaxis, this.props),
React.createElement(Yaxis, this.props),
_react2.default.createElement(_reactD3Core.Xaxis, this.props),
_react2.default.createElement(_reactD3Core.Yaxis, this.props),
xgrid,
ygrid
),
showLegend ? React.createElement(Legend, _extends({}, this.props, {
showLegend ? _react2.default.createElement(_reactD3Core.Legend, _extends({}, this.props, {
width: width,

@@ -131,3 +143,3 @@ margins: margins,

return MultiLineBrushChart;
}(Component);
}(_react.Component);

@@ -139,8 +151,8 @@ MultiLineBrushChart.defaultProps = _extends({

MultiLineBrushChart.propTypes = {
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
margins: PropTypes.object.isRequired,
data: PropTypes.array.isRequired,
chartSeries: PropTypes.array.isRequired
width: _react.PropTypes.number.isRequired,
height: _react.PropTypes.number.isRequired,
margins: _react.PropTypes.object.isRequired,
data: _react.PropTypes.array.isRequired,
chartSeries: _react.PropTypes.array.isRequired
};
exports.default = MultiLineBrushChart;
{
"name": "react-d3-shape",
"version": "0.3.24",
"version": "0.3.25",
"description": "react shape component",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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