data-visualization

D3 fill transition for heatmap not working

独自空忆成欢 提交于 2019-12-24 20:30:42
问题 I'm trying to create a modified version of Mike Bostock's calendar view (https://bl.ocks.org/mbostock/4063318), which only shows a few months. I'm almost there, but I'd like to add a short transition when the individual cells are filled. I tried to create this but it isn't transitioning. I must be missing something obvious. Any ideas? Thanks! Here is the script (see the line ".transition().duration(1000)"): <script src="https://d3js.org/d3.v4.min.js"></script> <script> var width = 550, height

How to add a tooltip that shows a bar chart onto a d3.js map

给你一囗甜甜゛ 提交于 2019-12-24 16:44:15
问题 I have a map of the US with markers for stores in each state and currently when you hover over each marker, the name and address of that store shows up. I used a json file (us.json) to get the states coordinates and boundaries. The second json file (newstorelocations.json) contains information about each store and it's location which I used to display the markers. I used a tooltip for this. What I currently have is at: http://bl.ocks.org/binishbaig/3969ec74b485d1021034 gist: https://gist

Position circles on a horizontal axis without overlapping using force layout

末鹿安然 提交于 2019-12-24 15:53:22
问题 I would like to position circles on a d3 scale and relax them in such a way that they do not overlap. I know that this decreases accuracy, but that's okay for the type of chart that I would like to generate. This is my minimum (non-)working example: https://jsfiddle.net/wmxh0gpb/1/ <body> <div id="content"> <svg width="700" height="200"> <g transform="translate(50, 100)"></g> </svg> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.min.js"></script> <script> var width =

How to bubble chart aligned bottom and stick to each other

…衆ロ難τιáo~ 提交于 2019-12-24 15:52:15
问题 I would like to ask if there is a way to achieve the layout and arrangement of the circles on the image. I would like create a chart of series of circles that are link together and all aligned in the bottom. 回答1: The distance between two circles with radii r1 and r2 is: You can use this to position your circles on the x-axis. For an example see: http://bl.ocks.org/7a9d6c4725367aaed5db . 来源: https://stackoverflow.com/questions/14826815/how-to-bubble-chart-aligned-bottom-and-stick-to-each-other

Insert images into dendogram's leaves using d3.js

为君一笑 提交于 2019-12-24 15:43:59
问题 I am using Cluster Dendogram . And I want to insert images in to the leaves of the dendogram according to my clustering results. How can I do that? <!DOCTYPE html> <meta charset="utf-8"> <style> .node circle { fill: #fff; stroke: steelblue; stroke-width: 1.5px; } .node { font: 10px sans-serif; } .link { fill: none; stroke: #ccc; stroke-width: 1.5px; } </style> <body> <svg id="mySvg" width="80" height="80"> <defs id="mdef"> <pattern id="image" x="-100" y="-100" height="200" width="200"

d3 arc diagram - add top semi circles

你说的曾经没有我的故事 提交于 2019-12-24 15:27:49
问题 http://jsfiddle.net/pRkpL/ and http://fiddle.jshell.net/pRkpL/show/ I am making an arc diagram which is based heavily on this demo: http://bl.ocks.org/sjengle/5431779. It's taken me a while to get to this stage, and the graph now adapts to the data in all the ways I need it to. However, I have 2 questions: 1) I need to create 2 arc diagrams - one above the black rectangles (named buckets in the code) and one below. As a temporary fix, I have used css3 3D transforms to flip one of the arc

How can I recreate this 3d histogram?

若如初见. 提交于 2019-12-24 15:04:00
问题 I am talking about this picture: Questions: This is R, not Matlab right? Below the page it says it was made with R.... How can I do this? I mean, how can I create such a 3d scatterplot with this advanced green surface and this grid? I now how to make simple scatterplots and also 3d scatterplots, but how can I create such an advanced picture? Which package is this? I want to include it in a paper where this picture should rotate automatically. I know how to include this into my tex

Grouped bar chart displaying cross tab between groups

℡╲_俬逩灬. 提交于 2019-12-24 12:27:43
问题 I'm trying to make a group bar chart that gives the frequency of two group combos. I referred to this site for rollup and nest function reference: http://bl.ocks.org/phoebebright/raw/3176159/ I'm trying to use my own dataset to create the following effect: https://bl.ocks.org/bricedev/0d95074b6d83a77dc3ad My current attempt with my own data, drug1.csv: https://blockbuilder.org/lydiawawa/9efb5df76c08640316efbef702437db7 In the console, the grouped counts do not seem to generate the right

How to use itkvtkglue to use ITK with VTK?

两盒软妹~` 提交于 2019-12-24 12:23:12
问题 I wanted to make the example which combines ITK with VTK called IO/ImageFileReader from wiki examples. I downloaded itkvtkglue, extracted to a folder, configured with cmake and built with visual studio 2010. but i can't use it when i try to configure the example given. Even though cmake finds the ItkVtkGlue_DIR by itself, it gives the error that he couldn't include the necessary files. Fails to include(${ItkVtkGlue_USE_FILE}) Should I somehow change the folders CMake looks for my ItkVtkGlue

heatmap based on ratios in Python's seaborn

梦想的初衷 提交于 2019-12-24 09:16:20
问题 I have data in Cartesian coordinates. To each Cartesian coordinate there is also binary variable. I wan to make a heatmap, where in each polygon (hexagon/rectangle,etc.) the color strength is the ratio of number of occurrences where the boolean is True out of the total occurrences in that polygon. The data can for example look like this: df = pd.DataFrame([[1,2,False],[-1,5,True], [51,52,False]]) I know that seaborn can generate heatmaps via seaborn.heatmap, but the color strength is based by