Skip to content

Commit

Permalink
General styling fixes. (refs #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsayer2 committed Jan 25, 2018
1 parent 88db815 commit 56c082d
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 28 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"@types/localforage": "0.0.34",
"@types/papaparse": "^4.1.28",
"BootSideMenu": "0.0.1",
"alertify.js": "^1.0.12",
"bootbox": "^4.4.0",
"bootstrap-sass": "3.3.7",
"bootstrap-slider": "^9.8.0",
Expand Down
26 changes: 20 additions & 6 deletions src/data_import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as papaparse from 'papaparse';
import * as $ from 'jquery';
import * as localforage from 'localforage';
import * as bootbox from 'bootbox';
import * as alertify from 'alertify.js';
import {textTransition} from './utilities';
import {MAppViews} from './app';
import {AppConstants} from './app_constants';
Expand Down Expand Up @@ -50,31 +51,40 @@ class DataImport implements MAppViews {

if(!dataAvailable) {
d3.select('.dataVizView').classed('invisibleClass', true);
d3.select('#backBtn').classed('invisibleClass', true);
} else {
d3.select('.dataVizView').classed('invisibleClass', false);
d3.select('#backBtn').classed('invisibleClass', false);
d3.select('.dataLoadingView').classed('invisibleClass', true);
}

this.build();
this.attachListener();

//Return the promise directly as long there is no dynamical data to update
// Return the promise directly as long there is no dynamical data to update
return Promise.resolve(this);
}

/**
* Build the basic DOM elements
*/
private build() {
//Add the upload form and whole container
// Add the upload form and whole container
this.$fileContainer = this.$node.html(`
<div class='fileContainer'>
<button type='button' id='specialBtn' class='btn btn-primary btn-lg'>Start Visualization</button>
<center><h2 id='informationText'>Upload your data here!!</h2></center>
<center><h2 id='informationText'>Load your data here!!</h2></center>
<form class='form-inline well'>
<div class='form-group'>
<label for='files'>Upload a CSV file:</label>
<input type='file' id='files' class='form-control' accept='.csv' required />
<div class='input-group'>
<span class='input-group-btn' style='padding-right: 2px;'>
<span class='btn btn-default btn-file'>
Load CSV file...
<input type='file' id='files' accept='.csv' required />
</span>
</span>
<input readonly='readonly' placeholder='CSV file' class='form-control' id='filename' type='text'>
</div>
</div>
<div class='form-group'>
<button type='submit' id='submitFile' class='btn btn-primary'>
Expand All @@ -84,7 +94,7 @@ class DataImport implements MAppViews {
</div>
</form>`);

//Add the display conatiner and the logs
// Add the display conatiner and the logs
d3.select('.fileContainer').append('div').classed('additionalInfo', true);
this.$displayContainer = d3.select('.additionalInfo').html(`
<div class='logContainer'>
Expand Down Expand Up @@ -275,6 +285,10 @@ class DataImport implements MAppViews {
});

d3.selectAll('a').on('click', (e) => {console.log('testaaaaaaa'); e.preventDefault();});

$('#files').change(function(){
$('#filename').val($(this).val().replace('C:\\fakepath\\', ''));
});
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/sankey_diagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class SankeyDiagram implements MAppViews {
</div>
<div class='col-sm-1' style='margin-top: 24px;'>
<a data-toggle='collapse' href='#collapseContentEntity' aria-expanded='true' class='collapsed'>
<i class='fa fa-pencil-square-o pull-right'></i></a>
<i class='fa fa-pencil-square-o pull-right specialIcon'></i></a>
</div>
</div>
<div id='collapseContentEntity' class='collapse'>
Expand Down Expand Up @@ -156,7 +156,7 @@ class SankeyDiagram implements MAppViews {
</div>
<div class='col-sm-1' style='margin-top: 24px;'>
<a data-toggle='collapse' href='#collapseContentEntity3' aria-expanded='true' class='collapsed'>
<i class='fa fa-pencil-square-o pull-right'></i></a>
<i class='fa fa-pencil-square-o pull-right specialIcon'></i></a>
</div>
</div>
<div id='collapseContentEntity3' class='collapse' style='width: 67%; margin-left: 21%;'>
Expand Down Expand Up @@ -194,7 +194,7 @@ class SankeyDiagram implements MAppViews {
</div>
<div class='col-sm-1' style='margin-top: 24px;'>
<a data-toggle='collapse' href='#collapseContentEntity2' aria-expanded='true' class='collapsed'>
<i class='fa fa-pencil-square-o pull-right'></i></a>
<i class='fa fa-pencil-square-o pull-right specialIcon'></i></a>
</div>
</div>
<div id='collapseContentEntity2' class='collapse'>
Expand Down
65 changes: 47 additions & 18 deletions src/styles/_data_imports.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@
}

.demo {
width:100%;
border:1px dashed #C0C0C0;
border-collapse:collapse;
padding:5px;
width: 100%;
border: 1px dashed #C0C0C0;
border-collapse: collapse;
padding: 5px;
table-layout: fixed;
}
.demo th {
border:1px dashed #C0C0C0;
padding:5px;
background:#CCCCCC;
border: 1px dashed #C0C0C0;
padding: 5px;
background: #CCCCCC;
}
.demo td {
border:1px dashed #C0C0C0;
text-align:left;
padding:5px;
border: 1px dashed #C0C0C0;
text-align: left;
padding: 5px;
}

.leftTD {
Expand All @@ -95,20 +95,49 @@
}

.downloadTable {
width:100%;
border:1px dotted #C0C0C0;
border-collapse:collapse;
padding:5px;
width: 100%;
border: 1px dotted #C0C0C0;
border-collapse: collapse;
padding: 5px;
}
.downloadTable th {
border:1px dotted #C0C0C0;
padding:5px;
border: 1px dotted #C0C0C0;
padding: 5px;
}
.downloadTable td {
border:1px dotted #C0C0C0;
padding:5px;
border: 1px dotted #C0C0C0;
padding: 5px;
}

#helpInfo {
margin-top: 40px;
}

.btn-file {
position: relative;
overflow: hidden;
}

.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
font-size: 999px;
text-align: right;
filter: alpha(opacity=0);
opacity: 0;
background: red;
cursor: inherit;
display: block;
}

input[readonly] {
background-color: white !important;
cursor: text !important;
}

#filename {
margin-right: 100px;
}
2 changes: 1 addition & 1 deletion src/styles/_sankey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ svg text.yaxisunit {
// transform: rotate(-90deg);
//}

.row .fa {
.specialIcon {
color: #808080;
font-size: 1.3em;
}
Expand Down

0 comments on commit 56c082d

Please sign in to comment.