diff --git a/ui/src/visualizations/File-Evolution/chart/chart.js b/ui/src/visualizations/File-Evolution/chart/chart.js
new file mode 100644
index 00000000..9ac8e06d
--- /dev/null
+++ b/ui/src/visualizations/File-Evolution/chart/chart.js
@@ -0,0 +1,129 @@
+'use strict';
+
+import React from 'react';
+import * as d3 from 'd3';
+
+import styles from '../styles.scss';
+import ReactDOM from 'react-dom';
+
+export default class FileEvolution extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+ componentWillReceiveProps(nextProps) {}
+
+ componentDidMount() {}
+
+ render() {
+ const space = 50;
+ const commitBoxes = this.getCommitsDraw(space);
+ //const svgHeight = (commitRects.length / 2 + 1) * this.props.commitBoxHeight + (commitRects.length / 2) * space;
+ const svgHeight = this.props.commitBoxHeight + space;
+ const svgWidth = (commitBoxes.length / 2 + 1) * this.props.commitBoxHeight + (commitBoxes.length / 2) * space;
+ return (
+
+ );
+ }
+
+ getCommitsDraw(space) {
+ function getBoxColor(props, commit) {
+ let color = 'red';
+ if (props.commitBoxColor === 'author') {
+ color = props.authorsColorPalette[commit.signature];
+ } else if (props.commitBoxColor === 'branch') {
+ //TODO branch color
+ color = 'yellow';
+ }
+ return color;
+ }
+
+ function getCommitInfo(props, commit) {
+ //TODO font size
+ const commitInfo = [];
+ if (props.showCommitMessage === 'header') {
+ commitInfo.push({commit.messageHeader});
+ } else if (props.showCommitMessage === 'all') {
+ commitInfo.push({commit.message});
+ }
+ if (props.showCommitDate) {
+ if (commitInfo.length > 0) {
+ commitInfo.push(
);
+ }
+ commitInfo.push({commit.date});
+ }
+ if (props.showCommitAuthor) {
+ if (commitInfo.length > 0) {
+ commitInfo.push(
);
+ }
+ commitInfo.push({commit.signature});
+ }
+ return commitInfo;
+ }
+
+ function getArrow(x, y, height, width) {
+ //TODO Arrow
+ const arrow = [];
+
+ const lineXstart = x + width + 5;
+ const lineY = y + height / 2;
+ const lineXend = x + width + space - 5;
+ const pointsForLine = '' + lineXstart.toString() + ',' + lineY.toString() + ' ' + lineXend.toString() + ',' + lineY.toString();
+
+ const arrowHeadYup = y + height / 4;
+ const arrowHeadYdown = y + (height / 4) * 3;
+ const arrowHeadX = lineXstart + ((lineXend - lineXstart) / 4) * 3;
+ const pointsForArrowHead =
+ '' +
+ arrowHeadX.toString() +
+ ',' +
+ arrowHeadYup.toString() +
+ ' ' +
+ lineXend.toString() +
+ ',' +
+ lineY.toString() +
+ ' ' +
+ arrowHeadX.toString() +
+ ',' +
+ arrowHeadYdown.toString();
+
+ arrow.push();
+ arrow.push();
+ return arrow;
+ }
+ const commitData = this.props.commits;
+ const width = this.props.commitBoxWidth;
+ const height = this.props.commitBoxHeight;
+ const commitRects = [];
+ let x = 20;
+ let y = 20;
+ for (const i in commitData) {
+ const commit = commitData[i];
+ if (this.props.selectedAuthors.indexOf(commit.signature) > -1) {
+ const color = getBoxColor(this.props, commit);
+ commitRects.push(
+
+
+
+ {getCommitInfo(this.props, commit)}
+
+
+ );
+
+ commitRects.push(
+
+ {getArrow(x, y, height, width)}
+
+ );
+
+ x = x + width + space;
+ //y = y + height + space; //TODO auskommentieren
+ }
+ }
+ commitRects.pop(); //remove last arrow
+ return commitRects;
+ }
+}
diff --git a/ui/src/visualizations/File-Evolution/chart/index.js b/ui/src/visualizations/File-Evolution/chart/index.js
new file mode 100644
index 00000000..14f5f569
--- /dev/null
+++ b/ui/src/visualizations/File-Evolution/chart/index.js
@@ -0,0 +1,31 @@
+'use strict';
+
+import { connect } from 'react-redux';
+
+import Chart from './chart.js';
+
+const mapStateToProps = (state /*, ownProps*/) => {
+ const FileEvolutionState = state.visualizations.fileEvolution.state;
+ console.log(FileEvolutionState);
+ return {
+ branches: FileEvolutionState.data.data.branches,
+ committers: FileEvolutionState.data.data.committers,
+ commits: FileEvolutionState.data.data.commits,
+ authorsColorPalette: FileEvolutionState.data.data.authorsColorPalette,
+ branchesColorPalette: FileEvolutionState.data.data.branchesColorPalette,
+ selectedAuthors: FileEvolutionState.config.selectedAuthors,
+ selectedBranches: FileEvolutionState.config.selectedBranches,
+ commitBoxHeight: FileEvolutionState.config.commitBoxHeight,
+ commitBoxWidth: FileEvolutionState.config.commitBoxWidth,
+ commitBoxColor: FileEvolutionState.config.commitBoxColor,
+ showCommitDate: FileEvolutionState.config.showCommitDate,
+ showCommitAuthor: FileEvolutionState.config.showCommitAuthor,
+ showCommitMessage: FileEvolutionState.config.showCommitMessage
+ };
+};
+
+const mapDispatchToProps = (dispatch /*, ownProps*/) => {
+ return {};
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(Chart);
diff --git a/ui/src/visualizations/File-Evolution/styles.scss b/ui/src/visualizations/File-Evolution/styles.scss
index b717df68..c96ffa9d 100644
--- a/ui/src/visualizations/File-Evolution/styles.scss
+++ b/ui/src/visualizations/File-Evolution/styles.scss
@@ -33,3 +33,20 @@
.configContainer{
}
+
+.chartContainer{
+.chartDiv {
+ width: 500px;
+ height: 100vh;
+ overflow-x: scroll;
+ overflow-y: scroll;
+}
+ svg{
+ position: relative;
+ overflow: scroll;
+ }
+
+ foreignObject{
+ overflow: scroll;
+ }
+}