data-visualization

d3.js, how can i create an axis with custom labels and customs ticks?

依然范特西╮ 提交于 2019-12-08 02:11:13
问题 I have an array similar to this: [{year: 1999, val: 5}, {year: 2002, val: 8}] and I would like to add an axis where I have one tick for each year value (something I can do with tickValues and tickFormat) but where the tick label is not only the year but has a custom format, so the result could be something like "1999: 5" for the first array element. To rephrase it: Where I'm now const xAxis = d3.axisTop(xScale) .tickValues(data.map(d => d.year); This is not ok because only the year is

Python Plotly - Multiple dropdown plots, each of which have subplots

柔情痞子 提交于 2019-12-08 00:39:00
问题 Problem I'm trying to combine two Python Plotly features. One of them is a drop down menu where a user can switch between plots (link to examples). The other feature is subplots. My attempt I have working code that uses the dropdown menu, but it doesn't have subplots. So I looked up how to create subplots here and I thought I could treat a tools.make_subplots figure the same way I treated a go.Box figure. I'm sorry if this seems naive, I'm actually fairly new to Plotly. However, this attempt

What is a good visualization library for creating state diagrams and animations?

霸气de小男生 提交于 2019-12-07 16:12:14
问题 I'd like to post-process log files and extract node data and transitions, and then graph them in a gui of some kind. So, I'd like to programmaticly draw bubble diagrams, maybe with animations showing packets going from node to node. Ideally, perl or java would be the language of choice, but anything that runs on a linux platform would be fine. What is the best library for this kind of thing? 回答1: Java Solutions Two possibilities in Java include Prefuse and Visual Library. They both have the

d3 custom bar chart bars using svg paths instead of rects

我的梦境 提交于 2019-12-07 16:05:20
问题 I'm trying to build a d3 bar chart, but due to a sneaky designer, I need rounded corners on the top-left and -right of each bar. I think I'm getting somewhere, but I could use a bit of help to push it over the line. Still very much on the uphill curve learning about d3 and svg, so I hope I haven't missed anything obvious. I have successfully made this work using the rects (commented out section), but there's a flaw, probably in how I'm drawing the paths. The anonymous functions I'm passing as

How to set the image size in Vis.js network graph

冷暖自知 提交于 2019-12-07 15:57:32
问题 I am building a network graph using vis.js The problem is, how do I make all the images the same size ? (see live example here --> comparison of wordpress & drupal) here's the graph code: var nodes = []; nodes.push({ id: 7, shape: 'image', image: '/static/windows8_icons/PNG/Industry/circuit/circuit-26.png', label: 'sharepoint', widthMin: 20, widthMax: 20 }); edges.push({ from: 1, to: 7, length: 100 }); var data = { nodes: nodes, edges: edges }; var options = { smoothCurves: false, stabilize:

Contour plot from scattered data in JavaScript [closed]

拥有回忆 提交于 2019-12-07 12:21:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm trying to plot a 2D and 3D contour from x, y, z data. Does anyone know any good JavaScript library that does that? Thank you 回答1: This question is very similar to another question that was already asked and answered at Create contour map In that post, it was recommended to use d3.js and conrec.js. 来源: https:

Updating D3 circle pack layout

爱⌒轻易说出口 提交于 2019-12-07 11:12:36
问题 I'm trying to dynamically update a d3 circle pack layout with data I receive in json. Every second I call d3.json() to get the new json. Instead of updating the existing visualization, my implementation just creates a new one under the old one. I want to to dynamically update the existing layout instead... <!DOCTYPE html> <html> <head> <script type="text/javascript" src="d3.v2.js"> </script> <script type="text/javascript" src="jquery-1.4.min.js"></script> <link rel="stylesheet" href="style

How to center ggplot plot title

♀尐吖头ヾ 提交于 2019-12-07 08:07:18
问题 The "lege artis" way to center justify a plot title in ggplot - plot.title = element_text(hjust = 0.5) - centers the title over plot area excluding axis labels . This can get ugly when the axis labels are very long, such as this plot of songs in Mary Poppins Soundtrack vs. their character length. library(tidyverse) mary_poppins <- data_frame(song = c("Overture", "Sister Suffragette", "The Life I Lead", "The Perfect Nanny", "A Spoonful of Sugar", "Pavement Artist", "Jolly Holiday",

google visualizations align 0 axis with two different y-axes

你离开我真会死。 提交于 2019-12-07 07:22:38
问题 I'm creating a combochart with google's visualization library. I'm charting a store's traffic and revenue over the course of a day. I have set my draw options to var options = { seriesType: "bars", series:{0:{targetAxisIndex:0},1:{targetAxisIndex:1}}, vAxes:{0:{title: "Revenue"},1:{title: "Traffic"}}, hAxis: {title: "Time", showTextEvery: 1}, }; which sets up the Revenue on a different Y-axis than the traffic. A sample of the data might look like this: var data = [ // Time Revenue Traffic [

how to remove line from fill scale legend using geom_vline and geom_histogram r ggplot2

ぃ、小莉子 提交于 2019-12-07 07:11:32
问题 Basics: Using R statistical software, ggplot2, geom_vline, and geom_histogram to visualize some data. The issue is with the legend keys. I'm trying to plot a pair of histograms from some stochastic simulations, and on top of that plot a couple of lines representing the result of a deterministic simulation. I've got the data plotted, but the legend keys for the histograms have an unnecessary black line through the middle of them. Can you help me remove those black lines? Some sample code