Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding themes (and other vis improvements) #49

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
30 changes: 24 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var watchify = require('watchify');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var concat = require('gulp-concat');
var less = require('gulp-less');

// testing
var mocha = require('gulp-mocha');
Expand Down Expand Up @@ -120,7 +121,7 @@ gulp.task('build-test',['init'], function() {
});

gulp.task('test-watch', function() {
gulp.watch(['./src/**/*.js','./lib/**/*.js', './test/**/*.js', './style/main.css'], ['test']);
gulp.watch(['./src/**/*.js','./lib/**/*.js', './test/**/*.js', './less/**/*.less', './style/main.css'], ['test']);
});

//build tasks
Expand All @@ -136,17 +137,34 @@ gulp.task('init', ['clean'], function() {
});
});

gulp.task('compile-css', ['init'], function() {
return gulp.src("./less/*.less")
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./style/'));
});

gulp.task('copy-resources', ['init'], function() {
gulp.src(["./font/**/*.*"])
.pipe(gulp.dest(buildDir + '/font/'));
return gulp.src("./style/*.css")
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(concat('main.css'))
.pipe(gulp.dest(buildDir + '/css/'));
});

gulp.task('build-css', ['copy-resources', 'compile-css'], function() {
return gulp.src(["./style/main.css", "./style/fontello.css"])
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(concat('main.css'))
.pipe(gulp.dest(buildDir + '/css/'));
});

gulp.task('build-css-theme', ['compile-css'], function() {
return gulp.src(["./style/*theme*.css"])
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest(buildDir + '/css/'));
});

