plotly.js

Plotly.js sphere with mesh3d

岁酱吖の 提交于 2021-02-10 16:19:03
问题 I'm trying to plot a simple sphere with plotly.js. However when using the mesh3d option the plot of the sphere comes out looking very rough and unrefined. Any advice on how to smooth it out would be appreciated. a = []; b = []; c = []; phiArr = []; thetaArr = []; function makeInterval(startValue, stopValue, numPoints) { var arr = []; var step = (stopValue - startValue) / (numPoints - 1); for (var i = 0; i < numPoints; i++) { arr.push(startValue + (step * i)); } return arr; } phiArr =

Plotly and Websockets

≡放荡痞女 提交于 2021-02-10 14:40:54
问题 Currently I am trying to use Plotly to make a live pie chart with data coming in from a websocket connection. However, I cant seem to get the data from the socket to the graph. Right now I see two ways of doing it. One is to get the data out of the onmessage function, such as returning a value to the parent function. The other is putting the Plotly code into the onmessage function. Neither are currently working. I'm not planning on talking about getting data out of the onmessage function in

Plotly and Websockets

此生再无相见时 提交于 2021-02-10 14:40:30
问题 Currently I am trying to use Plotly to make a live pie chart with data coming in from a websocket connection. However, I cant seem to get the data from the socket to the graph. Right now I see two ways of doing it. One is to get the data out of the onmessage function, such as returning a value to the parent function. The other is putting the Plotly code into the onmessage function. Neither are currently working. I'm not planning on talking about getting data out of the onmessage function in

Plotly plot failed to automatically scale inside a modal

北城以北 提交于 2021-01-27 10:42:51
问题 I have an issue with Plotly.js and bootstrap. When inserting a graph within a modal, the plot is not automatically scaled to the modal width even if the plot width is set to 100%, and the plot layout option autosize set to true. When opening the modal, the plot is 100px-wide (instead of 100%) and I have to programatically (or manually) click on the "autoscale" modebar button to correctly display the plot. You can see this in action with this codepen: https://codepen.io/anon/pen/PaGOWv?editors

Plotly plot failed to automatically scale inside a modal

守給你的承諾、 提交于 2021-01-27 10:42:00
问题 I have an issue with Plotly.js and bootstrap. When inserting a graph within a modal, the plot is not automatically scaled to the modal width even if the plot width is set to 100%, and the plot layout option autosize set to true. When opening the modal, the plot is 100px-wide (instead of 100%) and I have to programatically (or manually) click on the "autoscale" modebar button to correctly display the plot. You can see this in action with this codepen: https://codepen.io/anon/pen/PaGOWv?editors

Plotly Dash - Gradient Lines

可紊 提交于 2020-11-29 09:39:05
问题 Is it possible using Plotly Dash to create line graphs in which the line colors are gradient (purely for aesthetics) ? I tried using something like 'line': {'color': 'linear-gradient(90deg, red, red 60%, white)' } example of entire graph code in plotly dassh dcc.Graph( id='MORTGAGE_RATES', figure={ 'data': [ { "x": MORTGAGE30US['date'],"y": MORTGAGE30US['value'],"mode": "lines","name": '30 YR', 'line': {'color': 'linear-gradient(90deg, red, red 60%, white)' }}, { "x": MORTGAGE15US['date'],"y"

How to add colored background bars in plotly.js chart

六眼飞鱼酱① 提交于 2020-07-19 04:26:15
问题 How can "plot bands", or shaded areas in a chart, be added to a plotly-js chart? Something looking like this picture: (Which comes from a different product: Highcharts) Specifically, I would want to add background color to some portions (multiple of them) of a plotly chart, specifying [xFrom, xTo] coordinates for X, and painting the entire Y range, with arbitrary colors. For example, highlighting time windows of particular interest in a range (such as anomalies). 回答1: This example is from the

Detect if Lines Intersect in Google Charts or Plot.ly

被刻印的时光 ゝ 提交于 2020-04-18 05:44:36
问题 I have seen scripts that claim to enter coordinates and it'll tell you if they intersect, but I have an array of X,Y values for a couple of "lines" but how do I cycle through the points to find out if they intersect? I've included a photo of my graph and as you see, eventually my plots cross over, I just want to know if my values ever cross over (intersect). How do I run through this to find out if any intersection ever occurs? var Test = { x: [8043, 10695, 13292, 17163, 20716, 25270], y:

How to trigger zoom in and zoom out in plotly chart using user created on click buttons?

南楼画角 提交于 2020-01-25 10:13:28
问题 I am building an angular application. In which we need to create on click buttons for zooming in and zooming out for plotly chart. We can zoom in zoom out in plotly chart using buttons on hoverable mode bar but this is not required for our application. We want to zoom in and zoom out the chart using user created on click buttons. Is there a way to trigger actions of hoverable mode bar zoom in and out using on click buttons? if not then what are the other ways to do? any suggestion is

Ploting box plot from statistical summary data

巧了我就是萌 提交于 2019-12-25 00:29:39
问题 I would like to add a box plot to my page. Something like this (using Plotly.js). The problem with implementing the example from the link above is that the plotly.js library expect all the points, whereas I only have access to the already computed statistical data. In other words, I would like to plot the graphic by passing max , min , med , avr , stdev (statistical data of the series) instead of all the data points themselves. P.s.: Using plotly.js is not a requirement. I could go with D3.js