Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0432'
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Dec 14, 2015
2 parents 3f16815 + 1621286 commit 26349ec
Show file tree
Hide file tree
Showing 19 changed files with 221 additions and 211 deletions.
29 changes: 24 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Version 0xxx - 2015/xx/xx

### Additions
- Added scaling for folder and name labels based on the camera's zoom factor
- Added MessageBox which displays a warning in case git isn't found on the user's system (Closes [#50](https://github.com/rm-code/logivi/issues/50))
- Added mouse panning and scaling (Closes [#45](https://github.com/rm-code/logivi/issues/45))
- The mouse can be used to drag around the camera while the left button is pressed
- The mouse wheel can be used to zoom in and out

### Fixes
- Fixed [#51](https://github.com/rm-code/logivi/issues/51) - Fixed crash caused by faulty variable
- Fixed [#48](https://github.com/rm-code/logivi/issues/48) - Got rid of the timer for color fading
- Fixed [#35](https://github.com/rm-code/logivi/issues/35) - Made large graphs more stable
- Fixed minor issue with folder labels being drawn multiple times per frame

### Other Changes
- LoGiVi now starts in windowed mode on first start
- Canged design of the file panel to be less intrusive

# Version 0404 - 2015/11/24

### Additions
Expand Down Expand Up @@ -67,7 +86,7 @@
- Added config file validation after it has been loaded (Closes [#26](https://github.com/rm-code/logivi/issues/26))

### Fixes
- Fixed [#33](https://github.com/rm-code/logivi/issues/33) - Ignore lines in config file which aren't formatted correctly
- Fixed [#33](https://github.com/rm-code/logivi/issues/33) - Ignore lines in config file which aren't formatted correctly
- Fixed [#32](https://github.com/rm-code/logivi/issues/32) - Resize Timeline when MainScreen is resized
- Fixed [#31](https://github.com/rm-code/logivi/issues/31) - Directly pass the repository's path to the git command
- Fixed [#30](https://github.com/rm-code/logivi/issues/30) - Ignore files when no changes were applied
Expand Down Expand Up @@ -95,7 +114,7 @@
- Added keybinding for manually loading the previous commit
- Added keybinding for rewersing the graph creation (will run back until it reaches the first commit)
- Added keybinding for toggling fullscreen mode
- Added a timeline
- Added a timeline
- Indicates the current position of the log compared to the total commit history and shows the date of the currently indexed commit
- Allows the user to quickly jump around in time (forward and backwards) while still rendering the full graph (Closes [#10](https://github.com/rm-code/logivi/issues/10))
- Can be hidden via keybinding or in the config file
Expand Down Expand Up @@ -172,7 +191,7 @@
- Rewrote most of the graph system
- The graph is structured and handled completely different than before with files, folder nodes and edges being independent from each other
- Gets rid of a lot of issues like edges overlaying other nodes
- The arrangement of files around folder nodes is no longer updated every frame
- The arrangement of files around folder nodes is no longer updated every frame
- Major improvements in memory usage, performance and garbage production
- Updated log reader to separate commits based on the author tag instead of looking for the "special" logivi_commit tag (which was pretty useless anyway)
- Updated log reader to digest unix timestamps and transform them into human readable dates
Expand All @@ -192,7 +211,7 @@

### Additions
- Added (rudimentary) Force-Directed Graph which - visualises the files and folders of a git repository at a given point in time
- Files are represented as evenly distributed leaves around their parent folder node
- Files are represented as evenly distributed leaves around their parent folder node
- Depending on the amount of files in one folder new folders will be created automatically)
- Modified files are coloured red and fade back to their original color over time
- Folders are represented as single green dots (this will be changed in one of the next releases) and are connected by lines
Expand All @@ -204,4 +223,4 @@
- Authors will show links to the files they currently edit
- Authors can be assigned an alias
- Authors can be assigned an avatar (grabbed online)
- Added warning message if no log file can be found
- Added warning message if no log file can be found
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# LoGiVi

LoGiVi is a git-repository visualisation tool inspired by [Gource](http://gource.io/) and __currently in development__. It was written from scratch using [Lua](http://www.lua.org/) and the [LÖVE](https://love2d.org/) framework. Note: Since version [0375](https://github.com/rm-code/logivi/releases/tag/0375) LoGiVi uses version [0.10.0](https://love2d.org/wiki/0.10.0) of the LÖVE framework.
LoGiVi is a git-repository visualisation tool inspired by [Gource](http://gource.io/) and __currently in development__. It was written from scratch using [Lua](http://www.lua.org/) and the [LÖVE](https://love2d.org/) framework.

Note: Since version [0375](https://github.com/rm-code/logivi/releases/tag/0375) LoGiVi uses version [0.10.0](https://love2d.org/wiki/0.10.0) of the LÖVE framework.

![Example Visualization](https://github.com/rm-code/logivi/wiki/media/logivi_0312.gif)

Expand Down Expand Up @@ -46,9 +48,6 @@ This will create the file _log.txt_ in the folder you are currently in. Take thi
/Users/Robert/Library/Application Support/LOVE/rmcode_LoGiVi/logs/yourProject/log.txt
```
LoGiVi will use the folder's name to identify the log so make it informative.

# LÖVE Version
Version 0351 and all prior versions of LoGiVi are written for Version 0.9.2 of the LÖVE framework. ___All future versions will be based on LÖVE 0.10.0 (currently unreleased).___

# License

Expand Down
2 changes: 1 addition & 1 deletion conf.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local PROJECT_TITLE = "LoGiVi";

local PROJECT_VERSION = "0404";
local PROJECT_VERSION = "0432";

local PROJECT_IDENTITY = "rmcode_LoGiVi";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ backgroundColor = 0, 0, 0
removeTmpFiles = false
screenWidth = 0
screenHeight = 0
fullscreen = true
fullscreen = false
fullscreenType = desktop
vsync = true
msaa = 0
Expand Down
4 changes: 2 additions & 2 deletions src/Author.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function Author.new(name, avatar, cx, cy)
-- Public Functions
-- ------------------------------------------------

function self:draw(rotation)
function self:draw(rotation, scale)
if active then
love.graphics.setLineWidth(BEAM_WIDTH);
for i = 1, #links do
Expand All @@ -94,7 +94,7 @@ function Author.new(name, avatar, cx, cy)
love.graphics.setColor(255, 255, 255, avatarAlpha);
love.graphics.draw(avatar, posX, posY, -rotation, AVATAR_SIZE / aw, AVATAR_SIZE / ah, aw * 0.5, ah * 0.5);
love.graphics.setFont(LABEL_FONT);
love.graphics.print(name, posX, posY, -rotation, 1, 1, LABEL_FONT:getWidth(name) * 0.5, - AVATAR_SIZE);
love.graphics.print(name, posX, posY, -rotation, 1 / scale, 1 / scale, LABEL_FONT:getWidth(name) * 0.5, - AVATAR_SIZE * scale);
love.graphics.setFont(DEFAULT_FONT);
love.graphics.setColor(255, 255, 255, 255);
end
Expand Down
4 changes: 2 additions & 2 deletions src/AuthorManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ end
---
-- Draws a list of all authors working on the project.
--
function AuthorManager.drawLabels(rotation)
function AuthorManager.drawLabels(rotation, scale)
if visible then
for _, author in pairs(authors) do
author:draw(rotation);
author:draw(rotation, scale);
end
end
end
Expand Down
17 changes: 5 additions & 12 deletions src/FileManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ local colors;
-- Local Functions
-- ------------------------------------------------

---
-- Returns the extension of a file (or '.?' if it doesn't have one).
-- @param fileName
--
local function splitExtension(fileName)
return fileName:match("(%.[^.]+)$") or '.?';
end

---
-- Takes the extensions list and creates a list
-- which is sorted by the amount of files per extension.
Expand Down Expand Up @@ -73,9 +65,9 @@ end
---
-- Adds a new file extension to the list.
-- @param fileName
-- @param ext
--
function FileManager.add(fileName)
local ext = splitExtension(fileName);
function FileManager.add(fileName, ext)
if not extensions[ext] then
extensions[ext] = {};
extensions[ext].extension = ext;
Expand All @@ -99,9 +91,10 @@ end
-- same extension. If there are no more files
-- of that extension, it will remove it from
-- the list.
-- @param fileName
-- @param ext
--
function FileManager.remove(fileName)
local ext = splitExtension(fileName);
function FileManager.remove(fileName, ext)
if not extensions[ext] then
error('Tried to remove the non existing file extension "' .. ext .. '".');
end
Expand Down
2 changes: 1 addition & 1 deletion src/conf/ConfigReader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local ConfigReader = {};
-- ------------------------------------------------

local FILE_NAME = 'settings.cfg';
local TEMPLATE_PATH = 'res/templates/settings.cfg';
local TEMPLATE_PATH = 'res/templates/settings_template.cfg';

local INVALID_CONFIG_HEADER = 'Invalid config file';
local MISSING_SECTION_WARNING = 'Seems like the loaded configuration file is missing the [%s] section. The default settings will be used instead.';
Expand Down
91 changes: 36 additions & 55 deletions src/graph/File.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,42 @@ local File = {};
-- Constants
-- ------------------------------------------------

local MOD_TIMER = 2;
local ANIM_TIMER = 3.5;
local FADE_TIMER = 3.0;
local MOD_TIMER = 1.5;

local MOD_COLOR = {
add = { r = 0, g = 255, b = 0 },
del = { r = 255, g = 0, b = 0 },
mod = { r = 254, g = 140, b = 0 },
add = { r = 0, g = 255, b = 0, a = 255 },
del = { r = 255, g = 0, b = 0, a = 255 },
mod = { r = 254, g = 140, b = 0, a = 255 },
};

-- ------------------------------------------------
-- Constructor
-- ------------------------------------------------

function File.new(parent, name, color, extension, x, y)
function File.new(posX, posY, defaultColor, extension)
local self = {};

local posX, posY = x, y;
local state;

-- The target and the current offset from the parent node's position.
-- This is used to arrange the files around a node.
local targetOffsetX, targetOffsetY = 0, 0;
local currentOffsetX, currentOffsetY = 0, 0;
local fileColor, extension = color, extension;
local currentColor = { r = 0, g = 0, b = 0, a = 255 };
local modified = false;
local timer = MOD_TIMER;
local fade = false;
local dead = false;

-- The actual color currently displayed on screen.
local currentColor = {};

-- ------------------------------------------------
-- Private Functions
-- ------------------------------------------------

local function lerp(a, b, t)
return a + (b - a) * t;
end

---
-- Resets the color values and the timer, and sets
-- the modified flag to false.
-- Linear interpolation between a and b.
--
local function reset()
timer = MOD_TIMER;
modified = false;
fade = false;
dead = false;
currentColor.r = fileColor.r;
currentColor.g = fileColor.g;
currentColor.b = fileColor.b;
currentColor.a = 255;
local function lerp(a, b, t)
return a + (b - a) * t;
end

---
Expand All @@ -60,8 +51,8 @@ function File.new(parent, name, color, extension, x, y)
-- @param tarY - The target offset on the y-axis.
--
local function animate(dt, tarX, tarY)
currentOffsetX = lerp(currentOffsetX, tarX, dt * 3.5);
currentOffsetY = lerp(currentOffsetY, tarY, dt * 3.5);
currentOffsetX = lerp(currentOffsetX, tarX, dt * ANIM_TIMER);
currentOffsetY = lerp(currentOffsetY, tarY, dt * ANIM_TIMER);
end

-- ------------------------------------------------
Expand All @@ -76,42 +67,32 @@ function File.new(parent, name, color, extension, x, y)
function self:update(dt)
animate(dt, targetOffsetX, targetOffsetY);

if fade then
currentColor.a = math.min(255, math.max(currentColor.a - 3, 0));
if currentColor.a <= 0 then
dead = true;
end
return;
end
-- Slowly change the color from the modified color back to the default.
currentColor.r = lerp(currentColor.r, defaultColor.r, dt * MOD_TIMER);
currentColor.g = lerp(currentColor.g, defaultColor.g, dt * MOD_TIMER);
currentColor.b = lerp(currentColor.b, defaultColor.b, dt * MOD_TIMER);

if modified then
if timer > 0 then
timer = timer - dt;
currentColor.r = lerp(currentColor.r, fileColor.r, dt * 1.5);
currentColor.g = lerp(currentColor.g, fileColor.g, dt * 1.5);
currentColor.b = lerp(currentColor.b, fileColor.b, dt * 1.5);
else
reset();
-- Slowly fade out the file when it has been marked for deletion.
if state == 'del' then
currentColor.a = math.max(0, math.min(currentColor.a - FADE_TIMER, 255));
if currentColor.a == 0 then
state = 'dead';
end
end
end

---
-- Marks the file as modified and changes the
-- current color to the modified color.
-- @param mod
-- Sets the state of the file and changes the current color to a specific
-- color based on the used modifier.
-- @param mod - The modifier used on the file.
--
function self:modify(mod)
reset();
function self:setState(mod)
state = mod;

modified = true;
currentColor.r = MOD_COLOR[mod].r;
currentColor.g = MOD_COLOR[mod].g;
currentColor.b = MOD_COLOR[mod].b;

if mod == 'del' then
fade = true;
end
currentColor.a = MOD_COLOR[mod].a;
end

-- ------------------------------------------------
Expand Down Expand Up @@ -153,7 +134,7 @@ function File.new(parent, name, color, extension, x, y)
-- Returns true if the file is marked as dead.
--
function self:isDead()
return dead;
return state == 'dead';
end

-- ------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions src/graph/Graph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ function Graph.new(ewidth, showLabels)
-- @param path
-- @param filename
--
local function applyGitModifier(modifier, path, filename, mode)
local function applyGitModifier(modifier, path, filename, extension, mode)
local targetNode = getNode(path);

local modifiedFile;
if modifier == MOD_ADD then
modifiedFile = targetNode:addFile(filename);
modifiedFile = targetNode:addFile(filename, extension);
elseif modifier == MOD_DELETE then
if mode == 'normal' then
modifiedFile = targetNode:markFileForDeletion(filename);
else
modifiedFile = targetNode:removeFile(filename);
modifiedFile = targetNode:removeFile(filename, extension);
end
elseif modifier == MOD_MODIFY then
modifiedFile = targetNode:modifyFile(filename);
Expand All @@ -179,12 +179,12 @@ function Graph.new(ewidth, showLabels)
-- Public Functions
-- ------------------------------------------------

function self:draw(camrot)
function self:draw(camrot, camscale)
root:draw(ewidth);
love.graphics.draw(spritebatch);

if showLabels then
root:drawLabel(camrot);
root:drawLabel(camrot, camscale);
end
end

Expand Down
Loading

0 comments on commit 26349ec

Please sign in to comment.