Skip to content

Commit

Permalink
Fixing review comments- removing sliders for colors and zoom and addi…
Browse files Browse the repository at this point in the history
…ng color pickers, updating values for min and max zoom and replacing logo of the plugin
  • Loading branch information
anuprulez committed Mar 27, 2017
1 parent 086dfd7 commit 04941d0
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 132 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Expand Up @@ -112,25 +112,12 @@ define( [], function() {
return 'uid-' + top.__utils__uid__++;
};

/** Create Hex code from RGB color */
function toHexColor( rgb ) {
var red = rgb[0].toString(16),
green = rgb[1].toString(16),
blue = rgb[2].toString(16);
red = ( red.length == 1 ? "0" + red : red );
green = ( green.length == 1 ? "0" + green : green );
blue = ( blue.length == 1 ? "0" + blue : blue );

return "#" + red + green + blue;
};

return {
get : get,
merge : merge,
uid : uid,
request : request,
clone : clone,
isJSON : isJSON,
toHexColor : toHexColor
isJSON : isJSON
};
});
Expand Up @@ -67,50 +67,20 @@ define( [], function() {
{ label : 'Leaves', value : 'leaves' },
{ label : 'None', value : '' } ]
},
choose_red : {
name : 'choose_red',
label : 'Red',
help : 'Select red component for highlighted edges',
type : 'integer',
min : 0,
max : 255,
value : 51
color_picker_nodes : {
label : 'Select a color for nodes',
type : 'color',
value : '#30c9bc'
},
choose_green : {
name : 'choose_green',
label : 'Green',
help : 'Select green component for highlighted edges',
type : 'integer',
min : 0,
max : 255,
value : 102
color_picker_edges : {
label : 'Select a color for edges',
type : 'color',
value : '#ddd'
},
choose_blue : {
name : 'choose_blue',
label : 'Blue',
help : 'Select blue component for highlighted edges',
type : 'integer',
min : 0,
max : 255,
value : 153
},
min_zoom : {
name : 'min_zoom',
label : 'Minimum zoom',
help : 'Select minimum zoom for the display.',
type : 'float',
min : 1/10,
max : 1,
value : 1/2
},
max_zoom : {
name : 'max_zoom',
label : 'Maximum zoom',
help : 'Select maximum zoom for the display.',
type : 'float',
min : 2,
max : 20,
value : 5
color_picker_highlighted : {
label : 'Select a color for highlighted nodes and edges',
type : 'color',
value : '#330a9b'
}
}
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -7,17 +7,10 @@ define( [ 'utilities/utils', 'utilities/sifjson', 'plugins/cytoscape/cytoscape'
settings = options.chart.settings,
data_content = null,
cytoscape = null,
rgb = [],
hex_color = "",
astar_root = "",
astar_destination = "",
sif_file_ext = "sif";

// Get hex color for the highlighted edges
rgb.push( parseInt( settings.get( 'choose_red' ) ) );
rgb.push( parseInt( settings.get( 'choose_green' ) ) );
rgb.push( parseInt( settings.get( 'choose_blue' ) ) );
hex_color = Utils.toHexColor( rgb );
sif_file_ext = "sif",
highlighted_color = settings.get( 'color_picker_highlighted' );

Utils.get( {
url : dataset.download_url,
Expand All @@ -35,12 +28,12 @@ define( [ 'utilities/utils', 'utilities/sifjson', 'plugins/cytoscape/cytoscape'
layout: {
name: settings.get( 'layout_name' )
},
minZoom: parseFloat( settings.get( 'min_zoom' ) ),
maxZoom: parseFloat( settings.get( 'max_zoom' ) ),
minZoom: 0.1,
maxZoom: 20,
style: [{
selector: 'node',
style: {
'background-color': '#30c9bc',
'background-color': settings.get( 'color_picker_nodes' ),
'height': 20,
'width': 20,
'opacity': 1,
Expand All @@ -54,16 +47,16 @@ define( [ 'utilities/utils', 'utilities/sifjson', 'plugins/cytoscape/cytoscape'
'haystack-radius': 0,
'width': 5,
'opacity': 1,
'line-color': '#ddd',
'line-color': settings.get( 'color_picker_edges' ),
'target-arrow-shape': settings.get( 'directed' )
}
},
{
selector: '.searchpath',
style: {
'background-color': hex_color,
'line-color': hex_color,
'target-arrow-color': hex_color,
'background-color': highlighted_color,
'line-color': highlighted_color,
'target-arrow-color': highlighted_color,
'transition-property': 'background-color, line-color, target-arrow-color',
'transition-duration': '0.5s'
}
Expand Down

0 comments on commit 04941d0

Please sign in to comment.