webviz配置的核心组件

webviz-core-components的Python项目详细描述


PyPI versionBuild StatusCodacy BadgePython 3.6+

WebVIZ核心组件

webviz_core_components是用于webviz的短划线组件库。

您可以快速开始:

  1. 运行pip install webviz-core-components
  2. 运行python usage.py
  3. 访问网页浏览器中的http://localhost:8050

:warning: The components here are used by webviz-config. In order to facilitate a strong CSP configuration, this package has a side effect of changing the Plotly distribution coming with dash-core-components to one that do not rely on eval(). More specifically it changes from plotly-full to plotly-cartesian bundle. This will be necessary in order to enforce a strong CSP configuration as long as this plotly issue and this dash-core-components issue both are open. Note that this side-effect only takes place if dash-core-components is installed, which is a requirement if the Graph component from this repository is going to be used.

贡献

此项目由 dash-component-boilerplate。 它包含创建自定义短划线组件所需的最小代码集。

安装依赖项

如果在提示期间选择了“安装依赖项”,则可以跳过此部分。

  1. 安装NPM软件包

    npm install
    
  2. 创建一个虚拟环境并激活。

    virtualenv venv
    . venv/bin/activate
    

    注意:venv\scripts\activate for windows

  3. 安装构建组件所需的python包。

    pip install .[dependencies]
    pip install dash[dev]
    
  4. 安装python软件包进行测试(可选)

    pip install .[tests]
    pip install dash[testing]
    

    只要 this ^{} issue is open

src/lib/components/<component_name>.react.js

中编写组件代码
  • 演示应用程序位于src/demo中,您将把示例组件代码导入到演示应用程序中。

  • 在python环境中测试代码:

    1. 构建代码
      npm run build
      
    2. 运行并修改usage.py示例dash应用程序:
      python usage.py
      
  • 为组件编写测试。

    • 样本测试在tests/test_usage.py中可用,它将加载 usage.py然后您就可以自动化与硒的交互。

    • pytest tests运行测试。

    • dash团队广泛使用这些类型的集成测试。 浏览github上的dash组件代码以获取更多测试示例 (例如dash-core-components)。

  • 通过将自定义css文件放入 您的分发文件夹(webviz_subsurface_components)。

    • 确保它们在MANIFEST.in中被引用,以便它们得到 准备发布组件时正确包含。

    • 确保将样式表添加到 webviz_core_components/__init__.py所以dash将为他们服务 在请求组件套件时自动执行。

  • Review your code

编译代码并安装

  1. 生成代码:
    npm run build
    
  2. 安装python包:
    pip install -e .
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何在java中模拟按键?   尽管元素存在,但HtmlUnit中的java ElementNotFoundException   在Java中,长双精度并发写入不是原子的吗?   java如何在另一个对象数组中打印对象的int值?   java在显示或更改视图后执行一些代码   java JFR:读取时发生OutOfMemoryError。jfr文件   java Android助手检查是否购买   java这种设计模式的好处是什么?   Weblogic 10.3中针对托管服务器的java部署问题   java如何获取字符串。在编译时投诉的格式   声明字符串数组时发生java错误   java JPA在多个并行线程中从表中删除时发生死锁   java Android:在按钮动画之后启动活动   java并发与JMS主题在春季   使用Lucene spatial search/DateRangePrefixTree进行java日期范围查询?   java可选接口问题   JavaDbUnit没有在每个方法之后清洗和插入数据库,所以测试不是独立的   java在IAIK PKCS11包装器中一对私钥和证书如何匹配?