2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 d3.select('#legend').style.visibility="visible";
21 var svg1 = d3.select('#legend').append('svg');
22 var g1 = svg1.append("g");
23 svg1.attr('width', "100%")
24 .attr('height', "100%");
26 var circle1 = svg1.append("circle")
30 .attr('fill', greaterthan75_color)
31 .attr('stroke', 'black')
32 .attr('fill-opacity', 1.0);
35 var text4 = g1.append("text")
38 .attr("font-family", "sans-serif")
39 .attr("font-size", "10px");
40 text4.text(greaterthan75_text);
41 text4.attr("fill", "black");
43 var circle2 = svg1.append("circle")
47 .attr('fill', lessthan50_75_color)
48 .attr('stroke', 'black')
49 .attr('fill-opacity', 1.0);
51 var text5 = g1.append("text")
54 .attr("font-family", "sans-serif")
55 .attr("font-size", "10px");
56 text5.text(lessthan50_75_text);
57 text5.attr("fill", "black");
60 var circle3 = svg1.append("circle")
64 .attr('fill', lessthan50_color)
65 .attr('stroke', 'black')
66 .attr('fill-opacity', 1.0);
68 var text6 = g1.append("text")
71 .attr("font-family", "sans-serif")
72 .attr("font-size", "10px");
73 text6.text(lessthan50_text);
74 text6.attr("fill", "black");
76 //var zoom = d3.behavior.zoom().on ("zoom", move);
77 var zoom = d3.behavior.zoom()
78 .on("zoom",function() {
79 //alert(d3.event.scale);
80 g.attr("transform","translate("+d3.event.translate.join(",")+")scale("+d3.event.scale+")")
81 if(d3.event.scale >= 4) {
83 .scale(d3.event.scale);