d3.js

Changing the rectangle size causes to curtail the path in sunburst visualization

守給你的承諾、 提交于 2020-01-25 10:03:29
问题 This ques is in continuation of the question here Changing the size of arrow boxes of the sunburst visualization As suggested by ee2dev changing the size works and so did the text size. But I get two issues with that. First the middle text shown in the center of chart is missing unlike what we see below for ee2dev. Second, the path is curtailed to only 4 boxes even if the path is long. See the screenshot. https://bl.ocks.org/ee2dev/4153ee8eafb5a27d32588b12877a0ea7 来源: https://stackoverflow

Changing the rectangle size causes to curtail the path in sunburst visualization

荒凉一梦 提交于 2020-01-25 10:03:11
问题 This ques is in continuation of the question here Changing the size of arrow boxes of the sunburst visualization As suggested by ee2dev changing the size works and so did the text size. But I get two issues with that. First the middle text shown in the center of chart is missing unlike what we see below for ee2dev. Second, the path is curtailed to only 4 boxes even if the path is long. See the screenshot. https://bl.ocks.org/ee2dev/4153ee8eafb5a27d32588b12877a0ea7 来源: https://stackoverflow

D3.js pie chart labels for slices not tweening

旧城冷巷雨未停 提交于 2020-01-25 04:48:05
问题 When I click on the various hyperlinks to tween my chart: while the pie's slices are tweening but I cannot figure out how to bring along each slice's label. A mostly working JSfiddle is here: http://jsfiddle.net/lukateake/MX7JC/ Thanks in advance for any insights you can provide me. I promise to update the fiddle with whatever solution we discover as I imagine this effect is of interest to a great many D3'ers. 回答1: The main issue here is in your updateChart function - while you rebound the

DC.js - Custom ordering of ordinal scale line chart

穿精又带淫゛_ 提交于 2020-01-25 04:14:06
问题 Please forgive my english. I am trying to create a line chart with ordinal scale and brushon function. I successfully set brushing on ordinal thanks to this method : https://dc-js.github.io/dc.js/examples/brush-ordinal.html And now I need to set the x-axis values order. My data is like this : [{"id_commune":4,"datation":"-30/-20","effectif":0.09,"commune":"Frejus","lieu_dit":"Les Aiguieres","departement":"83","pays":"FR","longitude":6.73703399,"latitude":43.433152,"quantite":1,"id_datation":1

How to position text labels on a Sunburst chart with d3.js

 ̄綄美尐妖づ 提交于 2020-01-25 03:45:07
问题 I am facing a problem trying to position text inside the wedges of a Sunburst chart which is based on d3.js.The text elements seem to be not positioned as desired even on zooming.. Here is the brief snippet of the code that i tried, but unsuccessfully : var slices = svg.selectAll(".form") .data(function(d) { return data_slices; }) .enter() .append("g"); slices.append("path") .attr("d", arc) .attr("id",function(d,i){return d[2]+""+i;}) .style("fill", function(d) { return color(d[2]);}) .on(

Leaflet with D3 polylines

独自空忆成欢 提交于 2020-01-25 03:00:31
问题 Is it possible to use D3 for polylines in Leaflet? What I am trying to achieve is a less accurate, but more stylised, route display. I'd like to use d3's interpolation('monotone') on a line (or path) which runs through each marker point in Leaflet and creates a smooth, curved line. The only example I have found close to this is http://erasmus.ahoi.in which creates nice smooth arcs using d3 and canvas. Does anyone know of any examples of this? I have created a fiddle with some markers on a

crossfilter.js with dc.js update charts on callback group change

风流意气都作罢 提交于 2020-01-25 00:29:08
问题 I have a factory for creating dc.js charts which uses crossfilters functions bound to $scope. Plnkr Example $scope.updateMyPie = function(data) { var cf = crossfilter(data) $scope.mypie.dimension = cf.dimension(function(d) { return d.key }) $scope.mypie.group = $scope.mypie.dimension.group().reduceSum(function(d){ return d.value }); } chart factory takes all chart properties through the DOM via angular directive so the tags are like so <mypie id="mypie" chart-dimesion="mypie.dimension" chart

Adding clickable links or onClick handler in a D3 force directed diagram?

别等时光非礼了梦想. 提交于 2020-01-25 00:12:05
问题 When a user clicks on a node in a D3 force directed diagram, is it possible to send them to a URL or to call JavaScript such as alert("You clicked on node 1")? 回答1: A click listener can be applied to a selection. Therefore you can apply it to the nodes by calling an .on("click",function(d){...}) on your nodes selection. This is not in any kind special for the force layout. Most of the time force layouts are combined with a drag behavior. You should be aware that the click is also triggered

Passing a function to .attr('d')?

て烟熏妆下的殇ゞ 提交于 2020-01-24 21:56:12
问题 I am attempting to use two different area generators inside one .data() selection, so that one set of points can have an area rendered from top to bottom while the second set's area can be rendered from left to right. I can pass fat arrow functions to every .attr() except 'd', which produces the following error: Error: <path> attribute d: Expected moveto path command ('M' or 'm'), "function area(da…". I need to access the selection index in order to set the area from an array of booleans.

D3 making new, smaller CSV file

若如初见. 提交于 2020-01-24 21:33:45
问题 I'm stuck with a quite simple problem and need help. I have a big CSV file with 50 columns which i absolutely can't modifie. Now i want to make a chart where i only need 5-6 columns out of it. My idea was now to make a new "data2" which contains only these 5-6 columns (with key and evertything) and work with this data2. But i'm not able to create this data2. To filter which columns i need i wanted to work with regex. Something like this: d3.keys(data[0]).filter(function(d) { return d.match(/.