Move a node to a certain position without dragging

I use D3.js and i want that a node move to a certain position ( 1; 1000) after i clicked a button. The onclick function looks like this: var node = svg.append("g") .attr("class", "nodes") .selectAll("circle") .data(

how to use a CDN in a React component

I found a similar question, but didn't understand any of the answers (and the question was downvoted) So here I go: I'm trying to use a library built on D3, called Greuler, in order to dynamically render graphs. The npm package for it seems to be bro

d3 - Can not return data from the JSON request?

I'm trying to use d3.json() inside of a function to return data Spotify's API given an artist ID (such as 5K4W6rqBFWDnAN6FQUkS6x), but I can't figure out how to effectively return the data. The function looks like // Get artist's related artist's inf

Add an image to an existing table header

I have created a table, and I would like to add an image to the header. I am using a library called D3.js to create the table. The code is as follows: var columns = [ {src:"http://iconbug.com/data/3a/256/77c71e95885bf94c06c7c68ccb63b131.png"}, {

D3: Translate two identical paths to be parallel

My question is as follows: (a) I am plotting two paths in D3 that have exactly the same coordinates. The same paths. (b) I would now like to transform one of the paths so that they run parallel and that the 'width' between the paths is always equal t

Use d3.js in Angular2

There are a few question on SO about it, but unfortunately they all seem to be deprecated. Im using angular2 with angular-cli. To install d3.js im using npm install d3. My app.component.ts file: import { Component } from '@angular/core'; import * as

D3: Convert data to number

I have a bar chart in D3 and I want to display on the x axis some dates. What I get from the database are two fields which I have to concatenate to get the year and the month. See below. The idea is that for the d.date field i get NaN, although I hav

JSON drawing in SVG drawing with D3js

So this will be the first time where I couldn't find an answer to my problem just by searching.. I am quite new to D3 and to Javascript in general, and what I am trying to achieve is a visualisation of some curves exported from a CAD tool (Autodesk R

Two identical csv http URLs in D3

I am trying to combine two or multiple csv data from URL Http request using D3.js of different days but with the code above only get the first chart data.How could do that?,what i am doing wrong?: d3.csv("https://website.com/entry.csv?start=2015-11-3

D3 Access node attributes in the table

I'm new to D3 and I'm trying to set the attributes for some bars inside a bar chart. I select all the rects with d3.selectAll("rect") and store them in an array (an array of arrays actually). Then I slice the sub-array to store only the rects an

Replace the svg element with the icon

Replace Circle Elements with Icons I am trying to make my SVG circle elements look like shopping carts. Is there a way to completely replace the definition of a circle element in svg so that it renders a certain icon ? I'd like <circle cx="280px&q

Difference between d3.js and d3.v3.js

What is the difference between d3.js and d3.v3.js? I didn't find any declaration in office website, but it seems the one downloaded from github repository is d3.js/d3.min.js, but the office CDN is d3.v3.js? Are they the same?They may be or may not be

Remove or erase the previously drawn pencil chart

How to remove or clear previously drawn dimple bar chart. I did the following to redraw chart with new data: chart.data = newData; chart.draw(); This will redraw if data is not empty. If new data is empty, previously drawn chart remains and is not ge

how to remove grid lines for subtasks for the logarithmic scale

I have made a graph with log scale for which there are grid lines in the background. The grid lines are drawn for the sub-ticks also which i want to remove. can anyone know how to do it. I have tried it using linear scale also but it wasn't looking p

D3.js: get every single value in an ordinal scale

I want to get every unique value in an ordinal scale (built from an array of an array). Let's say this is my dataset: var people = [ ["Mary", "Mary Smith", "ID00001", 9.99 ], ["James", "James Smith", "

Javascript Item Return Date December 31, 1969

If you are using a date in the form of milliseconds does it need to be converted to a string in order for the Date object to recognize it? "values":[ {x:1390636800000 , y:12} , { x:1390640400000 , y:17} , { x:1390644000000 , y:17}, { x:139064760

Find max and min values ​​in a .json

For a graph I'm trying to do with d3.js I need to set up the scales for the axis. The data for the graph is stored in a Json file structured like so: [{ "id" : "AustraliaNewZealand" , "year" : [1990,1992,1994,1993,1995,1996,1

Selection of subset of data d3 according to the column

How do I adapt the code below from http://bl.ocks.org/mbostock/3884955 to select specific columns? var line = d3.svg.line() .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.temperature); }); d3.tsv("data.tsv", function(error, da

Problems with Javascript closures and scope

Currently I've got the following: function bar() { // Do fancy D3 stuff here function update(source) { // Do fancy D3 update } } I call bar() on the click of a button, but I'm going to need to have access to update() (as well as passing that an argum

d3.js - Sets the size of links to a force layout

Based on the "Molecule" example of Michael Bostock, available at this url : http://bl.ocks.org/mbostock/3037015. I'm trying to set the size of my links with several values. For that, I disabled the "gravity", put an important negative

how to know if the force layout had the knots placed?

I have graph based on force layout. I would like to put a 'loading' overlay until the graph is done placing the nodes. What event/property can I use to find out that graph is done? I checked the API, could not find anything..When the layout converges

Search an item in D3 - force or tree layout

Is there an example of searching for an element in a d3js layout (force directed or tree) and highlighting that element? I am thinking that there would be a text field where user enters values to search.I wrote a tool that allows browsing biological

d3.select method does not work

I am new to datavis and the D3 library and I'm trying to follow the tut here http://mbostock.github.com/d3/tutorial/bar-1.html When I run the code, nothing displays on my webpage, can anyone point out the problem?? I think its something to do with th

Detect if the click is in OverlayView

I want to display a certain Infobox when the user clicks anywhere on the map and a different Infobox when the user clicks inside an OverlayView. I'm adding a listener to the click event for the map object, but this event only provides a latLong param

d3.js: How to add labels to disperse points on a chart

I am trying to add labels to the scatter points on this graph: http://bost.ocks.org/mike/d3/workshop/dot-chart.html I thought that modifying this code a little bit would work, but it didn't: svg.selectAll(".dot") .append("text") .text(