1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

When drawing a very wide graph line diagram, smush it together a bit

Summary: Depends on D20345. Use a narrower layout for very large graphs to save some space.

Test Plan:
Before:

{F6320215}

After:

{F6320216}

This does not affect smaller graphs.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20346
This commit is contained in:
epriestley 2019-03-28 17:49:00 -07:00
parent e586ed439a
commit cec779cdab
2 changed files with 17 additions and 9 deletions

View file

@ -14,7 +14,7 @@ return array(
'differential.pkg.css' => '8d8360fb', 'differential.pkg.css' => '8d8360fb',
'differential.pkg.js' => '67e02996', 'differential.pkg.js' => '67e02996',
'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => '91192d85', 'diffusion.pkg.js' => 'a98c0bf7',
'maniphest.pkg.css' => '35995d6d', 'maniphest.pkg.css' => '35995d6d',
'maniphest.pkg.js' => 'c9308721', 'maniphest.pkg.js' => 'c9308721',
'rsrc/audio/basic/alert.mp3' => '17889334', 'rsrc/audio/basic/alert.mp3' => '17889334',
@ -384,7 +384,7 @@ return array(
'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => '94243d89', 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => '94243d89',
'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'b7b73831', 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'b7b73831',
'rsrc/js/application/diffusion/behavior-commit-branches.js' => '4b671572', 'rsrc/js/application/diffusion/behavior-commit-branches.js' => '4b671572',
'rsrc/js/application/diffusion/behavior-commit-graph.js' => '1c88f154', 'rsrc/js/application/diffusion/behavior-commit-graph.js' => 'ef836bf2',
'rsrc/js/application/diffusion/behavior-locate-file.js' => '87428eb2', 'rsrc/js/application/diffusion/behavior-locate-file.js' => '87428eb2',
'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'c715c123', 'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'c715c123',
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '6a85bc5a', 'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '6a85bc5a',
@ -606,7 +606,7 @@ return array(
'javelin-behavior-differential-diff-radios' => '925fe8cd', 'javelin-behavior-differential-diff-radios' => '925fe8cd',
'javelin-behavior-differential-populate' => 'dfa1d313', 'javelin-behavior-differential-populate' => 'dfa1d313',
'javelin-behavior-diffusion-commit-branches' => '4b671572', 'javelin-behavior-diffusion-commit-branches' => '4b671572',
'javelin-behavior-diffusion-commit-graph' => '1c88f154', 'javelin-behavior-diffusion-commit-graph' => 'ef836bf2',
'javelin-behavior-diffusion-locate-file' => '87428eb2', 'javelin-behavior-diffusion-locate-file' => '87428eb2',
'javelin-behavior-diffusion-pull-lastmodified' => 'c715c123', 'javelin-behavior-diffusion-pull-lastmodified' => 'c715c123',
'javelin-behavior-document-engine' => '243d6c22', 'javelin-behavior-document-engine' => '243d6c22',
@ -1033,11 +1033,6 @@ return array(
'javelin-install', 'javelin-install',
'javelin-util', 'javelin-util',
), ),
'1c88f154' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
),
'1cab0e9a' => array( '1cab0e9a' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',
@ -2124,6 +2119,11 @@ return array(
'phabricator-keyboard-shortcut', 'phabricator-keyboard-shortcut',
'javelin-stratcom', 'javelin-stratcom',
), ),
'ef836bf2' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
),
'f166c949' => array( 'f166c949' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-behavior-device', 'javelin-behavior-device',

View file

@ -44,11 +44,19 @@ JX.behavior('diffusion-commit-graph', function(config) {
cxt.stroke(); cxt.stroke();
} }
// If the graph is going to be wide, squish it a bit so it doesn't take up
// quite as much space.
var default_width;
if (config.count >= 8) {
default_width = 6;
} else {
default_width = 12;
}
for (var ii = 0; ii < nodes.length; ii++) { for (var ii = 0; ii < nodes.length; ii++) {
var data = JX.Stratcom.getData(nodes[ii]); var data = JX.Stratcom.getData(nodes[ii]);
var cell = 12; // Width of each thread. var cell = default_width;
var xpos = function(col) { var xpos = function(col) {
return (col * cell) + (cell / 2); return (col * cell) + (cell / 2);
}; };