mirror of https://gitee.com/bigwinds/arangodb
GraphViewer: Changed default values for the layout
This commit is contained in:
parent
5b2c0a03a9
commit
8f6180f1cb
|
@ -47,12 +47,17 @@ function ForceLayouter(config) {
|
|||
"use strict";
|
||||
var self = this,
|
||||
force = d3.layout.force(),
|
||||
/*
|
||||
distance = config.distance || 240, // 80
|
||||
gravity = config.gravity || 0.01, // 0.08
|
||||
charge = config.charge || -1000, // -240
|
||||
*/
|
||||
distance = config.distance || 160,
|
||||
gravity = config.gravity || 0.08,
|
||||
charge = config.charge || -600,
|
||||
onUpdate = config.onUpdate || function () {},
|
||||
width = config.width || 940,
|
||||
height = config.height || 640,
|
||||
width = config.width || 880,
|
||||
height = config.height || 680,
|
||||
parseConfig = function(config) {
|
||||
if (config.distance) {
|
||||
force.linkDistance(config.distance);
|
||||
|
|
|
@ -397,10 +397,10 @@
|
|||
expect(mock.gravity).wasCalledWith(0.08);
|
||||
expect(mock.charge).wasCalledWith(-240);
|
||||
*/
|
||||
expect(mock.size).wasCalledWith([940, 640]);
|
||||
expect(mock.linkDistance).wasCalledWith(240);
|
||||
expect(mock.gravity).wasCalledWith(0.01);
|
||||
expect(mock.charge).wasCalledWith(-1000);
|
||||
expect(mock.size).wasCalledWith([880, 680]);
|
||||
expect(mock.linkDistance).wasCalledWith(160);
|
||||
expect(mock.gravity).wasCalledWith(0.08);
|
||||
expect(mock.charge).wasCalledWith(-600);
|
||||
});
|
||||
|
||||
it('should be able to switch the distance', function() {
|
||||
|
|
Loading…
Reference in New Issue