Skip to content
Advertisement

Tag: d3.js

Use D3.min to find lowest value that is not 0

I’m trying to use D3 to find the lowest value in my dataset. However, I also have values that are 0, but I want D3 to find the lowest value that is not 0. Currently I am using: But obviously this returns 0 sometimes, when a 0 is found. Is there a way to do this? Or is the only

getBoundingClientRect returning wrong results

I’m struggling a little trying to determine the current location and size of an element within the DOM. I’ve put together a fragment to illustrate a card based system down the right hand side of the screen. The behavior that I’m trying to build is that when you click on one of those cards, another card will be added (ultimately

Wrapping Text in D3

I would like to get the text to wrap on the following D3 tree so that instead of each line is wrapped to I have tried making the text a ‘foreignObject’ rather than a text object and the text does indeed wrap, but it doesn’t move on the tree animation and is all grouped in the upper left hand corner.

d3.js get JSON from url

The situation is that i am trying to get d3 to read a JSON file which is stored in Windows Azure Blob storage. If i paste the url into a browser then the file is downloaded to my machine. I would like to be able get the JSON file from the url with d3, but no graph is produced which

D3.js Auto font-sizing based on nodes individual radius/diameter

How can I have D3.js automatically adjust font-size for each node based on their individual radius/diameter? I use a style that allows automatic increase insize ; * 10 + “px”; }) This effect removes the text from the smaller nodes. I also have a zoom function that I can increase a dot that originally cover 12 px to cover my

Adding an image within a circle object in d3 javascript?

My goal is to add an image into an existing circle with d3. The circle will render and is interactive with mouseover method, but only when I use “fill”, “color”, and not something more sophisticated like .append(“image”). The image doesn’t show after I mouse over. Using Ruby on Rails app, where my image “logo.jpeg” is stored in the assets/images/ directory.

How to programmatically trigger a D3 drag event?

So i have some data binded with drag event listeners : Now I want to call this onDrag function on a certain node programmatically. I do know the same is possible with standard events by doing Is there any way to do so ? Thanks. Answer Save the callback (the one you pass into the drag handler) in a variable

How can I remove or replace SVG content?

I have a piece of JavaScript code which creates (using D3.js) an svg element which contains a chart. I want to update the chart based on new data coming from a web service using AJAX, the problem is that each time I click on the update button, it generates a new svg, so I want to remove the old one

Advertisement