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

@devexpress/dx-react-chart

Package Overview
Dependencies
Maintainers
13
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devexpress/dx-react-chart - npm Package Compare versions

Comparing version 1.8.0-beta.1 to 1.8.0

136

dist/dx-react-chart.d.ts

@@ -32,2 +32,4 @@ import * as React from 'react';

stack?: string;
/** A series color. */
color?: string;
/** A component that renders the series. */

@@ -110,3 +112,3 @@ seriesComponent: React.ComponentType<AreaSeries.SeriesProps>;

/** A function that returns a tick formatter function. */
tickForamt?: (scale: object) => (tick: string) => string;
tickFormat?: (scale: ScaleObject) => (tick: string) => string;
/** A component that renders the axis's root layout. */

@@ -126,2 +128,30 @@ rootComponent: React.ComponentType<ArgumentAxis.RootProps>;

// -------------------------------------------------------------------------------------------------
// ArgumentGrid
// -------------------------------------------------------------------------------------------------
export namespace ArgumentGrid {
/** Describes properties passed to a component that renders a grid line. */
export interface LineProps {
/** The line start's x coordinate. */
x1: number;
/** The line end's x coordinate. */
x2: number;
/** The line start's y coordinate. */
y1: number;
/** The line end's y coordinate. */
y2: number;
}
}
export interface ArgumentGridProps {
/** An axis name. */
name?: string;
/** A component that renders a grid line. */
lineComponent: React.ComponentType<ArgumentGrid.LineProps>;
}
/** The ArgumentGrid plugin visualizes a grid for the argument axis. */
export declare const ArgumentGrid: React.ComponentType<ArgumentGridProps>;
// -------------------------------------------------------------------------------------------------
// BarSeries

@@ -161,2 +191,4 @@ // -------------------------------------------------------------------------------------------------

groupWidth?: number;
/** A series color. */
color?: string;
/** A component that renders a bar. */

@@ -196,30 +228,2 @@ pointComponent: React.ComponentType<BarSeries.PointProps>;

// -------------------------------------------------------------------------------------------------
// Grid
// -------------------------------------------------------------------------------------------------
export namespace Grid {
/** Describes properties passed to a component that renders a grid line. */
export interface LineProps {
/** The line start's x coordinate. */
x1: number;
/** The line end's x coordinate. */
x2: number;
/** The line start's y coordinate. */
y1: number;
/** The line end's y coordinate. */
y2: number;
}
}
export interface GridProps {
/** An axis name. */
name?: string;
/** A component that renders a grid line. */
lineComponent: React.ComponentType<Grid.LineProps>;
}
/** The Grid plugin visualizes a grid for the specified axis. */
export declare const Grid: React.ComponentType<GridProps>;
// -------------------------------------------------------------------------------------------------
// Legend

@@ -297,2 +301,4 @@ // -------------------------------------------------------------------------------------------------

stack?: string;
/** A series color. */
color?: string;
/** A component that renders the series. */

@@ -306,2 +312,14 @@ seriesComponent: React.ComponentType<LineSeries.SeriesProps>;

// -------------------------------------------------------------------------------------------------
// Palette
// -------------------------------------------------------------------------------------------------
export interface PaletteProps {
/** An array of colors. */
scheme: Array<string>;
}
/** The `Palette` plugin allows you to specify a custom color scheme for a chart. */
export declare const Palette: React.ComponentType<PaletteProps>;
// -------------------------------------------------------------------------------------------------
// PieSeries

@@ -347,12 +365,30 @@ // -------------------------------------------------------------------------------------------------

