d3.js

Uncaught SyntaxError: Unexpected token =

我与影子孤独终老i 提交于 2019-12-31 08:44:15
问题 I just switched from using a local copy of the minified version of d3.v3 to the development version. It worked fine when using the minified version, but using my local copy of http://d3js.org/d3.v3.js gives me the error in the title, referencing this line: var € = Math.PI, µ = 1e-6, d3_radians = € / 180, d3_degrees = 180 / €; When I include the hosted file, it works fine. 回答1: The problem is that you are serving D3 with the ISO-8859-1 character encoding (often the browser default), whereas D3

Is there any proper way to integrate d3.js graphics into Facebook React application?

情到浓时终转凉″ 提交于 2019-12-31 07:56:47
问题 Yes, I know there is react-art, but it seems to be broken. The problem is that d3.js is all about mutating the browser DOM, and using it directly, say inside componentDidMount method, will not work properly, because all changes to browser DOM will not be reflected in React's virtual DOM. Any ideas? 回答1: One strategy might be to build a black-box component that you never let React update. The component life cycle method shouldComponentUpdate() is intended to allow a component to determine on

How to update both the content and location of text labels on a D3 pie chart

怎甘沉沦 提交于 2019-12-31 07:56:24
问题 I'm trying to make a pie chart with d3.js that looks like this: Note that the labels are placed along the edges of the pie chart. Initially, I am able to draw the pie charts and properly place the text nodes (the fiddle only displays one pie chart; assume, however, that they all have data that works and is appropriate, as this one does). However, when I go to adjust the data, I can't seem to .attr(translate, transform) them to the correct region along the edge of the pie chart (or do anything

Error:Invalid value for <path> attribute d=“MNaN,NaNA67.5,67.5 0 1,1 NaN,NaNL0,0Z”

▼魔方 西西 提交于 2019-12-31 07:42:09
问题 I have made a pie chart which works fine when all values are present,but when all values are made 0, in console i get 600+ errors saying: Error: Invalid value for attribute transform="translate(NaN,NaN)" Error: Invalid value for attribute d="M4.133182947122317e-15,-67.5A67.5,67.5 0 1,1 NaN,NaNL0,0Z" I am unable to figure out. Please help. var data = [ {label:"Category 1", value:0}, {label:"Category 2", value:0}, {label:"Category 3", value:0} ]; var colorRange = d3.scale.category20(); var

Error:Invalid value for <path> attribute d=“MNaN,NaNA67.5,67.5 0 1,1 NaN,NaNL0,0Z”

点点圈 提交于 2019-12-31 07:42:07
问题 I have made a pie chart which works fine when all values are present,but when all values are made 0, in console i get 600+ errors saying: Error: Invalid value for attribute transform="translate(NaN,NaN)" Error: Invalid value for attribute d="M4.133182947122317e-15,-67.5A67.5,67.5 0 1,1 NaN,NaNL0,0Z" I am unable to figure out. Please help. var data = [ {label:"Category 1", value:0}, {label:"Category 2", value:0}, {label:"Category 3", value:0} ]; var colorRange = d3.scale.category20(); var

Make multiple line with animation from the last position to the new positions

╄→гoц情女王★ 提交于 2019-12-31 07:37:13
问题 In my real problem I'm consuming a web service that returns an array with points in x and y. this is the structure of the array that I can receive. var dataSet=[ [ { "voltaje": 10, "corriente": Math.random() * 130 + 10}, { "voltaje": 40, "corriente": Math.random() * 130 + 10}, { "voltaje": 70, "corriente": Math.random() * 130 + 10} ], [ { "voltaje": 100, "corriente": Math.random() * 130 + 10}, { "voltaje": 130, "corriente": Math.random() * 130 + 10}, { "voltaje": 160, "corriente": Math.random

mouseover on line doesn't give circle in d3 js

十年热恋 提交于 2019-12-31 06:58:33
问题 I try to get circle when mouses over on line like this. I used d3 js not nvd3. my code is <!DOCTYPE html> <style> body { font: 10px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } div.circle{ border-radius: 50%; width: 30px; height: 30px; } </style> <html> <head> <script type="text/javascript" src="d3.v3.min.js"></script> </head> <body> <script type="text/javascript"> data = [ {date: 1,temp:10},{date: 2,temp:40},{date: 3,temp:90}, {date: 4,temp

parsing json to bar chart d3js

て烟熏妆下的殇ゞ 提交于 2019-12-31 05:36:18
问题 I'm trying to create a bar chart using the json url. With respect to impressions and time. I don't think I'm referencing the data correctly at .data(data) how do I access the impressions field from json file in d3? var url = "https://script.google.com/macros/s/AKfycbwy56QiQwyfkkaLFWZ33QHVieAHhtLJYNa_AzKcCBr-J7Catgv2/exec?id=1vQsWQPUET20KcgeRKgs5NOOBngqLeUuNTHI1bWi5Et8&sheet=Sheet1"; d3.json(url, function(data) { console.log(data.Sheet1[0]); var canvas = d3.select("body").append("svg") .attr(

D3.js Zoomable Sunburst not Zooming

陌路散爱 提交于 2019-12-31 05:18:46
问题 I have a static 3 level Sunburst diagram - http://colinwhite.net/Sunburst/ My data is being nested with this function http://colinwhite.net/Sunburst/js/treeRemapper.js My approach is based on this example - http://bl.ocks.org/mbostock/4348373 For some reason my zoom and tweening is not working - var width = 960, height = 700, radius = Math.min(width, height) / 2, color = d3.scale.category20c(); var x = d3.scale.linear().range([0, 2 * Math.PI]), y = d3.scale.sqrt().range([0, radius]); var svg

How can I avoid d3.zoom translate on first zoom or pan?

冷暖自知 提交于 2019-12-31 05:13:09
问题 I try to make an orgchart with zoom and paning. To do so I need to call .nodeSize which translate my "root" to (0,0). Then I re-translate it by width/2 and it's ok. But when I implement d3.zoom, my "root" go back to (0,0)... How can i avoid this behavior ? Here is the code concerned : var svg = d3.select("#svg1").append("svg") .attr("width", width) .attr("height", height) .call(d3.zoom().on("zoom", function () { svg.attr("transform", d3.event.transform); })) .append('g').attr("transform",