How to use the @antv/scale.identity function in @antv/scale

To help you get started, we’ve selected a few @antv/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 antvis / G2 / test / unit / geom / geom-spec.js View on Github external
max: 10
});

const scaleB = Scale.linear({
  field: 'b',
  min: 0,
  max: 5,
  nice: false
});

const scaleC = Scale.cat({
  field: 'c',
  values: [ '1', '2' ]
});

const ScaleRed = Scale.identity({
  field: 'red',
  value: 'red'
});

const ScaleTen = Scale.identity({
  field: '10',
  value: 10
});
const coord = new Coord.Rect({
  start: {
    x: 0,
    y: 0
  },
  end: {
    x: 500,
    y: 500
github antvis / G2 / test / unit / geom / geom-spec.js View on Github external
describe('test edge', function() {
  const scaleX = Scale.linear({
    field: 'x',
    min: 0,
    max: 5
  });
  const scaleY = Scale.linear({
    field: 'y',
    min: 0,
    max: 5
  });
  const scaleVh = Scale.identity({
    field: 'vhv',
    value: 'vhv'
  });

  const data = [
    { x: [ 1, 2 ], y: [ 3, 4 ] },
    { x: [ 2, 3 ], y: [ 1, 5 ] }
  ];

  const group = canvas.addGroup();
  const geom = new Geom.Edge({
    data,
    coord,
    container: group,
    scales: { x: scaleX, y: scaleY, vhv: scaleVh, red: ScaleRed }
  });
github antvis / G2 / test / unit / geom / geom-spec.js View on Github external
describe('test schema', function() {
  const scaleX = Scale.linear({
    field: 'x',
    min: 0,
    values: [ 0, 1, 2, 3, 4, 5 ],
    max: 10
  });
  const scaleY = Scale.linear({
    field: 'y',
    min: 0,
    max: 5
  });

  const scaleBox = Scale.identity({
    field: 'box',
    value: 'box'
  });

  const scaleCandle = Scale.identity({
    field: 'candle',
    value: 'candle'
  });

  const group = canvas.addGroup();

  describe('test box', function() {
    const data = [
      { x: 1, y: [ 0, 1, 2, 3, 4 ] },
      { x: 2, y: [ 1, 2, 3, 4 ] },
      { x: 3, y: [ 0, 4 ] }
github antvis / G2 / test / unit / geom / geom-spec.js View on Github external
min: 0,
  max: 5,
  nice: false
});

const scaleC = Scale.cat({
  field: 'c',
  values: [ '1', '2' ]
});

const ScaleRed = Scale.identity({
  field: 'red',
  value: 'red'
});

const ScaleTen = Scale.identity({
  field: '10',
  value: 10
});
const coord = new Coord.Rect({
  start: {
    x: 0,
    y: 0
  },
  end: {
    x: 500,
    y: 500
  }
});

describe('test geoms', function() {
  const data = [{
github antvis / G2 / test / unit / geom / geom-spec.js View on Github external
min: 0,
    values: [ 0, 1, 2, 3, 4, 5 ],
    max: 10
  });
  const scaleY = Scale.linear({
    field: 'y',
    min: 0,
    max: 5
  });

  const scaleBox = Scale.identity({
    field: 'box',
    value: 'box'
  });

  const scaleCandle = Scale.identity({
    field: 'candle',
    value: 'candle'
  });

  const group = canvas.addGroup();

  describe('test box', function() {
    const data = [
      { x: 1, y: [ 0, 1, 2, 3, 4 ] },
      { x: 2, y: [ 1, 2, 3, 4 ] },
      { x: 3, y: [ 0, 4 ] }
    ];

    const geom = new Geom.Schema({
      data,
      coord,

@antv/scale

Toolkit for mapping abstract data into visual representation.

MIT
Latest version published 6 months ago

Package Health Score

73 / 100
Full package analysis