我安装了npm plotly.js,当我使用"import * as Plotly from 'plotly.js/dist/plotly';“并使用Plotly.newPlot()时,它会响应空白屏幕,没有任何错误。我该怎么办?
import * as Plotly from 'plotly.js/dist/plotly';
Plotly.newPlot();
我正在尝试在nuxt中设置plotly.js,但是无论我做什么,我都会得到这个神秘的错误 self is not defined 我试图安装plotly.js和plotly.js-dist,同样的错误显示。 我更喜欢定制构建,所以我试着在nuxt插件中这样做: // here we use custom partial bundle
import plotly from 'plotly.js/lib/core';
import barpolar from 'plotly.js/lib/barpolar';
export default function (_
我在Rails4中使用plotly.js,现在我只有lib文件/vendor/assets/javascripts/plotly.js,并且需要在application.js (//= require plotly)中使用它。Ploly.js大约是1MB,所以我想减小它的大小。在github页面上有一个如何做到这一点的:
// in custom-plotly.js
var plotlyCore = require('plotly.js/lib/core');
// Load in the trace types for pie, and choropleth
plotlyC
我尝试在Angular 6中使用plotly图形库,图形绘制工作正常,但无法识别如何使用angular component( )使用plotly API。
因此,我在angular组件中使用以下代码直接访问deleteTrace、addTrace等JavaScript API。
import * as Plotly from 'plotly.js';
但是在访问Plotly对象时,我得到了这个错误:
index.js:6 Uncaught ReferenceError: global is not defined
at Object../node_modules/has
我有一个绘图,当数据发生变化时,我想删除该绘图并生成一个新的绘图。为了做到这一点,我这样做:
$('#heatmap2').empty()
然后我重新生成我的图。但当我这样做的时候,它会崩溃,如下所示:
TypeError: Cannot read property 'textContent' of null
at Array.Mo.text (plotly-latest.min.js:12)
at Array.c.convertToTspans (plotly-latest.min.js:31)
at Array.Mo.call (pl
我正试图巧妙地将服务器通过POST请求接收到的数据流到http://localhost:3000/step。
在rest-example.js的基础上巧妙地构建-nodejs/示例,下面是我的服务器代码(我已经模糊了我的用户名、像素和令牌):
'use strict';
var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var events = require(
在当前的一个项目中,我正在Nrwl/Nx工作空间上实现Angular服务器端渲染。我严格遵循Nrwl的这些。在运行节点应用程序之前,一切工作正常。该项目包含一个名为Plotly.js的外部库,不幸的是,该库使用了document。它抛出以下错误
/Users/PATHTOPROJECT/node_modules/plotly.js/dist/plotly.js:105975
var style = document.getElementById(id);
^
ReferenceError: document is not defined
在延迟加载的Ng
- TypeError: Cannot read property 'addStyleRule' of undefined
at Object.<anonymous> (node_modules/plotly.js/build/plotcss.js:61:15)
at Object.<anonymous> (node_modules/plotly.js/src/plotly.js:30:1)
at Object.<anonymous> (node_modules/plotly.js/src/core.js:15:1
我很难将plotly_click事件绑定到plotly.js中的条形图。从我看到的所有文档/帖子(参见上面的链接)中,从事件传递到回调的数据应该按照以下方式构造:
{
points: [{
curveNumber: 2, // index in data of the trace associated with the selected point
pointNumber: 2, // index of the selected point
x: 5, // x value
y: 600, // y value
dat
我已经巧妙地使用npm i plotly.js安装了
将行import 'plotly.js/dist/plotly'添加到我的策略导入文件中
然后在webpack中按照的指示捆绑文件客户端。
添加到自定义js文件中,以巧妙地进行测试。
然后,在我的html页面中添加巧妙的脚本,将包放在第一位,然后是我的自定义js。
但是,我得到了错误消息ReferenceError: Plotly is not defined。
为了进行测试,我使用了来自的javascript代码。我可以让它发挥作用,当我保存文件在当地发现在网站上,但不是webpack。
我错过
当我从网上读取"plotly-latest.min.js“时,我的代码是正常的,我已经将它保存到".js”中,并放在与我的".py“文件相同的目录中。但是我不能在没有网络的情况下从本地阅读。
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QDir, QUrl
import plotly
import plotly.graph_objs as go
s
我正在使用Plotly Js,并且想要右对齐我的x轴标题,以便它位于x轴的右端下方。我需要我的轴标签也保留在Plotly生成的SVG图形图像中。 我已经阅读了Plotly JS文档,还搜索了各种论坛以寻找解决方案。Plotly似乎唯一与轴标题定位相关的项是automargin属性,该属性不允许我指定将标题放置在远离x轴中心的位置。 Plotly有办法解决这个问题吗?如果没有,有什么解决方案可以解决这个问题吗? I want my sample x axis title right aligned