How to use the d3-scale.scaleIdentity function in d3-scale

To help you get started, we’ve selected a few d3-scale 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 DefinitelyTyped / DefinitelyTyped / d3-scale / d3-scale-tests.ts View on Github external
outputString = logScaleNumString(10);

// copy(...) -----------------------------------------------------------------

let copiedLogScale: d3Scale.ScaleLogarithmic = logScaleNumString.copy();

// -------------------------------------------------------------------------------
// Identity Scale Factory
// -------------------------------------------------------------------------------

// scaleIdentity -----------------------------------------------------------------

let identityScale: d3Scale.ScaleIdentity;

identityScale = d3Scale.scaleIdentity();


// ScaleIdentity Interface ========================================================


// domain(...) -----------------------------------------------------------------

identityScale = identityScale.domain(domainNumeric);
identityScale = identityScale.domain(domainNumbers);
domainNumbers = identityScale.domain();

// range(...) -----------------------------------------------------------------

identityScale = identityScale.range(rangeNumbers);
rangeNumbers = identityScale.range();
github DefinitelyTyped / DefinitelyTyped / types / d3-scale / d3-scale-tests.ts View on Github external
outputString = logScaleNumString(10);

// copy(...) -----------------------------------------------------------------

const copiedLogScale: d3Scale.ScaleLogarithmic = logScaleNumString.copy();

// -------------------------------------------------------------------------------
// Identity Scale Factory
// -------------------------------------------------------------------------------

// scaleIdentity -----------------------------------------------------------------

let identityScale: d3Scale.ScaleIdentity;

identityScale = d3Scale.scaleIdentity();

// ScaleIdentity Interface ========================================================

// domain(...) -----------------------------------------------------------------

identityScale = identityScale.domain(domainNumeric);
identityScale = identityScale.domain(domainNumbers);
domainNumbers = identityScale.domain();

// range(...) -----------------------------------------------------------------

identityScale = identityScale.range(rangeNumbers);
rangeNumbers = identityScale.range();

// invert(...) -----------------------------------------------------------------
github Evercoder / uiuiui / src / Surface / DeltaSurface.js View on Github external
className="uix-surface--delta"
				x_scale={scale_identity}
				y_scale={scale_identity}
				onStart={this.start}
				onChange={this.change}
				onEnd={this.end}
				passive={this.props.passive}
				interacting={this.props.interacting}
			>
				{this.props.children}
			
		);
	}
}

const scale_identity = scaleIdentity();

DeltaSurface.propTypes = {
	onChange: PropTypes.func,
	onStart: PropTypes.func,
	onEnd: PropTypes.func,
	passive: PropTypes.bool,
	interacting: PropTypes.bool
};

DeltaSurface.defaultProps = {
	onChange: noop,
	onStart: noop,
	onEnd: noop,
	passive: false,
	interacting: false
};
github nteract / semiotic / src / components / OrdinalFrame.js View on Github external
import { pointOnArcAtAngle, renderLaidOutPieces } from "./svg/pieceDrawing"
import {
  clusterBarLayout,
  barLayout,
  pointLayout,
  swarmLayout,
  timelineLayout
} from "./svg/pieceLayouts"

import { drawSummaries, renderLaidOutSummaries } from "./svg/summaryLayouts"
import { stringToFn } from "./data/dataFunctions"

import PropTypes from "prop-types"

const xScale = scaleIdentity()
const yScale = scaleIdentity()

const midMod = d => (d.middle ? d.middle : 0)
const zeroFunction = () => 0
const twoPI = Math.PI * 2

const naturalLanguageTypes = {
  bar: { items: "bar", chart: "bar chart" },
  clusterbar: { items: "bar", chart: "grouped bar chart" },
  swarm: { items: "point", chart: "swarm plot" },
  point: { items: "point", chart: "point plot" },
  timeline: { items: "bar", chart: "timeline" }
}

const projectedCoordinatesObject = { y: "y", x: "x" }

const defaultOverflow = { top: 0, bottom: 0, left: 0, right: 0 }
github nteract / semiotic / src / components / OrdinalFrame.js View on Github external
} from "./svg/frameFunctions"
import { pointOnArcAtAngle, renderLaidOutPieces } from "./svg/pieceDrawing"
import {
  clusterBarLayout,
  barLayout,
  pointLayout,
  swarmLayout,
  timelineLayout
} from "./svg/pieceLayouts"

import { drawSummaries, renderLaidOutSummaries } from "./svg/summaryLayouts"
import { stringToFn } from "./data/dataFunctions"

import PropTypes from "prop-types"

const xScale = scaleIdentity()
const yScale = scaleIdentity()

const midMod = d => (d.middle ? d.middle : 0)
const zeroFunction = () => 0
const twoPI = Math.PI * 2

const naturalLanguageTypes = {
  bar: { items: "bar", chart: "bar chart" },
  clusterbar: { items: "bar", chart: "grouped bar chart" },
  swarm: { items: "point", chart: "swarm plot" },
  point: { items: "point", chart: "point plot" },
  timeline: { items: "bar", chart: "timeline" }
}

const projectedCoordinatesObject = { y: "y", x: "x" }
github react-d3 / react-d3-core / src / utils / scale.jsx View on Github external
export function scale(props) {
  const {
    type,
    scale,
  } = props;

  var func;

  if(scale === 'linear')
    func = D3Scale.scaleLinear();
  else if(scale === 'identity')
    func = D3Scale.scaleIdentity();
  else if(scale === 'sqrt')
    func = D3Scale.scaleSqrt();
  else if(scale === 'pow')
    func = D3Scale.scalePow();
  else if(scale === 'log')
    func = D3Scale.scaleLog();
  else if(scale === 'quantize')
    func = D3Scale.scaleQuantize();
  else if(scale === 'quantile')
    func = D3Scale.scaleQuantile();
  else if(scale === 'ordinal')
    func = D3Scale.scaleOrdinal()
  else if(scale === 'band')
    func = D3Scale.scaleBand();
  else if(scale === 'time')
    func = D3Scale.scaleTime();