Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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 }
});
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 ] }
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 = [{
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,