fixed issue where left show card was hiding behind top. Rearranged filters and added show/hide all. fixed directionality->working consistently

This commit is contained in:
Connor Turland 2012-11-24 17:48:26 -08:00
parent b34962b4f5
commit e493bbe2c9
10 changed files with 45 additions and 16906 deletions

View file

@ -73,21 +73,20 @@ function initFD(){
var pos = adj.nodeFrom.pos.getc(true);
var posChild = adj.nodeTo.pos.getc(true);
var direction = adj.getData("category");
var directionCat = adj.getData("category");
//label placement on edges
//plot arrow edge
if (direction == "none") {
if (directionCat == "none") {
this.edgeHelper.line.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, canvas);
}
else if (direction == "both") {
else if (directionCat == "both") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, false, canvas);
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, true, canvas);
}
else if (direction == "from-to") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, false, canvas);
}
else if (direction == "to-from") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, true, canvas);
else if (directionCat == "from-to") {
var direction = adj.data.$direction;
var inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id);
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, inv, canvas);
}
//check for edge label in data

View file

@ -73,21 +73,20 @@ function initRG(){
var pos = adj.nodeFrom.pos.getc(true);
var posChild = adj.nodeTo.pos.getc(true);
var direction = adj.getData("category");
var directionCat = adj.getData("category");
//label placement on edges
//plot arrow edge
if (direction == "none") {
if (directionCat == "none") {
this.edgeHelper.line.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, canvas);
}
else if (direction == "both") {
else if (directionCat == "both") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, false, canvas);
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, true, canvas);
}
else if (direction == "from-to") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, false, canvas);
}
else if (direction == "to-from") {
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, true, canvas);
else if (directionCat == "from-to") {
var direction = adj.data.$direction;
var inv = (direction && direction.length>1 && direction[0] != adj.nodeFrom.id);
this.edgeHelper.arrow.render({ x: pos.x, y: pos.y }, { x: posChild.x, y: posChild.y }, 40, inv, canvas);
}
//check for edge label in data

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -140,8 +140,9 @@ cursor: pointer; }
#iconLegend ul li {clear:both; list-style-type:none; display:block; padding:3px; }
#iconLegend ul img { width:40px; height:40px; float:left; }
#iconLegend ul p {float:left; display: block; margin: 0; background: none; padding: 10px 4px 2px 4px;}
#iconLegend #filters-left { float:left; }
#iconLegend #filters-right { float:left; }
#iconLegend #filters-one { float:left; }
#iconLegend #filters-two { float:left; }
#iconLegend #filters-three { float:left; }
#iconLegend li.toggledOff {
opacity: 0.4;

View file

@ -56,9 +56,9 @@ belongs_to :item_category
if @items.count > 1
json.array!(@items.delete_if{|item| (not item.authorize_to_view(current)) || (not item.has_viewable_synapses(current))}) do |item|
json.adjacencies item.synapses2.delete_if{|synapse| (not @items.include?(synapse.item1)) || (not synapse.authorize_to_view(current)) || (not synapse.item1.authorize_to_view(current)) } do |json, synapse|
json.nodeTo synapse.node1_id
json.nodeFrom synapse.node2_id
json.adjacencies item.synapses1.delete_if{|synapse| (not @items.include?(synapse.item2)) || (not synapse.authorize_to_view(current)) || (not synapse.item2.authorize_to_view(current)) } do |json, synapse|
json.nodeTo synapse.node2_id
json.nodeFrom synapse.node1_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@ -67,6 +67,7 @@ belongs_to :item_category
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
json.data @synapsedata
end

View file

