d3.js

d3.js trying to animate data, but changed data always treated as new

感情迁移 提交于 2020-01-06 14:16:26
问题 I have json data: an array of frames, each frame is an array of 10 nodes, and each node is a dictionary with the node id and x,y coordinates. I want to create a d3 animation that transitions between the positions of the node in each frame. I am using setInterval(...) to set up the transitions to the next set of node positions. However, a bunch of new nodes are added instead of the existing nodes updating by going through the transition. Am I doing something wrong with the key function, or

d3 setinterval animate text and remove image on button click

非 Y 不嫁゛ 提交于 2020-01-06 14:13:08
问题 Hi I have a click button event to start a setinterval / clear interval animation of some text and to also add an image on a button click. I would like help in how to better stop and remove the animating text and remove the image when a new button is clicked. At the moment the text is replaced by an empty string when the array ends. the image just duplicates each time I click the button. I have looked at examples that use exit().remove() or merge but I can't work out how to apply it in my case

崛起于SpringBoot2.X + 集成Neo4j图形数据库(70)

会有一股神秘感。 提交于 2020-01-06 14:12:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 《SpringBoot2.X心法总纲》 码云地址: https://gitee.com/mdxl/blog.git 提前安装好neo4j,使用Springboot2.1.5版本 1、依赖添加 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-neo4j</artifactId> </dependency> 2、配置文件 server.port=8084 #neo4j spring.data.neo4j.uri=bolt://localhost:7687 spring.data.neo4j.username=neo4j spring.data.neo4j.password=76521 3、配置类 import org.neo4j.driver.v1.AuthTokens; import org.neo4j.driver.v1.Driver

On button click open a new window and draw a circle with D3

强颜欢笑 提交于 2020-01-06 14:11:44
问题 I'm trying to open a new window on button click and draw a simple circle on it. I can open a window but circle won't appear on it with this code. Any ideas on how to solve this.0 Here is my code: function drawBarChart(newWindowRoot){ var sampleSVG = d3.select(newWindowRoot) .append("svg") .attr("width", 100) .attr("height", 100); sampleSVG.append("circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", 50) .attr("cy", 50) .on("mouseover", function(){d3.select(this

On button click open a new window and draw a circle with D3

ぐ巨炮叔叔 提交于 2020-01-06 14:11:21
问题 I'm trying to open a new window on button click and draw a simple circle on it. I can open a window but circle won't appear on it with this code. Any ideas on how to solve this.0 Here is my code: function drawBarChart(newWindowRoot){ var sampleSVG = d3.select(newWindowRoot) .append("svg") .attr("width", 100) .attr("height", 100); sampleSVG.append("circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", 50) .attr("cy", 50) .on("mouseover", function(){d3.select(this

set multiple attributes in D3 without knowing what they are going to be ahead of time

喜欢而已 提交于 2020-01-06 13:58:52
问题 I am tying to set multiple attributes in d3 similar to what is done in this answer: https://stackoverflow.com/a/20822552/1112097, but I want to be able to pass a set of attributes in as an array so that the same code can create different elements. For example, the following data should create a red square and a green circle: var data = [ { name: "Element 1", type: “rect”, id: “rect01”, attributes: [ {label: “x”, val: 0}, {label: “y”, val: 0}, {label: “width”, val: 10}, {label: “height”, val:

D3 X-value mouseover - function returns NaN

妖精的绣舞 提交于 2020-01-06 13:56:28
问题 So I am trying to adapt M Bostock's x-value mouseover example to my own graph, the main difference being that I have multiple series instead of his one. For the moment I'm just trying to get the circles to work. My problem is that when I mouseover the graph (in Firebug) I get the message: Unexpected value translate(<my_x>, NaN) parsing transform attribute . I've tried several different ways to fix it but I get the same response each time. What am I doing wrong? I have a jsFiddle, and the

D3 X-value mouseover - function returns NaN

杀马特。学长 韩版系。学妹 提交于 2020-01-06 13:56:15
问题 So I am trying to adapt M Bostock's x-value mouseover example to my own graph, the main difference being that I have multiple series instead of his one. For the moment I'm just trying to get the circles to work. My problem is that when I mouseover the graph (in Firebug) I get the message: Unexpected value translate(<my_x>, NaN) parsing transform attribute . I've tried several different ways to fix it but I get the same response each time. What am I doing wrong? I have a jsFiddle, and the

D3 Table Example with Array of Arrays Yields Empty TD Tags

隐身守侯 提交于 2020-01-06 13:12:36
问题 I am trying to create a table with d3.js following this example. Namely this is the code I am using var table = d3.select("#myTableDiv").append("table") .attr("style", "margin-left: 0px"), thead = table.append("thead"), tbody = table.append("tbody"); // append the header row thead.append("tr") .selectAll("th") .data(columns) .enter() .append("th") .text(function(column) { return column; }); // create a row for each object in the data var rows = tbody.selectAll("tr") .data(data) .enter()

X,Y domain data-binding in multiple grouped bar charts in d3.js

╄→гoц情女王★ 提交于 2020-01-06 12:53:11
问题 Fiddle Example I have been following these two examples (1)(2) to create small multiple grouped bar charts on the same page. Here's a JSON data example: var data = [ {"name":"AA","sales_price":20,"retail_price":25}, {"name":"BB","sales_price":30,"retail_price":45}, {"name":"CC","sales_price":10,"retail_price":55}, {"name":"DD","sales_price":10,"retail_price":25}, {"name":"EE","sales_price":13,"retail_price":20}, {"name":"GG","sales_price":13,"retail_price":15}, ]; I've managed to get the bar