How to use the victory-core.Data.getData function in victory-core

To help you get started, we’ve selected a few victory-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FormidableLabs / victory / packages / victory-voronoi / src / helper-methods.js View on Github external
const getCalculatedValues = (props) => {
  const defaultStyles =
    props.theme && props.theme.voronoi && props.theme.voronoi.style
      ? props.theme.voronoi.style
      : {};
  const style = Helpers.getStyles(props.style, defaultStyles);
  const data = Data.getData(props);
  const range = {
    x: Helpers.getRange(props, "x"),
    y: Helpers.getRange(props, "y")
  };
  const domain = {
    x: Domain.getDomain(props, "x"),
    y: Domain.getDomain(props, "y")
  };
  const scale = {
    x: Scale.getBaseScale(props, "x")
      .domain(domain.x)
      .range(props.horizontal ? range.y : range.x),
    y: Scale.getBaseScale(props, "y")
      .domain(domain.y)
      .range(props.horizontal ? range.x: range.y)
  };
github FormidableLabs / victory / packages / victory-bar / src / helper-methods.js View on Github external
const getCalculatedValues = (props) => {
  const { theme, polar } = props;
  const defaultStyles = theme && theme.bar && theme.bar.style ? theme.bar.style : {};
  const style = Helpers.getStyles(props.style, defaultStyles);
  const data = Data.getData(props);
  const range = {
    x: Helpers.getRange(props, "x"),
    y: Helpers.getRange(props, "y")
  };
  const domain = {
    x: Domain.getDomainWithZero(props, "x"),
    y: Domain.getDomainWithZero(props, "y")
  };
  const scale = {
    x: Scale.getBaseScale(props, "x")
      .domain(domain.x)
      .range(props.horizontal ? range.y : range.x),
    y: Scale.getBaseScale(props, "y")
      .domain(domain.y)
      .range(props.horizontal ? range.x: range.y)
  };
github FormidableLabs / victory-chart / src / components / victory-group / victory-group.js View on Github external
getDataWithOffset(props, defaultDataset, offset) {
    const dataset = props.data || props.y ? Data.getData(props) : defaultDataset;
    const xOffset = offset || 0;
    return dataset.map((datum) => {
      const _x1 = datum._x instanceof Date
        ? new Date(datum._x.getTime() + xOffset)
        : datum._x + xOffset;

      return assign({}, datum, { _x1 });
    });
  }
github FormidableLabs / victory-chart / src / helpers / wrapper.js View on Github external
const getData = (childProps) => {
      const data = Data.getData(childProps);
      return Array.isArray(data) && data.length > 0 ? data : undefined;
    };
github FormidableLabs / victory / packages / victory-group / src / helper-methods.js View on Github external
function getDataWithOffset(props, defaultDataset = [], offset) {
  const dataset = props.data || props.y ? Data.getData(props) : defaultDataset;
  const xOffset = offset || 0;
  return dataset.map((datum) => {
    const _x1 =
      datum._x instanceof Date ? new Date(datum._x.getTime() + xOffset) : datum._x + xOffset;

    return assign({}, datum, { _x1 });
  });
}
github FormidableLabs / victory / packages / victory-voronoi-container / src / voronoi-helpers.js View on Github external
const getData = (childProps) => {
      const data = Data.getData(childProps);
      return Array.isArray(data) && data.length > 0 ? data : undefined;
    };
github FormidableLabs / victory / src / components / victory-selection-container / helper-methods.js View on Github external
const getData = (childProps) => {
      const data = Data.getData(childProps);
      return Array.isArray(data) && data.length > 0 ? data : undefined;
    };