@ -24,9 +24,9 @@ end
#json.adjacencies item.synapses2.delete_if{|synapse| (not @items.include?(synapse.item1)) || (not @synapses.include?(synapse)) || (not synapse.authorize_to_view(current)) || (not synapse.item1.authorize_to_view(current)) } do |json, synapse|
json.adjacencies item.synapses2.delete_if{|synapse| (not @items.include?(synapse.item1)) || (not synapse.authorize_to_view(current)) || (not synapse.item1.authorize_to_view(current)) } do |json, synapse|
json.nodeTo synapse.node1_id
json.nodeFrom synapse.node2_id
json.adjacencies item.synapses1.delete_if{|synapse| (not @items.include?(synapse.item2)) || (not synapse.authorize_to_view(current)) || (not synapse.item2.authorize_to_view(current)) } do |json, synapse|
json.nodeTo synapse.node2_id
json.nodeFrom synapse.node1_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@ -35,6 +35,7 @@ end
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
json.data @synapsedata
end

View file

@ -19,6 +19,7 @@ has_many :maps, :through => :mappings
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
json.data @synapsedata
end
end
@ -30,9 +31,9 @@ has_many :maps, :through => :mappings
@items.push(self.item2)
json.array!(@items) do |item|
json.adjacencies item.synapses2.delete_if{|synapse| not @items.include?(Item.find_by_id(synapse.node1_id))} do |json, synapse|
json.nodeTo synapse.node1_id
json.nodeFrom synapse.node2_id
json.adjacencies item.synapses1.delete_if{|synapse| not @items.include?(Item.find_by_id(synapse.node2_id))} do |json, synapse|
json.nodeTo synapse.node2_id
json.nodeFrom synapse.node1_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@ -41,6 +42,7 @@ has_many :maps, :through => :mappings
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
json.data @synapsedata
end

View file

@ -71,7 +71,7 @@
<div class="legend">
<div id="iconLegend">
<h3>FILTERS</h3>
<ul id="filters-left">
<ul id="filters-one">
<li id="showAll">Show All</li>
<li><img src="/assets/action.png" alt="Action" /><p>action</p></li>
<li><img src="/assets/activity.png" alt="Activity" /><p>activity</p></li>
@ -82,18 +82,20 @@
<li><img src="/assets/futuredev.png" alt="Future Dev" /><p>future dev</p></li>
<li><img src="/assets/group.png" alt="Group" /><p>group</p></li>
<li><img src="/assets/idea.png" alt="Idea" /><p>idea</p></li>
</ul>
<ul id="filters-two">
<li id="hideAll">Hide All</li>
<li><img src="/assets/implication.png" alt="Implication" /><p>implication</p></li>
<li><img src="/assets/insight.png" alt="Insight" /><p>insight</p></li>
<li><img src="/assets/intention.png" alt="Intention" /><p>intention</p></li>
<li><img src="/assets/knowledge.png" alt="Knowledge" /><p>knowledge</p></li>
<li><img src="/assets/location.png" alt="Location" /><p>location</p></li>
</ul>
<ul id="filters-right">
<li id="hideAll">Hide All</li>
<li><img src="/assets/openissue.png" alt="Open Issue" /><p>open issue</p></li>
<li><img src="/assets/opinion.png" alt="Opinion" /><p>opinion</p></li>
<li><img src="/assets/opportunity.png" alt="Opportunity" /><p>opportunity</p></li>
<li><img src="/assets/person.png" alt="Person" /><p>person</p></li>
</ul>
<ul id="filters-three">
<li><img src="/assets/platform.png" alt="Platform" /><p>platform</p></li>
<li><img src="/assets/problem.png" alt="Problem" /><p>problem</p></li>
<li><img src="/assets/question.png" alt="Question" /><p>question</p></li>

View file

@ -65,10 +65,18 @@ if (map1 != null) {
lineWidth: 3,
color: '#36acfb'
});
var d = new Array(<%= @synapse.node1_id.to_s() %>, <%= @synapse.node2_id.to_s() %>);
console.log('d=' + d);
temp.setDataset('current', {
desc: '<%= @synapse.desc %>',
category: '<%= @synapse.category %>'
showDesc: false,
category: '<%= @synapse.category %>',
id: '<%= @synapse.id %>',
userid: '<%= @synapse.user.id %>',
username: '<%= @synapse.user.name %>'
});
temp.data.$direction = d;
console.log(temp);
mymap.fx.plotLine(temp, mymap.canvas);
mymap.fx.animate({
modes: ['node-property:dim','edge-property:lineWidth:color'],