plotly

Plotly in Angular 4 not finding HTML element with ngIf

送分小仙女□ 提交于 2019-12-11 08:46:08
问题 I am building an angular 4 App that needs a graph. For graphs I am using Plotly.js , this works as it should, except if I use ngIf . So what I want to do: I have a div in wich the graph is initialized.This works the first time. I also have some filters that work just fine.However I made a button to switch the view, instead of showing a graph I want to show a table with the values of the graph.When I switch the view back to graph,then i get the error that plotly cannot find the div. So here

Add onclick open hyperlink event to an html widget created in R

 ̄綄美尐妖づ 提交于 2019-12-11 08:15:38
问题 I would like to be able to do something like the answer of this but without using shiny. I also want to bind onclick events which open a hyperlink associated with the data point. I am using the saveWidget function from htmlwidgets and know that I can insert javascript code with the appendContent function from the htmltools package. Here is a small sample code: library(ggplot2) library(plotly) library(htmlwidgets) library(htmltools) path.test.results <- "C:\\Users\\img\\" myData <- data.frame

Plotly failed to return information for selected data points for multiple tracers

荒凉一梦 提交于 2019-12-11 08:14:34
问题 In this example, they plot everything in a single go.Scatter tracer and then they can use the selection_fn to get the information for the selected points. I want to do similar thing with my dataset with consists of 3 clusters. In order to make the clusters easier to be seen, I use one tracer for one class. Therefore, I try to modify the example code to adapt to my dataset as shown below. import plotly.plotly as py import plotly.graph_objs as go from plotly.tools import set_credentials_file

No plot displayed with plotly in shiny

醉酒当歌 提交于 2019-12-11 07:58:47
问题 when I'm pasting the code from https://plot.ly/r/shinyapp-plotly-events/ into my console no plotly graph is diplayed, I can't get any plot in shiny displayed with plotly. My sessionInfo: R version 3.4.0 (2017-04-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252 attached

iGraph + Plotly creates random connections

你说的曾经没有我的故事 提交于 2019-12-11 07:36:26
问题 I'm trying to use the example code here for doing iGraph network graphs in plotly and shoehorn in my own data.frames instead of using the example karate club data. When the graph is plotted, it seems to ignore the edge list and a bunch of random connections are being made. I think either the labels or edges are wrong but I can't tell. library(igraph) library(plotly) setwd('C:/Users/Andrew Riffle/Documents/MEGAsync/code/R/link_analysis') ID <- c(1:50) nodes <- data.frame(ID) Source <- c(23, 24

Plotly add_trace using lapply or for loops doesnt work

a 夏天 提交于 2019-12-11 07:34:46
问题 How can I add_trace in a loop when using a list of dataframes I keep getting the following using code below df1<-c(seq(1:32)) df2<-df*2 df3<-df2*8 dff1<-sqrt(df1) dff2<-sqrt(df2) dff3<-sqrt(df3) a<-cbind.data.frame(df1,dff1) b<-cbind.data.frame(df2,dff2) c<-cbind.data.frame(df3,dff3) colnames(a)<-c("df1","df2") colnames(b)<-c("df1","df2") colnames(c)<-c("df1","df2") df<-list() df[[1]]<-a df[[2]]<-b df[[3]]<-c pl<-plot_ly() for(i in 1:3){ pl<- add_trace(pl,data=df[[i]],x=~df[[i]]$df1,y=~df[[i]

Python 3d plot - axis centered

馋奶兔 提交于 2019-12-11 07:29:12
问题 I'm trying to make a 3d plot in python with axis in the middle like so: I've tried with matplotlib and plotly without success. Just to specify my problem, i don't want a plot like the following image, where you can see the axis are outside the data: 来源: https://stackoverflow.com/questions/51018584/python-3d-plot-axis-centered

How to plot horizontal lines through markers in plotly?

瘦欲@ 提交于 2019-12-11 06:27:59
问题 Here is some example code I wrote to illustrate my problem. Right now, the plot generates only the points. What I want to do is have horizontal lines that go through each point, spanning a length of 1 to each side. (i.e. for a point at (2,1) I want the line to run from (1,1) to (3,1) ) How can I do this in plotly ? I've looked here but can't seem to figure out how to get this to work when the y-axis is not numerical. library(plotly) p <- plot_ly(data = mtcars, x = ~mtcars$mpg, y = rownames

how to force map zero to white color in R plotly color scale

不想你离开。 提交于 2019-12-11 06:13:50
问题 My code is the following but I would like to have white color mapped to 0 instead of the middle values of the max and min of data_bydate$avg_score g <- plot_ly(data_bydate, x = ~Date, y = ~avg_score, color =data_bydate$avg_score, colors = c("#FF0000","#FFFFFF", "#008000"), mode ='markers', marker = list(size=3)) %>% layout(legend = list(orientation = 'h'), xaxis = list(title = "", zeroline = FALSE, tickformat="%X", showline = TRUE), yaxis = list(title = "", zeroline = FALSE, showline = TRUE )

Plot georeferenced raster images in Plotly (R API)

冷暖自知 提交于 2019-12-11 06:13:14
问题 I would like to use Plotly in R to create 3D modells of trenches of archaeological excavations. I'm quite successful to plot point and surface data (Example: Vignette of the R package I'm working on), but I would also like to add raster information of the georeferenced profile pictures of the trenches. I didn't find any way to plot raster data in Plotlys 3D environment. The only solution I came up with so far (thanks to this post) was to create a 3D modell of the profile with SFM using