// browserify debug
gulp.task('build-browser',['copy-resources'], function() {
gulp.task('build-browser',['init', 'build-css', 'build-css-theme'], function() {
var b = browserify({debug: true,hasExports: true});
exposeBundles(b);
return b.bundle()
Expand Down
177 changes: 177 additions & 0 deletions less/fv-theme-grey.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
@import "includes/defaults";

/*
d3.scale.category20()
*/
@c1: #1f77b4;
@c2: #aec7e8;
@c3: #ff7f0e;
@c4: #ffbb78;
@c5: #2ca02c;
@c6: #98df8a;
@c7: #d62728;
@c8: #ff9896;
@c9: #9467bd;
@c10: #c5b0d5;
@c11: #8c564b;
@c12: #c49c94;
@c13: #e377c2;
@c14: #f7b6d2;
@c15: #7f7f7f;
@c16: #c7c7c7;
@c17: #bcbd22;
@c18: #dbdb8d;
@c19: #17becf;
@c20: #9edae5;

@c_chain: @c1;
@c_transit: @c2;
@c_init_met: @c3;
@c_propep: @c4;
@c_peptide: @c5;
@c_signal: @c6;
@c_turn: @c7;
@c_strand: @c8;
@c_helix: @c9;
@c_crosslnk: @c10;
@c_disulfid: @c11;
@c_region: @c12;
@c_coiled: @c13;
@c_motif: @c14;
@c_repeat: @c15;
@c_ca_bind: @c16;
@c_dna_bind: @c17;
@c_domain: @c18;
@c_zn_fing: @c19;
@c_np_bind: @c20;
@c_metal: @c1;
@c_site: @c2;
@c_binding: @c3;
@c_act_site: @c4;
@c_mod_res: @c5;
@c_lipid: @c6;
@c_carbohyd: @c7;
@c_compbias: @c8;
@c_mutagen: @c9;
@c_conflict: @c10;
@c_non_cons: @c11;
@c_non_ter: @c12;
@c_unsure: @c13;
@c_non_std: @c14;
@c_topo_dom: @c15;
@c_transmem: @c16;
@c_intramem: @c17;

.pv-theme-grey {
.up_pftv_navruler svg {
background-color: transparent;
}

.up_pftv_buttons {
padding: 0;
margin: 0;
width: 100%;
text-align: center;
}

.up_pftv_buttons span {
background-color: #eee;
border: 1px solid #ccc;
border-radius: 3px 3px;
padding: 2px;
margin: 2px;
}

.up_pftv_buttons span:hover {
background-color: #fff;
border-color: #999;
}

.up_pftv_aaviewer .background, .up_pftv_viewport .background {
fill: white;
}

.up_pftv_container text.domain-label {
font-size: 12px !important;
}

.up_pftv_container, .up_pftv_aaviewer text {
font-family: Helvetica, sans-serif;
}

.up_pftv_container .up_pftv_navruler .resize {
font-size: 20px;
fill: #999;
fill-opacity: 1.0;
}

.up_pftv_category-container {
border-right: 1px solid #ddd;
border-top: 1px solid #ddd;
}

.up_pftv_category {
margin-bottom: 0;
border-bottom: 1px solid #ddd;
}

.up_pftv_category-name {
background-color: #eee;
text-transform: uppercase;
}

.up_pftv_category a:hover {
background-color: #ddd;
}

.up_pftv_track-header {
background-color: #f3f3f3;
text-align: right;
text-transform: uppercase;
font-size: 12px;
font-style: italic;
}

.up_pftv_track {
border-top: 1px solid #eee;
}

.up_pftv_navruler path.trapezoid {
}

.up_pftv_container .up_pftv_navruler .axis .tick, .up_pftv_container .up_pftv_navruler .axis .domain {
stroke: black;
}
.up_pftv_container .up_pftv_navruler .axis text {
stroke: none;
fill: black;
}

.up_pftv_navruler .extent {
fill: steelblue;
stroke: none;
}

.up_pftv_navruler .handle {
fill: #eee;
fill-opacity: 1.0;
stroke: #999;
stroke-opacity: 1.0;
stroke-width: 1;
}

.up_pftv_navruler text.domain-label {
fill: black;
}

.up_pftv_navruler .handle:hover {
fill: #ccc;
}

.up_pftv_disulphid {
}

@svg_features();
}


86 changes: 86 additions & 0 deletions less/includes/defaults.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@c_chain: #CC9933;
@c_transit: #009966;
@c_init_met: #996633;
@c_propep: #99CCCC;
@c_peptide: #006699;
@c_signal: #CC0033;
@c_turn: #0571AF;
@c_strand: #FFCC00;
@c_helix: #FF0066;
@c_crosslnk: #FF6600;
@c_disulfid: #23B14D;
@c_region: #B33E00;
@c_coiled: #006699;
@c_motif: #402060;
@c_repeat: #9900FF;
@c_ca_bind: #FF3399;
@c_dna_bind: #009933;
@c_domain: #9999FF;
@c_zn_fing: #990066;
@c_np_bind: #FF9900;
@c_metal: #009900;
@c_site: #660033;
@c_binding: #006699;
@c_act_site: #FF6666;
@c_mod_res: #000066;
@c_lipid: #99CC33;
@c_carbohyd: #CC3366;
@c_compbias: #FF3366;
@c_mutagen: #FF9900;
@c_conflict: #6633CC;
@c_non_cons: #FF0033;
@c_non_ter: #339933;
@c_unsure: #33FF00;
@c_non_std: #330066;
@c_topo_dom: #CC0000;
@c_transmem: #CC00CC;
@c_intramem: #0000CC;

@c_variant: #fc3133;
@c_unique: #fc3133;
@c_non_unique: #8585fc;

/* Features */
@svg_features: {
svg .up_pftv_chain { stroke: @c_chain; fill: @c_chain; }
svg .up_pftv_transit { stroke: @c_transit; fill: @c_transit; }
svg .up_pftv_init_met { stroke: @c_init_met; fill: @c_init_met; }
svg .up_pftv_propep { stroke: @c_propep; fill: @c_propep; }
svg .up_pftv_peptide { stroke: @c_peptide; fill: @c_peptide; }
svg .up_pftv_signal { stroke: @c_signal; fill: @c_signal; }
svg .up_pftv_crosslnk { stroke: @c_crosslnk; fill: @c_crosslnk; }
svg .up_pftv_disulfid { stroke: @c_disulfid; fill: @c_disulfid; }
svg .up_pftv_region { stroke: @c_region; fill: @c_region; }
svg .up_pftv_coiled { stroke: @c_coiled; fill: @c_coiled; }
svg .up_pftv_motif { stroke: @c_motif; fill: @c_motif; }
svg .up_pftv_repeat { stroke: @c_repeat; fill: @c_repeat; }
svg .up_pftv_ca_bind { stroke: @c_ca_bind; fill: @c_ca_bind; }
svg .up_pftv_dna_bind { stroke: @c_dna_bind; fill: @c_dna_bind; }
svg .up_pftv_domain { stroke: @c_domain; fill: @c_domain; }
svg .up_pftv_zn_fing { stroke: @c_zn_fing; fill: @c_zn_fing; }
svg .up_pftv_np_bind { stroke: @c_np_bind; fill: @c_np_bind; }
svg .up_pftv_metal { stroke: @c_metal; fill: @c_metal; }
svg .up_pftv_binding { stroke: @c_binding; fill: @c_binding; }
svg .up_pftv_act_site { stroke: @c_act_site; fill: @c_act_site; }
svg .up_pftv_mod_res { stroke: @c_mod_res; fill: @c_mod_res; }
svg .up_pftv_lipid { stroke: @c_lipid; fill: @c_lipid; }
svg .up_pftv_carbohyd { stroke: @c_carbohyd; fill: @c_carbohyd; }
svg .up_pftv_variant { stroke: @c_variant; fill: @c_variant; }
svg .up_pftv_compbias { stroke: @c_compbias; fill: @c_compbias; }
svg .up_pftv_mutagen { stroke: @c_mutagen; fill: @c_mutagen; }
svg .up_pftv_conflict { stroke: @c_conflict; fill: @c_conflict; }
svg .up_pftv_non_cons { stroke: @c_non_cons; fill: @c_non_cons; }
svg .up_pftv_non_ter { stroke: @c_non_ter; fill: @c_non_ter; }
svg .up_pftv_unsure { stroke: @c_unsure; fill: @c_unsure; }
svg .up_pftv_non_std { stroke: @c_non_std; fill: @c_non_std; }
svg .up_pftv_topo_dom { stroke: @c_topo_dom; fill: @c_topo_dom; }
svg .up_pftv_transmem { stroke: @c_transmem; fill: @c_transmem; }
svg .up_pftv_intramem { stroke: @c_intramem; fill: @c_intramem; }
svg .up_pftv_unique { stroke: @c_unique; fill: @c_unique; }
svg .up_pftv_non_unique { stroke: @c_non_unique; fill: @c_non_unique; }

svg .up_pftv_turn { stroke: @c_turn; fill: @c_turn; }
svg .up_pftv_strand { stroke: @c_strand; fill: @c_strand; }
svg .up_pftv_helix { stroke: @c_helix; fill: @c_helix; }
};

Loading