d3.js

Semantic zoom on map with circle showing capital

 ̄綄美尐妖づ 提交于 2019-12-25 05:36:27
问题 I wanted to implement semantic zoom on map of d3.js. I have developed a example of map and Major cities of particular country, which is working fine but sometime circle got overlap due to near places in maps so if i implement semantic zoom which will solve my circle overlapping problem. I don't understand how to transform only graph not circle in my map. My zooming function code is : var zoom = d3.behavior.zoom() .on("zoom",function() { g.attr("transform","translate("+ d3.event.translate.join

D3, dates on the x axis, data the width of a date

假装没事ソ 提交于 2019-12-25 05:36:11
问题 I am visualizing data by date. I want something a bit like this: The point is that I want to draw rectangles that are the width of the days. Here's how I draw rectangles: svg.selectAll(".my_class") .data(my_data) .enter() .append("rect") .attr({ "width": function(d) { return x_scale.rangeBand(); }, "height": function(d) { return h_scale(d.end - d.start); }, "x": function(d) { return x_scale(new Date(d.date)); }, "y": function(d) { return y_scale(d.end); }, "class": function(d) { return d

D3 is not responding after 2 nd time i hit the database for some result

扶醉桌前 提交于 2019-12-25 05:34:12
问题 I am using a D3 api in which i am representing some hierarchy between the nodes through links between them.all the data comes from database when i load the page.But here i have a criteria where i have to filter top 3 or 5 nodes i.e i have a select box here where i have values from 1 to 5.Now if i go for 2 the database will return the hierarchy for 2nd level.But i have a problem here when i load the page ,onload it will return a default level from the database,but when i go for 2nd or 3 rd

D3 - issues on first transition after initialization

只谈情不闲聊 提交于 2019-12-25 05:27:09
问题 I have created this jsbin http://jsbin.com/ibewux/3/edit to show a strange behavior on transitions. When the chart is initialized, it correctly displays the data (see the table below it). If I try to change the chart type through the dropdown menu, some series are swapped; after this happens, the series are not swapped anymore. Same thing happens if you click on updateChartData button; first time it will swap the series compared to the data displayed in the table. So it seems that only the

how to plot the image inside the polygon in d3

隐身守侯 提交于 2019-12-25 05:20:52
问题 hi all i am using d3 chart with polygon i have one map structure d3 chart and plot one circle for the purpose of show tooltip now my need is i need to show one image 'https://i.stack.imgur.com/O9xB5.png' to replace the circle so when mouse over the image i shown tooltip and another need show 'State Abbr' inside polygon like Ak,TD,PD... .help ow to do this here i attached my code files code <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <script src="http://d3js.org/d3.v3.min.js

d3 showing an error while using parse method tp parse the date. “TypeError: t.substring is not a function”

佐手、 提交于 2019-12-25 05:04:11
问题 What is causing me this error.. am i parsing the date wrongly or something else?? Actually i am trying to update the data periodically and pass it to javascript function that produces a d3 graph.... is my update method wrongly written??? please help me out with this.... <script type="text/javascript"> //<![CDATA[ $.noConflict(); jQuery(document) .ready( function($) { var x=(${rawEventsMB.jsonString}); var data1=JSON.stringify(x); var data = JSON.parse(data1); function InitChart(data) { try {

How to bring a selected (clicked on) bootstrap popover forward when multiple popovers are open?

♀尐吖头ヾ 提交于 2019-12-25 04:56:09
问题 I am using a bootstrap popover on svg elements in D3. Multiple popovers can be open at any given time. What I would like to know is how to, on clicking on a popover at the back, to force it to move to the front i.e. being focused on? Is there any way to increment the z-index of an individual popover to move it forward manually? Thanks. Edit: I have managed to create a fiddle using the suggested answer. The problem arises that, with using the global variable, it increments the z-index

nvd3 + lineplusbarchart + allign axises

混江龙づ霸主 提交于 2019-12-25 04:26:43
问题 not sure if I am going about this the right way but here goes... So i have the this example see fiddle here using lineplusbarchart and i am building on it from this question i posted here: SO question I have edited the lineplusbarchart to show the labels on the xaxis: chart.xAxis.tickFormat(function(d) { var dx = testdata[0].values[d] && testdata[0].values[d].x || 0; return dx; }) .showMaxMin(false); but i am still having a couple of issues to get what i want... 1 -> how can i make the y1 and

D3 JSON paths and SVGs

女生的网名这么多〃 提交于 2019-12-25 04:24:58
问题 After some wrestling, I have managed to put together a JSON file that can draw me a map of London and its boroughs. It's here http://graphitti.org/admin2/files/experiments/03_scaledTM5.html Apart from the fact that the boundaries aren't perfect, the map seems OK but there's a problem in that some, but not all, of the paths apparently take up the whole SVG space. So when I inspect them in the DOM, I end up selecting the whole area. Likewise if I were to colour them in with a fill, I'd turn the

Overlaying circles on leaflet with d3 results in not positioned properly

强颜欢笑 提交于 2019-12-25 04:18:02
问题 I want to overlay a leaflet map with circles through d3 . <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>D3 Test</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"> <script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> </head> <body> <div id="map" style="width:600px; height:600px;"> <script> var map = new L.Map("map", { center: [37.8,