d3.js

Paint the apartment and the town of different colors in d3.js

一个人想着一个人 提交于 2020-01-05 03:35:15
问题 I have a map, departments and municipalities. The departments are delimited by the red lines. I want when I mouse over the municipality, in addition to painting this municipality, also painted the department of another color. var width = 900, height = 900; var div = d3.select("body").append("div") .attr("class", "tooltip") .style("opacity", 0); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.json("https://cdn.rawgit.com/finiterank/mapa-colombia-js

Simple curved text within a circle

泪湿孤枕 提交于 2020-01-05 02:20:08
问题 I have a matrix of circles that I created like this: var maxColumn = 6; graphGroup.selectAll('circle') .data(data) .enter() .append('circle') .attr('id', function(d,i) {return 'c'+String(i)}) .attr('cx', function(d, i) { return (i % maxColumn) * 200 }) .attr('cy', function(d, i) { return ~~((i / maxColumn) % maxColumn) * 180 }) .attr('r', function(d) {return rScale(d.Trust)}) .style('fill', '#003366'); Then I wanted to try and append curved text within each circle with the date corresponding

Simple curved text within a circle

给你一囗甜甜゛ 提交于 2020-01-05 02:18:27
问题 I have a matrix of circles that I created like this: var maxColumn = 6; graphGroup.selectAll('circle') .data(data) .enter() .append('circle') .attr('id', function(d,i) {return 'c'+String(i)}) .attr('cx', function(d, i) { return (i % maxColumn) * 200 }) .attr('cy', function(d, i) { return ~~((i / maxColumn) % maxColumn) * 180 }) .attr('r', function(d) {return rScale(d.Trust)}) .style('fill', '#003366'); Then I wanted to try and append curved text within each circle with the date corresponding

D3Js on angularjs: How to drag and drop component and link them with connector using mouse

雨燕双飞 提交于 2020-01-04 23:26:18
问题 I want to develop sample application based the below conditions using D3JS and angularjs. For example. I have left pane and right pane. i have some nodes on left pane.(nodes can be any shapes or icons) i want to drag the nodes from left to right and join the specific nodes using connector. Thanks. 来源: https://stackoverflow.com/questions/38586717/d3js-on-angularjs-how-to-drag-and-drop-component-and-link-them-with-connector-u

D3Js on angularjs: How to drag and drop component and link them with connector using mouse

爷,独闯天下 提交于 2020-01-04 23:24:44
问题 I want to develop sample application based the below conditions using D3JS and angularjs. For example. I have left pane and right pane. i have some nodes on left pane.(nodes can be any shapes or icons) i want to drag the nodes from left to right and join the specific nodes using connector. Thanks. 来源: https://stackoverflow.com/questions/38586717/d3js-on-angularjs-how-to-drag-and-drop-component-and-link-them-with-connector-u

Line up x-axis with tick marks in d3.js

与世无争的帅哥 提交于 2020-01-04 20:13:32
问题 How can I properly line up the x-axis values to the vertical lines in the chart? Currently they are not properly aligned. var data = [ { "due": 89.99, "datestr": "2012-12-01 00:00:00", "paid": 89.99 }, { "due": 89.99, "datestr": "2013-01-01 00:00:00", "paid": 101.25 }, { "due": 109.99, "datestr": "2013-02-01 00:00:00", "paid": 143.69 }, { "due": 109.99, "datestr": "2013-03-01 00:00:00", "paid": 130.65 }, { "due": 139.99, "datestr": "2013-04-01 00:00:00", "paid": 150.25 }, { "due": 149.99,

Line up x-axis with tick marks in d3.js

房东的猫 提交于 2020-01-04 20:12:20
问题 How can I properly line up the x-axis values to the vertical lines in the chart? Currently they are not properly aligned. var data = [ { "due": 89.99, "datestr": "2012-12-01 00:00:00", "paid": 89.99 }, { "due": 89.99, "datestr": "2013-01-01 00:00:00", "paid": 101.25 }, { "due": 109.99, "datestr": "2013-02-01 00:00:00", "paid": 143.69 }, { "due": 109.99, "datestr": "2013-03-01 00:00:00", "paid": 130.65 }, { "due": 139.99, "datestr": "2013-04-01 00:00:00", "paid": 150.25 }, { "due": 149.99,

Line up x-axis with tick marks in d3.js

别等时光非礼了梦想. 提交于 2020-01-04 20:11:35
问题 How can I properly line up the x-axis values to the vertical lines in the chart? Currently they are not properly aligned. var data = [ { "due": 89.99, "datestr": "2012-12-01 00:00:00", "paid": 89.99 }, { "due": 89.99, "datestr": "2013-01-01 00:00:00", "paid": 101.25 }, { "due": 109.99, "datestr": "2013-02-01 00:00:00", "paid": 143.69 }, { "due": 109.99, "datestr": "2013-03-01 00:00:00", "paid": 130.65 }, { "due": 139.99, "datestr": "2013-04-01 00:00:00", "paid": 150.25 }, { "due": 149.99,

Why do GeoJSON features appear like a negative photo of the features themselves?

爱⌒轻易说出口 提交于 2020-01-04 15:30:35
问题 I have a pretty standard code thats reads a GeoJSON file and renders its features using D3.js. It works fairly well except with this file: https://github.com/regiskuckaertz/d3/blob/master/circonscriptions.json The file doesn't look weird or anything, in fact you can preview it on GitHub or geojsonlint.com. However, D3 draws paths that look like the features were used as a clipping mask, i.e. all the shapes are negatives of the features themselves. The code is pretty standard though: var proj

Use D3.js layout.stack() to make a normalized stacked bar chart

半世苍凉 提交于 2020-01-04 14:31:06
问题 I have something similar to: Normalized Stacked Bar Chart Is it possible / appropriate to instead of calculating the upper Y and lower Y of each layer to use the d3.layout.stack() feature instead? I'm unsure so would like to know when and when not to use it. 回答1: This question is old, but it doesn't have the answer I was looking for. The example that Lars Kotthoff doesn't actually normalize the data as the data is provided as normalized already. To normalize your stack, add .offset('expand')