/** */
export interface scaleOptions {
export interface ScaleOptions {
/** A scale type. */
type?: string;
/** A function that constructs a custom scale. */
constructor?: () => object;
constructor?: () => ScaleObject;
}
/** */
export interface ScaleObject {
/** A function that sets (if the `domain` parameter is an array) or gets (if the `domain` parameter is undefined) the current domain. */
domain: (domain?: Array<any>) => ScaleObject | Array<any>;
/** A function that sets (if the `domain` parameter is an array) or gets (if the `domain` parameter is undefined) the scale's current range. */
range: () => (range?: Array<any>) => ScaleObject | Array<any>;
/** A function that returns a tick formatter function. */
tickFormat?: (count: number, specifier: string) => (tick: any) => string;
/** A function that returns an array of ticks. */
ticks?: (count: number) => Array<any>;
/** A function that sets a scale's inner padding and returns the current scale. */
paddingInner?: (padding: number) => ScaleObject;
/** A function that sets a scale's outer padding and returns the current scale. */
paddingOuter?: (padding: number) => ScaleObject;
/** A function that returns the width of each band. */
bandWidth?: () => number;
}
export interface ScaleProps {
/** An array of scales with constructors. */
extensions?: Array<scaleOptions>;
extensions?: Array<ScaleOptions>;
}

@@ -404,2 +440,4 @@

point?: { size : number };
/** A series color. */
color?: string;
/** A component that renders a series point. */

@@ -441,2 +479,4 @@ pointComponent: React.ComponentType<ScatterSeries.PointProps>;

stack?: string;
/** A series color. */
color?: string;
/** A component that renders the series. */

@@ -555,3 +595,3 @@ seriesComponent: React.ComponentType<SplineSeries.SeriesProps>;

/** The axis name. */
name: string;
name?: string;
/** The indent from the axis. */

@@ -562,3 +602,3 @@ indentFromAxis?: number;

/** A function that returns a tick formatter function. */
tickForamt?: (scale: object) => (tick: string) => string;
tickFormat?: (scale: ScaleObject) => (tick: string) => string;
/** A component that renders the axis root layout. */

@@ -576,1 +616,29 @@ rootComponent: React.ComponentType<ValueAxis.RootProps>;

export declare const ValueAxis: React.ComponentType<ValueAxisProps>;
// -------------------------------------------------------------------------------------------------
// ValueGrid
// -------------------------------------------------------------------------------------------------
export namespace ValueGrid {
/** Describes properties passed to a component that renders a grid line. */
export interface LineProps {
/** The line start's x coordinate. */
x1: number;
/** The line end's x coordinate. */
x2: number;
/** The line start's y coordinate. */
y1: number;
/** The line end's y coordinate. */
y2: number;
}
}
export interface ValueGridProps {
/** An axis name. */
name?: string;
/** A component that renders a grid line. */
lineComponent: React.ComponentType<ValueGrid.LineProps>;
}
/** The ValueGrid plugin visualizes a grid for the value axis. */
export declare const ValueGrid: React.ComponentType<ValueGridProps>;
/**
* Bundle of @devexpress/dx-react-chart
* Generated: 2018-09-07
* Version: 1.8.0-beta.1
* Generated: 2018-10-04
* Version: 1.8.0
* License: https://js.devexpress.com/Licensing
*/
import { Component, Fragment, PureComponent, createElement } from 'react';
import { array, arrayOf, bool, func, node, number, object, shape, string } from 'prop-types';
import { Action, Getter, Plugin, PluginHost, Sizer, Template, TemplateConnector, TemplatePlaceholder, createStateHelper } from '@devexpress/dx-react-core';
import { BOTTOM, HORIZONTAL, LEFT, RIGHT, TOP, axesData, axisCoordinates, axisName, bBoxes, barCoordinates, checkZeroStart, computedExtension, coordinates, dArea, dBar, dLine, dSpline, domains, findSeriesByName, palette, pieAttributes, pointAttributes, prepareData, processData, seriesData, seriesWithStacks, stacks, xyScales } from '@devexpress/dx-chart-core';
import { stackOffsetDiverging, stackOrderNone } from 'd3-shape';
import { createElement, PureComponent, Fragment, Component } from 'react';
import { array, func, number, node, string, arrayOf, shape, object, oneOfType } from 'prop-types';
import { Plugin, Getter, Template, TemplatePlaceholder, TemplateConnector, Sizer, Action, createStateHelper, PluginHost } from '@devexpress/dx-react-core';
import { prepareData, ARGUMENT_DOMAIN, TOP, BOTTOM, LEFT, RIGHT, bBoxes, findSeriesByName, xyScales, seriesData, getValueDomainName, computeDomains, computeExtension, processData, seriesWithStacks, stacks, palette, dArea, coordinates, dBar, barCoordinates, dLine, pieAttributes, getPieItems, pointAttributes, dSpline, axisCoordinates, HORIZONTAL, axesData } from '@devexpress/dx-chart-core';
import { stackOrderNone, stackOffsetDiverging } from 'd3-shape';
var asyncGenerator = function () {
function AwaitValue(value) {
this.value = value;
}
var BasicData = function BasicData(_ref) {
var data = _ref.data;
return createElement(
Plugin,
{ name: 'Basis' },
createElement(Getter, { name: 'data', value: data }),
createElement(Getter, { name: 'series', value: [] }),
createElement(Getter, { name: 'axes', value: [] })
);
};
function AsyncGenerator(gen) {
var front, back;
process.env.NODE_ENV !== "production" ? BasicData.propTypes = {
data: array.isRequired
} : void 0;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null
};
var getData = function getData(_ref) {
var data = _ref.data,
series = _ref.series,
processingData = _ref.processingData;
return prepareData(data, series, processingData);
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
var getDomains = function getDomains(_ref2) {
var axes = _ref2.axes,
series = _ref2.series,
data = _ref2.data,
computeDomains$$1 = _ref2.computeDomains;
return computeDomains$$1(axes, series, data);
};
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var colorDomain = function colorDomain(_ref3) {
var series = _ref3.series,
domains = _ref3.domains,
items = _ref3.items,
paletteComputing = _ref3.paletteComputing;
return paletteComputing(series, domains[ARGUMENT_DOMAIN].domain, items);
};
if (value instanceof AwaitValue) {
Promise.resolve(value.value).then(function (arg) {
resume("next", arg);
}, function (arg) {
resume("throw", arg);
});
} else {
settle(result.done ? "return" : "normal", result.value);
}
} catch (err) {
settle("throw", err);
}
}
var ChartCore = function ChartCore() {
return createElement(
Plugin,
null,
createElement(Getter, { name: 'data', computed: getData }),
createElement(Getter, { name: 'domains', computed: getDomains }),
createElement(Getter, { name: 'colorDomain', computed: colorDomain })
);
};
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true
});
break;
var AxesLayout = function AxesLayout() {
return createElement(
Plugin,
null,
createElement(
Template,
{ name: 'canvas' },
createElement(
'div',
{ id: 'center-center', style: { display: 'flex', flexDirection: 'column', flexGrow: 1 } },
createElement(
'div',
{ id: TOP + '-axis-container', style: { display: 'flex', flexDirection: 'row' } },
createElement(TemplatePlaceholder, { name: TOP + '-' + LEFT + '-axis' }),
createElement(TemplatePlaceholder, { name: TOP + '-axis' }),
createElement(TemplatePlaceholder, { name: TOP + '-' + RIGHT + '-axis' })
),
createElement(
'div',
{ id: 'center-axis-container', style: { display: 'flex', flexDirection: 'row', flexGrow: 1 } },
createElement(TemplatePlaceholder, { name: LEFT + '-axis' }),
createElement(TemplatePlaceholder, null),
createElement(TemplatePlaceholder, { name: RIGHT + '-axis' })
),
createElement(
'div',
{ id: BOTTOM + '-axis-container', style: { display: 'flex', flexDirection: 'row' } },
createElement(TemplatePlaceholder, { name: BOTTOM + '-' + LEFT + '-axis' }),
createElement(TemplatePlaceholder, { name: BOTTOM + '-axis' }),
createElement(TemplatePlaceholder, { name: BOTTOM + '-' + RIGHT + '-axis' })
)
)
)
);
};
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen.return !== "function") {
this.return = undefined;
}
}
if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};
return {
wrap: function (fn) {
return function () {
return new AsyncGenerator(fn.apply(this, arguments));
};
},
await: function (value) {
return new AwaitValue(value);
}
};
}();
var classCallCheck = function (instance, Constructor) {

@@ -155,8 +122,2 @@ if (!(instance instanceof Constructor)) {

var _extends = Object.assign || function (target) {

@@ -176,4 +137,2 @@ for (var i = 1; i < arguments.length; i++) {

var inherits = function (subClass, superClass) {

@@ -195,10 +154,2 @@ if (typeof superClass !== "function" && superClass !== null) {

var objectWithoutProperties = function (obj, keys) {

@@ -224,6 +175,2 @@ var target = {};

var slicedToArray = function () {

@@ -267,85 +214,2 @@ function sliceIterator(arr, i) {

var ChartCore = function (_React$PureComponent) {
inherits(ChartCore, _React$PureComponent);
function ChartCore() {
classCallCheck(this, ChartCore);
return possibleConstructorReturn(this, (ChartCore.__proto__ || Object.getPrototypeOf(ChartCore)).apply(this, arguments));
}
createClass(ChartCore, [{
key: 'render',
value: function render() {
var data = this.props.data;
var getArgumentAxisName = function getArgumentAxisName(_ref) {
var argumentAxisName = _ref.argumentAxisName;
return axisName(argumentAxisName);
};
var processedData = function processedData(_ref2) {
var series = _ref2.series,
processingData = _ref2.processingData;
return prepareData(data, series, processingData);
};
var calculatedDomains = function calculatedDomains(_ref3) {
var axes = _ref3.axes,
series = _ref3.series,
chartData = _ref3.data,
argumentAxisName = _ref3.argumentAxisName,
startFromZero = _ref3.startFromZero,
computedDomain = _ref3.computedDomain;
return computedDomain(axes, series, chartData, argumentAxisName, startFromZero);
};
return createElement(
Plugin,
null,
createElement(Getter, { name: 'data', computed: processedData }),
createElement(Getter, { name: 'argumentAxisName', computed: getArgumentAxisName }),
createElement(Getter, { name: 'domains', computed: calculatedDomains })
);
}
}]);
return ChartCore;
}(PureComponent);
process.env.NODE_ENV !== "production" ? ChartCore.propTypes = {
data: array.isRequired
} : void 0;
var AxesLayout = function AxesLayout() {
return createElement(
Plugin,
null,
createElement(
Template,
{ name: 'canvas' },
createElement(
'div',
{ id: 'center-center', style: { display: 'flex', flexDirection: 'column', flexGrow: 1 } },
createElement(
'div',
{ id: TOP + '-axis-container', style: { display: 'flex', flexDirection: 'row' } },
createElement(TemplatePlaceholder, { name: TOP + '-' + LEFT + '-axis' }),
createElement(TemplatePlaceholder, { name: TOP + '-axis' }),
createElement(TemplatePlaceholder, { name: TOP + '-' + RIGHT + '-axis' })
),
createElement(
'div',
{ id: 'center-axis-container', style: { display: 'flex', flexDirection: 'row', flexGrow: 1 } },
createElement(TemplatePlaceholder, { name: LEFT + '-axis' }),
createElement(TemplatePlaceholder, null),
createElement(TemplatePlaceholder, { name: RIGHT + '-axis' })
),
createElement(
'div',
{ id: BOTTOM + '-axis-container', style: { display: 'flex', flexDirection: 'row' } },
createElement(TemplatePlaceholder, { name: BOTTOM + '-' + LEFT + '-axis' }),
createElement(TemplatePlaceholder, { name: BOTTOM + '-axis' }),
createElement(TemplatePlaceholder, { name: BOTTOM + '-' + RIGHT + '-axis' })
)
)
)
);
};
var SpaceFillingRects = function (_React$PureComponent) {

@@ -605,32 +469,290 @@ inherits(SpaceFillingRects, _React$PureComponent);

var themeComputing = function themeComputing(_ref) {
var series = _ref.series;
return palette(series);
var Root = function (_React$PureComponent) {
inherits(Root, _React$PureComponent);
function Root() {
classCallCheck(this, Root);
return possibleConstructorReturn(this, (Root.__proto__ || Object.getPrototypeOf(Root)).apply(this, arguments));
}
createClass(Root, [{
key: 'render',
value: function render() {
var _props = this.props,
children = _props.children,
width = _props.width,
height = _props.height,
style = _props.style,
restProps = objectWithoutProperties(_props, ['children', 'width', 'height', 'style']);
return createElement(
'div',
_extends({
style: _extends({}, style, {
height: height + 'px'
}, width ? { width: width + 'px' } : null)
}, restProps),
children
);
}
}]);
return Root;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Root.propTypes = {
children: node,
width: number.isRequired,
height: number.isRequired,
style: object
} : void 0;
Root.defaultProps = {
children: undefined,
style: undefined
};
var pieThemeComputing = function pieThemeComputing(_ref2) {
var domains$$1 = _ref2.domains,
argumentAxisName = _ref2.argumentAxisName;
return palette(domains$$1[argumentAxisName].domain.map(function (uniqueName) {
return { uniqueName: uniqueName };
}));
// TODO: Remove it - just pass `true` or `false` to `withSeriesPlugin`.
var isStartedFromZero = function isStartedFromZero(pathType) {
return pathType === 'area' || pathType === 'bar';
};
var ThemeManager = function ThemeManager() {
return createElement(
Plugin,
{ name: 'ThemeManager' },
createElement(Getter, { name: 'colorDomain', computed: themeComputing }),
createElement(Getter, { name: 'pieColorDomain', computed: pieThemeComputing })
);
var withSeriesPlugin = function withSeriesPlugin(Series, pluginName, pathType, // TODO: Replace it with bool - `isStartedFromZero`.
calculateCoordinates) {
var getItems = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (series) {
return series;
};
var Component$$1 = function (_React$PureComponent) {
inherits(Component$$1, _React$PureComponent);
function Component$$1() {
classCallCheck(this, Component$$1);
return possibleConstructorReturn(this, (Component$$1.__proto__ || Object.getPrototypeOf(Component$$1)).apply(this, arguments));
}
createClass(Component$$1, [{
key: 'render',
value: function render() {
var _this2 = this;
var seriesName = this.props.name;
var symbolName = Symbol(seriesName);
var getSeriesDataComputed = function getSeriesDataComputed(_ref) {
var series = _ref.series;
return seriesData(series, _extends({}, _this2.props, {
isStartedFromZero: isStartedFromZero(pathType),
symbolName: symbolName,
uniqueName: seriesName
}));
};
return createElement(
Plugin,
{ name: pluginName },
createElement(Getter, { name: 'series', computed: getSeriesDataComputed }),
createElement(Getter, { name: 'items', value: getItems }),
createElement(
Template,
{ name: 'series' },
createElement(TemplatePlaceholder, null),
createElement(
TemplateConnector,
null,
function (_ref2) {
var series = _ref2.series,
domains = _ref2.domains,
stacks$$1 = _ref2.stacks,
data = _ref2.data,
layouts = _ref2.layouts,
scaleExtension = _ref2.scaleExtension,
colorDomain = _ref2.colorDomain;
var _findSeriesByName = findSeriesByName(symbolName, series),
name = _findSeriesByName.name,
axisName = _findSeriesByName.axisName,
argumentField = _findSeriesByName.argumentField,
valueField = _findSeriesByName.valueField,
groupWidth = _findSeriesByName.groupWidth,
stack = _findSeriesByName.stack,
_symbolName = _findSeriesByName.symbolName,
_isStartedFromZero = _findSeriesByName.isStartedFromZero,
restProps = objectWithoutProperties(_findSeriesByName, ['name', 'axisName', 'argumentField', 'valueField', 'groupWidth', 'stack', 'symbolName', 'isStartedFromZero']);
var scales = xyScales(domains[ARGUMENT_DOMAIN], domains[getValueDomainName(axisName)], layouts.pane, groupWidth, scaleExtension);
var calculatedCoordinates = calculateCoordinates(data, scales, argumentField, valueField, name, stack, stacks$$1, restProps, scaleExtension);
return createElement(Series, _extends({
colorDomain: colorDomain,
coordinates: calculatedCoordinates
}, restProps));
}
)
)
);
}
}]);
return Component$$1;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Component$$1.propTypes = {
name: string,
valueField: string.isRequired,
argumentField: string.isRequired,
axisName: string,
stack: string,
color: string,
groupWidth: number
} : void 0;
Component$$1.defaultProps = {
name: 'defaultSeriesName',
color: undefined,
axisName: undefined,
stack: undefined,
groupWidth: 0.7
};
return Component$$1;
};
var Chart = function (_React$PureComponent) {
inherits(Chart, _React$PureComponent);
var withPatchedProps = function withPatchedProps(patch) {
return function (Target) {
var Component$$1 = function (_React$PureComponent) {
inherits(Component$$1, _React$PureComponent);
function Chart() {
classCallCheck(this, Chart);
return possibleConstructorReturn(this, (Chart.__proto__ || Object.getPrototypeOf(Chart)).apply(this, arguments));
function Component$$1() {
classCallCheck(this, Component$$1);
return possibleConstructorReturn(this, (Component$$1.__proto__ || Object.getPrototypeOf(Component$$1)).apply(this, arguments));
}
createClass(Component$$1, [{
key: 'render',
value: function render() {
var props = patch(this.props);
return createElement(Target, props);
}
}]);
return Component$$1;
}(PureComponent);
return Component$$1;
};
};
var withColorCore = withPatchedProps(function (_ref) {
var colorDomain = _ref.colorDomain,
uniqueName = _ref.uniqueName,
color = _ref.color,
restProps = objectWithoutProperties(_ref, ['colorDomain', 'uniqueName', 'color']);
return _extends({
color: color || colorDomain(uniqueName)
}, restProps);
});
var withColor = function withColor(Target) {
var ColoredTarget = withColorCore(Target);
ColoredTarget.propTypes = {
color: string,
colorDomain: func.isRequired,
uniqueName: string.isRequired
};
ColoredTarget.defaultProps = {
color: undefined
};
return ColoredTarget;
};
var makeBoundComponent = function makeBoundComponent(Target, components, exposed) {
var Component$$1 = function (_React$PureComponent) {
inherits(Component$$1, _React$PureComponent);
function Component$$1() {
classCallCheck(this, Component$$1);
return possibleConstructorReturn(this, (Component$$1.__proto__ || Object.getPrototypeOf(Component$$1)).apply(this, arguments));
}
createClass(Component$$1, [{
key: 'render',
value: function render() {
return createElement(Target, _extends({}, components, this.props));
}
}]);
return Component$$1;
}(PureComponent);
Component$$1.components = Target.components;
Object.assign(Component$$1, exposed);
return Component$$1;
};
var withComponents = function withComponents(components) {
return function (Target) {
var props = {};
var exposed = {};
Object.entries(Target.components).forEach(function (_ref) {
var _ref2 = slicedToArray(_ref, 2),
fieldName = _ref2[0],
componentName = _ref2[1];
var component = components[componentName];
if (component && component !== Target[componentName]) {
props[fieldName] = component;
}
exposed[componentName] = component || Target[componentName];
});
return Object.keys(props).length > 0 ? makeBoundComponent(Target, props, exposed) : Target;
};
};
var makeRawSeries = function makeRawSeries(d3Func) {
var Series = function (_React$PureComponent) {
inherits(Series, _React$PureComponent);
function Series() {
classCallCheck(this, Series);
return possibleConstructorReturn(this, (Series.__proto__ || Object.getPrototypeOf(Series)).apply(this, arguments));
}
createClass(Series, [{
key: 'render',
value: function render() {
var _props = this.props,
Path = _props.seriesComponent,
restProps = objectWithoutProperties(_props, ['seriesComponent']);
return createElement(Path, _extends({ path: d3Func }, restProps));
}
}]);
return Series;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Series.propTypes = {
seriesComponent: func.isRequired
} : void 0;
return Series;
};
var makeSeries = function makeSeries(pluginName, pathType, d3Func, calculateCoordinates, componentsDefinition) {
var enhance = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (x) {
return x;
};
var getItems = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function (x) {
return x;
};
var RawSeries = enhance(makeRawSeries(d3Func));
var Series = withSeriesPlugin(RawSeries, pluginName, pathType, calculateCoordinates, getItems);
Series.components = componentsDefinition;
return Series;
};
var RawChart = function (_React$PureComponent) {
inherits(RawChart, _React$PureComponent);
function RawChart() {
classCallCheck(this, RawChart);
return possibleConstructorReturn(this, (RawChart.__proto__ || Object.getPrototypeOf(RawChart)).apply(this, arguments));
}
createClass(Chart, [{
createClass(RawChart, [{
key: 'render',

@@ -643,3 +765,3 @@ value: function render() {

children = _props.children,
Root = _props.rootComponent,
rootComponent = _props.rootComponent,
restProps = objectWithoutProperties(_props, ['data', 'width', 'height', 'children', 'rootComponent']);

@@ -650,9 +772,9 @@

null,
createElement(BasicData, { data: data }),
children,
createElement(ChartCore, { data: data }),
createElement(ThemeManager, null),
createElement(ChartCore, null),
createElement(LayoutManager, _extends({
width: width,
height: height,
rootComponent: Root
rootComponent: rootComponent
}, restProps)),

@@ -667,5 +789,6 @@ createElement(PaneLayout, null),

}]);
return Chart;
return RawChart;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Chart.propTypes = {
process.env.NODE_ENV !== "production" ? RawChart.propTypes = {
data: array.isRequired,

@@ -678,3 +801,3 @@ rootComponent: func.isRequired,

Chart.defaultProps = {
RawChart.defaultProps = {
height: 500,

@@ -685,15 +808,54 @@ width: undefined,

var Legend = function (_React$PureComponent) {
inherits(Legend, _React$PureComponent);
RawChart.components = {
rootComponent: 'Root'
};
function Legend() {
classCallCheck(this, Legend);
return possibleConstructorReturn(this, (Legend.__proto__ || Object.getPrototypeOf(Legend)).apply(this, arguments));
var Chart = withComponents({ Root: Root })(RawChart);
var Marker = function (_React$PureComponent) {
inherits(Marker, _React$PureComponent);
function Marker() {
classCallCheck(this, Marker);
return possibleConstructorReturn(this, (Marker.__proto__ || Object.getPrototypeOf(Marker)).apply(this, arguments));
}
createClass(Legend, [{
createClass(Marker, [{
key: 'render',
value: function render() {
var _props = this.props,
Marker = _props.markerComponent,
color = _props.color,
restProps = objectWithoutProperties(_props, ['color']);
return createElement(
'svg',
_extends({ fill: color, width: '10', height: '10' }, restProps),
createElement('circle', _extends({ r: 5, cx: 5, cy: 5 }, restProps))
);
}
}]);
return Marker;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Marker.propTypes = {
color: string
} : void 0;
Marker.defaultProps = {
color: undefined
};
var RawLegend = function (_React$PureComponent) {
inherits(RawLegend, _React$PureComponent);
function RawLegend() {
classCallCheck(this, RawLegend);
return possibleConstructorReturn(this, (RawLegend.__proto__ || Object.getPrototypeOf(RawLegend)).apply(this, arguments));
}
createClass(RawLegend, [{
key: 'render',
value: function render() {
var _props = this.props,
MarkerComponent = _props.markerComponent,
Label = _props.labelComponent,

@@ -717,19 +879,16 @@ Root = _props.rootComponent,

var series = _ref.series,
colorDomain = _ref.colorDomain;
domains = _ref.domains,
colorDomain = _ref.colorDomain,
items = _ref.items;
return createElement(
Root,
{ name: 'legend-' + placeholder },
colorDomain.domain().map(function (domainName) {
var _series$find = series.find(function (_ref2) {
var uniqueName = _ref2.uniqueName;
return uniqueName === domainName;
}),
name = _series$find.name,
color = _series$find.color;
items(series, domains[ARGUMENT_DOMAIN].domain).map(function (_ref2) {
var uniqueName = _ref2.uniqueName,
color = _ref2.color;
return createElement(
Item,
{ key: domainName },
createElement(Marker, { name: name, color: color || colorDomain(domainName) }),
createElement(Label, { text: name })
{ key: uniqueName },
createElement(MarkerComponent, { name: uniqueName, color: color || colorDomain(uniqueName) }),
createElement(Label, { text: uniqueName })
);

@@ -744,6 +903,6 @@ })

}]);
return Legend;
return RawLegend;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Legend.propTypes = {
process.env.NODE_ENV !== "production" ? RawLegend.propTypes = {
markerComponent: func.isRequired,

@@ -756,6 +915,15 @@ labelComponent: func.isRequired,

Legend.defaultProps = {
RawLegend.defaultProps = {
position: 'right'
};
RawLegend.components = {
rootComponent: 'Root',
itemComponent: 'Item',
markerComponent: 'Marker',
labelComponent: 'Label'
};
var Legend = withComponents({ Marker: Marker })(RawLegend);
var Title = function (_React$PureComponent) {

@@ -804,2 +972,6 @@ inherits(Title, _React$PureComponent);

Title.components = {
textComponent: 'Text'
};
var Scale = function (_React$PureComponent) {

@@ -818,10 +990,7 @@ inherits(Scale, _React$PureComponent);

var getExtension = function getExtension() {
return computedExtension(extensions);
};
return createElement(
Plugin,
{ name: 'Scale' },
createElement(Getter, { name: 'computedDomain', value: domains }),
createElement(Getter, { name: 'scaleExtension', computed: getExtension })
createElement(Getter, { name: 'computeDomains', value: computeDomains }),
createElement(Getter, { name: 'scaleExtension', value: computeExtension(extensions) })
);

@@ -850,3 +1019,2 @@ }

// eslint-disable-next-line react/prefer-stateless-function
var Stack = function (_React$PureComponent) {

@@ -894,275 +1062,509 @@ inherits(Stack, _React$PureComponent);

var withSeriesPlugin = function withSeriesPlugin(Series, pluginName, pathType, calculateCoordinates) {
var Component$$1 = function (_React$PureComponent) {
inherits(Component$$1, _React$PureComponent);
var Palette = function (_React$PureComponent) {
inherits(Palette, _React$PureComponent);
function Component$$1() {
classCallCheck(this, Component$$1);
return possibleConstructorReturn(this, (Component$$1.__proto__ || Object.getPrototypeOf(Component$$1)).apply(this, arguments));
function Palette() {
classCallCheck(this, Palette);
return possibleConstructorReturn(this, (Palette.__proto__ || Object.getPrototypeOf(Palette)).apply(this, arguments));
}
createClass(Palette, [{
key: 'render',
value: function render() {
var scheme = this.props.scheme;
var paletteComputing = function paletteComputing(series, domain, items) {
return palette(items(series, domain), scheme);
};
return createElement(
Plugin,
{ name: 'Palette' },
createElement(Getter, { name: 'paletteComputing', value: paletteComputing })
);
}
}]);
return Palette;
}(PureComponent);
createClass(Component$$1, [{
key: 'render',
value: function render() {
var _props = this.props,
name = _props.name,
valueField = _props.valueField,
argumentField = _props.argumentField,
axisName$$1 = _props.axisName,
stackProp = _props.stack,
color = _props.color,
groupWidth = _props.groupWidth,
restProps = objectWithoutProperties(_props, ['name', 'valueField', 'argumentField', 'axisName', 'stack', 'color', 'groupWidth']);
process.env.NODE_ENV !== "production" ? Palette.propTypes = {
scheme: array.isRequired
} : void 0;
var Area = function (_React$PureComponent) {
inherits(Area, _React$PureComponent);
var symbolName = Symbol(name);
var getSeriesDataComputed = function getSeriesDataComputed(_ref) {
var series = _ref.series;
return seriesData(series, {
valueField: valueField,
argumentField: argumentField,
name: name,
symbolName: symbolName,
axisName: axisName$$1,
stack: stackProp,
color: color,
uniqueName: name
});
};
var startFromZeroByAxes = function startFromZeroByAxes(_ref2) {
var _ref2$startFromZero = _ref2.startFromZero,
startFromZero = _ref2$startFromZero === undefined ? {} : _ref2$startFromZero;
return checkZeroStart(startFromZero, axisName$$1, pathType);
};
return createElement(
Plugin,
{ name: pluginName },
createElement(Getter, { name: 'series', computed: getSeriesDataComputed }),
createElement(Getter, { name: 'startFromZero', computed: startFromZeroByAxes }),
createElement(
Template,
{ name: 'series' },
createElement(TemplatePlaceholder, null),
createElement(
TemplateConnector,
null,
function (_ref3) {
var series = _ref3.series,
domains$$1 = _ref3.domains,
stacks$$1 = _ref3.stacks,
data = _ref3.data,
argumentAxisName = _ref3.argumentAxisName,
layouts = _ref3.layouts,
scaleExtension = _ref3.scaleExtension,
colorDomain = _ref3.colorDomain,
pieColorDomain = _ref3.pieColorDomain;
function Area() {
classCallCheck(this, Area);
return possibleConstructorReturn(this, (Area.__proto__ || Object.getPrototypeOf(Area)).apply(this, arguments));
}
var _findSeriesByName = findSeriesByName(symbolName, series),
stack = _findSeriesByName.stack,
uniqueName = _findSeriesByName.uniqueName;
createClass(Area, [{
key: 'render',
value: function render() {
var _props = this.props,
path = _props.path,
coordinates$$1 = _props.coordinates,
color = _props.color,
value = _props.value,
restProps = objectWithoutProperties(_props, ['path', 'coordinates', 'color', 'value']);
var scales = xyScales(domains$$1[argumentAxisName], domains$$1[axisName$$1], layouts.pane, groupWidth, scaleExtension);
var calculatedCoordinates = calculateCoordinates(data, scales, argumentField, valueField, name, stack, stacks$$1, restProps, scaleExtension);
return createElement('path', _extends({
d: path(coordinates$$1),
fill: color
}, restProps));
}
}]);
return Area;
}(PureComponent);
return createElement(Series, _extends({
uniqueName: uniqueName,
colorDomain: pluginName === 'PieSeries' ? pieColorDomain : colorDomain,
coordinates: calculatedCoordinates,
color: color
}, restProps));
}
)
)
);
}
}]);
return Component$$1;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Area.propTypes = {
path: func.isRequired,
coordinates: array.isRequired,
color: string
} : void 0;
process.env.NODE_ENV !== "production" ? Component$$1.propTypes = {
name: string,
valueField: string.isRequired,
argumentField: string.isRequired,
axisName: string,
stack: string,
color: string,
groupWidth: number
} : void 0;
Component$$1.defaultProps = {
name: 'defaultSeriesName',
color: undefined,
axisName: undefined,
stack: undefined,
groupWidth: 0.7
};
return Component$$1;
Area.defaultProps = {
color: undefined
};
var withColor = function withColor(Series) {
var ColorizedSeries = function ColorizedSeries(_ref) {
var colorDomain = _ref.colorDomain,
uniqueName = _ref.uniqueName,
seriesColor = _ref.color,
restProps = objectWithoutProperties(_ref, ['colorDomain', 'uniqueName', 'color']);
var AreaSeries = withComponents({ Path: Area })(makeSeries('AreaSeries', 'area', dArea, coordinates, {
seriesComponent: 'Path'
}, withColor));
var color = colorDomain(uniqueName);
return createElement(Series, _extends({ color: seriesColor || color }, restProps));
};
process.env.NODE_ENV !== "production" ? ColorizedSeries.propTypes = {
color: string,
colorDomain: func.isRequired,
uniqueName: string.isRequired
} : void 0;
ColorizedSeries.defaultProps = {
color: undefined
};
var BarCollection = function (_React$PureComponent) {
inherits(BarCollection, _React$PureComponent);
return ColorizedSeries;
};
function BarCollection() {
classCallCheck(this, BarCollection);
return possibleConstructorReturn(this, (BarCollection.__proto__ || Object.getPrototypeOf(BarCollection)).apply(this, arguments));
}
var Series = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Point = props.pointComponent,
coordinates$$1 = props.coordinates,
path = props.path,
barWidth = props.barWidth,
restProps = objectWithoutProperties(props, ['pointComponent', 'coordinates', 'path', 'barWidth']);
createClass(BarCollection, [{
key: 'render',
value: function render() {
var _props = this.props,
Point = _props.pointComponent,
path = _props.path,
coordinates$$1 = _props.coordinates,
restProps = objectWithoutProperties(_props, ['pointComponent', 'path', 'coordinates']);
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, item, dBar(item), restProps));
});
};
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, item, dBar(item), restProps));
});
}
}]);
return BarCollection;
}(PureComponent);
var BarSeries = withSeriesPlugin(withColor(Series), 'BarSeries', 'bar', barCoordinates);
process.env.NODE_ENV !== "production" ? Series.propTypes = {
process.env.NODE_ENV !== "production" ? BarCollection.propTypes = {
pointComponent: func.isRequired
} : void 0;
var Series$1 = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Path = props.seriesComponent,
restProps = objectWithoutProperties(props, ['seriesComponent']);
var Bar = function (_React$PureComponent) {
inherits(Bar, _React$PureComponent);
return createElement(Path, _extends({}, restProps, { path: dLine }));
function Bar() {
classCallCheck(this, Bar);
return possibleConstructorReturn(this, (Bar.__proto__ || Object.getPrototypeOf(Bar)).apply(this, arguments));
}
createClass(Bar, [{
key: 'render',
value: function render() {
var _props = this.props,
color = _props.color,
value = _props.value,
restProps = objectWithoutProperties(_props, ['color', 'value']);
return createElement('rect', _extends({ fill: color }, restProps));
}
}]);
return Bar;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Bar.propTypes = {
x: number.isRequired,
y: number.isRequired,
width: number.isRequired,
height: number.isRequired,
value: number.isRequired,
color: string
} : void 0;
Bar.defaultProps = {
color: undefined
};
var LineSeries = withSeriesPlugin(withColor(Series$1), 'LineSeries', 'line', coordinates);
var BarSeries = withComponents({ Path: BarCollection, Point: Bar })(makeSeries('BarSeries', 'bar', null, // TODO: d3Func is not used.
barCoordinates, {
seriesComponent: 'Path',
pointComponent: 'Point'
}, withColor));
process.env.NODE_ENV !== "production" ? Series$1.propTypes = {
seriesComponent: func.isRequired
var Path = function (_React$PureComponent) {
inherits(Path, _React$PureComponent);
function Path() {
classCallCheck(this, Path);
return possibleConstructorReturn(this, (Path.__proto__ || Object.getPrototypeOf(Path)).apply(this, arguments));
}
createClass(Path, [{
key: 'render',
value: function render() {
var _props = this.props,
path = _props.path,
coordinates$$1 = _props.coordinates,
color = _props.color,
value = _props.value,
restProps = objectWithoutProperties(_props, ['path', 'coordinates', 'color', 'value']);
return createElement('path', _extends({
d: path(coordinates$$1),
stroke: color
}, restProps));
}
}]);
return Path;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Path.propTypes = {
path: func.isRequired,
coordinates: array.isRequired,
color: string
} : void 0;
var Series$2 = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Path = props.seriesComponent,
restProps = objectWithoutProperties(props, ['seriesComponent']);
return createElement(Path, _extends({}, restProps, { path: dSpline }));
Path.defaultProps = {
color: undefined
};
var SplineSeries = withSeriesPlugin(withColor(Series$2), 'SplineSeries', 'spline', coordinates);
var LineSeries = withComponents({ Path: Path })(makeSeries('LineSeries', 'line', dLine, coordinates, {
seriesComponent: 'Path'
}, withColor));
process.env.NODE_ENV !== "production" ? Series$2.propTypes = {
seriesComponent: func.isRequired
// TODO: Is it fine to have it hard coded or should there be `path` property?
var SliceCollection = function (_React$PureComponent) {
inherits(SliceCollection, _React$PureComponent);
function SliceCollection() {
classCallCheck(this, SliceCollection);
return possibleConstructorReturn(this, (SliceCollection.__proto__ || Object.getPrototypeOf(SliceCollection)).apply(this, arguments));
}
createClass(SliceCollection, [{
key: 'render',
value: function render() {
var _props = this.props,
Point = _props.pointComponent,
path = _props.path,
coordinates$$1 = _props.coordinates,
colorDomain = _props.colorDomain,
uniqueName = _props.uniqueName,
restProps = objectWithoutProperties(_props, ['pointComponent', 'path', 'coordinates', 'colorDomain', 'uniqueName']);
var pointOptions = objectWithoutProperties(restProps, ['innerRadius', 'outerRadius']);
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, item, pointOptions, {
color: colorDomain(item.id)
}));
});
}
}]);
return SliceCollection;
}(PureComponent);
process.env.NODE_ENV !== "production" ? SliceCollection.propTypes = {
pointComponent: func.isRequired
} : void 0;
var Series$3 = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Point = props.pointComponent,
coordinates$$1 = props.coordinates,
_props$point = props.point,
point = _props$point === undefined ? {} : _props$point,
restProps = objectWithoutProperties(props, ['pointComponent', 'coordinates', 'point']);
var Slice = function (_React$PureComponent) {
inherits(Slice, _React$PureComponent);
var getAttributes = pointAttributes(point);
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, getAttributes(item), item, restProps));
});
};
function Slice() {
classCallCheck(this, Slice);
return possibleConstructorReturn(this, (Slice.__proto__ || Object.getPrototypeOf(Slice)).apply(this, arguments));
}
var BaseSeries = function BaseSeries(_ref2) {
var Path = _ref2.Path,
path = _ref2.path,
props = objectWithoutProperties(_ref2, ['Path', 'path']);
return createElement(Path, props);
};
createClass(Slice, [{
key: 'render',
value: function render() {
var _props = this.props,
x = _props.x,
y = _props.y,
d = _props.d,
value = _props.value,
color = _props.color,
restProps = objectWithoutProperties(_props, ['x', 'y', 'd', 'value', 'color']);
process.env.NODE_ENV !== "production" ? BaseSeries.propTypes = {
Path: func,
path: func
return createElement('path', _extends({
fill: color,
transform: 'translate(' + x + ' ' + y + ')',
d: d
}, restProps));
}
}]);
return Slice;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Slice.propTypes = {
x: number.isRequired,
y: number.isRequired,
d: string.isRequired,
value: number.isRequired,
style: object,
color: string
} : void 0;
BaseSeries.defaultProps = {
Path: Series$3,
path: null
Slice.defaultProps = {
style: {},
color: undefined
};
var ScatterSeries = withSeriesPlugin(withColor(BaseSeries), 'ScatterSeries', 'scatter', coordinates);
var PieSeries = withComponents({ Path: SliceCollection, Point: Slice })(makeSeries('PieSeries', 'arc', null, // TODO: d3Func is not used.
pieAttributes, {
seriesComponent: 'Path',
pointComponent: 'Point'
}, undefined, getPieItems));
ScatterSeries.Path = Series$3;
var PointCollection = function (_React$PureComponent) {
inherits(PointCollection, _React$PureComponent);
process.env.NODE_ENV !== "production" ? Series$3.propTypes = {
function PointCollection() {
classCallCheck(this, PointCollection);
return possibleConstructorReturn(this, (PointCollection.__proto__ || Object.getPrototypeOf(PointCollection)).apply(this, arguments));
}
createClass(PointCollection, [{
key: 'render',
value: function render() {
var _props = this.props,
Point = _props.pointComponent,
path = _props.path,
coordinates$$1 = _props.coordinates,
_props$point = _props.point,
point = _props$point === undefined ? {} : _props$point,
restProps = objectWithoutProperties(_props, ['pointComponent', 'path', 'coordinates', 'point']);
var getAttributes = pointAttributes(point);
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, getAttributes(item), item, restProps));
});
}
}]);
return PointCollection;
}(PureComponent);
process.env.NODE_ENV !== "production" ? PointCollection.propTypes = {
pointComponent: func.isRequired
} : void 0;
var Series$4 = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Path = props.seriesComponent,
restProps = objectWithoutProperties(props, ['seriesComponent']);
var Point = function (_React$PureComponent) {
inherits(Point, _React$PureComponent);
return createElement(Path, _extends({
path: dArea
}, restProps));
function Point() {
classCallCheck(this, Point);
return possibleConstructorReturn(this, (Point.__proto__ || Object.getPrototypeOf(Point)).apply(this, arguments));
}
createClass(Point, [{
key: 'render',
value: function render() {
var _props = this.props,
x = _props.x,
y = _props.y,
value = _props.value,
color = _props.color,
restProps = objectWithoutProperties(_props, ['x', 'y', 'value', 'color']);
return createElement('path', _extends({
fill: color,
transform: 'translate(' + x + ' ' + y + ')'
}, restProps));
}
}]);
return Point;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Point.propTypes = {
x: number.isRequired,
y: number.isRequired,
value: number.isRequired,
color: string
} : void 0;
Point.defaultProps = {
color: undefined
};
var AreaSeries = withSeriesPlugin(withColor(Series$4), 'AreaSeries', 'area', coordinates);
var ScatterSeries = withComponents({ Path: PointCollection, Point: Point })(makeSeries('ScatterSeries', 'scatter', null, // TODO: d3Func is not used.
coordinates, {
seriesComponent: 'Path',
pointComponent: 'Point'
}, withColor));
process.env.NODE_ENV !== "production" ? Series$4.propTypes = {
seriesComponent: func.isRequired
var SplineSeries = withComponents({ Path: Path })(makeSeries('SplineSeries', 'spline', dSpline, coordinates, {
seriesComponent: 'Path'
}, withColor));
var Root$1 = function (_React$PureComponent) {
inherits(Root, _React$PureComponent);
function Root() {
classCallCheck(this, Root);
return possibleConstructorReturn(this, (Root.__proto__ || Object.getPrototypeOf(Root)).apply(this, arguments));
}
createClass(Root, [{
key: 'render',
value: function render() {
var _props = this.props,
x = _props.x,
y = _props.y,
refsHandler = _props.refsHandler,
children = _props.children,
restProps = objectWithoutProperties(_props, ['x', 'y', 'refsHandler', 'children']);
return createElement(
'g',
_extends({
ref: refsHandler,
transform: 'translate(' + x + ' ' + y + ')'
}, restProps),
children
);
}
}]);
return Root;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Root$1.propTypes = {
x: number.isRequired,
y: number.isRequired,
refsHandler: func.isRequired,
children: node.isRequired
} : void 0;
var Series$5 = function Series(_ref) {
var props = objectWithoutProperties(_ref, []);
var Point = props.pointComponent,
coordinates$$1 = props.coordinates,
colorDomain = props.colorDomain,
uniqueName = props.uniqueName,
restProps = objectWithoutProperties(props, ['pointComponent', 'coordinates', 'colorDomain', 'uniqueName']);
var innerRadius = restProps.innerRadius,
outerRadius = restProps.outerRadius,
pointOptions = objectWithoutProperties(restProps, ['innerRadius', 'outerRadius']);
var Tick = function (_React$PureComponent) {
inherits(Tick, _React$PureComponent);
return coordinates$$1.map(function (item) {
return createElement(Point, _extends({
key: item.id.toString()
}, item, pointOptions, {
color: colorDomain(item.id)
}));
});
};
function Tick() {
classCallCheck(this, Tick);
return possibleConstructorReturn(this, (Tick.__proto__ || Object.getPrototypeOf(Tick)).apply(this, arguments));
}
var PieSeries = withSeriesPlugin(Series$5, 'PieSeries', 'arc', pieAttributes);
createClass(Tick, [{
key: 'render',
value: function render() {
var _props = this.props,
x1 = _props.x1,
x2 = _props.x2,
y1 = _props.y1,
y2 = _props.y2,
className = _props.className,
restProps = objectWithoutProperties(_props, ['x1', 'x2', 'y1', 'y2', 'className']);
process.env.NODE_ENV !== "production" ? Series$5.propTypes = {
style: object,
pointComponent: func.isRequired
return createElement('path', _extends({
d: 'M ' + x1 + ' ' + y1 + ' L ' + x2 + ' ' + y2
}, restProps));
}
}]);
return Tick;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Tick.propTypes = {
x1: number.isRequired,
x2: number.isRequired,
y1: number.isRequired,
y2: number.isRequired
} : void 0;
Series$5.defaultProps = {
style: {}
};
var Label = function (_React$PureComponent) {
inherits(Label, _React$PureComponent);
var Axis = function (_React$Component) {
inherits(Axis, _React$Component);
function Label() {
classCallCheck(this, Label);
return possibleConstructorReturn(this, (Label.__proto__ || Object.getPrototypeOf(Label)).apply(this, arguments));
}
function Axis(props) {
classCallCheck(this, Axis);
createClass(Label, [{
key: 'render',
value: function render() {
var _props = this.props,
text = _props.text,
x = _props.x,
y = _props.y,
dominantBaseline = _props.dominantBaseline,
textAnchor = _props.textAnchor,
restProps = objectWithoutProperties(_props, ['text', 'x', 'y', 'dominantBaseline', 'textAnchor']);
var _this = possibleConstructorReturn(this, (Axis.__proto__ || Object.getPrototypeOf(Axis)).call(this, props));
return createElement(
'text',
_extends({
dominantBaseline: dominantBaseline,
textAnchor: textAnchor,
x: x,
y: y
}, restProps),
text
);
}
}]);
return Label;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Label.propTypes = {
text: oneOfType([string, number]).isRequired,
x: number.isRequired,
y: number.isRequired,
dominantBaseline: string.isRequired,
textAnchor: string.isRequired
} : void 0;
var Line = function (_React$PureComponent) {
inherits(Line, _React$PureComponent);
function Line() {
classCallCheck(this, Line);
return possibleConstructorReturn(this, (Line.__proto__ || Object.getPrototypeOf(Line)).apply(this, arguments));
}
createClass(Line, [{
key: 'render',
value: function render() {
var _props = this.props,
width = _props.width,
height = _props.height,
orientation = _props.orientation,
restProps = objectWithoutProperties(_props, ['width', 'height', 'orientation']);
return createElement('path', _extends({
d: 'M 0 0 L ' + (orientation === 'horizontal' ? width : 0) + ' ' + (orientation === 'horizontal' ? 0 : height)
}, restProps));
}
}]);
return Line;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Line.propTypes = {
width: number.isRequired,
height: number.isRequired,
orientation: string.isRequired
} : void 0;
var RawAxis = function (_React$PureComponent) {
inherits(RawAxis, _React$PureComponent);
function RawAxis(props) {
classCallCheck(this, RawAxis);
var _this = possibleConstructorReturn(this, (RawAxis.__proto__ || Object.getPrototypeOf(RawAxis)).call(this, props));
_this.state = {

@@ -1176,3 +1578,3 @@ xCorrection: 0,

createClass(Axis, [{
createClass(RawAxis, [{
key: 'createRefsHandler',

@@ -1239,9 +1641,8 @@ value: function createRefsHandler(placeholder, changeBBox, orientation) {

indentFromAxis = _props.indentFromAxis,
isArgumentAxis = _props.isArgumentAxis,
Root = _props.rootComponent,
Tick = _props.tickComponent,
Label = _props.labelComponent,
Line = _props.lineComponent;
RootComponent = _props.rootComponent,
TickComponent = _props.tickComponent,
LabelComponent = _props.labelComponent,
LineComponent = _props.lineComponent;
var getAxesDataComputed = function getAxesDataComputed(_ref2) {
var getAxes = function getAxes(_ref2) {
var axes = _ref2.axes;

@@ -1253,4 +1654,3 @@ return axesData(axes, _this3.props);

{ name: 'Axis' },
createElement(Getter, { name: 'axes', computed: getAxesDataComputed }),
isArgumentAxis ? createElement(Getter, { name: 'argumentAxisName', value: name || 'argumentAxis' }) : null,
createElement(Getter, { name: 'axes', computed: getAxes }),
createElement(

@@ -1264,4 +1664,3 @@ Template,

function (_ref3, _ref4) {
var domains$$1 = _ref3.domains,
argumentAxisName = _ref3.argumentAxisName,
var domains = _ref3.domains,
layouts = _ref3.layouts,

@@ -1271,4 +1670,10 @@ scaleExtension = _ref3.scaleExtension;

// TODO: Take axis from "axes" getter rather then from closure.
var placeholder = position + '-axis';
var domain = isArgumentAxis ? domains$$1[argumentAxisName] : domains$$1[name];
var domain = domains[name];
// TODO_DEBUG
if (!domain) {
throw new Error('domain is not found: ' + name);
}
// TODO_DEBUG
var orientation = domain.orientation,

@@ -1301,5 +1706,5 @@ type = domain.type;

position: 'relative',
width: orientation === 'horizontal' ? undefined : widthCalculated,
height: orientation === 'horizontal' ? heightCalculated : null,
flexGrow: orientation === 'horizontal' ? 1 : undefined
width: orientation === HORIZONTAL ? undefined : widthCalculated,
height: orientation === HORIZONTAL ? heightCalculated : null,
flexGrow: orientation === HORIZONTAL ? 1 : undefined
},

@@ -1320,3 +1725,3 @@ ref: function ref(node$$1) {

createElement(
Root,
RootComponent,
{

@@ -1333,3 +1738,3 @@ refsHandler: _this3.createRefsHandler(placeholder, changeBBox, orientation),

key = _ref6.key;
return createElement(Tick, {
return createElement(TickComponent, {
key: key,

@@ -1342,3 +1747,3 @@ x1: x1,

}),
createElement(Line, {
createElement(LineComponent, {
width: widthPostCalculated,

@@ -1358,3 +1763,3 @@ height: heightPostCalculated,

{ key: key },
createElement(Label, {
createElement(LabelComponent, {
text: text,

@@ -1377,8 +1782,7 @@ x: xText,

}]);
return Axis;
}(Component);
return RawAxis;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Axis.propTypes = {
name: string,
isArgumentAxis: bool,
process.env.NODE_ENV !== "production" ? RawAxis.propTypes = {
name: string.isRequired,
rootComponent: func.isRequired,

@@ -1393,23 +1797,88 @@ tickComponent: func.isRequired,

Axis.defaultProps = {
RawAxis.defaultProps = {
tickSize: 5,
indentFromAxis: 10,
name: undefined,
isArgumentAxis: false
indentFromAxis: 10
};
var Grid = function (_React$PureComponent) {
inherits(Grid, _React$PureComponent);
RawAxis.components = {
rootComponent: 'Root',
tickComponent: 'Tick',
labelComponent: 'Label',
lineComponent: 'Line'
};
function Grid() {
classCallCheck(this, Grid);
return possibleConstructorReturn(this, (Grid.__proto__ || Object.getPrototypeOf(Grid)).apply(this, arguments));
var Axis = withComponents({
Root: Root$1, Tick: Tick, Label: Label, Line: Line
})(RawAxis);
// TODO: It is not axis who defines that argument is HORIZONTAL and value is VERTICAL.
// TODO: Check that only BOTTOM and TOP are accepted.
var ArgumentAxis = withPatchedProps(function (props) {
return _extends({
position: BOTTOM
}, props, {
name: ARGUMENT_DOMAIN
});
})(Axis);
// TODO: Check that only LEFT and RIGHT are accepted.
var ValueAxis = withPatchedProps(function (props) {
return _extends({
position: LEFT
}, props, {
name: getValueDomainName(props.name)
});
})(Axis);
ArgumentAxis.components = Axis.components;
ValueAxis.components = Axis.components;
var Line$1 = function (_React$PureComponent) {
inherits(Line, _React$PureComponent);
function Line() {
classCallCheck(this, Line);
return possibleConstructorReturn(this, (Line.__proto__ || Object.getPrototypeOf(Line)).apply(this, arguments));
}
createClass(Grid, [{
createClass(Line, [{
key: 'render',
value: function render() {
var _props = this.props,
x1 = _props.x1,
x2 = _props.x2,
y1 = _props.y1,
y2 = _props.y2,
restProps = objectWithoutProperties(_props, ['x1', 'x2', 'y1', 'y2']);
return createElement('path', _extends({
d: 'M ' + x1 + ' ' + y1 + ' L ' + x2 + ' ' + y2
}, restProps));
}
}]);
return Line;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Line$1.propTypes = {
x1: number.isRequired,
x2: number.isRequired,
y1: number.isRequired,
y2: number.isRequired
} : void 0;
var RawGrid = function (_React$PureComponent) {
inherits(RawGrid, _React$PureComponent);
function RawGrid() {
classCallCheck(this, RawGrid);
return possibleConstructorReturn(this, (RawGrid.__proto__ || Object.getPrototypeOf(RawGrid)).apply(this, arguments));
}
createClass(RawGrid, [{
key: 'render',
value: function render() {
var _props = this.props,
name = _props.name,
Line = _props.lineComponent,
LineComponent = _props.lineComponent,
restProps = objectWithoutProperties(_props, ['name', 'lineComponent']);

@@ -1428,7 +1897,7 @@

function (_ref) {
var domains$$1 = _ref.domains,
var domains = _ref.domains,
layouts = _ref.layouts,
scaleExtension = _ref.scaleExtension;
var domain = domains$$1[name];
var domain = domains[name];
var orientation = domain.orientation,

@@ -1458,7 +1927,7 @@ type = domain.type;

key = _ref2.key;
return createElement(Line, _extends({
return createElement(LineComponent, _extends({
key: key,
x1: orientation === 'horizontal' ? x1 : width,
x1: orientation === HORIZONTAL ? x1 : width,
x2: x2,
y1: orientation === 'horizontal' ? height : y1,
y1: orientation === HORIZONTAL ? height : y1,
y2: y2

@@ -1474,15 +1943,32 @@ }, restProps));

}]);
return Grid;
return RawGrid;
}(PureComponent);
process.env.NODE_ENV !== "production" ? Grid.propTypes = {
name: string,
process.env.NODE_ENV !== "production" ? RawGrid.propTypes = {
name: string.isRequired,
lineComponent: func.isRequired
} : void 0;
Grid.defaultProps = {
name: undefined
RawGrid.components = {
lineComponent: 'Line'
};
export { Chart, Legend, Title, Scale, Stack, BarSeries, LineSeries, SplineSeries, ScatterSeries, AreaSeries, PieSeries, Axis, Grid };
var Grid = withComponents({ Line: Line$1 })(RawGrid);
var ArgumentGrid = withPatchedProps(function (props) {
return _extends({}, props, {
name: ARGUMENT_DOMAIN
});
})(Grid);
var ValueGrid = withPatchedProps(function (props) {
return _extends({}, props, {
name: getValueDomainName(props.name)
});
})(Grid);
ArgumentGrid.components = Grid.components;
ValueGrid.components = Grid.components;
export { Chart, Legend, Title, Scale, Stack, Palette, AreaSeries, BarSeries, LineSeries, PieSeries, ScatterSeries, SplineSeries, Axis, ArgumentAxis, ValueAxis, Grid, ArgumentGrid, ValueGrid, withPatchedProps, withComponents };
//# sourceMappingURL=dx-react-chart.es.js.map
{
"name": "@devexpress/dx-react-chart",
"version": "1.8.0-beta.1",
"version": "1.8.0",
"description": "Composable plugin-based chart component for React",

@@ -44,3 +44,3 @@ "author": {

"devDependencies": {
"@devexpress/dx-testing": "^1.8.0-beta.1",
"@devexpress/dx-testing": "^1.8.0",
"babel-core": "^6.26.3",

@@ -57,3 +57,3 @@ "babel-jest": "^23.4.2",

"enzyme-adapter-react-16": "^1.2.0",
"eslint": "^5.4.0",
"eslint": "^5.6.1",
"eslint-config-airbnb": "^17.1.0",

@@ -63,16 +63,16 @@ "eslint-config-airbnb-base": "^13.1.0",

"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.22.0",
"eslint-plugin-jest": "^21.24.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.1",
"jest": "^23.5.0",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-test-renderer": "^16.4.2",
"rollup": "0.50.0",
"jest": "^23.6.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-test-renderer": "^16.5.2",
"rollup": "^0.66.2",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-license": "^0.6.0",
"rollup-plugin-node-resolve": "^3.3.0"
"rollup-plugin-license": "^0.7.0",
"rollup-plugin-node-resolve": "^3.4.0"
},
"dependencies": {
"@devexpress/dx-chart-core": "^1.8.0-beta.1",
"@devexpress/dx-chart-core": "^1.8.0",
"d3-scale": "^2.1.2",

@@ -87,3 +87,3 @@ "d3-shape": "^1.2.2",

},
"gitHead": "8fb5dc5f32b4a02a8922917f07398b48902ecc5c"
"gitHead": "30dd98f003c170e60ce6eb79d48fe4e3ac99338d"
}

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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